Index: /issm/oecreview/Archive/23185-23389/Date.tex
===================================================================
--- /issm/oecreview/Archive/23185-23389/Date.tex	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/Date.tex	(revision 23390)
@@ -0,0 +1,1 @@
+Oct-5-2018
Index: /issm/oecreview/Archive/23185-23389/ISSM-23190-23191.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23190-23191.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23190-23191.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/configure.ac
+===================================================================
+--- ../trunk-jpl/configure.ac	(revision 23190)
++++ ../trunk-jpl/configure.ac	(revision 23191)
+@@ -1,7 +1,7 @@
+ # Process this file with autoconf to produce a configure script.
+ 
+ #AUTOCONF
+-AC_INIT([Ice Sheet System Model (ISSM)],[4.14],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
++AC_INIT([Ice Sheet System Model (ISSM)],[4.15],[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/23185-23389/ISSM-23191-23192.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23191-23192.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23191-23192.diff	(revision 23390)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/src/m/modules/Triangle.py
+===================================================================
+--- ../trunk-jpl/src/m/modules/Triangle.py	(revision 23191)
++++ ../trunk-jpl/src/m/modules/Triangle.py	(nonexistent)
+@@ -1,21 +0,0 @@
+-from Triangle_python import Triangle_python
+-
+-def Triangle(domainoutlinefilename,rifts,mesh_area):
+-	"""
+-	TRIMESH - Mesh a domain using an .exp file
+-
+-	   Usage: 
+-			[index,x,y,segments,segmentmarkers]=Triangle(domainoutlinefilename,rifts,mesh_area); 
+-
+-	   index,x,y: defines a triangulation 
+-		segments: An array made of exterior segments to the mesh domain outline 
+-		segmentmarkers: An array flagging each segment
+-
+-	   domainoutlinefilename: an Argus domain outline file
+-		mesh_area: The maximum area desired for any element of the resulting mesh
+-	"""
+-	# Call mex module
+-	index,x,y,segments,segmentmarkers=Triangle_python(domainoutlinefilename,rifts,mesh_area)
+-	# Return
+-	return index,x,y,segments,segmentmarkers
+-
+Index: ../trunk-jpl/src/m/mesh/triangle2dvertical.m
+===================================================================
+--- ../trunk-jpl/src/m/mesh/triangle2dvertical.m	(revision 23191)
++++ ../trunk-jpl/src/m/mesh/triangle2dvertical.m	(revision 23192)
+@@ -24,7 +24,7 @@
+ area=resolution^2;
+ 
+ %Mesh using Triangle
+-[elements,x,z,segments,segmentmarkers]=Triangle(domainname,'',area);
++[elements,x,z,segments,segmentmarkers]=Triangle_matlab(domainname,'',area);
+ 
+ %check that all the created nodes belong to at least one element
+ orphan=find(~ismember([1:length(x)],sort(unique(elements(:)))));
+Index: ../trunk-jpl/src/m/mesh/triangle.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/triangle.py	(revision 23191)
++++ ../trunk-jpl/src/m/mesh/triangle.py	(revision 23192)
+@@ -49,7 +49,7 @@
+ 
+ 	#Mesh using Triangle
+ 	md.mesh=mesh2d()
+-	md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers=Triangle(domainname,riftname,area)
++	md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers=Triangle_python(domainname,riftname,area)
+ 	md.mesh.elements=md.mesh.elements.astype(int)
+ 	md.mesh.segments=md.mesh.segments.astype(int)
+ 	md.mesh.segmentmarkers=md.mesh.segmentmarkers.astype(int)
Index: /issm/oecreview/Archive/23185-23389/ISSM-23192-23193.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23192-23193.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23192-23193.diff	(revision 23390)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test421.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test421.py	(revision 23192)
++++ ../trunk-jpl/test/NightlyRun/test421.py	(revision 23193)
+@@ -19,7 +19,7 @@
+ 
+ #Fields and tolerances to track changes
+ field_names     =['Vx','Vy','Vz','Vel','Pressure']
+-field_tolerances=[1e-06,9e-07,2e-05,2e-06,2e-06]
++field_tolerances=[2e-06,9e-07,2e-05,2e-06,2e-06]
+ field_values=[\
+ 	md.results.StressbalanceSolution.Vx,\
+ 	md.results.StressbalanceSolution.Vy,\
+Index: ../trunk-jpl/test/NightlyRun/test421.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test421.m	(revision 23192)
++++ ../trunk-jpl/test/NightlyRun/test421.m	(revision 23193)
+@@ -9,7 +9,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
+-field_tolerances={1e-06,9e-07,2e-05,2e-06,2e-06};
++field_tolerances={2e-06,9e-07,2e-05,2e-06,2e-06};
+ field_values={...
+ 	(md.results.StressbalanceSolution.Vx),...
+ 	(md.results.StressbalanceSolution.Vy),...
Index: /issm/oecreview/Archive/23185-23389/ISSM-23193-23194.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23193-23194.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23193-23194.diff	(revision 23390)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/m/mesh/triangle.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/triangle.py	(revision 23193)
++++ ../trunk-jpl/src/m/mesh/triangle.py	(revision 23194)
+@@ -4,6 +4,7 @@
+ from Triangle import Triangle
+ from NodeConnectivity import NodeConnectivity
+ from ElementConnectivity import ElementConnectivity
++from Triangle_python import Triangle_python
+ import MatlabFuncs as m
+ 
+ def triangle(md,domainname,*args):
Index: /issm/oecreview/Archive/23185-23389/ISSM-23197-23198.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23197-23198.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23197-23198.diff	(revision 23390)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp	(revision 23197)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp	(revision 23198)
+@@ -20,10 +20,6 @@
+ 	Vector<IssmDouble>* df  = NULL;
+ 	Vector<IssmDouble>* ys  = NULL;
+ 
+-	Vec res;
+-	double resNorm;
+-
+-
+ 	Loads* savedloads=NULL;
+ 	bool converged;
+ 	int constraints_converged;
+@@ -74,21 +70,6 @@
+ 		Solverx(&uf, Kff, pf, old_uf, df, femmodel->parameters);
+ 		femmodel->profiler->Stop(SOLVER);
+ 	
+-		
+-//		VecDuplicate(uf->pvector->vector,&res);
+-//		VecCopy(uf->pvector->vector,res);
+-//		VecAssemblyBegin(res);
+-//		VecAssemblyEnd(res);
+-//		VecScale(pf->pvector->vector,-1.);
+-//		MatMultAdd(Kff->pmatrix->matrix,uf->pvector->vector,pf->pvector->vector,res);
+-//		VecScale(pf->pvector->vector,-1.);
+-//		VecView(pf->pvector->vector,PETSC_VIEWER_STDOUT_WORLD);
+-//		VecNorm(res,NORM_INFINITY,&resNorm);
+-//		PetscPrintf(PETSC_COMM_WORLD,"Count = %d, Res. norm: %g\n", count,resNorm);
+-
+-
+-		
+-		
+ 		Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);delete ys;
+ 
+ 		convergence(&converged,Kff,pf,uf,old_uf,eps_res,eps_rel,eps_abs); delete Kff; delete pf; delete df;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23198-23199.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23198-23199.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23198-23199.diff	(revision 23390)
@@ -0,0 +1,93 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 23198)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 23199)
+@@ -74,6 +74,7 @@
+ 		ElementMatrix* CreateKMatrixFSViscousLA(Element* element);
+ 		ElementMatrix* CreateKMatrixFSViscousXTH(Element* element);
+ 		ElementMatrix* CreatePressureMassMatrix(Element* element);
++		ElementMatrix* CreateSchurPrecondMatrix(Element* element);
+ 		ElementVector* CreatePVectorFS(Element* element);
+ 		ElementVector* CreatePVectorFSFriction(Element* element);
+ 		ElementVector* CreatePVectorFSFront(Element* element);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 23198)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 23199)
+@@ -944,9 +944,11 @@
+ 		#ifdef _HAVE_PETSC_
+ 		int solver_type;
+ 		PetscOptionsDetermineSolverType(&solver_type);
++
+ 		if(solver_type==FSSolverEnum) is_schur_cg_solver = true;
+ 		#endif
+ 
++		
+ 		if(is_schur_cg_solver)
+ 		 solutionsequence_schurcg(femmodel);
+ 		else if (fe_FS==XTaylorHoodEnum)
+@@ -3288,6 +3290,64 @@
+ 	xDelete<IssmDouble>(pbasis);
+ 	return Ke;
+ }/*}}}*/
++ElementMatrix* StressbalanceAnalysis::CreateSchurPrecondMatrix(Element* element){/*{{{*/
++
++	/*Intermediaries*/
++	int         i,dim;
++	IssmDouble  viscosity,FSreconditioning,Jdet;
++	IssmDouble *xyz_list = NULL;
++
++	/*Get problem dimension*/
++	element->FindParam(&dim,DomainDimensionEnum);
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int vnumnodes = element->NumberofNodesVelocity();
++	int pnumnodes = element->NumberofNodesPressure();
++	int numdof    = vnumnodes*dim + pnumnodes;
++
++	/*Initialize Element matrix and vectors*/
++	ElementMatrix* Ke  = element->NewElementMatrix(FSvelocityEnum);
++	IssmDouble* pbasis = xNew<IssmDouble>(pnumnodes);
++
++	/*Retrieve all inputs and parameters*/
++	element->GetVerticesCoordinates(&xyz_list);
++	//element->FindParam(&FSreconditioning,StressbalanceFSreconditioningEnum);
++	Input* vx_input=element->GetInput(VxEnum);     _assert_(vx_input);
++	Input* vy_input=element->GetInput(VyEnum);     _assert_(vy_input);
++	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);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		element->NodalFunctionsPressure(pbasis,gauss);
++		element->material->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input);
++
++
++		if(dim==3){
++			/*Pressure mass matrix*/
++			for(int k=0;k<pnumnodes;k++){
++				for(int j=0;j<pnumnodes;j++){
++					Ke->values[(3*vnumnodes+k)*numdof+3*vnumnodes+j] += gauss->weight*1./viscosity*Jdet*(pbasis[j]*pbasis[k]);
++				}
++			}
++		}
++		else{
++			_error_("STOP");
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(pbasis);
++	return Ke;
++}/*}}}*/
++
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSViscousLA(Element* element){/*{{{*/
+ 
+ 	/*Intermediaries*/
Index: /issm/oecreview/Archive/23185-23389/ISSM-23204-23205.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23204-23205.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23204-23205.diff	(revision 23390)
@@ -0,0 +1,369 @@
+Index: ../trunk-jpl/src/c/solutionsequences/convergence.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/convergence.cpp	(revision 23204)
++++ ../trunk-jpl/src/c/solutionsequences/convergence.cpp	(revision 23205)
+@@ -6,7 +6,7 @@
+ #include "../modules/modules.h"
+ #include "../shared/shared.h"
+ 
+-void convergence(bool* pconverged, Matrix<IssmDouble>* Kff,Vector<IssmDouble>* pf,Vector<IssmDouble>* uf,Vector<IssmDouble>* old_uf,IssmDouble eps_res,IssmDouble eps_rel,IssmDouble eps_abs){
++void convergence(bool* pconverged, Matrix<IssmDouble>* Kff,Vector<IssmDouble>* pf,Vector<IssmDouble>* uf,Vector<IssmDouble>* old_uf,IssmDouble eps_res,IssmDouble eps_rel,IssmDouble eps_abs){/*{{{*/
+ 
+ 	/*output*/
+ 	bool converged=false;
+@@ -33,9 +33,12 @@
+ 		return;
+ 	}
+ 
++
+ 	/*Display solver caracteristics*/
+ 	if (VerboseConvergence()){
+ 
++	
++
+ 		/*compute KUF = KU - F = K*U - F*/
+ 		KU=uf->Duplicate(); Kff->MatMult(uf,KU);
+ 		KUF=KU->Duplicate(); KU->Copy(KUF); KUF->AYPX(pf,-1.0);
+@@ -135,4 +138,6 @@
+ 
+ 	/*assign output*/
+ 	*pconverged=converged;
+-}
++}/*}}}*/
++
++
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 23204)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 23205)
+@@ -11,12 +11,13 @@
+ 
+ 
+ #ifdef _HAVE_PETSC_
+-void SchurCGSolver(Vector<IssmDouble>** puf,Mat Kff,Mat Iff,Vec pf, Vec uf0,Vec df,Parameters* parameters){/*{{{*/
+ 
++
++void SchurCGSolver(Vector<IssmDouble>** puf,Mat Kff,Vec pf, Vec uf0,IS isv,IS isp,Parameters* parameters){/*{{{*/
++
+ 	Mat                  A, B, BT;				/* Saddle point block matrices */
+ 	Mat						IP;						/* Preconditioner matrix */
+-	IS                   isv=NULL;				/* Index set free velocity nodes */
+-	IS                   isp=NULL;				/* Index set free pressure nodes */
++	Mat						IP2;
+ 	int                  nu, np;					/* No of. free nodes in velocity / pressure space */
+    Vec                  p,uold,unew;			/* Solution vectors for pressure / vel. */ 
+ 	Vec						tmpu, tmpp, rhsu,rhsp; /* temp. vectors, arbitrary RHS in vel. / pressure space */
+@@ -37,16 +38,6 @@
+ 	/*Initialize output*/
+ 	Vector<IssmDouble>* out_uf=new Vector<IssmDouble>(uf0);
+ 	
+-	/* Get velocity and pressure index sets for extraction */
+-	#if _PETSC_MAJOR_==3
+-		/*Make indices out of doftypes: */
+-		if(!df)_error_("need doftypes for FS solver!\n");
+-	   DofTypesToIndexSet(&isv,&isp,df,FSSolverEnum);
+-	#else
+-	   _error_("Petsc 3.X required");
+-	#endif
+-
+-
+ 	/* Extract block matrices from the saddle point matrix */
+ 	/* [ A   B ] = Kff
+     * [ B^T 0 ] 
+@@ -56,8 +47,8 @@
+ 	MatGetSubMatrix(Kff,isp,isv,MAT_INITIAL_MATRIX,&BT);
+ 	
+ 	/* Extract preconditioner matrix on the pressure space*/
+-	MatGetSubMatrix(Iff,isp,isp,MAT_INITIAL_MATRIX,&IP);
+-	
++	MatGetSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP);
++
+ 	/* Get number of velocity / pressure nodes */
+ 	MatGetSize(B,&nu,&np);
+ 
+@@ -229,9 +220,12 @@
+ 		 break;
+ 		else if(rnorm > 100*initRnorm)
+ 		 _error_("Solver diverged. This shouldn't happen\n");
+-		else
+-		 PetscPrintf(PETSC_COMM_WORLD,"rel. residual at step %d: %g, at TOL = %g\n",count,rnorm/initRnorm,TOL);
+-		
++		//else
++		// PetscPrintf(PETSC_COMM_WORLD,"rel. residual at step %d: %g, at TOL = %g\n",count,rnorm/initRnorm,TOL);
++	
++
++
++
+ 		if(count > np-1) break;
+ 	
+ 
+@@ -273,6 +267,194 @@
+ 	VecDestroy(&thetanew);VecDestroy(&thetaold);
+ 
+ }/*}}}*/
++void convergence_schurcg(bool* pconverged, Matrix<IssmDouble>* Kff,Vector<IssmDouble>* pf,Vector<IssmDouble>* uf,Vector<IssmDouble>* old_uf,IssmDouble eps_res,IssmDouble eps_rel,IssmDouble eps_abs,IS isv,IS isp){/*{{{*/
++
++	/*output*/
++	bool converged=false;
++
++	/*intermediary*/
++	//Vector<IssmDouble>* KU=NULL;
++	//Vector<IssmDouble>* KUF=NULL;
++	//Vector<IssmDouble>* KUold=NULL;
++	//Vector<IssmDouble>* KUoldF=NULL;
++	Vector<IssmDouble>* duf=NULL;
++	IssmDouble ndu,nduinf,nu;
++	IssmDouble nKUF;
++	IssmDouble nKUoldF;
++	IssmDouble nF;
++	IssmDouble solver_residue,res;
++	int analysis_type;
++
++	Mat A, B, BT;
++	Vec u,p,uold,pold,f1,f2,tmp,res1,res2;
++	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 
++	 * the get go: */
++	if(uf->IsEmpty()){
++		*pconverged=true;
++		return;
++	}
++
++  /* Note: SchurCG also constructs the Schur preconditioner and stores it in the free block of Kff */
++  /*			[A    B]
++	* Kff =  |      |
++	*			[B^T IP]
++  /* To calculate the residual, only the necessary blocks need to be extracted */
++
++		/*Extract A, B, B^T */
++		MatGetSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A);
++		MatGetSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B);
++		MatGetSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT);
++	
++		/*no. of free nodes in velocity/pressure space*/
++		MatGetSize(B,&n_u,&n_p);
++
++		/*Extract values corresponding to the free velocity/pressure nodes*/
++		VecCreate(IssmComm::GetComm(),&p);VecSetSizes(p,PETSC_DECIDE,n_p);VecSetFromOptions(p);
++		VecAssemblyBegin(p);VecAssemblyEnd(p);
++		VecCreate(IssmComm::GetComm(),&u);VecSetSizes(u,PETSC_DECIDE,n_u);VecSetFromOptions(u);
++		VecAssemblyBegin(u);VecAssemblyEnd(u);
++
++		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);
++		VecDuplicate(p,&f2);VecSet(f2,1.0);
++		VecGetSubVector(pf->pvector->vector,isv,&f1);
++		VecGetSubVector(pf->pvector->vector,isp,&f2);
++
++		/*Allocate intermediaries*/
++		VecDuplicate(u,&res1);VecSet(res1,1.0);
++		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);
++		nF=pf->Norm(NORM_TWO);
++		solver_residue=nKUF/nF;
++		_printf0_("\n" << "   solver residue: norm(KU-F)/norm(F)=" << solver_residue << "\n");
++		if(xIsNan<IssmDouble>(solver_residue)){
++			//Kff->Echo();
++		}
++
++	}
++	/*clean up*/
++	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)*/
++
++	/*Calculate res1 = A*uold + B*pold - f1*/
++	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);
++	nF=pf->Norm(NORM_TWO);
++	res=nKUoldF/nF;
++	if (xIsNan<IssmDouble>(res)){
++		_printf0_("norm nf = " << nF << "f and norm kuold = " << nKUoldF << "f\n");
++		_error_("mechanical equilibrium convergence criterion is NaN!");
++	}
++
++	MatDestroy(&A);MatDestroy(&B);MatDestroy(&BT);
++	VecRestoreSubVector(pf->pvector->vector,isv,&f1);
++	VecRestoreSubVector(pf->pvector->vector,isp,&f2);
++	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");
++		converged=true;
++	}
++	else{ 
++		if(VerboseConvergence()) _printf0_(setw(50)<<left<<"   mechanical equilibrium convergence criterion"<<res*100<<" > "<<eps_res*100<<" %\n");
++		converged=false;
++	}
++
++	/*Relative criterion (optional)*/
++	if (!xIsNan<IssmDouble>(eps_rel) || (VerboseConvergence())){
++
++		//compute norm(du)/norm(u)
++		duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
++		ndu=duf->Norm(NORM_TWO); nu=old_uf->Norm(NORM_TWO);
++
++		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!");
++
++		//clean up
++		delete duf;
++
++		//print
++		if (!xIsNan<IssmDouble>(eps_rel)){
++			if((ndu/nu)<eps_rel){
++				if(VerboseConvergence()) _printf0_(setw(50) << left << "   Convergence criterion: norm(du)/norm(u)" << ndu/nu*100 << " < " << eps_rel*100 << " %\n");
++			}
++			else{ 
++				if(VerboseConvergence()) _printf0_(setw(50) << left << "   Convergence criterion: norm(du)/norm(u)" << ndu/nu*100 << " > " << eps_rel*100 << " %\n");
++				converged=false;
++			}
++		}
++		else _printf0_(setw(50) << left << "   Convergence criterion: norm(du)/norm(u)" << ndu/nu*100 << " %\n");
++
++	}
++
++	/*Absolute criterion (Optional) = max(du)*/
++	if (!xIsNan<IssmDouble>(eps_abs) || (VerboseConvergence())){
++
++		//compute max(du)
++		duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
++		ndu=duf->Norm(NORM_TWO); nduinf=duf->Norm(NORM_INF);
++		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!");
++
++		//clean up
++		delete duf;
++
++		//print
++		if (!xIsNan<IssmDouble>(eps_abs)){
++			if ((nduinf)<eps_abs){
++				if(VerboseConvergence()) _printf0_(setw(50) << left << "   Convergence criterion: max(du)" << nduinf << " < " << eps_abs << "\n");
++			}
++			else{
++				if(VerboseConvergence()) _printf0_(setw(50) << left << "   Convergence criterion: max(du)" << nduinf << " > " << eps_abs << "\n");
++				converged=false;
++			}
++		}
++		else  _printf0_(setw(50) << left << "   Convergence criterion: max(du)" << nduinf << "\n");
++
++	}
++
++	/*assign output*/
++	*pconverged=converged;
++}/*}}}*/
+ void solutionsequence_schurcg(FemModel* femmodel){/*{{{*/
+ 
+ 	/*intermediary: */
+@@ -284,7 +466,6 @@
+ 	Vector<IssmDouble>* pf  = NULL;
+ 	Vector<IssmDouble>* df  = NULL;
+ 	Vector<IssmDouble>* ys  = NULL;
+-	Matrix<IssmDouble>* Iff = NULL;
+ 
+ 
+ 	/*parameters:*/
+@@ -323,19 +504,29 @@
+ 		Reduceloadx(pf, Kfs, ys); delete Kfs;
+ 
+ 		/*Create mass matrix*/
+-		int fsize; Kff->GetSize(&fsize,&fsize);
+-		Iff=new Matrix<IssmDouble>(fsize,fsize,300,4);
+ 		StressbalanceAnalysis* analysis = new StressbalanceAnalysis();
+ 		/*Get complete stiffness matrix without penalties*/
+ 		for(int i=0;i<femmodel->elements->Size();i++){
+ 			Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+ 			ElementMatrix* Ie = analysis->CreateSchurPrecondMatrix(element);
+-			if(Ie) Ie->AddToGlobal(Iff,NULL);
++			if(Ie) Ie->AddToGlobal(Kff,NULL);
+ 			delete Ie;
+ 		}
+-		Iff->Assemble();
++		Kff->Assemble();
+ 		delete analysis;
+ 
++		/*Obtain index sets for velocity and pressure components */
++		IS isv = NULL;
++		IS isp = NULL;
++		#if _PETSC_MAJOR_==3
++			/*Make indices out of doftypes: */
++			if(!(df->pvector->vector))_error_("need doftypes for FS solver!\n");
++			DofTypesToIndexSet(&isv,&isp,df->pvector->vector,FSSolverEnum);
++		#else
++			_error_("Petsc 3.X required");
++		#endif
++
++
+ 		/*Solve*/
+ 		femmodel->profiler->Start(SOLVER);
+ 		_assert_(Kff->type==PetscMatType); 
+@@ -342,19 +533,19 @@
+ 		
+ 		SchurCGSolver(&uf,
+ 					Kff->pmatrix->matrix,
+-					Iff->pmatrix->matrix,
+ 					pf->pvector->vector,
+ 					old_uf->pvector->vector,
+-					df->pvector->vector,
++					isv,
++					isp,
+ 					femmodel->parameters);
+ 		femmodel->profiler->Stop(SOLVER);
+-		delete Iff;
+-		
++	
++
+ 		/*Merge solution from f set to g set*/
+ 		Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);delete ys;
+ 
+ 		/*Check for convergence and update inputs accordingly*/
+-		convergence(&converged,Kff,pf,uf,old_uf,eps_res,eps_rel,eps_abs); delete Kff; delete pf; delete df;
++		convergence_schurcg(&converged,Kff,pf,uf,old_uf,eps_res,eps_rel,eps_abs,isv,isp); delete Kff; delete pf; delete df;
+ 		count++;
+ 
+ 		if(count>=max_nonlinear_iterations){
+@@ -379,6 +570,7 @@
+ 	delete old_uf;
+ 
+ }/*}}}*/
++
+ #else
+ void solutionsequence_schurcg(FemModel* femmodel){_error_("PETSc needs to be installed");}
+ #endif
Index: /issm/oecreview/Archive/23185-23389/ISSM-23205-23206.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23205-23206.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23205-23206.diff	(revision 23390)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 23205)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 23206)
+@@ -3278,6 +3278,13 @@
+ 					Ke->values[(3*vnumnodes+k)*numdof+3*vnumnodes+j] += gauss->weight*Jdet*(pbasis[j]*pbasis[k]);
+ 				}
+ 			}
++		}else if(dim==2){
++			/*Pressure mass matrix*/
++			for(int k=0;k<pnumnodes;k++){
++				for(int j=0;j<pnumnodes;j++){
++					Ke->values[(2*vnumnodes+k)*numdof+2*vnumnodes+j] += gauss->weight*Jdet*(pbasis[j]*pbasis[k]);
++				}
++			}
+ 		}
+ 		else{
+ 			_error_("STOP");
+@@ -3335,6 +3342,13 @@
+ 					Ke->values[(3*vnumnodes+k)*numdof+3*vnumnodes+j] += gauss->weight*1./viscosity*Jdet*(pbasis[j]*pbasis[k]);
+ 				}
+ 			}
++		}else if(dim==2){
++			/*Pressure mass matrix*/
++			for(int k=0;k<pnumnodes;k++){
++				for(int j=0;j<pnumnodes;j++){
++					Ke->values[(2*vnumnodes+k)*numdof+2*vnumnodes+j] += gauss->weight*1./viscosity*Jdet*(pbasis[j]*pbasis[k]);
++				}
++			}
+ 		}
+ 		else{
+ 			_error_("STOP");
Index: /issm/oecreview/Archive/23185-23389/ISSM-23206-23207.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23206-23207.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23206-23207.diff	(revision 23390)
@@ -0,0 +1,56 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 23206)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 23207)
+@@ -3271,22 +3271,14 @@
+ 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+ 		element->NodalFunctionsPressure(pbasis,gauss);
+ 
+-		if(dim==3){
++		if(dim==3 || dim==2){
+ 			/*Pressure mass matrix*/
+ 			for(int k=0;k<pnumnodes;k++){
+ 				for(int j=0;j<pnumnodes;j++){
+-					Ke->values[(3*vnumnodes+k)*numdof+3*vnumnodes+j] += gauss->weight*Jdet*(pbasis[j]*pbasis[k]);
++					Ke->values[(dim*vnumnodes+k)*numdof+dim*vnumnodes+j] += gauss->weight*Jdet*(pbasis[j]*pbasis[k]);
+ 				}
+ 			}
+-		}else if(dim==2){
+-			/*Pressure mass matrix*/
+-			for(int k=0;k<pnumnodes;k++){
+-				for(int j=0;j<pnumnodes;j++){
+-					Ke->values[(2*vnumnodes+k)*numdof+2*vnumnodes+j] += gauss->weight*Jdet*(pbasis[j]*pbasis[k]);
+-				}
+-			}
+-		}
+-		else{
++		}else{
+ 			_error_("STOP");
+ 		}
+ 	}
+@@ -3335,22 +3327,14 @@
+ 		element->material->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input);
+ 
+ 
+-		if(dim==3){
++		if(dim==3 || dim==2){
+ 			/*Pressure mass matrix*/
+ 			for(int k=0;k<pnumnodes;k++){
+ 				for(int j=0;j<pnumnodes;j++){
+-					Ke->values[(3*vnumnodes+k)*numdof+3*vnumnodes+j] += gauss->weight*1./viscosity*Jdet*(pbasis[j]*pbasis[k]);
++					Ke->values[(dim*vnumnodes+k)*numdof+dim*vnumnodes+j] += gauss->weight*1./viscosity*Jdet*(pbasis[j]*pbasis[k]);
+ 				}
+ 			}
+-		}else if(dim==2){
+-			/*Pressure mass matrix*/
+-			for(int k=0;k<pnumnodes;k++){
+-				for(int j=0;j<pnumnodes;j++){
+-					Ke->values[(2*vnumnodes+k)*numdof+2*vnumnodes+j] += gauss->weight*1./viscosity*Jdet*(pbasis[j]*pbasis[k]);
+-				}
+-			}
+-		}
+-		else{
++		}else{
+ 			_error_("STOP");
+ 		}
+ 	}
Index: /issm/oecreview/Archive/23185-23389/ISSM-23210-23211.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23210-23211.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23210-23211.diff	(revision 23390)
@@ -0,0 +1,331 @@
+Index: ../trunk-jpl/src/m/contrib/defleurian/paraview/enveloppeVTK.py
+===================================================================
+--- ../trunk-jpl/src/m/contrib/defleurian/paraview/enveloppeVTK.py	(revision 23210)
++++ ../trunk-jpl/src/m/contrib/defleurian/paraview/enveloppeVTK.py	(revision 23211)
+@@ -8,13 +8,13 @@
+ 	function exportVTK(filename,model)
+ 	creates a directory with the vtk files for displays in paraview
+ 	(only work for triangle and wedges based on their number of nodes)
+-	
+-	Give only the results for nw but could be extended to geometry, mask... 
+-	
+-	input: filename   destination 
++
++	Give only the results for nw but could be extended to geometry, mask...
++
++	input: filename   destination
+ 	(string)
+ 	------------------------------------------------------------------
+-model      this is md 
++model      this is md
+ 	------------------------------------------------------------------
+ 	By default only the results are exported, you can add whichever
+ 	field you need as a string:
+@@ -39,24 +39,40 @@
+ 	else:
+ 		os.mkdir(filename)
+ 
+-	IsEnveloppe=np.where(model.mesh.vertexonbase | model.mesh.vertexonsurface)
+-	#get the element related variables
++	# {{{get the element related variables
+ 	if 'z' in dict.keys(model.mesh.__dict__):
+-		points=np.column_stack((model.mesh.x,model.mesh.y,model.mesh.z))
+-		num_of_elt=np.size(np.isnan(model.mesh.lowerelements))+np.size(np.isnan(model.mesh.upperelements))
+-		low_elt_num=np.size(np.isnan(model.mesh.lowerelements))
+-		top_elt_num=np.size(np.isnan(model.mesh.upperelements))
++		is_enveloppe=np.logical_or(model.mesh.vertexonbase,model.mesh.vertexonsurface)
++		enveloppe_index=np.where(is_enveloppe)[0]
++		convert_index=np.nan*np.ones(np.shape(model.mesh.x))
++		convert_index=np.asarray([[i,np.where(enveloppe_index==i)[0][0]] for i,val in enumerate(convert_index) if any(enveloppe_index==i)])
++		points=np.column_stack((model.mesh.x[enveloppe_index],
++														model.mesh.y[enveloppe_index],
++														model.mesh.z[enveloppe_index]))
++		low_elt_num=np.size(np.where(np.isnan(model.mesh.lowerelements)))
++		top_elt_num=np.size(np.where(np.isnan(model.mesh.upperelements)))
++		num_of_elt=low_elt_num+top_elt_num
++		connect=model.mesh.elements[np.where(is_enveloppe[model.mesh.elements-1])].reshape(int(num_of_elt),3)-1
++		for elt in range(0, num_of_elt):
++			connect[elt,0]=convert_index[np.where(convert_index==connect[elt,0])[0],1][0]
++			connect[elt,1]=convert_index[np.where(convert_index==connect[elt,1])[0],1][0]
++			connect[elt,2]=convert_index[np.where(convert_index==connect[elt,2])[0],1][0]
++
+ 	else:
+-		points=np.column_stack((model.mesh.x,model.mesh.y,np.zeros(np.shape(model.mesh.x))))
++		points=np.column_stack((model.mesh.x,
++														model.mesh.y,
++														np.zeros(np.shape(model.mesh.x))))
+ 		num_of_elt=np.shape(model.mesh.elements)[0]
+-		
+-	num_of_points=np.size(points)[0]
+-	dim=np.size(points)[1]
+-	point_per_elt=np.shape(model.mesh.elements)[1]
+-		
++		connect=model.mesh.elements-1
++		enveloppe_index=np.arange(0,np.size(model.mesh.x))
++
++	every_nodes=np.size(model.mesh.x)
++	num_of_points=np.size(enveloppe_index)
++	dim=3
++	point_per_elt=3
+ 	celltype=5 #triangles
+-	
+-	#this is the result structure
++
++	# }}}
++	# {{{this is the result structure
+ 	res_struct=model.results
+ 	if (len(res_struct.__dict__)>0):
+ 		#Getting all the solutions of the model
+@@ -63,7 +79,7 @@
+ 		solnames=(dict.keys(res_struct.__dict__))
+ 		num_of_sols=len(solnames)
+ 		num_of_timesteps=1
+-		#%building solutionstructure 
++		#%building solutionstructure
+ 		for solution in solnames:
+ 			#looking for multiple time steps
+ 			if (np.size(res_struct.__dict__[solution])>num_of_timesteps):
+@@ -71,7 +87,8 @@
+ 				num_of_timesteps=int(num_of_timesteps)+1
+ 	else:
+ 		num_of_timesteps=1
+-
++	# }}}
++	# {{{write header and mesh
+ 	for step in range(0,num_of_timesteps):
+ 		timestep=step
+ 		fid=open((filename +'/Timestep.vtk'+str(timestep)+'.vtk'),'w+')
+@@ -82,26 +99,21 @@
+ 		fid.write('POINTS %d float\n' % num_of_points)
+ 		for point in points:
+ 			fid.write('%f %f %f \n'%(point[0], point[1], point[2]))
+-			
++
+ 		fid.write('CELLS %d %d\n' %(num_of_elt, num_of_elt*(point_per_elt+1)))
+ 
+-		# 	if exist('low_elt_num')
+-		# triaconnect=zeros(num_of_elt,3);
+-		# triaconnect(1:low_elt_num,:)=model.mesh.elements(find(isnan(model.mesh.lowerelements)),1:3);
+-		# upshift=-min(min(model.mesh.elements(find(isnan(model.mesh.upperelements)),4:6)))+1+max(max(model.mesh.elements(find(isnan(model.mesh.lowerelements)),1:3)));
+-		# triaconnect(1+low_elt_num:num_of_elt,:)=model.mesh.elements(find(isnan(model.mesh.upperelements)),4:6)+upshift;
+-		# fprintf(fid,s,[(3)*ones(num_of_elt,1) triaconnect-1]');
+ 		for elt in range(0, num_of_elt):
+-		
+-			fid.write('3 %d %d %d\n' %(model.mesh.elements[elt,0]-1,model.mesh.elements[elt,1]-1,model.mesh.elements[elt,2]-1))
+-		
++			fid.write('3 %d %d %d\n' %(connect[elt,0],
++																 connect[elt,1],
++																 connect[elt,2]))
++
+ 		fid.write('CELL_TYPES %d\n' %num_of_elt)
+ 		for elt in range(0, num_of_elt):
+ 			fid.write('%d\n' %celltype)
+ 
+ 		fid.write('POINT_DATA %s \n' %str(num_of_points))
+-	
+-		#loop over the different solution structures
++		# }}}
++		# {{{loop over the different solution structures
+ 		if 'solnames' in locals():
+ 			for sol in solnames:
+ 				#dealing with results on different timesteps
+@@ -109,7 +121,7 @@
+ 					timestep = step
+ 				else:
+ 					timestep = np.size(res_struct.__dict__[sol])
+-				
++
+ 				#getting the  fields in the solution
+ 				if(np.size(res_struct.__dict__[sol])>1):
+ 					fieldnames=dict.keys(res_struct.__dict__[sol].__getitem__(timestep-1).__dict__)
+@@ -122,36 +134,37 @@
+ 					else:
+ 						fieldstruct=res_struct.__dict__[sol].__dict__[field]
+ 
+-					if ((np.size(fieldstruct))==num_of_points):
++					if ((np.size(fieldstruct))==every_nodes):
+ 						fid.write('SCALARS %s float 1 \n' % field)
+ 						fid.write('LOOKUP_TABLE default\n')
+ 						for node in range(0,num_of_points):
+ 							#paraview does not like NaN, replacing
+-							if np.isnan(fieldstruct[node]):
++							if np.isnan(fieldstruct[enveloppe_index[node]]):
+ 								fid.write('%e\n' % -9999.9999)
+ 							#also checking for verry small value that mess up
+-							elif (abs(fieldstruct[node])<1.0e-20):
++							elif (abs(fieldstruct[enveloppe_index[node]])<1.0e-20):
+ 								fid.write('%e\n' % 0.0)
+ 							else:
+-								fid.write('%e\n' % fieldstruct[node])
+-					
+-		#loop on arguments, if something other than result is asked, do
+-		#it now
++								fid.write('%e\n' % fieldstruct[enveloppe_index[node]])
++		# }}}
++		# {{{loop on arguments, if something other than result is asked, do it now
++
+ 		for other in args:
+ 			other_struct=model.__dict__[other]
+ 			othernames=(dict.keys(other_struct.__dict__))
+ 			for field in othernames:
+-#				fprintf(fid,s,res_struct.(fieldnames{k})(IsEnveloppe));
+-				if ((np.size(other_struct.__dict__[field]))==num_of_points):
++				if ((np.size(other_struct.__dict__[field]))==every_nodes):
+ 					fid.write('SCALARS %s float 1 \n' % field)
+ 					fid.write('LOOKUP_TABLE default\n')
+ 					for node in range(0,num_of_points):
+ 						#paraview does not like NaN, replacing
+-						if np.isnan(other_struct.__dict__[field][node]):
++						if np.isnan(other_struct.__dict__[field][enveloppe_index[node]]):
+ 							fid.write('%e\n' % -9999.9999)
+ 						#also checking for verry small value that mess up
+-						elif (abs(other_struct.__dict__[field][node])<1.0e-20):
++						elif (abs(other_struct.__dict__[field][enveloppe_index[node]])<1.0e-20):
+ 							fid.write('%e\n' % 0.0)
+ 						else:
+-							fid.write('%e\n' % other_struct.__dict__[field][node])
++							fid.write('%e\n' % other_struct.__dict__[field][enveloppe_index[node]])
++
++			# }}}
+ 	fid.close();
+Index: ../trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py
+===================================================================
+--- ../trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py	(revision 23210)
++++ ../trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py	(revision 23211)
+@@ -8,13 +8,13 @@
+ 	function exportVTK(filename,model)
+ 	creates a directory with the vtk files for displays in paraview
+ 	(only work for triangle and wedges based on their number of nodes)
+-	
+-	Give only the results for nw but could be extended to geometry, mask... 
+-	
+-	input: filename   destination 
++
++	Give only the results for nw but could be extended to geometry, mask...
++
++	input: filename   destination
+ 	(string)
+ 	------------------------------------------------------------------
+-model      this is md 
++model      this is md
+ 	------------------------------------------------------------------
+ 	By default only the results are exported, you can add whichever
+ 	field you need as a string:
+@@ -66,7 +66,7 @@
+ 		solnames=(dict.keys(res_struct.__dict__))
+ 		num_of_sols=len(solnames)
+ 		num_of_timesteps=1
+-		#%building solutionstructure 
++		#%building solutionstructure
+ 		for solution in solnames:
+ 			#looking for multiple time steps
+ 			if (np.size(res_struct.__dict__[solution])>num_of_timesteps):
+@@ -90,9 +90,9 @@
+ 		elif(dim==2):
+ 			for point in points:
+ 				fid.write('%f %f %f \n'%(point[0], point[1], point[2]))
+-			
++
+ 		fid.write('CELLS %d %d\n' %(num_of_elt, num_of_elt*(point_per_elt+1)))
+-		
++
+ 		if point_per_elt==3:
+ 			for elt in range(0, num_of_elt):
+ 				fid.write('3 %d %d %d\n' %(model.mesh.elements[elt,0]-1,model.mesh.elements[elt,1]-1,model.mesh.elements[elt,2]-1))
+@@ -116,7 +116,7 @@
+ 					timestep = step
+ 				else:
+ 					timestep = np.size(res_struct.__dict__[sol])
+-				
++
+ 				#getting the  fields in the solution
+ 				if(np.size(res_struct.__dict__[sol])>1):
+ 					fieldnames=dict.keys(res_struct.__dict__[sol].__getitem__(timestep).__dict__)
+@@ -186,13 +186,16 @@
+ 								fid.write('%e\n' % current_force[node])
+ 					# reloaded variable are generally of dim 2
+ 					elif np.shape(other_struct.__dict__[field])[0]==num_of_points:
++						# we want only vector
++						if np.shape(other_struct.__dict__[field])[1]==1:
+ 							fid.write('SCALARS %s float 1 \n' % field)
+ 							fid.write('LOOKUP_TABLE default\n')
+ 							for node in range(0,num_of_points):
+ 								#paraview does not like NaN, replacing
++								print other_struct.__dict__[field][node]
+ 								if np.isnan(other_struct.__dict__[field][node]):
+ 									fid.write('%e\n' % -9999.9999)
+-								#also checking for verry small value that mess up
++									#also checking for verry small value that mess up
+ 								elif (abs(other_struct.__dict__[field][node])<1.0e-20):
+ 									fid.write('%e\n' % 0.0)
+ 								else:
+Index: ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py
+===================================================================
+--- ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 23210)
++++ ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 23211)
+@@ -17,7 +17,7 @@
+ 		else:
+ 			print ('New file name is {}'.format(newname))
+ 			filename=newname
+-			
++
+ 	NCData=Dataset(filename, 'w', format='NETCDF4')
+ 	NCData.description = 'Results for run' + md.miscellaneous.name
+ 	NCData.history = 'Created ' + time.ctime(time.time())
+@@ -99,12 +99,12 @@
+ 				Subgroup=NCgroup.createGroup(str(field))
+ 				Subgroup.__setattr__('classtype',md.__dict__[group].__class__.__name__)
+ 				subfields=dict.keys(md.__dict__[group].__dict__[field].__dict__)
+-                                
++
+ 				for subfield in subfields:
+ 					if str(subfield)!='outlog':
+ 						Var=md.__dict__[group].__dict__[field].__dict__[subfield]
+ 						DimDict=CreateVar(NCData,Var,subfield,Subgroup,DimDict)
+-				
++
+ 	NCData.close()
+ 
+ #============================================================================
+@@ -129,11 +129,12 @@
+ 							np.int64:'i8',
+ 							str:str,
+ 							dict:str}
+-		
++
+ 	val_dim=np.shape(val_shape)[0]
++
+ 	#Now define and fill up variable
+ 	#treating scalar string or bool as atribute
+-	if val_type==str or val_type==unicode or val_type==bool:
++	if val_type in [str,unicode,bool]:
+ 		Group.__setattr__(str(field).swapcase(), str(var))
+ 	#treating list as string table
+ 	elif val_type==list:
+@@ -146,7 +147,7 @@
+ 		ncvar = Group.createVariable(str(field),nctype,dimensions,zlib=True)
+ 		if val_shape==0:
+ 			ncvar= []
+-		else:			
++		else:
+ 			for elt in range(0,val_shape[0]):
+ 				ncvar[elt] = var[elt]
+ 	#treating bool tables as string tables
+@@ -163,7 +164,7 @@
+ 			ncvar[elt,0]=dict.keys(var)[elt]
+ 			ncvar[elt,1]=str(dict.values(var)[elt]) #converting to str to avoid potential problems
+ 	#Now dealing with numeric variables
+-	else:
++	elif val_type in [float,'float64',np.float64,int,'int64']:
+ 		dimensions,DimDict=GetDim(NCData,var,val_shape,DimDict,val_dim)
+ 		ncvar = Group.createVariable(str(field),TypeDict[val_type],dimensions,zlib=True)
+ 		try:
+@@ -174,6 +175,8 @@
+ 				ncvar[:] = var
+ 		except TypeError: #type does not accept nan, get vallue of the variable
+ 			ncvar[:] = var
++	else:
++		print('WARNING type "{}" is unknown for "{}.{}"'.format(val_type,Group.name,field))
+ 	return DimDict
+ 
+ #============================================================================
Index: /issm/oecreview/Archive/23185-23389/ISSM-23211-23212.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23211-23212.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23211-23212.diff	(revision 23390)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 23211)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 23212)
+@@ -88,7 +88,11 @@
+ 	
+ 	/* Create KSP context */
+ 	KSPCreate(IssmComm::GetComm(),&kspu);
++	#if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=5)
+ 	KSPSetOperators(kspu,A,A);
++	#else
++	KSPSetOperators(kspu,A,A,DIFFERENT_NONZERO_PATTERN);
++	#endif
+ 	KSPSetType(kspu,KSPCG);
+ 	KSPSetInitialGuessNonzero(kspu,PETSC_TRUE);
+ 	//KSPSetTolerances(kspu,1e-12,PETSC_DEFAULT,PETSC_DEFAULT,PETSC_DEFAULT);
+@@ -119,7 +123,11 @@
+ 	
+ 	/* Create KSP context */
+ 	KSPCreate(IssmComm::GetComm(),&kspp);
++	#if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=5)
+ 	KSPSetOperators(kspp,IP,IP);
++	#else
++	KSPSetOperators(kspp,IP,IP,DIFFERENT_NONZERO_PATTERN);
++	#endif
+ 	
+ 	/* Create RHS */
+ 	/* RHS = BT * uold - F2 */
Index: /issm/oecreview/Archive/23185-23389/ISSM-23214-23215.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23214-23215.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23214-23215.diff	(revision 23390)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/c/cores/adjointstressbalance_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/adjointstressbalance_core.cpp	(revision 23214)
++++ ../trunk-jpl/src/c/cores/adjointstressbalance_core.cpp	(revision 23215)
+@@ -30,9 +30,20 @@
+ 
+ 	if(VerboseSolution()) _printf0_("   computing velocities\n");
+ 	femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
++	
++	bool is_schur_cg_solver = false;
++	#ifdef _HAVE_PETSC_
++	int solver_type;
++	PetscOptionsDetermineSolverType(&solver_type);
++
++	if(solver_type==FSSolverEnum) is_schur_cg_solver = true;
++	#endif
++
+ 	if(isFS){
+ 		if (fe_FS==LATaylorHoodEnum || fe_FS==LACrouzeixRaviartEnum)
+ 		 solutionsequence_la(femmodel);
++		else if(is_schur_cg_solver)
++		 solutionsequence_schurcg(femmodel);
+ 		else
+ 		 solutionsequence_nonlinear(femmodel,conserve_loads); 
+ 	}
+Index: ../trunk-jpl/src/c/cores/stressbalance_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 23214)
++++ ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 23215)
+@@ -36,7 +36,6 @@
+ 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,StressbalanceRequestedOutputsEnum);
+ 
+ 	if(VerboseSolution()) _printf0_("   computing new velocity\n");
+-
+ 	/*Compute slopes if necessary */
+ 	if(isSIA || (isFS && domaintype==Domain2DverticalEnum)) surfaceslope_core(femmodel);
+ 	if(isFS){
Index: /issm/oecreview/Archive/23185-23389/ISSM-23215-23216.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23215-23216.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23215-23216.diff	(revision 23390)
@@ -0,0 +1,917 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 23215)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 23216)
+@@ -8,7 +8,7 @@
+ 
+ 	dnl ISSM's internal options
+ 	dnl Build info{{{
+-	
++
+ 	dnl build date
+ 	AC_PATH_PROGS(DATE, date)
+ 	AC_MSG_CHECKING(for build date)
+@@ -152,7 +152,7 @@
+ 	[WRAPPERS_VALUE="yes"])                                           dnl action if not given
+ 	AC_MSG_CHECKING(for wrappers compilation)
+ 	AM_CONDITIONAL([WRAPPERS], [test x$WRAPPERS_VALUE = xyes])
+-	AC_MSG_RESULT($WRAPPERS_VALUE) 
++	AC_MSG_RESULT($WRAPPERS_VALUE)
+ 	dnl }}}
+ 	dnl Extensions{{{
+ 	ISSMEXT=".exe"
+@@ -250,7 +250,7 @@
+ 		AC_MSG_ERROR([unknown compiler vendor!])
+ 		fi
+ 	fi
+-	AC_SUBST([OSLIBS]) 
++	AC_SUBST([OSLIBS])
+ 	AC_MSG_RESULT(done)
+ 	dnl }}}
+ 	dnl matlab{{{
+@@ -280,23 +280,23 @@
+ 	if test "x$HAVE_MATLAB" = "xyes"; then
+ 
+ 		AC_DEFINE([_HAVE_MATLAB_],[1],[with matlab in ISSM src])
+-		
++
+ 		dnl 4. get MEXLIB MEXLINK and MEXEXT (experimental) except for windows
+ 		AC_MSG_CHECKING([matlab's mex compilation flags])
+   		case "${host_os}" in
+-  			*cygwin*) 
++  			*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" 
++  					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"
+ 					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" 
++  					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"
+ 					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" 
++  					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"
+   					MATLABINCL="-I`cygpath -m $MATLAB_ROOT/extern/include/`"
+ 					MEXEXT=".mexw64"
+   				fi
+@@ -310,7 +310,7 @@
+ 				if test "x$MEXEXT" = "x" ; 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 
++					 $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")
+ 					 MEXLIB=$( cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")
+@@ -332,7 +332,7 @@
+ 		AC_SUBST([MATLABINCL])
+ 		MATLABWRAPPEREXT=$MEXEXT
+ 		AC_SUBST([MATLABWRAPPEREXT])
+-	   AC_SUBST([MEXLIB]) 
++	   AC_SUBST([MEXLIB])
+ 		AC_SUBST([MEXLINK])
+ 	fi
+ 	dnl }}}
+@@ -344,7 +344,7 @@
+ 	dnl javascript{{{
+ 	AC_ARG_WITH([javascript],
+ 	  AS_HELP_STRING([--with-javascript], [compile javascript wrappers? default is no.]),
+-	  [JAVASCRIPT=$withval],[JAVASCRIPT="no"]) 
++	  [JAVASCRIPT=$withval],[JAVASCRIPT="no"])
+ 
+ 	dnl Check whether javascript wrappers are desired
+ 	AC_MSG_CHECKING([for javascript])
+@@ -363,7 +363,7 @@
+ 	dnl triangle {{{
+ 	AC_ARG_WITH([triangle-dir],
+ 			  AS_HELP_STRING([--with-triangle-dir=DIR], [triangle root directory.]),
+-			 [TRIANGLE_ROOT=$withval],[TRIANGLE_ROOT="no"]) 
++			 [TRIANGLE_ROOT=$withval],[TRIANGLE_ROOT="no"])
+ 
+   dnl Check whether triangle is enabled
+ 	AC_MSG_CHECKING([for triangle])
+@@ -393,7 +393,7 @@
+ 				TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+ 				if test "x$HAVE_JAVASCRIPT" = "xyes"; then
+ 					dnl go to the bit code, not the library.
+-					TRIANGLELIB=$TRIANGLE_ROOT/triangle.o 
++					TRIANGLELIB=$TRIANGLE_ROOT/triangle.o
+ 				else
+ 					TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+ 				fi
+@@ -401,7 +401,7 @@
+ 				*darwin*)
+ 				if test "x$HAVE_JAVASCRIPT" = "xyes"; then
+ 					dnl go to the bit code, not the library.
+-					TRIANGLELIB=$TRIANGLE_ROOT/triangle.o 
++					TRIANGLELIB=$TRIANGLE_ROOT/triangle.o
+ 				else
+ 					TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+ 				fi
+@@ -415,7 +415,7 @@
+ 	dnl boost{{{
+ 	AC_ARG_WITH([boost-dir],
+ 	  AS_HELP_STRING([--with-boost-dir=DIR], [boost root directory.]),
+-	  [BOOST_ROOT=$withval],[BOOST_ROOT="no"]) 
++	  [BOOST_ROOT=$withval],[BOOST_ROOT="no"])
+ 
+ 	dnl Check whether boost is enabled
+ 	AC_MSG_CHECKING([for boost])
+@@ -442,8 +442,8 @@
+ 	dnl dakota{{{
+ 	AC_ARG_WITH([dakota-dir],
+ 	  AS_HELP_STRING([--with-dakota-dir=DIR], [dakota root directory.]),
+-	  [DAKOTA_ROOT=$withval],[DAKOTA_ROOT="no"]) 
+-	
++	  [DAKOTA_ROOT=$withval],[DAKOTA_ROOT="no"])
++
+ 	dnl Check whether dakota is enabled
+ 	AC_MSG_CHECKING([for dakota])
+ 	if test "x$DAKOTA_ROOT" = "xno" ; then
+@@ -572,7 +572,7 @@
+ 	dnl python{{{
+ 	AC_ARG_WITH([python-dir],
+ 	  AS_HELP_STRING([--with-python-dir=DIR], [python root directory.]),
+-	  [PYTHON_ROOT=$withval],[PYTHON_ROOT="no"]) 
++	  [PYTHON_ROOT=$withval],[PYTHON_ROOT="no"])
+ 
+ 	dnl Check whether python is enabled
+ 	AC_MSG_CHECKING([for python])
+@@ -596,7 +596,7 @@
+ 		PYTHON_VERSION=$($PYTHON_ROOT/bin/python -c "import sys; print sys.version[[:3]]")
+ 		AC_MSG_RESULT($PYTHON_VERSION)
+ 
+-		dnl recover major 
++		dnl recover major
+ 		PYTHON_MAJOR=${PYTHON_VERSION%.*}
+ 		AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_],$PYTHON_MAJOR,[python version major])
+ 		if test "x$PYTHON_MAJOR" = "x3"; then
+@@ -642,8 +642,8 @@
+ 	dnl python-numpy{{{
+ 	AC_ARG_WITH([python-numpy-dir],
+ 	  AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory.]),
+-	  [PYTHON_NUMPY_ROOT=$withval],[PYTHON_NUMPY_ROOT="no"]) 
+-	
++	  [PYTHON_NUMPY_ROOT=$withval],[PYTHON_NUMPY_ROOT="no"])
++
+ 	dnl Check whether numpy is enabled
+ 	AC_MSG_CHECKING(for python-numpy)
+ 	if test "x$PYTHON_NUMPY_ROOT" = "xno" ; then
+@@ -666,8 +666,8 @@
+ 	dnl chaco{{{
+ 	AC_ARG_WITH([chaco-dir],
+ 	  AS_HELP_STRING([--with-chaco-dir=DIR], [chaco root directory.]),
+-	  [CHACO_ROOT=$withval],[CHACO_ROOT="no"]) 
+-	
++	  [CHACO_ROOT=$withval],[CHACO_ROOT="no"])
++
+ 	dnl Check whether chaco is enabled
+ 	AC_MSG_CHECKING([for chaco])
+ 	if test "x$CHACO_ROOT" = "xno" ; then
+@@ -693,7 +693,7 @@
+ 	dnl scotch{{{
+ 	AC_ARG_WITH([scotch-dir],
+ 	  AS_HELP_STRING([--with-scotch-dir=DIR], [scotch root directory.]),
+-	  [SCOTCH_ROOT=$withval],[SCOTCH_ROOT="no"]) 
++	  [SCOTCH_ROOT=$withval],[SCOTCH_ROOT="no"])
+ 
+   dnl Check whether scotch is enabled
+ 	AC_MSG_CHECKING([for scotch])
+@@ -707,7 +707,7 @@
+ 	fi
+ 	AC_MSG_RESULT($HAVE_SCOTCH)
+ 	AM_CONDITIONAL([SCOTCH],[test x$HAVE_SCOTCH = xyes])
+-	
++
+ 	dnl scotch libraries
+ 	if test "x$HAVE_SCOTCH" = "xyes"; then
+ 		SCOTCHINCL="-DNOFILEIO -I$SCOTCH_ROOT/include -DSCOTCH_VERSION=\\\"UNKNOWN\\\""
+@@ -720,7 +720,7 @@
+ 	dnl esmf{{{
+ 	AC_ARG_WITH([esmf-dir],
+ 		AS_HELP_STRING([--with-esmf-dir=DIR], [esmf root directory.]),
+-		[ESMF_ROOT=$withval],[ESMF_ROOT="no"]) 
++		[ESMF_ROOT=$withval],[ESMF_ROOT="no"])
+ 
+ 	dnl Check whether esmf is enabled
+ 	AC_MSG_CHECKING([for esmf])
+@@ -733,7 +733,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_ESMF)
+-	
++
+ 	dnl esmf headers and libraries
+ 	if test "x$HAVE_ESMF" == "xyes"; then
+ 		ESMFINCL="-I$ESMF_ROOT/include"
+@@ -747,7 +747,7 @@
+ 	dnl adolc{{{
+ 	AC_ARG_WITH([adolc-dir],
+ 		AS_HELP_STRING([--with-adolc-dir=DIR], [adolc root directory.]),
+-		[ADOLC_ROOT=$withval],[ADOLC_ROOT="no"]) 
++		[ADOLC_ROOT=$withval],[ADOLC_ROOT="no"])
+ 
+ 	dnl Check whether adolc is enabled
+ 	AC_MSG_CHECKING([for adolc])
+@@ -760,7 +760,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_ADOLC)
+-	
++
+ 	dnl adolc headers and libraries
+ 	if test "x$HAVE_ADOLC" == "xyes"; then
+ 		ADOLCINCL="-I$ADOLC_ROOT/include"
+@@ -777,8 +777,8 @@
+ 	dnl adolc-version{{{
+ 	AC_ARG_WITH([adolc-version],
+ 		AS_HELP_STRING([--with-adolc-version=number], [adolc version.]),
+-		[ADOLC_VERSION=$withval],[ADOLC_VERSION=2]) 
+-	AC_MSG_CHECKING(for adolc-version) 
++		[ADOLC_VERSION=$withval],[ADOLC_VERSION=2])
++	AC_MSG_CHECKING(for adolc-version)
+ 
+ 	AC_DEFINE_UNQUOTED([_ADOLC_VERSION_],$ADOLC_VERSION,[ADOLC version])
+ 	AC_MSG_RESULT($ADOLC_VERSION)
+@@ -786,7 +786,7 @@
+ 	dnl adic2{{{
+ 	AC_ARG_WITH([adic2-dir],
+ 	  AS_HELP_STRING([--with-adic2-dir=DIR], [adic2 root directory.]),
+-	  [ADIC2_ROOT=$withval],[ADIC2_ROOT="no"]) 
++	  [ADIC2_ROOT=$withval],[ADIC2_ROOT="no"])
+ 
+ 	dnl Check whether adic2 is enabled
+ 	AC_MSG_CHECKING([for adic2])
+@@ -814,7 +814,7 @@
+ 	AC_ARG_WITH([atlas-dir],
+ 	  AS_HELP_STRING([--with-atlas-dir=DIR],[atlas root directory]),
+ 	  [ATLAS_ROOT=$withval],[ATLAS_ROOT="no"])
+-			  
++
+ 	dnl Check whether atlas is enabled
+ 	AC_MSG_CHECKING(for atlas and cblas libraries)
+ 	if test "x$ATLAS_ROOT" = "xno" ; then
+@@ -835,10 +835,10 @@
+ 			ATLASLIB="-L`cygpath -m $ATLAS_ROOT` -Wl,libatlas.lib  -Wl,libcblas.lib"
+ 			;;
+ 			*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" 
++			ATLASLIB=-L"$ATLAS_ROOT/lib -lcblas -latlas -lm"
+ 			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_ATLAS_],[1],[with ATLAS in ISSM src])
+@@ -848,7 +848,7 @@
+ 	dnl gsl{{{
+ 	AC_ARG_WITH([gsl-dir],
+ 	  AS_HELP_STRING([--with-gsl-dir=DIR], [gsl root directory.]),
+-	  [GSL_ROOT=$withval],[GSL_ROOT="no"]) 
++	  [GSL_ROOT=$withval],[GSL_ROOT="no"])
+ 
+ 	dnl Check whether gsl is enabled
+ 	AC_MSG_CHECKING([for gsl])
+@@ -861,7 +861,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_GSL)
+-	
++
+ 	dnl gsl headers and libraries
+ 	if test "x$HAVE_GSL" == "xyes"; then
+ 		GSLINCL="-I$GSL_ROOT/include"
+@@ -879,7 +879,7 @@
+ 	dnl adjoinable-mpi{{{
+ 	AC_ARG_WITH([ampi-dir],
+ 	  AS_HELP_STRING([--with-ampi-dir=DIR], [adjoinable mpi root directory.]),
+-	  [AMPI_ROOT=$withval],[AMPI_ROOT="no"]) 
++	  [AMPI_ROOT=$withval],[AMPI_ROOT="no"])
+ 
+ 	dnl Check whether ampi is enabled
+ 	AC_MSG_CHECKING([for ampi])
+@@ -892,7 +892,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_AMPI)
+-	
++
+ 	dnl ampi headers and libraries
+ 	if test "x$HAVE_AMPI" == "xyes"; then
+ 		AMPIINCL="-I$AMPI_ROOT/include"
+@@ -914,7 +914,7 @@
+ 	dnl rose{{{
+ 	AC_ARG_WITH([rose-dir],
+ 	  AS_HELP_STRING([--with-rose-dir=DIR], [rose root directory.]),
+-	  [ROSE_ROOT=$withval],[ROSE_ROOT="no"]) 
++	  [ROSE_ROOT=$withval],[ROSE_ROOT="no"])
+ 
+ 	dnl Check whether rose is enabled
+ 	AC_MSG_CHECKING([for rose])
+@@ -940,7 +940,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]),
+ 	  [MPI_INCLUDE=$withval],[MPI_INCLUDE=""])
+@@ -953,7 +953,7 @@
+ 	  AS_HELP_STRING([--with-mpi-libflags=LIBS],[mpi libraries to be used, necessary for parallel build]),
+ 	  [MPI_LIBFLAGS=$withval],[MPI_LIBFLAGS=""])
+ 
+-	
++
+ 	if test -z "$MPI_INCLUDE" ; then
+ 		HAVE_MPI=no
+ 	else
+@@ -979,7 +979,7 @@
+ 
+ 		if  test x$IS_WINDOWS = xyes; then
+ 			MPIINCL=/I"$MPI_INCLUDE"
+-		else 
++		else
+ 			MPIINCL=-I"$MPI_INCLUDE"
+ 		fi
+ 
+@@ -995,7 +995,7 @@
+ 	AC_ARG_WITH([petsc-dir],
+ 	  AS_HELP_STRING([--with-petsc-dir=DIR],[PETSc root directory, necessary for parallel build]),
+ 	  [PETSC_ROOT=$withval],[PETSC_ROOT="no"])
+-		
++
+ 	dnl Check whether petsc is enabled
+ 	AC_MSG_CHECKING([for petsc])
+ 	if test "x$PETSC_ROOT" = "xno" ; then
+@@ -1032,7 +1032,7 @@
+ 		else
+ 			AC_MSG_RESULT(no)
+ 		fi
+-	
++
+ 		AC_ARG_WITH([petsc-arch],
+ 		  AS_HELP_STRING([--with-petsc-arch=DIR],[PETSc arch, necessary for PETSc < 3.0]),
+ 		  [PETSC_ARCH=$withval],[PETSC_ARCH=""])
+@@ -1049,7 +1049,7 @@
+ 		if test "x$PETSC_ARCH" != "x" && test -d "$PETSC_ROOT/include/$PETSC_ARCH"; then
+ 		 PETSCINCL+=" $PETSC_ROOT/include/$PETSC_ARCH"
+ 		fi
+-		
++
+ 		case "${host_os}" in
+ 				*cygwin*)
+ 				if test $PETSC_MAJOR -lt 3 ; then
+@@ -1068,7 +1068,7 @@
+ 				fi
+ 				if test "x$host_os_version" = "x3.0.101-0.31.1_1.0502.8394-cray_gem_s" ; then
+ 					PETSCLIB="-L$PETSC_ROOT/lib -lcraypetsc_gnu_real -lmetis"
+-				fi 
++				fi
+ 				;;
+ 				*darwin*)
+ 				if test $PETSC_MAJOR -lt 3 ; then
+@@ -1121,10 +1121,10 @@
+ 			fi
+ 
+ 			if test "$METIS_VERSION" = "4" ; then
+-				METISINCL=-I"$METIS_ROOT/Lib" 
++				METISINCL=-I"$METIS_ROOT/Lib"
+ 				case "${host_os}" in
+ 					*cygwin*)
+-					METISINCL="/I`cygpath -m $METIS_ROOT/Lib`" 
++					METISINCL="/I`cygpath -m $METIS_ROOT/Lib`"
+ 					METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m $METIS_ROOT` -Wl,libmetis.lib"
+ 					;;
+ 					*linux*)
+@@ -1149,7 +1149,7 @@
+ 					METISLIB=-L"$METIS_ROOT/lib -lmetis"
+ 					;;
+ 				esac
+-				METISINCL=-I"$METIS_ROOT/include" 
++				METISINCL=-I"$METIS_ROOT/include"
+ 				AC_DEFINE([_METIS_VERSION_],[5],[ Metis version number])
+ 			fi
+ 
+@@ -1163,7 +1163,7 @@
+ 	dnl tao{{{
+ 	AC_ARG_WITH([tao-dir],
+ 		AS_HELP_STRING([--with-tao-dir=DIR], [tao root directory.]),
+-		[TAO_ROOT=$withval],[TAO_ROOT="no"]) 
++		[TAO_ROOT=$withval],[TAO_ROOT="no"])
+ 
+ 	dnl Check whether tao is enabled
+ 	AC_MSG_CHECKING([for tao])
+@@ -1198,7 +1198,7 @@
+ 	dnl m1qn3{{{
+ 	AC_ARG_WITH([m1qn3-dir],
+ 		AS_HELP_STRING([--with-m1qn3-dir=DIR], [m1qn3 root directory.]),
+-		[M1QN3_ROOT=$withval],[M1QN3_ROOT="no"]) 
++		[M1QN3_ROOT=$withval],[M1QN3_ROOT="no"])
+ 
+ 	dnl Check whether m1qn3 is enabled
+ 	AC_MSG_CHECKING([for m1qn3])
+@@ -1211,10 +1211,10 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_M1QN3)
+-	
++
+ 	dnl m1qn3 headers and libraries
+ 	if test "x$HAVE_M1QN3" == "xyes"; then
+-	  M1QN3LIB="$M1QN3_ROOT/libm1qn3.a $M1QN3_ROOT//libddot.a"
++	  M1QN3LIB="$M1QN3_ROOT/libm1qn3.a $M1QN3_ROOT/libddot.a"
+ 	  AC_DEFINE([_HAVE_M1QN3_],[1],[with M1QN3 in ISSM src])
+ 	  AC_SUBST([M1QN3LIB])
+ 	fi
+@@ -1222,7 +1222,7 @@
+ 	dnl proj.4{{{
+ 	AC_ARG_WITH([proj4-dir],
+ 		AS_HELP_STRING([--with-proj4-dir=DIR], [proj4 root directory.]),
+-		[PROJ4_ROOT=$withval],[PROJ4_ROOT="no"]) 
++		[PROJ4_ROOT=$withval],[PROJ4_ROOT="no"])
+ 
+ 	dnl Check whether proj4 is enabled
+ 	AC_MSG_CHECKING([for proj.4])
+@@ -1235,7 +1235,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_PROJ4)
+-	
++
+ 	dnl proj4 headers and libraries
+ 	if test "x$HAVE_PROJ4" == "xyes"; then
+ 	  PROJ4INCL="-I$PROJ4_ROOT/include "
+@@ -1250,7 +1250,7 @@
+ 	AC_ARG_WITH([slepc-dir],
+ 	  AS_HELP_STRING([--with-slepc-dir=DIR],[slepc root directory]),
+ 	  [SLEPC_ROOT=$withval],[SLEPC_ROOT="no"])
+-			  
++
+ 	dnl Check whether slepc is enabled
+ 	AC_MSG_CHECKING([for slepc])
+ 	if test "x$SLEPC_ROOT" = "xno" ; then
+@@ -1262,7 +1262,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_SLEPC)
+-	
++
+ 	dnl slepc headers and libraries
+ 	if test "x$HAVE_SLEPC" == "xyes"; then
+ 		SLEPCINCL=-I"$SLEPC_ROOT/include"
+@@ -1276,7 +1276,7 @@
+ 	AC_ARG_WITH([shapelib-dir],
+ 	  AS_HELP_STRING([--with-shapelib-dir=DIR], [shapelib root directory]),
+ 	  [SHAPELIB_ROOT=$withval],[SHAPELIB_ROOT="no"])
+-			  
++
+ 	dnl Check whether shapelib is enabled
+ 	AC_MSG_CHECKING([for shapelib])
+ 	if test "x$SHAPELIB_ROOT" = "xno" ; then
+@@ -1288,7 +1288,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_SHAPELIB)
+-	
++
+ 	dnl shapelib headers and libraries
+ 	if test "x$HAVE_SHAPELIB" == "xyes"; then
+ 		SHAPELIBINCL=-I"$SHAPELIB_ROOT/include"
+@@ -1308,7 +1308,7 @@
+ 	AC_ARG_WITH([scalapack-lib],
+ 	  AS_HELP_STRING([--with-scalapack-lib=LIBS],[scalapack libraries to include]),
+ 	  [SCALAPACKLIB=$withval],[SCALAPACKLIB="no"])
+-			  
++
+ 	dnl Check whether scalapack is enabled
+ 	AC_MSG_CHECKING([for scalapack])
+ 	if test "x$SCALAPACK_ROOT" = "xno" && test "x$SCALAPACKLIB" = "xno"; then
+@@ -1328,7 +1328,7 @@
+ 	fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_SCALAPACK)
+-	
++
+ 	dnl scalapack headers and libraries
+ 	if test "x$HAVE_SCALAPACK" = "xyes"; then
+ 		AC_DEFINE([_HAVE_SCALAPACK_],[1],[with Scalapack in ISSM src])
+@@ -1339,7 +1339,7 @@
+ 	AC_ARG_WITH([blas-lapack-dir],
+ 	  AS_HELP_STRING([--with-blas-lapack-dir=DIR],[blas-lapack root directory]),
+ 	  [BLASLAPACK_ROOT=$withval],[BLASLAPACK_ROOT="no"])
+-			  
++
+ 	dnl Check whether blas-lapack is enabled
+ 	AC_MSG_CHECKING([for blas-lapack])
+ 	if test "x$BLASLAPACK_ROOT" = "xno" ; then
+@@ -1351,7 +1351,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_BLASLAPACK)
+-	
++
+ 	dnl blas-lapack headers and libraries
+ 	if test "x$HAVE_BLASLAPACK" == "xyes"; then
+ 		BLASLAPACKINCL=""
+@@ -1361,10 +1361,10 @@
+ 		  BLASLAPACKLIB="-L`cygpath -m $BLASLAPACK_ROOT` -Wl,libf2cblas.lib  -Wl,libf2clapack.lib"
+ 		  ;;
+ 		*linux*)
+-		  BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -lflapack -lfblas " 
++		  BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -lflapack -lfblas "
+ 		  ;;
+ 		*darwin*)
+-		  BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -lflapack -lfblas " 
++		  BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -lflapack -lfblas "
+ 		  ;;
+ 		esac
+ 		AC_DEFINE([_HAVE_BLASLAPACK_],[1],[with blas lapack in ISSM src])
+@@ -1392,19 +1392,19 @@
+ 	dnl }}}
+ 	dnl plapack{{{
+ 	AC_MSG_CHECKING(for plapack)
+-	
++
+ 	AC_ARG_WITH([plapack-lib],
+ 	  AS_HELP_STRING([--with-plapack-lib = lib],[plapack library]),
+ 	  [PLAPACK_LIB=$withval],[PLAPACK_LIB=""])
+-	
++
+ 	AC_ARG_WITH([plapack-include],
+ 			  AS_HELP_STRING([--with-plapack-include = include],
+ 							 [plapack include ]),
+ 			  [PLAPACK_INCLUDE=$withval],[PLAPACK_INCLUDE=""])
+-	  
++
+ 	if test -n "$PLAPACK_LIB"; then
+ 		if test -n "$PLAPACK_INCLUDE"; then
+-		
++
+ 			HAVE_PLAPACK=yes
+ 			PLAPACKINCL="$PLAPACK_INCLUDE"
+ 			PLAPACKLIB="$PLAPACK_LIB"
+@@ -1423,7 +1423,7 @@
+ 	AC_ARG_WITH([mumps-dir],
+ 	  AS_HELP_STRING([--with-mumps-dir=DIR],[mumps root directory]),
+ 	  [MUMPS_ROOT=$withval],[MUMPS_ROOT="no"])
+-			  
++
+ 	dnl Check whether mumps is enabled
+ 	AC_MSG_CHECKING([for mumps])
+ 	if test "x$MUMPS_ROOT" = "xno" ; then
+@@ -1435,7 +1435,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_MUMPS)
+-	
++
+ 	dnl mumps headers and libraries
+ 	if test "x$HAVE_MUMPS" == "xyes"; then
+ 		MUMPSINCL=-I"$MUMPS_ROOT/include"
+@@ -1454,7 +1454,7 @@
+ 	dnl mumps2{{{
+ 	if test "x$HAVE_MUMPS" != "xyes"; then
+ 	AC_MSG_CHECKING(for mumps2 (stand alone))
+-	
++
+ 	AC_ARG_WITH([mumps2-include],
+ 	  AS_HELP_STRING([--with-mumps2-include=DIR],[mumps2 include directory, necessary for parallel build]),
+ 	  [MUMPS_INCLUDE=$withval],[MUMPS_INCLUDE=""])
+@@ -1463,7 +1463,7 @@
+ 	  AS_HELP_STRING([--with-mumps2-libflags=LIBS],[mumps2 libraries to be used, necessary for parallel build]),
+ 	  [MUMPS_LIBFLAGS=$withval],[MUMPS_LIBFLAGS=""])
+ 
+-	
++
+ 	if test -z "$MUMPS_INCLUDE" ; then
+ 		HAVE_MUMPS=no
+ 	else
+@@ -1489,7 +1489,7 @@
+ 	AC_ARG_WITH([blacs-dir],
+ 		AS_HELP_STRING([--with-blacs-dir=DIR],[blacs root directory]),
+ 			  [BLACS_ROOT=$withval],[BLACS_ROOT="no"])
+-			  
++
+ 	dnl Check whether blacs is enabled
+ 	AC_MSG_CHECKING([for blacs])
+ 	if test "x$BLACS_ROOT" = "xno" ; then
+@@ -1501,7 +1501,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_BLACS)
+-	
++
+ 	dnl blacs headers and libraries
+ 	if test "x$HAVE_BLACS" == "xyes"; then
+ 		BLACSINCL=""
+@@ -1515,7 +1515,7 @@
+ 	AC_ARG_WITH([hypre-dir],
+ 	  AS_HELP_STRING([--with-hypre-dir=DIR],[hypre root directory]),
+ 			  [HYPRE_ROOT=$withval],[HYPRE_ROOT="no"])
+-			  
++
+ 	dnl Check whether hypre is enabled
+ 	AC_MSG_CHECKING([for hypre])
+ 	if test "x$HYPRE_ROOT" = "xno" ; then
+@@ -1589,7 +1589,7 @@
+ 			AC_SUBST([SPAILIB])
+ 		fi
+ 	  dnl }}}
+-dnl superlu{{{ 
++dnl superlu{{{
+ 	AC_ARG_WITH([superlu-dir],
+ 				AS_HELP_STRING([--with-superlu-dir=DIR],[superlu root directory]),
+ 				[SUPERLU_ROOT=$withval],[SUPERLU_ROOT="no"])
+@@ -1605,7 +1605,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_SUPERLU)
+-	
++
+ 	dnl superlu headers and libraries
+ 	if test "x$HAVE_SUPERLU" == "xyes"; then
+ 		  SUPERLUINCL=-I"$SUPERLU_ROOT/include"
+@@ -1615,7 +1615,7 @@
+ 		  AC_SUBST([SUPERLULIB])
+ 	 fi
+ 	 dnl }}}
+-dnl spooles{{{ 
++dnl spooles{{{
+ 	AC_ARG_WITH([spooles-dir],
+ 				AS_HELP_STRING([--with-spooles-dir=DIR],[spooles root directory]),
+ 				[SPOOLES_ROOT=$withval],[SPOOLES_ROOT="no"])
+@@ -1631,7 +1631,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_SPOOLES)
+-	
++
+ 	dnl spooles headers and libraries
+ 	if test "x$HAVE_SPOOLES" == "xyes"; then
+ 		  SPOOLESINCL=-I"$SPOOLES_ROOT/include"
+@@ -1641,7 +1641,7 @@
+ 		  AC_SUBST([SPOOLESLIB])
+ 	 fi
+ 	 dnl }}}
+-dnl pastix{{{ 
++dnl pastix{{{
+ 	AC_ARG_WITH([pastix-dir],
+ 				AS_HELP_STRING([--with-pastix-dir=DIR],[pastix root directory]),
+ 				[PASTIX_ROOT=$withval],[PASTIX_ROOT="no"])
+@@ -1657,7 +1657,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_PASTIX)
+-	
++
+ 	dnl pastix headers and libraries
+ 	if test "x$HAVE_PASTIX" == "xyes"; then
+ 		  PASTIXINCL=-I"$PASTIX_ROOT/include"
+@@ -1671,7 +1671,7 @@
+ 	AC_ARG_WITH([ml-dir],
+ 	  AS_HELP_STRING([--with-ml-dir=DIR],[ml root directory]),
+ 			  [ML_ROOT=$withval],[ML_ROOT="no"])
+-			  
++
+ 	dnl Check whether ml is enabled
+ 	AC_MSG_CHECKING([for ml])
+ 	if test "x$ML_ROOT" = "xno" ; then
+@@ -1683,7 +1683,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_ML)
+-	
++
+ 	dnl ml headers and libraries
+ 	if test "x$HAVE_ML" == "xyes"; then
+ 		MLINCL=-I"$ML_ROOT/include"
+@@ -1697,7 +1697,7 @@
+ 		AC_ARG_WITH([umfpack-dir],
+ 		  AS_HELP_STRING([--with-umfpack-dir=DIR],[UMFPACK root directory]),
+ 					[UMFPACK_ROOT=$withval],[UMFPACK_ROOT="no"])
+-			  
++
+ 	dnl Check whether umfpack is enabled
+ 	AC_MSG_CHECKING([for umfpack])
+ 	if test "x$UMFPACK_ROOT" = "xno" ; then
+@@ -1709,7 +1709,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_UMFPACK)
+-	
++
+ 	dnl umfpack headers and libraries
+ 	if test "x$HAVE_UMFPACK" == "xyes"; then
+ 		UMFPACKINCL=""
+@@ -1737,8 +1737,8 @@
+ 	dnl math77{{{
+ 		AC_ARG_WITH([math77-dir],
+ 					AS_HELP_STRING([--with-math77-dir=DIR], [math77 root directory.]),
+-					[MATH77_ROOT=$withval],[MATH77_ROOT="no"]) 
+-		  
++					[MATH77_ROOT=$withval],[MATH77_ROOT="no"])
++
+ 	dnl Check whether math77 is enabled
+ 	AC_MSG_CHECKING([for math77])
+ 	if test "x$MATH77_ROOT" = "xno" ; then
+@@ -1750,7 +1750,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_MATH77)
+-	
++
+ 	dnl math77 headers and libraries
+ 	if test "x$HAVE_MATH77" == "xyes"; then
+ 		MATH77LIB="-L$MATH77_ROOT/ -lmath77"
+@@ -1761,7 +1761,7 @@
+ 	dnl fortran{{{
+ 	AC_ARG_WITH([fortran],
+ 		AS_HELP_STRING([--with-fortran = YES], [do we compile fortran code (default is yes)]),
+-		[FORTRAN=$withval],[FORTRAN=yes]) 
++		[FORTRAN=$withval],[FORTRAN=yes])
+ 	AC_MSG_CHECKING(for fortran compilation)
+ 	if test "x$FORTRAN" = "xyes"; then
+ 		dnl defaults
+@@ -1829,7 +1829,7 @@
+ 	dnl meteoio{{{
+ 	AC_ARG_WITH([meteoio-dir],
+ 	  AS_HELP_STRING([--with-meteoio-dir=DIR], [use meteoio in conjunction with snowpack model.]),
+-	  [METEOIO_ROOT=$withval],[METEOIO_ROOT="no"]) 
++	  [METEOIO_ROOT=$withval],[METEOIO_ROOT="no"])
+ 
+ 	dnl Check whether meteoio is enabled
+ 	AC_MSG_CHECKING([for meteoio])
+@@ -1842,7 +1842,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_METEOIO)
+-	
++
+ 	dnl meteoio headers and libraries
+ 	if test "x$HAVE_METEOIO" == "xyes"; then
+ 		METEOIOINCL="-I$METEOIO_ROOT/include"
+@@ -1857,7 +1857,7 @@
+ 	dnl snowpack{{{
+ 	AC_ARG_WITH([snowpack-dir],
+ 	  AS_HELP_STRING([--with-snowpack-dir=DIR], [use snowpack for surface mass balance model.]),
+-	  [SNOWPACK_ROOT=$withval],[SNOWPACK_ROOT="no"]) 
++	  [SNOWPACK_ROOT=$withval],[SNOWPACK_ROOT="no"])
+ 
+ 	dnl Check whether snowpack is enabled
+ 	AC_MSG_CHECKING([for snowpack])
+@@ -1870,7 +1870,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_SNOWPACK)
+-	
++
+ 	dnl snowpack headers and libraries
+ 	if test "x$HAVE_SNOWPACK" == "xyes"; then
+ 		SNOWPACKINCL="-I$SNOWPACK_ROOT/include"
+@@ -1885,7 +1885,7 @@
+ 	dnl neopz{{{
+ 	AC_ARG_WITH([neopz-dir],
+ 		AS_HELP_STRING([--with-neopz-dir=DIR], [neopz root directory.]),
+-		[NEOPZ_ROOT=$withval],[NEOPZ_ROOT="no"]) 
++		[NEOPZ_ROOT=$withval],[NEOPZ_ROOT="no"])
+ 
+ 	dnl Check whether neopz is enabled
+ 	AC_MSG_CHECKING([for neopz])
+@@ -1898,7 +1898,7 @@
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT($HAVE_NEOPZ)
+-	
++
+ 	dnl neopz headers and libraries
+ 	if test "x$HAVE_NEOPZ" == "xyes"; then
+ 	  NEOPZLIB="$NEOPZ_ROOT/lib/libpz.a"
+@@ -1937,7 +1937,7 @@
+ 	dnl with-bamg{{{
+ 	AC_ARG_WITH([bamg],
+ 		AS_HELP_STRING([--with-bamg = YES],[compile with bamg capabilities (default is yes)]),
+-		[BAMG=$withval],[BAMG=yes]) 
++		[BAMG=$withval],[BAMG=yes])
+ 	AC_MSG_CHECKING(for bamg capability compilation)
+ 
+ 	HAVE_BAMG=no
+@@ -1951,7 +1951,7 @@
+ 	dnl with-ocean{{{
+ 	AC_ARG_WITH([ocean],
+ 		AS_HELP_STRING([--with-ocean = YES],[compile with ice/ocean coupling (default is no)]),
+-		[OCEAN=$withval],[OCEAN=no]) 
++		[OCEAN=$withval],[OCEAN=no])
+ 	AC_MSG_CHECKING(for ice/ocean capability compilation)
+ 
+ 	HAVE_OCEAN=no
+@@ -1965,7 +1965,7 @@
+ 	dnl with-kml{{{
+ 	AC_ARG_WITH([kml],
+ 		AS_HELP_STRING([--with-kml = YES],[compile with kml capabilities (default is no)]),
+-		[KML=$withval],[KML=no]) 
++		[KML=$withval],[KML=no])
+ 	AC_MSG_CHECKING(for kml capability compilation)
+ 
+ 	HAVE_KML=no
+@@ -1979,7 +1979,7 @@
+ 	dnl with-kriging{{{
+ 	AC_ARG_WITH([kriging],
+ 		AS_HELP_STRING([--with-kriging = YES],[compile with kriging capabilities (default is yes)]),
+-		[KRIGING=$withval],[KRIGING=yes]) 
++		[KRIGING=$withval],[KRIGING=yes])
+ 	AC_MSG_CHECKING(for kriging capability compilation)
+ 
+ 	HAVE_KRIGING=no
+@@ -1996,7 +1996,7 @@
+ 	dnl with-ios{{{
+ 	AC_ARG_WITH([ios],
+ 		AS_HELP_STRING([--with-ios = YES], [compile with iOS capabilities (default is no, alternatives are yes)]),
+-		[IOS=$withval],[IOS=no]) 
++		[IOS=$withval],[IOS=no])
+ 	AC_MSG_CHECKING(for iOS compilation)
+ 
+ 	if test "x$IOS" = "xyes"; then
+@@ -2015,7 +2015,7 @@
+ 	dnl with-android{{{
+ 	AC_ARG_WITH([android],
+ 		AS_HELP_STRING([--with-android = EXE], [compile with android capabilities (default is no, alternatives are exe and jni)]),
+-		[ANDROID=$withval],[ANDROID=no]) 
++		[ANDROID=$withval],[ANDROID=no])
+ 	AC_MSG_CHECKING(for android capability compilation)
+ 
+ 	if test "x$ANDROID" = "xjni"; then
+@@ -2042,9 +2042,9 @@
+ 	dnl with-android-ndk{{{
+ 	AC_ARG_WITH([android-ndk],
+ 	  AS_HELP_STRING([--with-android-ndk=DIR], [android-ndk root directory.]),
+-	  [ANDROID_NDK_ROOT=$withval],[ANDROID_NDK_ROOT=""]) 
++	  [ANDROID_NDK_ROOT=$withval],[ANDROID_NDK_ROOT=""])
+ 	AC_MSG_CHECKING(with android ndk)
+-	
++
+ 	if test -d "$ANDROID_NDK_ROOT"; then
+ 		dnl defaults
+ 		HAVE_ANDROID_NDK=yes
+@@ -2060,10 +2060,10 @@
+ 
+ 	dnl other options
+ 	dnl optimization{{{
+-	dnl bypass standard optimization -g -O2 ? 
++	dnl bypass standard optimization -g -O2 ?
+ 	AC_ARG_WITH([cxxoptflags],
+ 	  AS_HELP_STRING([--with-cxxoptflags = CXXOPTFLAGS], [optimization using CXX flags, ex: --with-cxxoptflags=-march=opteron -O3]),
+-	  [CXXOPTFLAGS=$withval],[CXXOPTFLAGS="-g -O2 -fPIC"]) 
++	  [CXXOPTFLAGS=$withval],[CXXOPTFLAGS="-g -O2 -fPIC"])
+ 	AC_MSG_CHECKING(for c++ optimization flags)
+ 	AC_SUBST([CXXOPTFLAGS])
+ 	AC_MSG_RESULT(done)
+@@ -2078,7 +2078,7 @@
+ 	MULTITHREADING=no
+ 	MULTITHREADINLIB=""
+ 	if test "$NUMTHREADS_VALUE" != "1"; then
+-		
++
+ 		MULTITHREADINGLIB="-lpthread -lrt"
+ 		case "${host_os}" in
+ 		*cygwin*)
+@@ -2095,12 +2095,12 @@
+ 	fi
+ 	AC_DEFINE_UNQUOTED([_NUMTHREADS_],[$NUMTHREADS_VALUE],[number of threads])
+ 	AC_SUBST([MULTITHREADINGLIB])
+-	AC_MSG_RESULT($NUMTHREADS_VALUE) 
++	AC_MSG_RESULT($NUMTHREADS_VALUE)
+ 	dnl }}}
+ 	dnl 64bit {{{
+ 	AC_ARG_WITH([64bit-indices],
+ 	  AS_HELP_STRING([--with-64bit-indices = bool], [use 64 bit integers, default 0, ex: --with-64bit-indices=1]),
+-	  [USE_64BIT_INDICES=$withval],[USE_64BIT_INDICES=0]) 
++	  [USE_64BIT_INDICES=$withval],[USE_64BIT_INDICES=0])
+ 	AC_MSG_CHECKING(for 64 bit indices)
+ 
+ 	if test "$USE_64BIT_INDICES" == "1"; then
+@@ -2131,7 +2131,7 @@
+ 		 if test "$HAVE_GIAIVINS" = "yes" &&  test "$HAVE_FORTRAN" = "no" ; then
+ 			  AC_MSG_ERROR([need fortran compiler to compile GiaIvins (or use --without-GiaIvins )]);
+ 		 fi
+-			
++
+        dnl check that fortran is provided if Love is on
+ 		 if test "$HAVE_LOVE" = "yes" &&  test "$HAVE_FORTRAN" = "no" ; then
+ 			  AC_MSG_ERROR([need fortran compiler to compile Love (or use --without-Love)]);
+@@ -2141,7 +2141,7 @@
+ 		  if test "$HAVE_METIS" = "yes"  && test "$HAVE_MPI" = "no" ; then
+ 				AC_MSG_ERROR([need mpi if using the metis partitioner!]);
+ 		  fi
+-		
++
+ 		dnl check that if we run adolc, we don't compile krigging.exe
+ 		if test "$HAVE_ADOLC" = "yes"  && test "$HAVE_KRIGING" = "yes" ; then
+ 			AC_MSG_ERROR([cannot compile kriging.exe under adolc conditions!]);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23216-23217.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23216-23217.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23216-23217.diff	(revision 23390)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 23216)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 23217)
+@@ -142,7 +142,8 @@
+ 
+ 	/*Update control input*/
+ 	SetControlInputsFromVectorx(femmodel,X);
+-
++	
++	
+ 	/*solve forward: */
+ 	switch(solution_type){
+ 		case SteadystateSolutionEnum:
+@@ -151,8 +152,20 @@
+ 			break;
+ 		case StressbalanceSolutionEnum:
+ 			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
+-			solutionsequence_nonlinear(femmodel,conserve_loads); 
+-			break;
++			
++			bool is_schur_cg_solver = false;
++			#ifdef _HAVE_PETSC_
++			int solver_type;
++			PetscOptionsDetermineSolverType(&solver_type);
++			if(solver_type==FSSolverEnum) is_schur_cg_solver = true;
++			#endif
++			
++			if(is_schur_cg_solver){
++			 solutionsequence_schurcg(femmodel);
++			}else{
++			 solutionsequence_nonlinear(femmodel,conserve_loads); 
++			}
++			 break;
+ 		case BalancethicknessSolutionEnum:
+ 			femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
+ 			solutionsequence_linear(femmodel); 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23217-23218.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23217-23218.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23217-23218.diff	(revision 23390)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 23217)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 23218)
+@@ -150,7 +150,7 @@
+ 			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
+ 			stressbalance_core(femmodel);	//We need a 3D velocity!! (vz is required for the next thermal run)
+ 			break;
+-		case StressbalanceSolutionEnum:
++		case StressbalanceSolutionEnum:{
+ 			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
+ 			
+ 			bool is_schur_cg_solver = false;
+@@ -165,6 +165,7 @@
+ 			}else{
+ 			 solutionsequence_nonlinear(femmodel,conserve_loads); 
+ 			}
++			}
+ 			 break;
+ 		case BalancethicknessSolutionEnum:
+ 			femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23218-23219.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23218-23219.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23218-23219.diff	(revision 23390)
@@ -0,0 +1,42 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 23218)
++++ ../trunk-jpl/etc/environment.sh	(revision 23219)
+@@ -74,20 +74,12 @@
+ 	libpathappend "$GMT_DIR/lib"
+ fi
+ 
+-#legacy mpich2 (To be removed)
+-MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install"
+-if [ -d "$MPI_DIR" ]; then
+-	export MPI_DIR
+-	pathprepend   "$MPI_DIR/bin"
+-	libpathappend "$MPI_DIR/lib"
+-fi
+-
+ MPI_DIR="$ISSM_DIR/externalpackages/mpich/install"
+ if [ -d "$MPI_DIR" ]; then
+ 	export MPI_DIR
+ 	export MPI_INC_DIR="$MPI_DIR/include"
+-	pathprepend   "$MPI_DIR/bin"
+-	libpathappend "$MPI_DIR/lib"
++	pathprepend    "$MPI_DIR/bin"
++	libpathprepend "$MPI_DIR/lib"
+ fi
+ 
+ PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"
+@@ -233,14 +225,6 @@
+ GMAKE_DIR="$ISSM_DIR/externalpackages/gmake/install"
+ pathprepend "$GMAKE_DIR/bin"
+ 
+-PYTHON_DIR="$ISSM_DIR/externalpackages/python/install"
+-if [ -d "$PYTHON_DIR" ]; then
+-	export PYTHONPATH="$PYTHONPATH:$ISSM_DIR/lib"
+-	pathprepend    "$PYTHON_DIR/bin"
+-	libpathprepend "$PYTHON_DIR/lib"
+-	libpathprepend "$ISSM_DIR/lib"
+-fi
+-
+ MODELE_DIR="$ISSM_DIR/externalpackages/modelE/install"
+ pathappend "$MODELE_DIR/src/exec"
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23219-23220.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23219-23220.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23219-23220.diff	(revision 23390)
@@ -0,0 +1,47 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 23219)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 23220)
+@@ -42,12 +42,22 @@
+ 	/* [ A   B ] = Kff
+     * [ B^T 0 ] 
+ 	 *         */
++	#if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=8)
++	MatCreateSubMatrix(Kff,isv,isv,MAT_INITIAL_MATRIX,&A);
++	MatCreateSubMatrix(Kff,isv,isp,MAT_INITIAL_MATRIX,&B);
++	MatCreateSubMatrix(Kff,isp,isv,MAT_INITIAL_MATRIX,&BT);
++	#else
+ 	MatGetSubMatrix(Kff,isv,isv,MAT_INITIAL_MATRIX,&A);
+ 	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_MAJOR_==3) && (_PETSC_MINOR_>=8)
++	MatCreateSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP);
++	#else
+ 	MatGetSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP);
++	#endif
+ 
+ 	/* Get number of velocity / pressure nodes */
+ 	MatGetSize(B,&nu,&np);
+@@ -312,12 +322,18 @@
+   /*			[A    B]
+ 	* Kff =  |      |
+ 	*			[B^T IP]
+-  /* To calculate the residual, only the necessary blocks need to be extracted */
++   * To calculate the residual, only the necessary blocks need to be extracted */
+ 
+ 		/*Extract A, B, B^T */
++		#if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=8)
++		MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A);
++		MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B);
++		MatCreateSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT);
++		#else
+ 		MatGetSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A);
+ 		MatGetSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B);
+ 		MatGetSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT);
++		#endif
+ 	
+ 		/*no. of free nodes in velocity/pressure space*/
+ 		MatGetSize(B,&n_u,&n_p);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23220-23221.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23220-23221.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23220-23221.diff	(revision 23390)
@@ -0,0 +1,257 @@
+Index: ../trunk-jpl/src/c/cores/masstransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 23220)
++++ ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 23221)
+@@ -11,6 +11,9 @@
+ 
+ void masstransport_core(FemModel* femmodel){
+ 
++	/*Start profiler*/
++	femmodel->profiler->Start(MASSTRANSPORTCORE);
++
+ 	/*parameters: */
+ 	int    numoutputs,domaintype;
+ 	bool   save_results;
+@@ -80,4 +83,7 @@
+ 
+ 	/*Free ressources:*/
+ 	if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
++
++	/*profiler*/
++	femmodel->profiler->Stop(MASSTRANSPORTCORE);
+ }
+Index: ../trunk-jpl/src/c/cores/stressbalance_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 23220)
++++ ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 23221)
+@@ -12,6 +12,9 @@
+ 
+ void stressbalance_core(FemModel* femmodel){
+ 
++	/*Start profiler*/
++	femmodel->profiler->Start(STRESSBALANCECORE);
++
+ 	/*parameters: */
+ 	bool       dakota_analysis,control_analysis;
+ 	int        domaintype;
+@@ -85,4 +88,7 @@
+ 
+ 	/*Free ressources:*/	
+ 	if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
++
++	/*End profiler*/
++	femmodel->profiler->Stop(STRESSBALANCECORE);
+ }
+Index: ../trunk-jpl/src/c/classes/Profiler.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.cpp	(revision 23220)
++++ ../trunk-jpl/src/c/classes/Profiler.cpp	(revision 23221)
+@@ -14,7 +14,7 @@
+ 
+ /*Profiler constructors and destructors:*/
+ Profiler::Profiler(){/*{{{*/
+-	for(int i=0;i<MAXIMUMSIZE;i++){
++	for(int i=0;i<MAXPROFSIZE;i++){
+ 		this->time[i]          = 0.;
+ 		this->time_start[i]    = 0.;
+ 		this->flops[i]         = 0.;
+@@ -22,6 +22,7 @@
+ 		this->memory[i]        = 0.;
+ 		this->memory_start[i]  = 0.;
+ 		this->running[i]       = false;
++		this->used[i]          = false;
+ 	}
+ } /*}}}*/
+ Profiler::~Profiler(){/*{{{*/
+@@ -31,7 +32,7 @@
+ 	/*First do simple copy: */
+ 	Profiler* output=new Profiler();
+ 
+-	for(int i=0;i<MAXIMUMSIZE;i++){
++	for(int i=0;i<MAXPROFSIZE;i++){
+ 		output->time[i]  =this->time[i];
+ 		output->flops[i] =this->flops[i];
+ 		output->memory[i]=this->memory[i];
+@@ -48,7 +49,7 @@
+ void Profiler::Echo(void){/*{{{*/
+ 
+ 	_printf_("Profiler:\n");
+-	for(int i=0;i<MAXIMUMSIZE;i++){
++	for(int i=0;i<MAXPROFSIZE;i++){
+ 		_printf_("    Tag "<<i<<":\n");
+ 		_printf_("       flops:   "<<this->flops[i]<<"\n");
+ 		_printf_("       memory:  "<<this->memory[i]<<"\n");
+@@ -69,13 +70,13 @@
+ 
+ 	MARSHALLING_ENUM(ProfilerEnum);
+ 	pointer = &this->time[0];
+-	MARSHALLING_DYNAMIC(pointer,IssmPDouble,MAXIMUMSIZE);
++	MARSHALLING_DYNAMIC(pointer,IssmPDouble,MAXPROFSIZE);
+ 	pointer = &this->flops[0];
+-	MARSHALLING_DYNAMIC(pointer,IssmPDouble,MAXIMUMSIZE);
++	MARSHALLING_DYNAMIC(pointer,IssmPDouble,MAXPROFSIZE);
+ 	pointer = &this->memory[0];
+-	MARSHALLING_DYNAMIC(pointer,IssmPDouble,MAXIMUMSIZE);
++	MARSHALLING_DYNAMIC(pointer,IssmPDouble,MAXPROFSIZE);
+ 	bpointer = &this->running[0];
+-	MARSHALLING_DYNAMIC(bpointer,bool,MAXIMUMSIZE);
++	MARSHALLING_DYNAMIC(bpointer,bool,MAXPROFSIZE);
+ 
+ } /*}}}*/
+ int  Profiler::ObjectEnum(void){/*{{{*/
+@@ -87,7 +88,7 @@
+ 
+ 	/*Get tag*/
+ 	_assert_(tag>=0); 
+-	_assert_(tag<MAXIMUMSIZE); 
++	_assert_(tag<MAXPROFSIZE); 
+ 	if(this->running[tag]) _error_("Tag "<<tag<<" has not been stopped");
+ 
+ 	return this->flops[tag];
+@@ -96,7 +97,7 @@
+ 
+ 	/*Get tag*/
+ 	_assert_(tag>=0); 
+-	_assert_(tag<MAXIMUMSIZE); 
++	_assert_(tag<MAXPROFSIZE); 
+ 	if(this->running[tag]) _error_("Tag "<<tag<<" has not been stopped");
+ 
+ 	#ifdef _HAVE_MPI_
+@@ -129,7 +130,7 @@
+ 
+ 	/*Get initial flops*/
+ 	_assert_(tag>=0); 
+-	_assert_(tag<MAXIMUMSIZE); 
++	_assert_(tag<MAXPROFSIZE); 
+ 	if(this->running[tag]) _error_("Tag "<<tag<<" has not been stopped");
+ 
+ 	return this->memory[tag];
+@@ -139,7 +140,7 @@
+ 
+ 	/*Check tag*/
+ 	_assert_(tag>=0); 
+-	_assert_(tag<MAXIMUMSIZE); 
++	_assert_(tag<MAXPROFSIZE); 
+ 	if(this->running[tag]) _error_("Tag "<<tag<<" is already running");
+ 
+ 	/*If mpisync requested, make sure all the cpus are at the same point in the execution: */
+@@ -166,7 +167,7 @@
+ 
+ 	/*Plug into this->time: */
+ 	_assert_(tag>=0); 
+-	_assert_(tag<MAXIMUMSIZE); 
++	_assert_(tag<MAXPROFSIZE); 
+ 	this->time_start[tag]   = t;
+ 	this->flops_start[tag]  = f;
+ 	this->memory_start[tag] = m;
+@@ -173,12 +174,13 @@
+ 
+ 	/*turn on running*/
+ 	this->running[tag] = true;
++	this->used[tag]    = true;
+ }/*}}}*/
+ void  Profiler::Stop(int tag,bool dontmpisync){/*{{{*/
+ 
+ 	/*Check tag*/
+ 	_assert_(tag>=0); 
+-	_assert_(tag<MAXIMUMSIZE); 
++	_assert_(tag<MAXPROFSIZE); 
+ 	if(!this->running[tag]) _error_("Tag "<<tag<<" is not running");
+ 
+ 	/*If mpisync requested, make sure all the cpus are at the same point in the execution: */
+@@ -205,7 +207,7 @@
+ 
+ 	/*Plug into this->time: */
+ 	_assert_(tag>=0); 
+-	_assert_(tag<MAXIMUMSIZE); 
++	_assert_(tag<MAXPROFSIZE); 
+ 	this->time[tag]   += t - this->time_start[tag];
+ 	this->flops[tag]  += f - this->flops_start[tag];
+ 	this->memory[tag] += m - this->memory_start[tag];
+@@ -213,3 +215,10 @@
+ 	/*turn off running*/
+ 	this->running[tag] = false;
+ }/*}}}*/
++bool  Profiler::Used(int tag){/*{{{*/
++
++	/*Check tag*/
++	_assert_(tag>=0); 
++	_assert_(tag<MAXPROFSIZE); 
++	return this->used[tag];
++}/*}}}*/
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23220)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23221)
+@@ -253,10 +253,16 @@
+ 
+ 	/*Before we delete the profiler, report statistics for this run: */
+ 	profiler->Stop(TOTAL);  //final tagging
++
+ 	_printf0_("\n");
+-	_printf0_("   "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<profiler->TotalTime(MPROCESSOR) << "\n");
+-	_printf0_("   "<<setw(40)<<left<<"Core solution elapsed time:"<<profiler->TotalTime(CORE) << "\n");
+-	_printf0_("   "<<setw(40)<<left<<"Solver elapsed time:"<<profiler->TotalTime(SOLVER) << "\n");
++	_printf0_("   "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<setw(7)<<profiler->TotalTime(MPROCESSOR) << "\n");
++	/*Total times*/
++	_printf0_("   "<<setw(40)<<left<<"Total Core solution elapsed time:"<<setw(7)<<profiler->TotalTime(CORE) << "\n");
++	/*Individual cores*/
++	if(profiler->Used(STRESSBALANCECORE)) _printf0_("   "<<setw(40)<<left<<"Stress balance core elapsed time:"<<setw(7)<<profiler->TotalTime(STRESSBALANCECORE) << "\n");
++	if(profiler->Used(MASSTRANSPORTCORE)) _printf0_("   "<<setw(40)<<left<<"Mass transport core elapsed time:"<<setw(7)<<profiler->TotalTime(MASSTRANSPORTCORE) << "\n");
++	/*Linear solver only*/
++	_printf0_("   "<<setw(40)<<left<<"Linear solver elapsed time:"<<setw(7)<<profiler->TotalTime(SOLVER) << " ("<<setprecision(2)<<profiler->TotalTime(SOLVER)/profiler->TotalTime(CORE)*100.<<"%)\n");
+ 	_printf0_("\n");
+ 	_printf0_("   Total elapsed time: "
+ 				<<profiler->TotalTimeModHour(TOTAL)<<" hrs "
+Index: ../trunk-jpl/src/c/classes/Profiler.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.h	(revision 23220)
++++ ../trunk-jpl/src/c/classes/Profiler.h	(revision 23221)
+@@ -10,23 +10,26 @@
+ #include "../datastructures/datastructures.h"
+ 
+ /*Macros*/
+-#define TOTAL 0      /*Profiling Total time */ 
+-#define MPROCESSOR 1 /*Profiling Model processor*/ 
+-#define CORE 2       /*Profiling solution */ 
+-#define SOLVER 3     /*Profiling solution */ 
+-#define ADCORE 4     /*Profiling AD */ 
+-#define MAXIMUMSIZE 5
++#define TOTAL              0 /*Profiling Total time */
++#define MPROCESSOR         1 /*Profiling Model processor*/
++#define CORE               2 /*Profiling solution */
++#define SOLVER             3 /*Profiling solution */
++#define ADCORE             4 /*Profiling AD */
++#define STRESSBALANCECORE  5 /*Profiling AD */
++#define MASSTRANSPORTCORE  6 /*Profiling AD */
++#define MAXPROFSIZE        7 /*Used to initialize static arrays*/
+ 
+ class Profiler: public Object{
+ 
+ 	public: 
+-		IssmPDouble flops[MAXIMUMSIZE];
+-		IssmPDouble flops_start[MAXIMUMSIZE];
+-		IssmPDouble memory[MAXIMUMSIZE];
+-		IssmPDouble memory_start[MAXIMUMSIZE];
+-		IssmPDouble time[MAXIMUMSIZE];
+-		IssmPDouble time_start[MAXIMUMSIZE];
+-		bool        running[MAXIMUMSIZE];
++		IssmPDouble flops[MAXPROFSIZE];
++		IssmPDouble flops_start[MAXPROFSIZE];
++		IssmPDouble memory[MAXPROFSIZE];
++		IssmPDouble memory_start[MAXPROFSIZE];
++		IssmPDouble time[MAXPROFSIZE];
++		IssmPDouble time_start[MAXPROFSIZE];
++		bool        running[MAXPROFSIZE];
++		bool        used[MAXPROFSIZE];
+ 
+ 		/*Profiler constructors, destructors */
+ 		Profiler();
+@@ -49,6 +52,7 @@
+ 		IssmPDouble  Memory(int tag);
+ 		void         Start(int tagenum,bool dontmpisync=false);
+ 		void         Stop(int tagenum,bool dontmpisync=false);
++		bool         Used(int tagenum);
+ };
+ 
+ #endif  /* _PROFILER_H_ */
Index: /issm/oecreview/Archive/23185-23389/ISSM-23221-23222.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23221-23222.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23221-23222.diff	(revision 23390)
@@ -0,0 +1,73 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23221)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23222)
+@@ -258,9 +258,7 @@
+ 	_printf0_("   "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<setw(7)<<profiler->TotalTime(MPROCESSOR) << "\n");
+ 	/*Total times*/
+ 	_printf0_("   "<<setw(40)<<left<<"Total Core solution elapsed time:"<<setw(7)<<profiler->TotalTime(CORE) << "\n");
+-	/*Individual cores*/
+-	if(profiler->Used(STRESSBALANCECORE)) _printf0_("   "<<setw(40)<<left<<"Stress balance core elapsed time:"<<setw(7)<<profiler->TotalTime(STRESSBALANCECORE) << "\n");
+-	if(profiler->Used(MASSTRANSPORTCORE)) _printf0_("   "<<setw(40)<<left<<"Mass transport core elapsed time:"<<setw(7)<<profiler->TotalTime(MASSTRANSPORTCORE) << "\n");
++
+ 	/*Linear solver only*/
+ 	_printf0_("   "<<setw(40)<<left<<"Linear solver elapsed time:"<<setw(7)<<profiler->TotalTime(SOLVER) << " ("<<setprecision(2)<<profiler->TotalTime(SOLVER)/profiler->TotalTime(CORE)*100.<<"%)\n");
+ 	_printf0_("\n");
+@@ -858,10 +856,16 @@
+ 		solution_flops=profiler->TotalFlops(CORE);
+ 		solution_memory=profiler->Memory(CORE);
+ 
+-		_printf0_("Core solution elapsed time    : " << solution_time   << " Seconds\n");
+-		_printf0_("Core solution number of flops : " << solution_flops  << " Flops\n");
+-		_printf0_("Core solution memory used     : " << solution_memory << " Bytes\n");
++		_printf0_("\nCore solution profiling\n");
++		_printf0_("   elapsed time    : " << solution_time   << " Seconds\n");
++		_printf0_("   number of flops : " << solution_flops  << " Flops\n");
++		_printf0_("   memory used     : " << solution_memory << " Bytes\n");
+ 
++		/*Individual cores*/
++		_printf0_("Individual core profiling\n");
++		if(profiler->Used(STRESSBALANCECORE)) _printf0_("   "<<setw(40)<<left<<"Stress balance core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(STRESSBALANCECORE) << " sec\n");
++		if(profiler->Used(MASSTRANSPORTCORE)) _printf0_("   "<<setw(40)<<left<<"Mass transport core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(MASSTRANSPORTCORE) << " sec\n");
++
+ 		/*Add to results: */
+ 		results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingSolutionTimeEnum,  solution_time));
+ 		results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentMemEnum,  solution_memory));
+@@ -868,14 +872,16 @@
+ 		results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentFlopsEnum, solution_flops));
+ 
+ 		#ifdef _HAVE_ADOLC_
+-		solution_time=profiler->TotalTime(ADCORE);
+-		solution_flops=profiler->TotalFlops(ADCORE);
+-		solution_memory=profiler->Memory(ADCORE);
++		solution_time   = profiler->TotalTime(ADCORE);
++		solution_flops  = profiler->TotalFlops(ADCORE);
++		solution_memory = profiler->Memory(ADCORE);
+ 
+-		_printf0_("AD Solution elapsed time    : " << solution_time   << " Seconds\n");
+-		_printf0_("AD Solution number of flops : " << solution_flops  << " Flops\n");
+-		_printf0_("AD Solution memory used     : " << solution_memory << " Bytes\n");
++		_printf0_("AD profiling\n");
++		_printf0_("   elapsed time    : " << solution_time   << " Seconds\n");
++		_printf0_("   number of flops : " << solution_flops  << " Flops\n");
++		_printf0_("   memory used     : " << solution_memory << " Bytes\n");
+ 		#endif
++		_printf0_("\n");
+ 
+ 	}
+ }
+Index: ../trunk-jpl/src/c/classes/Profiler.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.h	(revision 23221)
++++ ../trunk-jpl/src/c/classes/Profiler.h	(revision 23222)
+@@ -50,8 +50,8 @@
+ 		int          TotalTimeModMin(int tag);
+ 		int          TotalTimeModSec(int tag);
+ 		IssmPDouble  Memory(int tag);
+-		void         Start(int tagenum,bool dontmpisync=false);
+-		void         Stop(int tagenum,bool dontmpisync=false);
++		void         Start(int tagenum,bool dontmpisync=true); /*Do not call MPI barrier by default to save some ms*/
++		void         Stop(int tagenum, bool dontmpisync=true); /*Do not call MPI barrier by default to save some ms*/
+ 		bool         Used(int tagenum);
+ };
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23222-23223.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23222-23223.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23222-23223.diff	(revision 23390)
@@ -0,0 +1,47 @@
+Index: ../trunk-jpl/test/NightlyRun/test2084.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23222)
++++ ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23223)
+@@ -1,5 +1,5 @@
+ 
+-%Test Name: GiaCaron. 
++%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.
+@@ -56,7 +56,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={field_names{:},'LoveH_loading_realpart','LoveK_loading_realpart','LoveL_loading_realpart','LoveH_loading_imagpart','LoveK_loading_imagpart','LoveL_loading_imagpart'};
+-field_tolerances={field_tolerances{:},7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10};
++field_tolerances={field_tolerances{:},5e-7,5e-7,5e-7,5e-7,5e-7,5e-7};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,:)),...
+ 	(md.results.LoveSolution.LoveKr(:,:)),...
+@@ -74,7 +74,7 @@
+ 
+ %tidal love numbers
+ field_names     ={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={field_tolerances{:},7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10};
++field_tolerances={field_tolerances{:},3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,1)),...
+ 	(md.results.LoveSolution.LoveKr(:,1)),...
+@@ -114,7 +114,7 @@
+ %md=solve(md,'lv');
+ %
+ %field_names     ={field_names{:},'LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart'};
+-%field_tolerances={field_tolerances{:},7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10};
++%field_tolerances={field_tolerances{:},2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7};
+ %field_values={field_values{:},...
+ %	(md.results.LoveSolution.LoveHr(:,1)),...
+ %	(md.results.LoveSolution.LoveKr(:,1)),...
+@@ -146,7 +146,7 @@
+ md.love.nfreq=length(md.love.frequencies);
+ 
+ field_names     ={field_names{:},'LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart'};
+-field_tolerances={field_tolerances{:},7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10,7.0e-10};
++field_tolerances={field_tolerances{:},2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,1)),...
+ 	(md.results.LoveSolution.LoveKr(:,1)),...
Index: /issm/oecreview/Archive/23185-23389/ISSM-23223-23224.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23223-23224.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23223-23224.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test2084.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23223)
++++ ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23224)
+@@ -146,7 +146,7 @@
+ md.love.nfreq=length(md.love.frequencies);
+ 
+ field_names     ={field_names{:},'LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart'};
+-field_tolerances={field_tolerances{:},2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7};
++field_tolerances={field_tolerances{:},6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,1)),...
+ 	(md.results.LoveSolution.LoveKr(:,1)),...
Index: /issm/oecreview/Archive/23185-23389/ISSM-23227-23228.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23227-23228.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23227-23228.diff	(revision 23390)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/src/c/cores/thermal_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/thermal_core.cpp	(revision 23227)
++++ ../trunk-jpl/src/c/cores/thermal_core.cpp	(revision 23228)
+@@ -11,7 +11,10 @@
+ #include "../solutionsequences/solutionsequences.h"
+ 
+ void thermal_core(FemModel* femmodel){
+-
++	
++	/*Start profiler*/
++        femmodel->profiler->Start(THERMALCORE);
++	
+ 	/*intermediary*/
+ 	bool   save_results,isenthalpy;
+ 	bool   dakota_analysis;
+@@ -51,5 +54,7 @@
+ 
+ 	/*Free ressources:*/	
+ 	if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
+-
++	
++	/*End profiler*/
++        femmodel->profiler->Stop(THERMALCORE);
+ }
+Index: ../trunk-jpl/src/c/classes/Profiler.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.h	(revision 23227)
++++ ../trunk-jpl/src/c/classes/Profiler.h	(revision 23228)
+@@ -15,9 +15,10 @@
+ #define CORE               2 /*Profiling solution */
+ #define SOLVER             3 /*Profiling solution */
+ #define ADCORE             4 /*Profiling AD */
+-#define STRESSBALANCECORE  5 /*Profiling AD */
+-#define MASSTRANSPORTCORE  6 /*Profiling AD */
+-#define MAXPROFSIZE        7 /*Used to initialize static arrays*/
++#define THERMALCORE	   5 /*Profiling THERMAL */
++#define STRESSBALANCECORE  6 /*Profiling STRESSBALANCE */
++#define MASSTRANSPORTCORE  7 /*Profiling MASSTRANSPORT */
++#define MAXPROFSIZE        8 /*Used to initialize static arrays*/
+ 
+ class Profiler: public Object{
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23228-23229.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23228-23229.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23228-23229.diff	(revision 23390)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23228)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23229)
+@@ -863,8 +863,10 @@
+ 
+ 		/*Individual cores*/
+ 		_printf0_("Individual core profiling\n");
++		if(profiler->Used(THERMALCORE)) _printf0_("   "<<setw(40)<<left<<"Thermal core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(THERMALCORE) << " sec\n");
+ 		if(profiler->Used(STRESSBALANCECORE)) _printf0_("   "<<setw(40)<<left<<"Stress balance core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(STRESSBALANCECORE) << " sec\n");
+ 		if(profiler->Used(MASSTRANSPORTCORE)) _printf0_("   "<<setw(40)<<left<<"Mass transport core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(MASSTRANSPORTCORE) << " sec\n");
++		
+ 
+ 		/*Add to results: */
+ 		results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingSolutionTimeEnum,  solution_time));
Index: /issm/oecreview/Archive/23185-23389/ISSM-23229-23230.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23229-23230.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23229-23230.diff	(revision 23390)
@@ -0,0 +1,254 @@
+Index: ../trunk-jpl/src/m/classes/clusters/stallo.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/stallo.py	(revision 23229)
++++ ../trunk-jpl/src/m/classes/clusters/stallo.py	(revision 23230)
+@@ -50,7 +50,7 @@
+ 		self=stallo_settings(self)
+ 		#OK get other fields
+ 		self=options.AssignObjectFields(self)
+-		self.np=self.numnodes*self.cpuspernode		
++		self.np=self.numnodes*self.cpuspernode
+ 	# }}}
+ 
+ 	def __repr__(self):
+@@ -60,7 +60,7 @@
+ 		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,'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'))
+@@ -119,9 +119,9 @@
+ 		m,s=divmod(timeobj.total_seconds(), 60)
+ 		h,m=divmod(m, 60)
+ 		d,h=divmod(h, 60)
+-		timestring="%02d-%02d:%02d:%02d" % (d, h, m, s)
+-		fid.write('#SBATCH --time=%s\n' % timestring) #walltime is minutes
+-		fid.write('#SBATCH --mem-per-cpu=%iGB\n' % self.mem)# mem is in GB
++#		timestring="%02d-%02d:%02d:%02d" % (d, h, m, s)
++		fid.write('#SBATCH --time={}\n'.format(timestring)) #walltime is minutes
++		fid.write('#SBATCH --mem-per-cpu={}MB\n'.format(1000*self.mem))# mem is in MB (to keep it integral)
+ 		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)
+Index: ../trunk-jpl/src/m/classes/clusters/stallo.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/stallo.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/clusters/stallo.m	(revision 23230)
+@@ -0,0 +1,214 @@
++%        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
++
++			 %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',floor(cluster.time/(3600*24)),floor(cluster.time/3600),floor(mod(cluster.time,60)));
++			 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 --output %s/%s/%s.outlog \n',cluster.executionpath,dirname,modelname);
++ 			 fprintf(fid,'#SBATCH --error %s/%s/%s.errlog \n\n',cluster.executionpath,dirname,modelname);
++ 			 fprintf(fid,'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 ' && qsub ' modelname '.queue '];
++				 else
++					 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++						 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
++				 end
++			 else
++				 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/23185-23389/ISSM-23230-23231.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23230-23231.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23230-23231.diff	(revision 23390)
@@ -0,0 +1,1000 @@
+Index: ../trunk-jpl/test/NightlyRun/test413.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test413.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test413.py	(revision 23231)
+@@ -0,0 +1,66 @@
++#Test Name: SquareSheetShelfDiadSSA3dDakotaPart
++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 partitioner import *
++from importancefactors import *
++
++md = triangle(model(),'../Exp/Square.exp',150000.)
++md = setmask(md,'../Exp/SquareShelf.exp','')
++md = parameterize(md,'../Par/SquareSheetShelf.py')
++md = setflowequation(md,'SSA','all')
++md.cluster = generic('name',gethostname(),'np',3)
++
++#Dakota options
++
++#dakota version
++version = IssmConfig('_DAKOTA_VERSION_')
++version = float(version[0])
++
++#partitioning
++md.qmu.numberofpartitions = 20
++md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
++md.qmu.partition = md.qmu.partition-1
++
++#variables
++md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01)
++md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient',1,0.01)
++
++#responses
++md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++
++#method
++md.qmu.method = dakota_method.dakota_method('nond_l')
++
++#parameters
++md.qmu.params.direct = True
++md.qmu.params.interval_type = 'forward'
++
++if version >= 6:
++	md.qmu.params.analysis_driver = 'matlab'
++	md.qmu.params.evaluation_scheduling = 'master'
++	md.qmu.params.processors_per_evaluation = 2
++else:
++	md.qmu.params.analysis_driver = 'stressbalance'
++	md.qmu.params.evaluation_concurrency = 1
++
++
++#imperative!
++md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
++md.qmu.isdakota = 1
++
++#solve
++md.verbose = verbose('000000000')	# this line is recommended
++md = solve(md,'Stressbalance','overwrite','y')
++
++#Fields and tolerances to track changes
++md.qmu.results = md.results.dakota
++md.results.dakota.importancefactors = importancefactors(md,'scaled_FrictionCoefficient','MaxVel').T
++field_names = ['importancefactors']
++field_tolerances = [1e-10]
++field_values = [md.results.dakota.importancefactors]
+Index: ../trunk-jpl/test/NightlyRun/test234.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test234.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test234.py	(revision 23231)
+@@ -0,0 +1,101 @@
++#Test Name: SquareShelfTranForceNeg2dDakotaSamp
++import numpy as np
++import scipy.io as spio
++from os import getcwd
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from SMBgemb import *
++from partitioner import *
++from dmeth_params_set import *
++
++md = triangle(model(),'../Exp/Square.exp',180000.)
++md = setmask(md,'all','')
++md = parameterize(md,'../Par/SquareShelf.py')
++md = setflowequation(md,'SSA','all')
++md.cluster = generic('name',gethostname(),'np',3)
++
++md.timestepping.time_step = 1
++md.settings.output_frequency = 1
++md.timestepping.final_time = 4
++
++smb = np.ones((md.mesh.numberofvertices,))*3.6
++smb = np.array([smb,smb*-1]).T
++
++md.smb.mass_balance = smb
++md.smb.mass_balance = np.concatenate((md.smb.mass_balance,[[1.5,3]]))
++md.transient.isthermal = 0
++
++#Dakota options
++
++#dakota version
++version = IssmConfig('_DAKOTA_VERSION_')
++version = float(version[0])
++
++#partitioning
++md.qmu.numberofpartitions = 20
++md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
++md.qmu.partition = md.qmu.partition - 1
++
++#variables
++md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance',1,0.1)
++
++#responses
++md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.IceVolume = response_function.response_function('IceVolume',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++
++#mass flux profiles
++md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp']
++md.qmu.mass_flux_profile_directory = getcwd()
++
++##  nond_sampling study
++md.qmu.method = dakota_method.dakota_method('nond_samp')
++md.qmu.method = dmeth_params_set(md.qmu.method,'seed',1234,'samples',20,'sample_type','lhs')
++dver = str(version)
++if ((int(dver[0]) == 4 and int(dver[2])>2) or int(dver[0])>4):
++	md.qmu.method = dmeth_params_set(md.qmu.method,'rng','rnum2')
++
++#parameters
++md.qmu.params.direct = True
++md.qmu.params.analysis_components = ''
++md.qmu.params.interval_type = 'forward'
++md.qmu.params.tabular_graphics_data = True
++md.qmu.isdakota = 1
++
++if version >= 6:
++	md.qmu.params.analysis_driver = 'matlab'
++	md.qmu.params.evaluation_scheduling = 'master'
++	md.qmu.params.processors_per_evaluation = 2
++else:
++	md.qmu.params.analysis_driver = 'stressbalance'
++	md.qmu.params.evaluation_concurrency = 1
++
++md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
++md.transient.requested_outputs = ['IceVolume']
++
++#solve
++md.verbose = verbose('000000000')	# this line is recommended
++md = solve(md,'Transient','overwrite','y')
++md.qmu.results = md.results.dakota
++
++#Fields and tolerances to track changes
++md.results.dakota.moments = []
++for i in range(8):
++	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
++
++for i in range(8):
++	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
++
++field_names      = ['moments']
++field_tolerances = [1e-11]
++field_values = [md.results.dakota.moments]
+Index: ../trunk-jpl/test/NightlyRun/test414.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test414.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test414.py	(revision 23231)
+@@ -0,0 +1,92 @@
++#Test Name: SquareSheetShelfDiadSSA3dDakotaMassFlux
++import numpy as np
++from os import getcwd
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from partitioner import *
++
++md = triangle(model(),'../Exp/Square.exp',150000.)
++md = setmask(md,'../Exp/SquareShelf.exp','')
++md = parameterize(md,'../Par/SquareSheetShelf.py')
++md = setflowequation(md,'SSA','all')
++md.cluster = generic('name',gethostname(),'np',3)
++md.materials.rho_ice = 10**7 #involved in the mass flux, make it easy
++md.geometry.thickness[:] = 1 #make it easy
++md.geometry.surface = md.geometry.base+md.geometry.thickness
++
++#constrain all velocities to 1 m/yr, in the y-direction
++md.stressbalance.spcvx = np.zeros((md.mesh.numberofvertices,))
++md.stressbalance.spcvy = np.ones((md.mesh.numberofvertices,))
++md.stressbalance.spcvz = np.zeros((md.mesh.numberofvertices,))
++
++#Dakota options
++
++#dakota version
++version = IssmConfig('_DAKOTA_VERSION_')
++version = float(version[0])
++
++#partitioning
++md.qmu.numberofpartitions = 20
++md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
++md.qmu.partition = md.qmu.partition-1
++
++#variables
++md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient',1,0.01)
++
++#responses
++md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux6 = response_function.response_function('indexed_MassFlux_6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux7 = response_function.response_function('indexed_MassFlux_7',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++
++#mass flux profiles
++md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp','../Exp/Square.exp']
++md.qmu.mass_flux_profile_directory = getcwd()
++
++#method
++md.qmu.method = dakota_method.dakota_method('nond_l')
++
++#parameters
++md.qmu.params.direct = True
++md.qmu.params.interval_type = 'forward'
++md.qmu.isdakota = 1
++md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
++
++if version >= 6:
++	md.qmu.params.analysis_driver = 'matlab'
++	md.qmu.params.evaluation_scheduling = 'master'
++	md.qmu.params.processors_per_evaluation = 2
++else:
++	md.qmu.params.analysis_driver = 'stressbalance'
++	md.qmu.params.evaluation_concurrency = 1
++
++#solve
++md.verbose = verbose('000000000')	# this line is recommended
++md = solve(md,'Stressbalance','overwrite','y')
++md.qmu.results = md.results.dakota
++
++#Fields and tolerances to track changes
++#ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
++#we recover those mass fluxes through the mean of the response.
++#also, we recover the max velo, which should be 1m/yr. 
++#we put all that data in the moments, which we will use to test for success.
++#also, check that the stddev are 0.
++md.results.dakota.moments = []
++for i in range(8):
++	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
++
++for i in range(8):
++	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
++
++field_names      = ['moments']
++field_tolerances = [1e-11]
++field_values = [md.results.dakota.moments]
+Index: ../trunk-jpl/test/NightlyRun/test235.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test235.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test235.py	(revision 23231)
+@@ -0,0 +1,97 @@
++#Test Name: SquareShelfTranForceNeg2dDakotaLocal
++import numpy as np
++import scipy.io as spio
++from os import getcwd
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from SMBgemb import *
++from partitioner import *
++from dmeth_params_set import *
++
++md = triangle(model(),'../Exp/Square.exp',180000.)
++md = setmask(md,'all','')
++md = parameterize(md,'../Par/SquareShelf.py')
++md = setflowequation(md,'SSA','all')
++md.cluster = generic('name',gethostname(),'np',3)
++
++md.timestepping.time_step = 1
++md.settings.output_frequency = 1
++md.timestepping.final_time = 4
++
++smb = np.ones((md.mesh.numberofvertices,))*3.6
++smb = np.array([smb,smb*-1]).T
++
++md.smb.mass_balance = smb
++md.smb.mass_balance = np.concatenate((md.smb.mass_balance,[[1.5,3]]))
++md.transient.isthermal = 0
++
++#Dakota options
++
++#dakota version
++version = IssmConfig('_DAKOTA_VERSION_')
++version = float(version[0])
++
++#partitioning
++md.qmu.numberofpartitions = 20
++md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
++md.qmu.partition = md.qmu.partition - 1
++
++#variables
++md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance',1,100)
++
++#responses
++md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.IceVolume = response_function.response_function('IceVolume',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++
++#mass flux profiles
++md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp']
++md.qmu.mass_flux_profile_directory = getcwd()
++
++#method
++md.qmu.method = dakota_method.dakota_method('nond_l')
++
++#parameters
++md.qmu.params.direct = True
++md.qmu.params.analysis_components = ''
++md.qmu.params.interval_type = 'forward'
++md.qmu.params.fd_gradient_step_size = '0.1'
++md.qmu.isdakota = 1
++
++if version >= 6:
++	md.qmu.params.analysis_driver = 'matlab'
++	md.qmu.params.evaluation_scheduling = 'master'
++	md.qmu.params.processors_per_evaluation = 2
++else:
++	md.qmu.params.analysis_driver = 'stressbalance'
++	md.qmu.params.evaluation_concurrency = 1
++
++md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
++md.transient.requested_outputs = ['IceVolume']
++
++#solve
++md.verbose = verbose('000000000')	# this line is recommended
++md = solve(md,'Transient','overwrite','y')
++md.qmu.results = md.results.dakota
++
++#Fields and tolerances to track changes
++md.results.dakota.moments = []
++for i in range(8):
++	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
++
++for i in range(8):
++	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
++
++field_names      = ['moments']
++field_tolerances = [1e-11]
++field_values = [md.results.dakota.moments]
+Index: ../trunk-jpl/test/NightlyRun/test417.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test417.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test417.py	(revision 23231)
+@@ -0,0 +1,106 @@
++#Test Name: SquareSheetShelfDiadSSA3dDakotaSamp
++import numpy as np
++from os import getcwd
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from partitioner import *
++from dmeth_params_set import *
++
++md = triangle(model(),'../Exp/Square.exp',150000.)
++md = setmask(md,'../Exp/SquareShelf.exp','')
++md = parameterize(md,'../Par/SquareSheetShelf.py')
++md = setflowequation(md,'SSA','all')
++md.cluster = generic('name',gethostname(),'np',3)
++md.materials.rho_ice = 10**7 #involved in the mass flux, make it easy
++md.geometry.thickness[:] = 1 #make it easy
++md.geometry.surface = md.geometry.base+md.geometry.thickness
++
++#constrain all velocities to 1 m/yr, in the y-direction
++md.stressbalance.spcvx[:] = 0
++md.stressbalance.spcvy[:] = 1
++md.stressbalance.spcvz[:] = 0
++
++#Dakota options
++
++#dakota version
++version = IssmConfig('_DAKOTA_VERSION_')
++version = float(version[0])
++
++#partitioning
++md.qmu.numberofpartitions = 20
++md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
++md.qmu.partition = md.qmu.partition-1
++
++#variables
++md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient',1,0.01)
++
++#responses
++md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux6 = response_function.response_function('indexed_MassFlux_6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.MassFlux7 = response_function.response_function('indexed_MassFlux_7',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++
++#mass flux profiles
++md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp','../Exp/Square.exp']
++md.qmu.mass_flux_profile_directory = getcwd()
++
++#method
++md.qmu.method = dakota_method.dakota_method('nond_samp')
++md.qmu.method = dmeth_params_set(md.qmu.method,'seed',1234,'samples',20,'sample_type','lhs')
++
++#parameters
++md.qmu.params.direct = True
++md.qmu.params.analysis_components = ''
++md.qmu.params.tabular_graphics_data = True;
++
++if version >= 6:
++	md.qmu.params.analysis_driver = 'matlab'
++	md.qmu.params.evaluation_scheduling = 'master'
++	md.qmu.params.processors_per_evaluation = 2
++else:
++	md.qmu.params.analysis_driver = 'stressbalance'
++	md.qmu.params.evaluation_concurrency = 1
++
++#partitioning
++md.qmu.numberofpartitions = 20
++md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
++md.qmu.partition = md.qmu.partition-1
++md.qmu.isdakota = 1
++
++md.stressbalance.reltol = 10**-5	#tighten for qmu analyses
++
++#solve
++md.verbose = verbose('000000000')	# this line is recommended
++
++# There may be a pair of numpy warnings in the function true_divide,
++#	this is normal and will not affect the results
++#	See src/m/qmu/dakota_out_parse.py, function "dak_tab_out" for details
++md = solve(md,'Stressbalance','overwrite','y')
++
++#Fields and tolerances to track changes
++md.qmu.results = md.results.dakota;
++
++#ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
++#we recover those mass fluxes through the mean of the response.
++#also, we recover the max velo, which should be 1m/yr. 
++#we put all that data in the montecarlo field, which we will use to test for success.
++#also, check that the stddev are 0.
++md.results.dakota.montecarlo = []
++for i in range(8):
++	md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].mean)
++
++for i in range(8):
++	md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].stddev)
++
++field_names      = ['moments']
++field_tolerances = [1e-11]
++field_values = [md.results.dakota.montecarlo]
+Index: ../trunk-jpl/test/NightlyRun/test444.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test444.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test444.py	(revision 23231)
+@@ -0,0 +1,127 @@
++#Test Name: SquareShelfTranForceNeg2dDakotaLocal
++import numpy as np
++from os import getcwd
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from SMBgemb import *
++from partitioner import *
++from dmeth_params_set import *
++from ContourToMesh import *
++from regionaloutput import *
++
++#model not consistent:  equality thickness=surface-base violated
++
++md = triangle(model(),'../Exp/Square.exp',150000.)
++md = setmask(md,'../Exp/SquareShelf.exp','')
++md = parameterize(md,'../Par/SquareSheetShelf.py')
++md.geometry.bed = md.geometry.base.copy()
++pos = np.where(md.mask.groundedice_levelset < 0)
++md.geometry.bed[pos] = md.geometry.base[pos]-10
++md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices,))
++md.friction.p = np.ones((md.mesh.numberofelements,))
++md.friction.q = np.ones((md.mesh.numberofelements,))
++md.transient.isthermal = 0
++md.transient.isgroundingline = 1
++md.groundingline.migration = 'AggressiveMigration'
++
++md.settings.output_frequency = 3
++md = setflowequation(md,'SSA','all')
++md.cluster = generic('name',oshostname(),'np',3)
++
++regionalmask = np.zeros((md.mesh.numberofvertices,))
++c_in = ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,'../Exp/SquareHalfRight.exp','node',1)
++regionalmask[np.where(c_in)] = 1
++md.transient.requested_outputs = ['default','GroundedArea','FloatingArea','IceVolumeAboveFloatation','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',
++	'IceMass1','IceVolume1','IceVolumeAboveFloatation1','IceVolumeAboveFloatation']
++md.outputdefinition.definitions.append(regionaloutput('name','GroundedArea1','outputnamestring','GroundedArea','mask',regionalmask,
++	'definitionstring','Outputdefinition1'))
++md.outputdefinition.definitions.append(regionaloutput('name','FloatingArea1','outputnamestring','FloatingArea','mask',regionalmask,
++	'definitionstring','Outputdefinition2'))
++md.outputdefinition.definitions.append(regionaloutput('name','TotalFloatingBmb1','outputnamestring','TotalFloatingBmb','mask',regionalmask,
++	'definitionstring','Outputdefinition3'))
++md.outputdefinition.definitions.append(regionaloutput('name','TotalGroundedBmb1','outputnamestring','TotalGroundedBmb','mask',regionalmask,
++	'definitionstring','Outputdefinition4'))
++md.outputdefinition.definitions.append(regionaloutput('name','IceMass1','outputnamestring','IceMass','mask',regionalmask,
++	'definitionstring','Outputdefinition5'))
++md.outputdefinition.definitions.append(regionaloutput('name','IceVolume1','outputnamestring','IceVolume','mask',regionalmask,
++	'definitionstring','Outputdefinition6'))
++md.outputdefinition.definitions.append(regionaloutput('name','IceVolumeAboveFloatation1','outputnamestring','IceVolumeAboveFloatation','mask',regionalmask,
++	'definitionstring','Outputdefinition7'))
++md.outputdefinition.definitions.append(regionaloutput('name','TotalSmb1','outputnamestring','TotalSmb','mask',regionalmask,
++	'definitionstring','Outputdefinition8'))
++md.outputdefinition.definitions.append(regionaloutput('name','TotalSmb2','outputnamestring','TotalSmb','mask',regionalmask,
++	 'definitionstring','Outputdefinition9'))
++
++md.extrude(3,1.)
++md.collapse()
++
++#Dakota options
++
++#dakota version
++version = IssmConfig('_DAKOTA_VERSION_')
++version = float(version[0])
++
++#variables
++md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_BasalforcingsFloatingiceMeltingRate',1,0.1)
++
++#responses
++md.qmu.responses.IceMass1 = response_function.response_function('Outputdefinition5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.IceVolume1 = response_function.response_function('Outputdefinition6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.IceVolumeAboveFloatation1 = response_function.response_function('Outputdefinition7',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.IceVolumeAboveFloatation = response_function.response_function('IceVolumeAboveFloatation',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.GroundedArea1 = response_function.response_function('Outputdefinition1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.FloatingArea1 = response_function.response_function('Outputdefinition2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.TotalFloatingBmb1 = response_function.response_function('Outputdefinition3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.TotalGroundedBmb1 = response_function.response_function('Outputdefinition4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.TotalSmb1 = response_function.response_function('Outputdefinition8',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.TotalSmb2 = response_function.response_function('Outputdefinition9',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++md.qmu.responses.FloatingArea = response_function.response_function('FloatingArea',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++
++#method
++md.qmu.method = dakota_method.dakota_method('nond_samp')
++md.qmu.method = dmeth_params_set(md.qmu.method,'seed',1234,'samples',20,'sample_type','random')
++
++#parameters
++md.qmu.params.direct = True
++md.qmu.params.analysis_components = ''
++md.qmu.params.tabular_graphics_data = True
++
++if version >= 6:
++	md.qmu.params.analysis_driver = 'matlab'
++	md.qmu.params.evaluation_scheduling = 'master'
++	md.qmu.params.processors_per_evaluation = 2
++else:
++	md.qmu.params.analysis_driver = 'stressbalance'
++	md.qmu.params.evaluation_concurrency = 1
++
++#partitioning
++md.qmu.numberofpartitions = 10
++md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
++md.qmu.partition = md.qmu.partition-1
++md.qmu.isdakota = 1
++
++md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
++
++#solve
++md.verbose = verbose('000000000')	# this line is recommended
++md = solve(md,'Transient','overwrite','y')
++
++#Fields and tolerances to track changes
++md.qmu.results = md.results.dakota
++
++#we put all the mean and stdev data in the montecarlo field, which we will use to test for success.
++md.results.dakota.montecarlo = []
++for i in range(11):
++	md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].mean)
++
++for i in range(11):
++	md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].stddev)
++
++field_names      = ['montecarlo']
++field_tolerances = [1e-11]
++field_values = [md.results.dakota.montecarlo]
+Index: ../trunk-jpl/src/m/modules/Chaco.py
+===================================================================
+--- ../trunk-jpl/src/m/modules/Chaco.py	(revision 23230)
++++ ../trunk-jpl/src/m/modules/Chaco.py	(revision 23231)
+@@ -4,7 +4,7 @@
+ 	'''CHACO
+ 
+    Usage:
+-      [assgn] = Chaco(A,vwgts,ewgts,x,y,z,options,nparts,goal);
++      assgn = Chaco(A,vwgts,ewgts,x,y,z,options,nparts,goal);
+ 
+    A:			Input adjacency matrix
+    vwgts:		weights for all vertices
+Index: ../trunk-jpl/src/m/modules/Scotch.py
+===================================================================
+--- ../trunk-jpl/src/m/modules/Scotch.py	(revision 23230)
++++ ../trunk-jpl/src/m/modules/Scotch.py	(revision 23231)
+@@ -1,7 +1,7 @@
+ from Scotch_python import Scotch_python
+ 
+ def Scotch(*varargin):
+-'''SCOTCH - Scotch partitioner
++	'''SCOTCH - Scotch partitioner
+ 
+    Usage:
+       maptab=Scotch(adjmat,vertlb,vertwt,edgewt,archtyp,archpar,Scotch-specific parameters)
+Index: ../trunk-jpl/src/m/partition/partitioner.py
+===================================================================
+--- ../trunk-jpl/src/m/partition/partitioner.py	(revision 23230)
++++ ../trunk-jpl/src/m/partition/partitioner.py	(revision 23231)
+@@ -2,10 +2,11 @@
+ from pairoptions import *
+ import MatlabFuncs as m
+ from adjacency import *
+-#from Chaco import *
++from Chaco import *
+ #from Scotch import *
+-#from MeshPartition import *
++from MeshPartition import *
+ from project3d import *
++from mesh2d import *
+ 
+ def partitioner(md,*varargin):
+ 	help ='''
+@@ -59,30 +60,31 @@
+ 		print 'skipping adjacency matrix computation as requested in the options'
+ 
+ 	if m.strcmpi(package,'chaco'):
+-		raise RuntimeError('Chaco is not currently supported for this function')
++		#raise RuntimeError('Chaco is not currently supported for this function')
+ 
+ 		#  default method (from chaco.m)
+-		#method=np.array([1,1,0,0,1,1,50,0,.001,7654321]).reshape(-1,1)
+-		#method[0]=3    #  global method (3=inertial (geometric))
+-		#method[2]=0    #  vertex weights (0=off, 1=on)
++		method=np.array([1,1,0,0,1,1,50,0,.001,7654321])
++		method[0]=3    #  global method (3=inertial (geometric))
++		method[2]=0    #  vertex weights (0=off, 1=on)
+ 
+ 		#specify bisection
+-		#method[5]=options.getfieldvalue('section')#  ndims (1=bisection, 2=quadrisection, 3=octasection)
++		method[5]=options.getfieldvalue('section')#  ndims (1=bisection, 2=quadrisection, 3=octasection)
+ 
+ 		#are we using weights? 
+-		#if m.strcmpi(options.getfieldvalue('weighting'),'on'):
+-			#weights=np.floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight))
+-			#method[2]=1
+-		#else:
+-			#weights=[]
++		if m.strcmpi(options.getfieldvalue('weighting'),'on'):
++			weights=np.floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight))
++			method[2]=1
++		else:
++			weights=[]
+ 	
++		method = method.reshape(-1,1)	# transpose to 1x10 instead of 10
++
+ 		#  partition into nparts
+-		#if isinstance(md.mesh,mesh2d):
+-			#part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,np.zeros((md.mesh.numberofvertices,)),method,npart,[]).T+1 #index partitions from 1 up. like metis.
+-		#else:
+-			#part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,md.mesh.z,method,npart,[]).T+1 #index partitions from 1 up. like metis.
++		if isinstance(md.mesh,mesh2d):
++			part=np.array(Chaco(md.qmu.adjacency,weights,np.array([]),md.mesh.x, md.mesh.y,np.zeros((md.mesh.numberofvertices,)),method,npart,np.array([]))).T+1 #index partitions from 1 up. like metis.
++		else:
++			part=np.array(Chaco(md.qmu.adjacency,weights,np.array([]),md.mesh.x, md.mesh.y,md.mesh.z,method,npart,np.array([]))).T+1 #index partitions from 1 up. like metis.
+ 	
+-	
+ 	elif m.strcmpi(package,'scotch'):
+ 		raise RuntimeError('Scotch is not currently supported for this function')
+ 
+Index: ../trunk-jpl/src/m/qmu/dakota_out_parse.py
+===================================================================
+--- ../trunk-jpl/src/m/qmu/dakota_out_parse.py	(revision 23230)
++++ ../trunk-jpl/src/m/qmu/dakota_out_parse.py	(revision 23231)
+@@ -240,6 +240,17 @@
+ 	dmin95 =prctile_issm(data,5,0)
+ 	dmax95 =prctile_issm(data,95,0)
+ 
++	# Note: the following line may cause the following warning
++	#	(should not crash or invalidate results) when one of
++	#	the inputs does not change with respect to the
++	#	other/s causing an internal divide-by-zero error
++
++	#/usr/local/lib/python2.7/dist-packages/numpy/lib/function_base.py:3163:
++	#	RuntimeWarning: invalid value encountered in true_divide
++	#	c /= stddev[:,None]
++
++	#	(and/or the same but with "c /= stddev[None, :]")
++
+ 	dcorrel=np.corrcoef(data.T)
+ 
+ 	#  divide the data into structures for consistency
+Index: ../trunk-jpl/src/m/qmu/dakota_in_write.py
+===================================================================
+--- ../trunk-jpl/src/m/qmu/dakota_in_write.py	(revision 23230)
++++ ../trunk-jpl/src/m/qmu/dakota_in_write.py	(revision 23231)
+@@ -61,7 +61,7 @@
+ 
+ 	filei2=fullfile(pathstr,name+ext)
+ 
+-	print 'Opening Dakota input file \''+filei2 + '\''
++	print 'Opening Dakota input file \''+filei2 + '\'.'
+ 	try:
+ 		with open(filei2,'w+') as fidi:
+ 
+Index: ../trunk-jpl/src/m/qmu/process_qmu_response_data.m
+===================================================================
+--- ../trunk-jpl/src/m/qmu/process_qmu_response_data.m	(revision 23230)
++++ ../trunk-jpl/src/m/qmu/process_qmu_response_data.m	(revision 23231)
+@@ -42,9 +42,7 @@
+ 
+ 	%ok, process the domains named in qmu_mass_flux_profiles,  to build a list of segments (MatArray)
+ 	md.qmu.mass_flux_segments=cell(num_mass_flux,1);
+-	md.qmu.mass_flux_segments
+ 	for i=1:num_mass_flux,
+ 		md.qmu.mass_flux_segments{i}=MeshProfileIntersection(md.mesh.elements,md.mesh.x,md.mesh.y,[md.qmu.mass_flux_profile_directory '/' md.qmu.mass_flux_profiles{i}]);
+ 	end
+-	md.qmu.mass_flux_segments
+ end
+Index: ../trunk-jpl/src/wrappers/Chaco/Chaco.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/Chaco/Chaco.cpp	(revision 23230)
++++ ../trunk-jpl/src/wrappers/Chaco/Chaco.cpp	(revision 23231)
+@@ -46,15 +46,15 @@
+ 
+ 	/*Fetch Data*/
+ 	FetchChacoData(&nvtxs,&adjacency,&start,&ewgts,A_IN,EWGTS_IN);
+-	FetchData(&vwgts,&nterms,VWGTS_IN); 
+-	FetchData(&x,&nterms,X_IN); 
+-	FetchData(&y,&nterms,Y_IN); 
+-	FetchData(&z,&nterms,Z_IN); 
+-	FetchData(&in_options,&nterms,OPTNS_IN); 
++	FetchData(&vwgts,&nterms,VWGTS_IN);
++	FetchData(&x,&nterms,X_IN);
++	FetchData(&y,&nterms,Y_IN);
++	FetchData(&z,&nterms,Z_IN);
++	FetchData(&in_options,&nterms,OPTNS_IN);
+ 	for (i=0;i<(nterms<10?nterms:10);i++) options[i]=in_options[i]; //copy in_options into default options
+-	FetchData(&npart,NPARTS_IN); 
++	FetchData(&npart,NPARTS_IN);
+ 	//int * nparts=xNew<int>(1); nparts[0]=npart; //weird Chacox interface ain't it?
+-	FetchData(&goal,&nterms,GOAL_IN); 
++	FetchData(&goal,&nterms,GOAL_IN);
+ 
+ 	/*Allocate output: */
+ 	short* assignment = xNewZeroInit<short>(nvtxs);
+Index: ../trunk-jpl/src/wrappers/python/io/pythonio.h
+===================================================================
+--- ../trunk-jpl/src/wrappers/python/io/pythonio.h	(revision 23230)
++++ ../trunk-jpl/src/wrappers/python/io/pythonio.h	(revision 23231)
+@@ -50,6 +50,9 @@
+ void FetchData(Contours** pcontours,PyObject* py_list);
+ void FetchChacoData(int* pnvtxs,int** padjacency,int** pstart,float** pewgts,PyObject* A_IN,PyObject* EWGTS_IN);
+ 
++void pyGetJc(double* a, int nvtxs, int* Jc);
++void pyGetIr(double* a, int nvtxs, int nzmax, int* Ir);
++
+ int CheckNumPythonArguments(PyObject* inputs,int NRHS, void (*function)( void ));
+ 
+ /*Utils*/
+Index: ../trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp	(revision 23230)
++++ ../trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp	(revision 23231)
+@@ -31,7 +31,7 @@
+ 		#endif
+ 	}
+ 	else if (PyInt_Check(py_float))
+-	 dscalar=(double)PyInt_AsLong(py_float);
++		dscalar=(double)PyInt_AsLong(py_float);
+ 	else if (PyBool_Check(py_float))
+ 		dscalar=(double)PyLong_AsLong(py_float);
+ 	else if (PyTuple_Check(py_float) && (int)PyTuple_Size(py_float)==1)
+@@ -131,7 +131,8 @@
+ 	/*output: */
+ 	double* dmatrix=NULL;
+ 	double* matrix=NULL;
+-	int M,N;
++	int M=0;
++	int N=0;
+ 	int ndim;
+ 	npy_intp*  dims=NULL;
+ 
+@@ -235,7 +236,8 @@
+ 
+ 	/*output: */
+ 	int* matrix=NULL;
+-	int M,N;
++	int M=0;
++	int N=0;
+ 	int ndim;
+ 	npy_intp*  dims=NULL;
+ 
+@@ -324,7 +326,8 @@
+ 	/*output: */
+ 	bool* bmatrix=NULL;
+ 	bool* matrix=NULL;
+-	int M,N;
++	int M=0;
++	int N=0;
+ 	int ndim;
+ 	npy_intp*  dims=NULL;
+ 
+@@ -410,7 +413,7 @@
+ 	/*output: */
+ 	double* dvector=NULL;
+ 	double* vector=NULL;
+-	int M;
++	int M=0;
+ 	int ndim;
+ 	npy_intp*  dims=NULL;
+ 
+@@ -498,7 +501,7 @@
+ 
+ 	/*output: */
+ 	float* vector=NULL;
+-	int M;
++	int M=0;
+ 	int ndim;
+ 	npy_intp*  dims=NULL;
+ 
+@@ -538,7 +541,7 @@
+ 
+ 				/*transform into int vector: */
+ 				vector=xNew<float>(M);
+-				for(i=0;i<M;i++)vector[i]=(float)lvector[i];
++				for(i=0;i<M;i++)vector[i]=(float)dvector[i];
+ 			}
+ 
+ 			else if (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_LONG) {
+@@ -565,7 +568,7 @@
+ 			if(py_vector2) delete(py_vector2);
+ 		}
+ 		else
+-		 vector=NULL;
++			vector=NULL;
+ 	}
+ 	else{
+ 		M=1;
+@@ -583,7 +586,7 @@
+ 
+ 	/*output: */
+ 	int* vector=NULL;
+-	int M;
++	int M=0;
+ 	int ndim;
+ 	npy_intp*  dims=NULL;
+ 
+@@ -623,7 +626,7 @@
+ 
+ 				/*transform into int vector: */
+ 				vector=xNew<int>(M);
+-				for(i=0;i<M;i++)vector[i]=(int)lvector[i];
++				for(i=0;i<M;i++)vector[i]=(int)dvector[i];
+ 			}
+ 
+ 			else if (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_LONG) {
+@@ -671,7 +674,7 @@
+ 	/*output: */
+ 	bool* bvector=NULL;
+ 	bool* vector=NULL;
+-	int M;
++	int M=0;
+ 	int ndim;
+ 	npy_intp*  dims=NULL;
+ 
+@@ -922,11 +925,91 @@
+ 	xDelete<char>(contourname);
+ 	*pcontours=contours;
+ }
++
++void FetchChacoData(int* pnvtxs,int** padjacency,int** pstart,float** pewgts,PyObject* A_IN, PyObject* EWGTS_IN){/*{{{*/
++
++	double* a = ((double*)PyArray_DATA((PyArrayObject*)A_IN));
++	int ndim  = PyArray_NDIM((PyArrayObject*)A_IN);
++	int nzmax = PyArray_CountNonzero((PyArrayObject*)A_IN);
++
++	/*Fetch adjacency matrix:*/
++	int      nvtxs       = PyArray_DIMS((PyArrayObject*)A_IN)[1];
++
++	int* mwstart = xNewZeroInit<int>(nvtxs+1);
++	pyGetJc(a,nvtxs,mwstart);
++
++	int* mwadjacency = xNewZeroInit<int>(nzmax);
++	pyGetIr(a,nvtxs,nzmax,mwadjacency);
++	
++	int* start = xNew<int>(nvtxs+1);
++	for(int i=0;i<nvtxs+1;i++) start[i]=(int)mwstart[i];
++	int* adjacency = xNew<int>(nzmax);
++	for(int i=0; i<nzmax; i++) adjacency[i]=(int)mwadjacency[i];
++
++	/*Get edges weights*/
++	int nedges = start[nvtxs];
++	float* ewgts = NULL;
++	int size = PyArray_SIZE((PyArrayObject*)EWGTS_IN);
++	//size may be 1 and still be empty;
++	//presumably size of edge_weights input will never be exactly 1
++	if(size != 1 && size != 0){
++		ewgts = xNewZeroInit<float>(nedges);
++		for(int i = 0; i<nedges;i++){
++			ewgts[i] = (float)a[i];
++		}
++	}
++
++	/*Assign output pointers*/
++	*pnvtxs     = nvtxs;
++	*padjacency = adjacency;
++	*pstart     = start;
++	*pewgts     = ewgts;
++}
+ /*}}}*/
+-void FetchChacoData(int* pnvtxs,int** padjacency,int** pstart,float** pewgts,PyObject* A_IN,PyObject* EWGTS_IN){
+-	_error_("Nathan... I need your help here");
++
++void pyGetJc(double* a, int nvtxs, int* Jc){
++/*{{{*/
++	//get the number of non-zero elements in each row, adding to the prior number;
++	//always starts with 0 and has length: number_of_rows_in(a)+1 == nvtxs+1
++	// eg: 0, 1, 3, 6, 8, 13, ...
++	// for: 1 in the first row, 2 in the second, 3 in the third, etc.
++	int c = 0;
++	Jc[c++] = 0;
++
++	for(int i=0;i<nvtxs;i++){
++		for(int j=0;j<nvtxs;j++){
++			if ((int)a[i+(j*nvtxs)] != 0){
++				Jc[c] += 1;
++			}
++		}
++		c++;
++		Jc[c] = Jc[c-1];
++	}
++	return;
+ }
++/*}}}*/
+ 
++void pyGetIr(double* a, int nvtxs, int nzmax, int* Ir){
++/*{{{*/
++	//get the row-wise position of each non-zero element;
++	//has length: number_of_non_zero_elements_in(a) == nzmax
++	// eg: 10, 24, 25, 4, ...
++	// the 10th, 24th, and 25th elements in the first row, the 4th in the second row
++	// using pyGetJc to determine which indices correspond to which row
++	int r = 0;
++
++	for(int i=0;i<nvtxs;i++){
++		for(int j=0;j<nvtxs;j++){
++			if ((int)a[i+(j*nvtxs)] != 0){
++				Ir[r] = j;
++				r++;
++			}
++		}
++	}
++	return;
++}
++/*}}}*/
++
+ /*Python version dependent: */
+ #if _PYTHON_MAJOR_ >= 3 
+ /*FUNCTION FetchData(char** pstring,PyObject* py_unicode){{{*/
Index: /issm/oecreview/Archive/23185-23389/ISSM-23231-23232.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23231-23232.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23231-23232.diff	(revision 23390)
@@ -0,0 +1,237 @@
+Index: ../trunk-jpl/src/c/cores/gia_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/gia_core.cpp	(revision 23231)
++++ ../trunk-jpl/src/c/cores/gia_core.cpp	(revision 23232)
+@@ -10,6 +10,9 @@
+ #include "../solutionsequences/solutionsequences.h"
+ void gia_core(FemModel* femmodel){
+ 
++	/*Start profiler*/
++	femmodel->profiler->Start(GIACORE);
++
+ 	Vector<IssmDouble> *wg    = NULL;
+ 	Vector<IssmDouble> *dwdtg = NULL;
+ 	IssmDouble          *x    = NULL;
+@@ -55,4 +58,7 @@
+ 
+ 	xDelete<IssmDouble>(x);
+ 	xDelete<IssmDouble>(y);
++	
++	/*End profiler*/
++	femmodel->profiler->Stop(GIACORE);
+ }
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 23231)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 23232)
+@@ -400,6 +400,10 @@
+ 		}
+ 
+ 		if(isgroundingline){
++		
++			/*Start profiler*/
++			femmodel->profiler->Start(GROUNDINGLINECORE);
++		
+ 			if(VerboseSolution()) _printf0_("   computing new grounding line position\n");
+ 			GroundinglineMigrationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+ 
+@@ -409,6 +413,9 @@
+ 			extrudefrombase_core(femmodel);
+ 			femmodel->parameters->SetParam(SurfaceEnum,InputToExtrudeEnum);
+ 			extrudefrombase_core(femmodel);
++			
++			/*Stop profiler*/
++			femmodel->profiler->Stop(GROUNDINGLINECORE);
+ 
+ 			if(save_results){
+ 				int outputs[3] = {SurfaceEnum,BaseEnum,MaskGroundediceLevelsetEnum};
+Index: ../trunk-jpl/src/c/cores/esa_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/esa_core.cpp	(revision 23231)
++++ ../trunk-jpl/src/c/cores/esa_core.cpp	(revision 23232)
+@@ -11,6 +11,9 @@
+ 
+ void esa_core(FemModel* femmodel){ /*{{{*/
+ 
++	/*Start profiler*/
++	femmodel->profiler->Start(ESACORE);
++
+ 	Vector<IssmDouble> *U_radial  = NULL; 
+ 	Vector<IssmDouble> *U_north   = NULL; 
+ 	Vector<IssmDouble> *U_east    = NULL; 
+@@ -111,6 +114,9 @@
+ 		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/movingfront_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/movingfront_core.cpp	(revision 23231)
++++ ../trunk-jpl/src/c/cores/movingfront_core.cpp	(revision 23232)
+@@ -10,6 +10,9 @@
+ #include "../modules/modules.h"
+ 
+ void movingfront_core(FemModel* femmodel){
++	
++	/*Start profiler*/
++	femmodel->profiler->Start(MOVINGFRONTCORE);
+ 
+ 	/* intermediaries */
+ 	bool save_results,isstressbalance,ismasstransport,isthermal,isenthalpy,islevelset,ismovingfront;
+@@ -97,4 +100,7 @@
+ 		int outputs[1] = {IceMaskNodeActivationEnum};
+ 		femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],1);
+ 	}
++	
++	/*End profiler*/
++	femmodel->profiler->Stop(MOVINGFRONTCORE);
+ }
+Index: ../trunk-jpl/src/c/cores/damage_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/damage_core.cpp	(revision 23231)
++++ ../trunk-jpl/src/c/cores/damage_core.cpp	(revision 23232)
+@@ -10,7 +10,10 @@
+ #include "../solutionsequences/solutionsequences.h"
+ 
+ void damage_core(FemModel* femmodel){
+-
++	
++	/*Start profiler*/
++	femmodel->profiler->Start(DAMAGECORE);
++        
+ 	/*intermediary*/
+ 	bool   save_results;
+ 	bool   dakota_analysis     = false;
+@@ -47,4 +50,7 @@
+ 		} 
+ 		xDelete<char*>(requested_outputs);
+ 	}
++	
++	/*End profiler*/
++	femmodel->profiler->Stop(DAMAGECORE);
+ }
+Index: ../trunk-jpl/src/c/cores/hydrology_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 23231)
++++ ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 23232)
+@@ -11,6 +11,9 @@
+ 
+ void hydrology_core(FemModel* femmodel){
+ 
++	/*Start profiler*/
++	femmodel->profiler->Start(HYDROLOGYCORE);
++        
+ 	/*intermediary*/
+ 	int          hydrology_model;
+ 	int          solution_type;
+@@ -149,4 +152,7 @@
+ 		}
+ 		xDelete<char*>(requested_outputs);
+ 	}
++	
++	/*End profiler*/
++	femmodel->profiler->Stop(HYDROLOGYCORE);
+ }
+Index: ../trunk-jpl/src/c/cores/smb_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/smb_core.cpp	(revision 23231)
++++ ../trunk-jpl/src/c/cores/smb_core.cpp	(revision 23232)
+@@ -10,7 +10,10 @@
+ #include "../solutionsequences/solutionsequences.h"
+ 
+ void smb_core(FemModel* femmodel){
+-
++	
++	/*Start profiler*/
++	femmodel->profiler->Start(SMBCORE);
++	
+ 	/*parameters: */
+ 	Analysis* analysis=NULL;
+ 	int    smb_model;
+@@ -44,4 +47,7 @@
+ 
+ 	/*Free ressources:*/
+ 	if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
++
++	/*End profiler*/
++	femmodel->profiler->Stop(SMBCORE);
+ }
+Index: ../trunk-jpl/src/c/cores/sealevelrise_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelrise_core.cpp	(revision 23231)
++++ ../trunk-jpl/src/c/cores/sealevelrise_core.cpp	(revision 23232)
+@@ -12,6 +12,9 @@
+ /*cores:*/
+ void sealevelrise_core(FemModel* femmodel){ /*{{{*/
+ 
++	/*Start profiler*/
++	femmodel->profiler->Start(SLRCORE);
++
+ 	/*Parameters, variables:*/
+ 	bool save_results;
+ 	bool isslr=0;
+@@ -53,6 +56,9 @@
+ 
+ 	/*requested dependents: */
+ 	if(solution_type==SealevelriseSolutionEnum)femmodel->RequestedDependentsx();
++	
++	/*End profiler*/
++	femmodel->profiler->Stop(SLRCORE);
+ }
+ /*}}}*/
+ void geodetic_core(FemModel* femmodel){ /*{{{*/
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23231)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23232)
+@@ -864,10 +864,17 @@
+ 		/*Individual cores*/
+ 		_printf0_("Individual core profiling\n");
+ 		if(profiler->Used(THERMALCORE)) _printf0_("   "<<setw(40)<<left<<"Thermal core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(THERMALCORE) << " sec\n");
++		if(profiler->Used(HYDROLOGYCORE)) _printf0_("   "<<setw(40)<<left<<"Hydrology core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(HYDROLOGYCORE) << " sec\n");
+ 		if(profiler->Used(STRESSBALANCECORE)) _printf0_("   "<<setw(40)<<left<<"Stress balance core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(STRESSBALANCECORE) << " sec\n");
++		if(profiler->Used(DAMAGECORE)) _printf0_("   "<<setw(40)<<left<<"Damage core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(DAMAGECORE) << " sec\n");
++		if(profiler->Used(MOVINGFRONTCORE)) _printf0_("   "<<setw(40)<<left<<"Moving front core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(MOVINGFRONTCORE) << " sec\n");
+ 		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");
+ 		
+-
+ 		/*Add to results: */
+ 		results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingSolutionTimeEnum,  solution_time));
+ 		results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentMemEnum,  solution_memory));
+Index: ../trunk-jpl/src/c/classes/Profiler.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.h	(revision 23231)
++++ ../trunk-jpl/src/c/classes/Profiler.h	(revision 23232)
+@@ -15,10 +15,18 @@
+ #define CORE               2 /*Profiling solution */
+ #define SOLVER             3 /*Profiling solution */
+ #define ADCORE             4 /*Profiling AD */
+-#define THERMALCORE	   5 /*Profiling THERMAL */
+-#define STRESSBALANCECORE  6 /*Profiling STRESSBALANCE */
+-#define MASSTRANSPORTCORE  7 /*Profiling MASSTRANSPORT */
+-#define MAXPROFSIZE        8 /*Used to initialize static arrays*/
++#define THERMALCORE			5 /*Profiling THERMAL */
++#define HYDROLOGYCORE		6 /*Profiling HYDROLOGY */
++#define STRESSBALANCECORE	7 /*Profiling STRESSBALANCE */
++#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 MAXPROFSIZE			16 /*Used to initialize static arrays*/
+ 
+ class Profiler: public Object{
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23232-23233.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23232-23233.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23232-23233.diff	(revision 23390)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/externalpackages/adjointmpi/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/adjointmpi/install.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/adjointmpi/install.sh	(revision 23233)
+@@ -0,0 +1,25 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install
++
++#Almost the same as adjoinable mpi but some adaptations to CoDiPack https://github.com/michel2323/AdjointMPI
++svn co https://github.com/michel2323/AdjointMPI.git/trunk src
++mkdir install
++
++cd src
++autoreconf -fi
++ ./configure \
++	 --prefix="$ISSM_DIR/externalpackages/adjointmpi/install" \
++	 --with-mpi-root="$ISSM_DIR/externalpackages/mpich/install" \
++	 CXXFLAGS="-O2 -fPIC" CFLAGS="-O2 -fPIC" 
++
++#Compile adjoinablempi 
++make clean
++if [ $# -eq 0 ]; then
++	make 
++else
++	make -j $1
++fi
++make install
+
+Property changes on: ../trunk-jpl/externalpackages/adjointmpi/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/23185-23389/ISSM-23233-23234.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23233-23234.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23233-23234.diff	(revision 23390)
@@ -0,0 +1,29 @@
+Index: ../trunk-jpl/jenkins/linux64_ross_dakota
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_dakota	(revision 23233)
++++ ../trunk-jpl/jenkins/linux64_ross_dakota	(revision 23234)
+@@ -10,6 +10,8 @@
+ ISSM_CONFIG='--prefix=$ISSM_DIR\
+ 	--disable-static \
+ 	--with-matlab-dir=$MATLAB_PATH \
++	--with-python-dir=/usr \
++	--with-python-numpy-dir=/home/jenkins/.local/lib/python2.7/site-packages/numpy \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+ 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
+ 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi -lmpicxx -lmpifort" \
+@@ -29,7 +31,7 @@
+ 
+ #PYTHON and MATLAB testing
+ MATLAB_TEST=1
+-PYTHON_TEST=0
++PYTHON_TEST=1
+ 
+ #-----------------------------------#
+ # 3: External packages installation #
+@@ -62,5 +64,5 @@
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+ #by Matlab and runme.m
+ #ex: "'id',[101 102 103]"
+-PYTHON_NROPTIONS="--exclude 243 701 702 435"
++PYTHON_NROPTIONS="--exclude 243 701 702 435 --include_name 'Dakota'"
+ MATLAB_NROPTIONS="'exclude',[243,701,702,435]"
Index: /issm/oecreview/Archive/23185-23389/ISSM-23234-23235.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23234-23235.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23234-23235.diff	(revision 23390)
@@ -0,0 +1,132 @@
+Index: ../trunk-jpl/test/NightlyRun/test2084.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23234)
++++ ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23235)
+@@ -1,5 +1,4 @@
+-
+-%Test Name: GiaCaron.
++%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.
+@@ -38,7 +37,7 @@
+ %Fields and tolerances to track changes
+ %loading love numbers
+ field_names     ={'LoveH_loading_elastic','LoveK_loading_elastic','LoveL_loading_elastic'};
+-field_tolerances={7.0e-10,7.0e-10,7.0e-10};
++field_tolerances={4.3e-9,4.3e-9,4.3e-9};
+ field_values={...
+ 	(md.results.LoveSolution.LoveHr(:,1)),...
+ 	(md.results.LoveSolution.LoveKr(:,1)),...
+@@ -56,7 +55,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={field_names{:},'LoveH_loading_realpart','LoveK_loading_realpart','LoveL_loading_realpart','LoveH_loading_imagpart','LoveK_loading_imagpart','LoveL_loading_imagpart'};
+-field_tolerances={field_tolerances{:},5e-7,5e-7,5e-7,5e-7,5e-7,5e-7};
++field_tolerances={field_tolerances{:},4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,:)),...
+ 	(md.results.LoveSolution.LoveKr(:,:)),...
+@@ -74,7 +73,7 @@
+ 
+ %tidal love numbers
+ field_names     ={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={field_tolerances{:},3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6};
++field_tolerances={field_tolerances{:},4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,1)),...
+ 	(md.results.LoveSolution.LoveKr(:,1)),...
+@@ -114,7 +113,7 @@
+ %md=solve(md,'lv');
+ %
+ %field_names     ={field_names{:},'LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart'};
+-%field_tolerances={field_tolerances{:},2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7,2e-7};
++%field_tolerances={field_tolerances{:},4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9};
+ %field_values={field_values{:},...
+ %	(md.results.LoveSolution.LoveHr(:,1)),...
+ %	(md.results.LoveSolution.LoveKr(:,1)),...
+@@ -146,7 +145,7 @@
+ md.love.nfreq=length(md.love.frequencies);
+ 
+ field_names     ={field_names{:},'LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart'};
+-field_tolerances={field_tolerances{:},6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7};
++field_tolerances={field_tolerances{:},4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,1)),...
+ 	(md.results.LoveSolution.LoveKr(:,1)),...
+Index: ../trunk-jpl/test/NightlyRun/test2084.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.py	(revision 23234)
++++ ../trunk-jpl/test/NightlyRun/test2084.py	(revision 23235)
+@@ -1,9 +1,10 @@
+-#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
++#Test Name: GiaCaron
++#Forward Love number solution for a viscoelastic earth,
++#model M3-L70-V01 from Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M.,
++#Martinec, Z., Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A.
++#and King, M. A. (2011), A benchmark study for glacial isostatic
++#adjustment codes. Geophysical Journal International,
++#185: 106-132. doi:10.1111/j.1365-246X.2011.04952.x
+ 
+ from model import *
+ from socket import gethostname
+@@ -47,8 +48,8 @@
+ 
+ #Fields and tolerances to track changes
+ #loading love numbers
+-field_names=['LoveHe','LoveKe','LoveLe']
+-field_tolerances=[3.7e-9,3.7e-9,3.7e-9]
++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],
+@@ -66,8 +67,8 @@
+ 
+ #Fields and tolerances to track changes
+ #loading love numbers
+-field_names+=['LoveHlr','LoveKlr','LoveLlr','LoveHli','LoveKli','LoveLli']
+-field_tolerances+=[3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9]
++field_names+=['LoveH_loading_realpart','LoveK_loading_realpart','LoveL_loading_realpart','LoveH_loading_imagpart','LoveK_loading_imagpart','LoveL_loading_imagpart']
++field_tolerances+=[4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9]
+ field_values+=[
+ np.array(md.results.LoveSolution.LoveHr),
+ np.array(md.results.LoveSolution.LoveKr),
+@@ -86,8 +87,8 @@
+ md=solve(md,'lv')
+ 
+ #tidal love numbers, check
+-field_names+=['LoveHtr','LoveKtr','LoveLtr','LoveHti','LoveKti','LoveLti']
+-field_tolerances+=[3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9]
++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+=[4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9]
+ field_values+=[
+ np.array(md.results.LoveSolution.LoveHr)[:,0],
+ np.array(md.results.LoveSolution.LoveKr)[:,0],
+@@ -126,8 +127,8 @@
+ #md.materials.numlayers=len(md.materials.viscosity)
+ #md=solve(md,'lv')
+ #
+-#field_names=[field_names,'LoveHmr','LoveKmr','LoveLmr','LoveHmi','LoveKmi','LoveLmi']
+-#field_tolerances=[field_tolerances,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
++#field_names=[field_names,'LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart']
++#field_tolerances=[field_tolerances,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9]
+ #field_values=[field_values,\
+ #	(md.results.LoveSolution.LoveHr[:][0]),\
+ #	(md.results.LoveSolution.LoveKr[:][0]),\
+@@ -185,8 +186,8 @@
+ 				-1])*2*pi).reshape(-1,1)/cst
+ md.love.nfreq=len(md.love.frequencies)
+ 
+-field_names+=['LoveHmr','LoveKmr','LoveLmr','LoveHmi','LoveKmi','LoveLmi']
+-field_tolerances+=[3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9,3.7e-9]
++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+=[4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9]
+ field_values+=[
+ np.array(md.results.LoveSolution.LoveHr)[:,0],
+ np.array(md.results.LoveSolution.LoveKr)[:,0],
Index: /issm/oecreview/Archive/23185-23389/ISSM-23235-23236.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23235-23236.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23235-23236.diff	(revision 23390)
@@ -0,0 +1,40 @@
+Index: ../trunk-jpl/src/m/classes/numberedcostfunction.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/numberedcostfunction.m	(revision 23235)
++++ ../trunk-jpl/src/m/classes/numberedcostfunction.m	(revision 23236)
+@@ -1,4 +1,4 @@
+-%M1QN3INVERSION class definition
++%NUMBEREDCOSTFUNCTION class definition
+ %
+ %   Usage:
+ %      numberedcostfunction=numberedcostfunction();
+@@ -43,20 +43,20 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			num_costfunc=size(md.inversion.cost_functions,2);
++			num_costfunc=size(self.cost_functions,2);
+ 
+-			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','md.outputdefinition.definition{X}.dependent{X}.cost_functions','field',self.cost_functions,'size',[1 num_costfunc],'values',supportedcostfunctions());
++			md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.cost_functions_coefficients','field',self.cost_functions_coefficients,'size',[md.mesh.numberofvertices numel(self.cost_functions)],'>=',0);
++			
+ 			if strcmp(solution,'BalancethicknessSolution')
+-				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
+-				md = checkfield(md,'fieldname','inversion.surface_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
++				md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.thickness_obs','field',self.thickness_obs,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
++				md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.surface_obs','field',self.surface_obs,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
+ 			elseif strcmp(solution,'BalancethicknessSoftSolution')
+-				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
++				md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.thickness_obs','field',self.thickness_obs,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
+ 			else
+-				md = checkfield(md,'fieldname','inversion.vx_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
++				md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.vx_obs','field',self.vx_obs,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
+ 				if ~strcmp(domaintype(md.mesh),'2Dvertical'),
+-					md = checkfield(md,'fieldname','inversion.vy_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
++					md = checkfield(md,'fieldname','md.outputdefinition.definition{X}.vy_obs','field',self.vy_obs,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
+ 				end
+ 			end
+ 		end % }}}
Index: /issm/oecreview/Archive/23185-23389/ISSM-23236-23237.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23236-23237.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23236-23237.diff	(revision 23390)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmToolkitUtils.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmToolkitUtils.cpp	(revision 23236)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmToolkitUtils.cpp	(revision 23237)
+@@ -85,18 +85,17 @@
+ } /*}}}*/  
+ int IssmSolverTypeFromToolkitOptions(void){ /*{{{*/
+ 
+-	char* solver_type=NULL;
+ 	int   solver_type_enum;
+-	int   num_procs=0;
+ 	bool  isparallel=false;
+ 
+ 	/*first, figure out if we are running in parallel: */
+-	num_procs=IssmComm::GetSize();
++	int num_procs=IssmComm::GetSize();
+ 	if(num_procs>1)isparallel=true;
+ 
+ 	/*retrieve solver type as a string, from the Toolkits Options database, similar to what Petsc does. Actually, 
+ 	 *we try and stick with the Petsc vector types: */
+-	solver_type=ToolkitOptions::GetToolkitOptionValue("solver_type");
++	char* solver_type=ToolkitOptions::GetToolkitOptionValue("solver_type");
++	if(!solver_type) _error_("Solver not set");
+ 
+ 	if (strcmp(solver_type,"mumps")==0){
+ 		solver_type_enum=MumpsEnum;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23237-23238.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23237-23238.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23237-23238.diff	(revision 23390)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/m/mesh/triangle.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/triangle.py	(revision 23237)
++++ ../trunk-jpl/src/m/mesh/triangle.py	(revision 23238)
+@@ -1,7 +1,6 @@
+ import os.path
+ import numpy as np
+ from mesh2d import mesh2d
+-from Triangle import Triangle
+ from NodeConnectivity import NodeConnectivity
+ from ElementConnectivity import ElementConnectivity
+ from Triangle_python import Triangle_python
Index: /issm/oecreview/Archive/23185-23389/ISSM-23238-23239.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23238-23239.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23238-23239.diff	(revision 23390)
@@ -0,0 +1,108 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 23238)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 23239)
+@@ -744,6 +744,45 @@
+ 	fi
+ 	AM_CONDITIONAL([ESMF], [test x$HAVE_ESMF = xyes])
+ 	dnl }}}
++	dnl codipack{{{
++	AC_ARG_WITH([codipack-dir],
++		AS_HELP_STRING([--with-codipack-dir=DIR], [CoDiPack root directory.]),
++		[CODIPACK_ROOT=$withval],[CODIPACK_ROOT="no"])
++
++	dnl Check whether codipack is enabled
++	AC_MSG_CHECKING([for CoDiPack])
++	if test "x$CODIPACK_ROOT" = "xno" ; then
++		HAVE_CODIPACK=no
++	else
++		HAVE_CODIPACK=yes
++		if ! test -d "$CODIPACK_ROOT"; then
++			AC_MSG_ERROR([codipack directory provided ($CODIPACK_ROOT) does not exist]);
++		fi
++	fi
++	AC_MSG_RESULT($HAVE_CODIPACK)
++
++	dnl codipack headers and libraries
++	if test "x$HAVE_CODIPACK" == "xyes"; then
++		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])
++		AC_SUBST([CODIPACKINCL])
++	fi
++	AM_CONDITIONAL([CODIPACK], [test x$HAVE_CODIPACK = xyes])
++   AM_COND_IF(CODIPACK,[CXXFLAGS+=" -std=c++11"])
++	dnl }}}
++	dnl tapeallocation {{{
++	AC_ARG_ENABLE([tape-alloc], dnl feature
++		AS_HELP_STRING([--enable-tape-alloc],[turn tape allocation support on]),
++		[enable_tape_alloc=$enableval], [enable_tape_alloc=no])
++
++	dnl check whether enabled
++	AC_MSG_CHECKING(for tape memory allocation)
++	if test "x$enable_tape_alloc" = xyes; then
++		AC_DEFINE([_AD_TAPE_ALLOC_],[1],[Macro to enable a priori tape allocation for AD])
++	fi
++	AC_MSG_RESULT($enable_tape_alloc)
++	dnl }}}
+ 	dnl adolc{{{
+ 	AC_ARG_WITH([adolc-dir],
+ 		AS_HELP_STRING([--with-adolc-dir=DIR], [adolc root directory.]),
+@@ -772,7 +811,7 @@
+ 		AC_SUBST([ADOLCLIB])
+ 	fi
+ 	AM_CONDITIONAL([ADOLC], [test x$HAVE_ADOLC = xyes])
+-        AM_COND_IF(ADOLC,[CXXFLAGS+=" -std=c++11"])
++   AM_COND_IF(ADOLC,[CXXFLAGS+=" -std=c++11"])
+ 	dnl }}}
+ 	dnl adolc-version{{{
+ 	AC_ARG_WITH([adolc-version],
+@@ -876,7 +915,7 @@
+ 	fi
+ 	AM_CONDITIONAL([GSL], [test x$HAVE_GSL = xyes])
+ 	dnl }}}
+-	dnl adjoinable-mpi{{{
++	dnl ampi (ADOLC){{{
+ 	AC_ARG_WITH([ampi-dir],
+ 	  AS_HELP_STRING([--with-ampi-dir=DIR], [adjoinable mpi root directory.]),
+ 	  [AMPI_ROOT=$withval],[AMPI_ROOT="no"])
+@@ -911,6 +950,39 @@
+ 	fi
+ 	AM_CONDITIONAL([AMPI], [test x$HAVE_AMPI = xyes])
+ 	dnl }}}
++	dnl adjointmpi (CoDiPack){{{
++	AC_ARG_WITH([adjointmpi-dir],
++	  AS_HELP_STRING([--with-adjointmpi-dir=DIR], [adjoinable mpi root directory.]),
++	  [ADJOINTMPI_ROOT=$withval],[ADJOINTMPI_ROOT="no"])
++
++	dnl Check whether adjointmpi is enabled
++	AC_MSG_CHECKING([for adjointmpi])
++	if test "x$ADJOINTMPI_ROOT" = "xno" ; then
++		HAVE_ADJOINTMPI=no
++	else
++		HAVE_ADJOINTMPI=yes
++		if ! test -d "$ADJOINTMPI_ROOT"; then
++			AC_MSG_ERROR([adjointmpi directory provided ($ADJOINTMPI_ROOT) does not exist]);
++		fi
++	fi
++	AC_MSG_RESULT($HAVE_ADJOINTMPI)
++
++	dnl adjointmpi headers and libraries
++	if test "x$HAVE_ADJOINTMPI" == "xyes"; then
++		if test "x$CODIPACK_ROOT" == "xno"; then
++			AC_MSG_ERROR([cannot run adjoint mpi without CoDiPack]);
++		fi
++		ADJOINTMPIINCL="-I$ADJOINTMPI_ROOT/include"
++		ADJOINTMPILIB="-L$ADJOINTMPI_ROOT/lib  -lAMPI"
++		dnl Also set _HAVE_AMPI_, because the interface is (almost) the
++		dnl same as for adjoinable mpi...
++		AC_DEFINE([_HAVE_AMPI_],[1],[with adjoint mpi in ISSM src])
++		AC_DEFINE([_HAVE_ADJOINTMPI_],[1],[with adjoint mpi in ISSM src])
++		AC_SUBST([ADJOINTMPIINCL])
++		AC_SUBST([ADJOINTMPILIB])
++	fi
++	AM_CONDITIONAL([ADJOINTMPI], [test x$HAVE_ADJOINTMPI = xyes])
++	dnl }}}
+ 	dnl rose{{{
+ 	AC_ARG_WITH([rose-dir],
+ 	  AS_HELP_STRING([--with-rose-dir=DIR], [rose root directory.]),
Index: /issm/oecreview/Archive/23185-23389/ISSM-23239-23240.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23239-23240.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23239-23240.diff	(revision 23390)
@@ -0,0 +1,123 @@
+Index: ../trunk-jpl/src/c/shared/MemOps/MemOps.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/MemOps/MemOps.cpp	(revision 23239)
++++ ../trunk-jpl/src/c/shared/MemOps/MemOps.cpp	(revision 23240)
+@@ -15,7 +15,7 @@
+ 
+ #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
+ template <> adouble*  xNew(unsigned int size, const char* const contig) {
+-	if (*contig == 't')
++	if (contig[0] == 't' || contig[0] == 'c')
+ 		ensureContiguousLocations(size);
+ 
+ 	adouble* aT_p=new adouble[size];
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 23239)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 23240)
+@@ -18,6 +18,7 @@
+ void CreateParametersDakota(Parameters* parameters,IoModel* iomodel,char* rootpath);
+ void CreateOutputDefinitions(Elements* elements, Parameters* parameters,IoModel* iomodel);
+ void UpdateElementsAndMaterialsControl(Elements* elements,Parameters* parameters,Materials* materials, IoModel* iomodel);
++void UpdateElementsAndMaterialsControlAD(Elements* elements,Parameters* parameters,Materials* materials, IoModel* iomodel);
+ void UpdateElementsAndMaterialsDakota(Elements* elements,Materials* materials, IoModel* iomodel);
+ void UpdateElementsTransient(Elements* elements,Parameters* parameters,IoModel* iomodel,int analysis_type);
+ void CreateNodes(Nodes*nodes, IoModel* iomodel,int analysis,int finite_element,int approximation=NoneApproximationEnum);
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 23239)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 23240)
+@@ -8,7 +8,6 @@
+ #include "../../MeshPartitionx/MeshPartitionx.h"
+ #include "../ModelProcessorx.h"
+ 
+-#if !defined(_HAVE_ADOLC_)
+ void	UpdateElementsAndMaterialsControl(Elements* elements,Parameters* parameters,Materials* materials, IoModel* iomodel){
+ 	/*Intermediary*/
+ 	bool       control_analysis;
+@@ -21,6 +20,14 @@
+ 	char     **cost_functions   = NULL;
+ 
+ 	/*Fetch parameters: */
++	bool isautodiff;
++	iomodel->FindConstant(&isautodiff,"md.autodiff.isautodiff");
++	if(isautodiff){
++		UpdateElementsAndMaterialsControlAD(elements,parameters,materials,iomodel);
++		return;
++	}
++
++	/*Fetch parameters: */
+ 	iomodel->FindConstant(&control_analysis,"md.inversion.iscontrol");
+ 	if(control_analysis) iomodel->FindConstant(&num_controls,"md.inversion.num_control_parameters");
+ 
+@@ -125,9 +132,9 @@
+ 	for(int i=0;i<num_controls;i++) xDelete<char>(controls[i]);
+ 	xDelete<char*>(controls);
+ }
+-#else 
+-void UpdateElementsAndMaterialsControl(Elements* elements,Parameters* parameters,Materials* materials, IoModel* iomodel){
++void UpdateElementsAndMaterialsControlAD(Elements* elements,Parameters* parameters,Materials* materials, IoModel* iomodel){
+ 
++	#if defined(_HAVE_ADOLC_)
+ 	/*Intermediaries*/
+ 	int				num_independent_objects,M,N,M_par,N_par;
+ 	char**			names                   = NULL;
+@@ -224,5 +231,7 @@
+ 	/*Step2: create cost functions (dependents)*/
+ 
+ 	return;
++#else 
++	_error_("ADOLC not compiled");
++#endif
+ }
+-#endif
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 23239)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 23240)
+@@ -263,10 +263,10 @@
+ 			}
+ 
+ 			for(i=0;i<num_procs;i++){
+-				ISSM_MPI_Scatterv( row_indices_forcpu, sendcnts, displs, ISSM_MPI_INT, row_indices_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
+-				ISSM_MPI_Scatterv( col_indices_forcpu, sendcnts, displs, ISSM_MPI_INT, col_indices_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
+-				ISSM_MPI_Scatterv( values_forcpu, sendcnts, displs, ISSM_MPI_DOUBLE, values_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_DOUBLE, i, comm);
+-				ISSM_MPI_Scatterv( modes_forcpu, sendcnts, displs, ISSM_MPI_INT, modes_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
++				if(row_indices_fromcpu[i]) ISSM_MPI_Scatterv( row_indices_forcpu, sendcnts, displs, ISSM_MPI_INT, row_indices_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
++				if(col_indices_fromcpu[i]) ISSM_MPI_Scatterv( col_indices_forcpu, sendcnts, displs, ISSM_MPI_INT, col_indices_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
++				if(values_fromcpu[i])      ISSM_MPI_Scatterv( values_forcpu, sendcnts, displs, ISSM_MPI_DOUBLE, values_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_DOUBLE, i, comm);
++				if(modes_fromcpu[i])       ISSM_MPI_Scatterv( modes_forcpu, sendcnts, displs, ISSM_MPI_INT, modes_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
+ 			}
+ 			/*}}}*/
+ 
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23239)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23240)
+@@ -162,8 +162,9 @@
+ 
+ 	/*Turning off trace tape*/
+ 	trace_off();
+-time_t now = time(NULL);
+-if(my_rank==0) _printf_("\nTIME: "<<now<<"\n");
++	//time_t now = time(NULL);
++	//if(my_rank==0) _printf_("\nTIME: "<<now<<"\n");
++
+ 	/*Print tape statistics so that user can kill this run if something is off already:*/
+ 	if(VerboseAutodiff()){ /*{{{*/
+ 		size_t  tape_stats[15];
+Index: ../trunk-jpl/src/c/classes/Numberedcostfunction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Numberedcostfunction.cpp	(revision 23239)
++++ ../trunk-jpl/src/c/classes/Numberedcostfunction.cpp	(revision 23240)
+@@ -148,8 +148,10 @@
+ 			 default:
+ 				 _error_("not supported");
+ 		 }
++		 _printf0_("#"<<i+1<<": "<<value<<" ");
+ 		 value_sum += value;
+  }
++	 _printf0_("\n");
+ 
+ 	 /*done:*/
+ 	return value_sum;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23240-23241.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23240-23241.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23240-23241.diff	(revision 23390)
@@ -0,0 +1,245 @@
+Index: ../trunk-jpl/src/c/toolkits/codipack/codipackincludes.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/codipack/codipackincludes.h	(nonexistent)
++++ ../trunk-jpl/src/c/toolkits/codipack/codipackincludes.h	(revision 23241)
+@@ -0,0 +1,11 @@
++/* \file codipackincludes.h
++ * \brief all includes for CoDiPack layer
++ */
++
++#ifndef _COIDPACK_INCLUDES_H_
++#define _COIDPACK_INCLUDES_H_
++
++#include "./CoDiPackCommon.hpp"
++#include "./CoDiPackGlobal.h"
++
++#endif
+
+Property changes on: ../trunk-jpl/src/c/toolkits/codipack/codipackincludes.h
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp	(nonexistent)
++++ ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp	(revision 23241)
+@@ -0,0 +1,90 @@
++/*
++ * CoDiPackCommon.hpp
++ *
++ *  Created on: Mai 30, 2016
++ *      Author: sagebaum
++ */
++
++#ifndef _CODIPACK_COMMON_HPP_
++#define _CODIPACK_COMMON_HPP_
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile without HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#if defined(_HAVE_CODIPACK_)
++#include "codi.hpp"
++
++template<typename Real, typename Passive>
++inline void getVectorPrimal(const Real* vec, Passive* pasVec, int n) {
++  for(int i = 0; i < n; ++i) {
++    pasVec[i]=vec[i].getValue();
++  }
++}
++
++template<typename Real, typename Passive>
++inline void setVectorPrimal(Real* vec, const Passive* pasVec, int n) {
++  for(int i = 0; i < n; ++i) {
++    vec[i].value() = pasVec[i];
++  }
++}
++
++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();
++  }
++}
++
++template<typename Real, typename Passive, typename Data>
++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();
++  }
++}
++
++template<typename Real, typename Passive, typename Data>
++inline void getPrimalAndGradData(const Real& value, Passive& pas, Data& data) {
++  pas=value.getValue();
++  data=value.getGradientData();
++}
++
++template<typename Real, typename Data>
++inline void registerVector(Real* vec, Data* dataVec, int n) {
++  typename Real::TapeType& tape = Real::getGlobalTape();
++
++  for(int i = 0; i < n; ++i) {
++    tape.registerInput(vec[i]);
++    dataVec[i]=vec[i].getGradientData();
++  }
++}
++
++template<typename Tape, typename Data, typename Adjoint>
++inline void getVectorAdjoint(Tape& tape, const Data* dataVec, Adjoint* adjVec, int n) {
++  for(int i = 0; i < n; ++i) {
++    Data index = dataVec[i];
++    adjVec[i] = tape.getGradient(index);
++    tape.gradient(index) = 0.0;
++  }
++}
++
++template<typename Tape, typename Data, typename Adjoint>
++inline void updateVectorAdjoint(Tape& tape, const Data* dataVec, const Adjoint* adjVec, int n) {
++  for(int i = 0; i < n; ++i) {
++    Data index = dataVec[i];
++    tape.gradient(index) += adjVec[i];
++  }
++}
++
++template<typename Tape, typename Data, typename Adjoint>
++inline void updateAdjoint(Tape& tape, const Data& data, const Adjoint& adj) {
++  Data index = data;
++  tape.gradient(index) += adj;
++}
++
++#endif
++
++#endif
+
+Property changes on: ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/toolkits/codipack/CoDiPackGlobal.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/codipack/CoDiPackGlobal.h	(nonexistent)
++++ ../trunk-jpl/src/c/toolkits/codipack/CoDiPackGlobal.h	(revision 23241)
+@@ -0,0 +1,40 @@
++/*
++ * CoDiPackGlobal.h
++ *
++ *  Created on: Jul 20, 2016
++ *      Author: a_h_ck
++ */
++
++#ifndef SRC_C_TOOLKITS_CODIPACK_CODIPACKGLOBAL_H_
++#define SRC_C_TOOLKITS_CODIPACK_CODIPACKGLOBAL_H_
++
++#ifdef HAVE_CONFIG_H
++    #include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#if defined(_HAVE_CODIPACK_)
++
++#include <iostream>
++#include <vector>
++
++struct CoDi_global {
++    std::vector<int> input_indices;
++    std::vector<int> output_indices;
++
++    void print(std::ostream& out) const {
++        out << "-------------------------------------\nCoDi_global:\n  in = [ ";
++        for(auto& in_index : input_indices) {
++            out << in_index << " ";
++        }
++        out << "]\n  out = [ ";
++        for(auto& out_index : output_indices) {
++            out << out_index << " ";
++        }
++        out << "]\n-------------------------------------\n";
++    }
++};
++
++#endif /* _HAVE_CODIPACK_ */
++#endif /* SRC_C_TOOLKITS_CODIPACK_CODIPACKGLOBAL_H_ */
+
+Property changes on: ../trunk-jpl/src/c/toolkits/codipack/CoDiPackGlobal.h
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp	(revision 23241)
+@@ -0,0 +1 @@
++#include "externals/ampi_interface_realreverse.cpp"
+
+Property changes on: ../trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/toolkits/toolkits.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/toolkits.h	(revision 23240)
++++ ../trunk-jpl/src/c/toolkits/toolkits.h	(revision 23241)
+@@ -29,6 +29,10 @@
+ #include "./adolc/adolcincludes.h"
+ #endif
+ 
++#ifdef _HAVE_CODIPACK_
++#include "./codipack/codipackincludes.h"
++#endif
++
+ #ifdef _HAVE_TRIANGLE_
+ #include "./triangle/triangleincludes.h"
+ #endif
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 23240)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 23241)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @MPIINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJ4INCL@
++AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MPIINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJ4INCL@
+ 
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+@@ -319,6 +319,11 @@
+ 					./classes/Inputs/PentaInput.cpp\
+ 					./classes/Inputs/TetraInput.cpp
+ #}}}
++# ADJOINTMPI sources {{{
++if ADJOINTMPI
++issm_sources += ./toolkits/codipack/ampi_interface.cpp
++endif
++# }}}
+ #DAKOTA sources  {{{
+ if DAKOTA
+ issm_sources +=  ./classes/Dakota/IssmDirectApplicInterface.h\
+@@ -631,7 +636,7 @@
+ 
+ if !WINDOWS
+ if !STANDALONE_LIBRARIES
+-libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(M1QN3LIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB)   $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
++libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(M1QN3LIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB)   $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
+ if FORTRAN
+ libISSMCore_la_LIBADD += $(FLIBS) $(FORTRANLIB)
+ endif
+@@ -713,7 +718,7 @@
+ endif
+ 
+ #External packages
+-LDADD +=  $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(PETSCLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB)  $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(AMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJ4LIB)
++LDADD +=  $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(PETSCLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB)  $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJ4LIB)
+ 
+ if FORTRAN
+ LDADD += $(FLIBS) $(FORTRANLIB)
Index: /issm/oecreview/Archive/23185-23389/ISSM-23241-23242.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23241-23242.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23241-23242.diff	(revision 23390)
@@ -0,0 +1,571 @@
+Index: ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 23241)
++++ ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 23242)
+@@ -621,7 +621,7 @@
+ } /*}}}*/
+ 
+ 	/*Specific instantiations for IssmDouble*: */
+-#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)  //We hook off this specific specialization when not running ADOLC, otherwise we get a redeclaration with the next specialization. 
++#if defined(_HAVE_AD_) && !defined(_WRAPPERS_)  //We hook off this specific specialization when not running ADOLC, otherwise we get a redeclaration with the next specialization. 
+ template <> inline GenericExternalResult<IssmDouble*>::~GenericExternalResult(){ /*{{{*/
+ 	xDelete<char>(result_name);
+ 	xDelete<IssmDouble>(value);
+@@ -708,7 +708,7 @@
+ 	template <> inline Object* GenericExternalResult<Vector<IssmPDouble>*>::copy(void){ /*{{{*/
+ 		return new GenericExternalResult<Vector<IssmPDouble>*>(this->id,StringToEnumx(this->result_name),this->value,this->step,this->time);
+ 	} /*}}}*/
+-#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)  //We hook off this specific specialization when not running ADOLC, otherwise we get a redeclaration with the next specialization. 
++#if defined(_HAVE_AD_) && !defined(_WRAPPERS_)  //We hook off this specific specialization when not running ADOLC, otherwise we get a redeclaration with the next specialization. 
+ 	template <> inline void GenericExternalResult<Vector<IssmPDouble>*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
+ 
+ 		char *name   = NULL;
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23241)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23242)
+@@ -880,7 +880,7 @@
+ 		results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentMemEnum,  solution_memory));
+ 		results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingCurrentFlopsEnum, solution_flops));
+ 
+-		#ifdef _HAVE_ADOLC_
++		#ifdef _HAVE_AD_
+ 		solution_time   = profiler->TotalTime(ADCORE);
+ 		solution_flops  = profiler->TotalFlops(ADCORE);
+ 		solution_memory = profiler->Memory(ADCORE);
+@@ -1844,7 +1844,7 @@
+ 	parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
+ 
+ 	if(isautodiff){
+-		#ifdef _HAVE_ADOLC_
++		#ifdef _HAVE_AD_
+ 		parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
+ 		parameters->FindParam(&dependent_objects,AutodiffDependentObjectsEnum);
+ 		if(num_dependents){
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 23241)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 23242)
+@@ -3132,7 +3132,10 @@
+ 			fac += dz[i]*(rho_ice - fmin(d[i],rho_ice));
+ 		}
+ 
+-		#ifndef _HAVE_ADOLC_ //we want to avoid the round operation at all cost. Not differentiable.
++		#if defined(_HAVE_AD_)
++		/*we want to avoid the round operation at all cost. Not differentiable.*/
++		_error_("not implemented yet");
++		#else
+ 		dMass = sumMass + sumR + sumW - sumP - sumEC - initMass - sumMassAdd;
+ 		dMass = round(dMass * 100.0)/100.0;
+ 
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 23241)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 23242)
+@@ -52,6 +52,7 @@
+ 	AutodiffNumDependentsEnum,
+ 	AutodiffNumIndependentsEnum,
+ 	AutodiffObufsizeEnum,
++	AutodiffTapeAllocEnum,
+ 	AutodiffTbufsizeEnum,
+ 	AutodiffXpEnum,
+ 	BalancethicknessStabilizationEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 23241)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 23242)
+@@ -60,6 +60,7 @@
+ 		case AutodiffNumDependentsEnum : return "AutodiffNumDependents";
+ 		case AutodiffNumIndependentsEnum : return "AutodiffNumIndependents";
+ 		case AutodiffObufsizeEnum : return "AutodiffObufsize";
++		case AutodiffTapeAllocEnum : return "AutodiffTapeAlloc";
+ 		case AutodiffTbufsizeEnum : return "AutodiffTbufsize";
+ 		case AutodiffXpEnum : return "AutodiffXp";
+ 		case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 23241)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 23242)
+@@ -60,6 +60,7 @@
+ 	      else if (strcmp(name,"AutodiffNumDependents")==0) return AutodiffNumDependentsEnum;
+ 	      else if (strcmp(name,"AutodiffNumIndependents")==0) return AutodiffNumIndependentsEnum;
+ 	      else if (strcmp(name,"AutodiffObufsize")==0) return AutodiffObufsizeEnum;
++	      else if (strcmp(name,"AutodiffTapeAlloc")==0) return AutodiffTapeAllocEnum;
+ 	      else if (strcmp(name,"AutodiffTbufsize")==0) return AutodiffTbufsizeEnum;
+ 	      else if (strcmp(name,"AutodiffXp")==0) return AutodiffXpEnum;
+ 	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
+@@ -135,11 +136,11 @@
+ 	      else if (strcmp(name,"FrictionGamma")==0) return FrictionGammaEnum;
+ 	      else if (strcmp(name,"FrictionLaw")==0) return FrictionLawEnum;
+ 	      else if (strcmp(name,"FrictionPseudoplasticityExponent")==0) return FrictionPseudoplasticityExponentEnum;
+-	      else if (strcmp(name,"FrictionThresholdSpeed")==0) return FrictionThresholdSpeedEnum;
+          else stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"FrictionDelta")==0) return FrictionDeltaEnum;
++	      if (strcmp(name,"FrictionThresholdSpeed")==0) return FrictionThresholdSpeedEnum;
++	      else if (strcmp(name,"FrictionDelta")==0) return FrictionDeltaEnum;
+ 	      else if (strcmp(name,"FrictionVoidRatio")==0) return FrictionVoidRatioEnum;
+ 	      else if (strcmp(name,"GiaCrossSectionShape")==0) return GiaCrossSectionShapeEnum;
+ 	      else if (strcmp(name,"GroundinglineMigration")==0) return GroundinglineMigrationEnum;
+@@ -258,11 +259,11 @@
+ 	      else if (strcmp(name,"SealevelriseEquatorialMoi")==0) return SealevelriseEquatorialMoiEnum;
+ 	      else if (strcmp(name,"SealevelriseFluidLove")==0) return SealevelriseFluidLoveEnum;
+ 	      else if (strcmp(name,"SealevelriseGElastic")==0) return SealevelriseGElasticEnum;
+-	      else if (strcmp(name,"SealevelriseGeodetic")==0) return SealevelriseGeodeticEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"SealevelriseGeodeticRunFrequency")==0) return SealevelriseGeodeticRunFrequencyEnum;
++	      if (strcmp(name,"SealevelriseGeodetic")==0) return SealevelriseGeodeticEnum;
++	      else if (strcmp(name,"SealevelriseGeodeticRunFrequency")==0) return SealevelriseGeodeticRunFrequencyEnum;
+ 	      else if (strcmp(name,"SealevelriseHElastic")==0) return SealevelriseHElasticEnum;
+ 	      else if (strcmp(name,"SealevelriseHoriz")==0) return SealevelriseHorizEnum;
+ 	      else if (strcmp(name,"SealevelriseLoopIncrement")==0) return SealevelriseLoopIncrementEnum;
+@@ -381,11 +382,11 @@
+ 	      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=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"ParametersEND")==0) return ParametersENDEnum;
++	      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 if (strcmp(name,"Adjointx")==0) return AdjointxEnum;
+@@ -504,11 +505,11 @@
+ 	      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 if (strcmp(name,"LevelsetfunctionSlopeX")==0) return LevelsetfunctionSlopeXEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"LevelsetfunctionSlopeY")==0) return LevelsetfunctionSlopeYEnum;
++	      if (strcmp(name,"LevelsetfunctionSlopeX")==0) return LevelsetfunctionSlopeXEnum;
++	      else if (strcmp(name,"LevelsetfunctionSlopeY")==0) return LevelsetfunctionSlopeYEnum;
+ 	      else if (strcmp(name,"LoadingforceX")==0) return LoadingforceXEnum;
+ 	      else if (strcmp(name,"LoadingforceY")==0) return LoadingforceYEnum;
+ 	      else if (strcmp(name,"LoadingforceZ")==0) return LoadingforceZEnum;
+@@ -627,11 +628,11 @@
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+ 	      else if (strcmp(name,"StrainRatexx")==0) return StrainRatexxEnum;
+ 	      else if (strcmp(name,"StrainRatexy")==0) return StrainRatexyEnum;
+-	      else if (strcmp(name,"StrainRatexz")==0) return StrainRatexzEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"StrainRateyy")==0) return StrainRateyyEnum;
++	      if (strcmp(name,"StrainRatexz")==0) return StrainRatexzEnum;
++	      else if (strcmp(name,"StrainRateyy")==0) return StrainRateyyEnum;
+ 	      else if (strcmp(name,"StrainRateyz")==0) return StrainRateyzEnum;
+ 	      else if (strcmp(name,"StrainRatezz")==0) return StrainRatezzEnum;
+ 	      else if (strcmp(name,"StressMaxPrincipal")==0) return StressMaxPrincipalEnum;
+@@ -750,11 +751,11 @@
+ 	      else if (strcmp(name,"DeviatoricStressErrorEstimator")==0) return DeviatoricStressErrorEstimatorEnum;
+ 	      else if (strcmp(name,"Divergence")==0) return DivergenceEnum;
+ 	      else if (strcmp(name,"Domain3Dsurface")==0) return Domain3DsurfaceEnum;
+-	      else if (strcmp(name,"DoubleArrayInput")==0) return DoubleArrayInputEnum;
+          else stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
++	      if (strcmp(name,"DoubleArrayInput")==0) return DoubleArrayInputEnum;
++	      else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
+ 	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
+ 	      else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
+ 	      else if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum;
+@@ -873,11 +874,11 @@
+ 	      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 stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"LoveKi")==0) return LoveKiEnum;
++	      if (strcmp(name,"LoveKernelsReal")==0) return LoveKernelsRealEnum;
++	      else if (strcmp(name,"LoveKi")==0) return LoveKiEnum;
+ 	      else if (strcmp(name,"LoveKr")==0) return LoveKrEnum;
+ 	      else if (strcmp(name,"LoveLi")==0) return LoveLiEnum;
+ 	      else if (strcmp(name,"LoveLr")==0) return LoveLrEnum;
+@@ -996,11 +997,11 @@
+ 	      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;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition49")==0) return Outputdefinition49Enum;
++	      if (strcmp(name,"Outputdefinition48")==0) return Outputdefinition48Enum;
++	      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;
+@@ -1119,11 +1120,11 @@
+ 	      else if (strcmp(name,"SMBgradientsela")==0) return SMBgradientselaEnum;
+ 	      else if (strcmp(name,"SMBgradients")==0) return SMBgradientsEnum;
+ 	      else if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum;
+-	      else if (strcmp(name,"SmbMAdd")==0) return SmbMAddEnum;
+          else stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"SMBmeltcomponents")==0) return SMBmeltcomponentsEnum;
++	      if (strcmp(name,"SmbMAdd")==0) return SmbMAddEnum;
++	      else if (strcmp(name,"SMBmeltcomponents")==0) return SMBmeltcomponentsEnum;
+ 	      else if (strcmp(name,"SMBpdd")==0) return SMBpddEnum;
+ 	      else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
+ 	      else if (strcmp(name,"SmbRlapslgm")==0) return SmbRlapslgmEnum;
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 23241)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 23242)
+@@ -373,7 +373,7 @@
+ 	/*Now, deal with toolkits options, which need to be put into the parameters dataset: */
+ 	ParseToolkitsOptionsx(parameters,toolkitsoptionsfid);
+ 
+-	#ifdef _HAVE_ADOLC_
++	#ifdef _HAVE_AD_
+ 	if(VerboseMProcessor()) _printf0_("   starting autodiff parameters \n");
+ 	CreateParametersAutodiff(parameters,iomodel);
+ 	if(VerboseMProcessor()) _printf0_("   ending autodiff parameters \n");
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 23241)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 23242)
+@@ -72,8 +72,36 @@
+ 		/*Free ressources: */
+ 		xDelete<char>(options);
+ 		/*}}}*/
++		#elif _HAVE_CODIPACK_
++		//fprintf(stderr, "*** Codipack CreateParametersAutodiff()\n");
++		/*initialize a placeholder to store solver pointers: {{{*/
++		/*Solver pointers depend on what type of solver we are implementing: */
++		options=OptionsFromAnalysis(parameters,DefaultAnalysisEnum); //options database is not filled in yet, use default.
++		ToolkitOptions::Init(options);
+ 
++		switch(IssmSolverTypeFromToolkitOptions()){
++			case MumpsEnum:{
++				#ifndef _HAVE_MUMPS_
++				_error_("CoDiPack: requesting mumps solver without MUMPS being compiled in!");
++				#endif
++				break;
++				}
++			case GslEnum: {
++				#ifndef _HAVE_GSL_
++				_error_("CoDiPack: requesting GSL solver without GSL being compiled in!");
++				#endif
++				break;
++				}
++			default:
++							_error_("solver type not supported yet!");
++		}
++		/*Free ressources: */
++		xDelete<char>(options);
++		#endif
++		#if defined(_HAVE_AD_) 
++
+ 	if(isautodiff){
++#if _HAVE_ADOLC_
+ 		/*Copy some parameters from IoModel to parameters dataset: {{{*/
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.obufsize",AutodiffObufsizeEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.cbufsize",AutodiffCbufsizeEnum));
+@@ -82,11 +110,16 @@
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.gcTriggerRatio",AutodiffGcTriggerRatioEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.gcTriggerMaxSize",AutodiffGcTriggerMaxSizeEnum));
+ 		/*}}}*/
++#endif
+ 		/*retrieve driver: {{{*/
+ 		iomodel->FindConstant(&autodiff_driver,"md.autodiff.driver");
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.driver",AutodiffDriverEnum));
+ 
+ 		if(strcmp(autodiff_driver,"fos_forward")==0){
++#if _HAVE_CODIPACK_
++			// FIXME codi support Foward Mode (scalar)
++			_error_("Foward Mode (scalar) not supported yet!");
++#endif
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.fos_forward_index",AutodiffFosForwardIndexEnum));
+ 		}
+ 		else if(strcmp(autodiff_driver,"fos_reverse")==0){
+@@ -93,6 +126,10 @@
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.fos_reverse_index",AutodiffFosReverseIndexEnum));
+ 		}
+ 		else if(strcmp(autodiff_driver,"fov_forward")==0){
++#if _HAVE_CODIPACK_
++			// FIXME codi support Foward Mode (vector)
++			_error_("Foward Mode (vector) not supported yet!");
++#endif
+ 			/*Retrieve list of indices: */
+ 			iomodel->FetchData(&indices,&num_indices,&dummy,"md.autodiff.fov_forward_indices");
+ 			parameters->AddObject(new IntMatParam(AutodiffFovForwardIndicesEnum,indices,num_indices,1));
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 23241)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 23242)
+@@ -61,7 +61,7 @@
+ 	//check to see if the top grid cell structure length (dzTop) goes evenly 
+ 	//into specified top structure depth (zTop). Also make sure top grid cell
+ 	//structure length (dzTop) is greater than 5 cm
+-	#ifndef _HAVE_ADOLC_  //avoid the round operation check!
++	#ifndef _HAVE_AD_  //avoid the round operation check!
+ 	if (dgpTop != round(dgpTop)){ 
+ 		_error_("top grid cell structure length does not go evenly into specified top structure depth, adjust dzTop or zTop");
+ 	}
+@@ -424,11 +424,11 @@
+ 
+ 			// spectral range:
+ 			// 0.3 - 0.8um
+-			IssmDouble a0 = fmin(0.98, 1 - 1.58 *pow(gsz,0.5));
++			IssmDouble a0 = min(0.98, 1 - 1.58 *pow(gsz,0.5));
+ 			// 0.8 - 1.5um
+-			IssmDouble a1 = fmax(0, 0.95 - 15.4 *pow(gsz,0.5));
++			IssmDouble a1 = max(0, 0.95 - 15.4 *pow(gsz,0.5));
+ 			// 1.5 - 2.8um
+-			IssmDouble a2 = fmax(0.127, 0.88 + 346.3*gsz - 32.31*pow(gsz,0.5));
++			IssmDouble a2 = max(0.127, 0.88 + 346.3*gsz - 32.31*pow(gsz,0.5));
+ 
+ 			// broadband surface albedo
+ 			a[0] = sF[0]*a0 + sF[1]*a1 + sF[2]*a2;
+@@ -666,7 +666,7 @@
+ 	// determine minimum acceptable delta t (diffusion number > 1/2) [s]
+ 	// NS: 2.16.18 divided dt by scaling factor, default set to 1/11 for stability
+ 	dt=1e12; 
+-	for(int i=0;i<m;i++)dt = fmin(dt,CI * pow(dz[i],2) * d[i]  / (3 * K[i]) * thermo_scaling);
++	for(int i=0;i<m;i++)dt = min(dt,CI * pow(dz[i],2) * d[i]  / (3 * K[i]) * thermo_scaling);
+ 
+ 	// smallest possible even integer of 60 min where diffusion number > 1/2
+ 	// must go evenly into one hour or the data frequency if it is smaller
+@@ -751,7 +751,7 @@
+ 		// calculated.  The estimated enegy balance & melt are significanly
+ 		// less when Ts is taken as the mean of the x top grid cells.
+ 		Ts = (T[0] + T[1])/2.0;
+-		Ts = fmin(CtoK,Ts);    // don't allow Ts to exceed 273.15 K (0 degC)
++		Ts = min(CtoK,Ts);    // don't allow Ts to exceed 273.15 K (0 degC)
+ 
+ 		//TURBULENT HEAT FLUX
+ 
+@@ -766,7 +766,7 @@
+ 		// calculate Monin-Obukhov stability factors 'coefM' and 'coefH'
+ 
+ 		// do not allow Ri to exceed 0.19
+-		Ri = fmin(Ri, 0.19);
++		Ri = min(Ri, 0.19);
+ 
+ 		// calculate momentum 'coefM' stability factor
+ 		if (Ri > 0.0+Ttol){
+@@ -946,11 +946,11 @@
+ 
+ 			// spectral albedos:
+ 			// 0.3 - 0.8um
+-			IssmDouble a0 = fmin(0.98, 1.0 - 1.58 *pow(gsz[0],0.5));
++			IssmDouble a0 = min(0.98, 1.0 - 1.58 *pow(gsz[0],0.5));
+ 			// 0.8 - 1.5um
+-			IssmDouble a1 = fmax(0.0, 0.95 - 15.4 *pow(gsz[0],0.5));
++			IssmDouble a1 = max(0.0, 0.95 - 15.4 *pow(gsz[0],0.5));
+ 			// 1.5 - 2.8um
+-			IssmDouble a2 = fmax(0.127, 0.88 + 346.3*gsz[0] - 32.31*pow(gsz[0],0.5));
++			IssmDouble a2 = max(0.127, 0.88 + 346.3*gsz[0] - 32.31*pow(gsz[0],0.5));
+ 
+ 			// separate net shortwave radiative flux into spectral ranges
+ 			IssmDouble swfS[3];
+@@ -1203,7 +1203,7 @@
+ 
+ 		mass_diff = mass - massinit - P;
+ 
+-		#ifndef _HAVE_ADOLC_  //avoid round operation. only check in forward mode.
++		#ifndef _HAVE_AD_  //avoid round operation. only check in forward mode.
+ 		mass_diff = round(mass_diff * 100.0)/100.0;
+ 		if (mass_diff > 0) _error_("mass not conserved in accumulation function");
+ 		#endif
+@@ -1322,11 +1322,11 @@
+ 
+ 	// calculate temperature excess above 0 deg C
+ 	exsT=xNewZeroInit<IssmDouble>(n);
+-	for(int i=0;i<n;i++) exsT[i]= fmax(0.0, T[i] - CtoK);        // [K] to [degC]
++	for(int i=0;i<n;i++) exsT[i]= max(0.0, T[i] - CtoK);        // [K] to [degC]
+ 
+ 	// new grid point center temperature, T [K]
+ 	// for(int i=0;i<n;i++) T[i]-=exsT[i];
+-	for(int i=0;i<n;i++) T[i]=fmin(T[i],CtoK);
++	for(int i=0;i<n;i++) T[i]=min(T[i],CtoK);
+ 
+ 	// specify irreducible water content saturation [fraction]
+ 	const IssmDouble Swi = 0.07;                     // assumed constant after Colbeck, 1974
+@@ -1336,10 +1336,10 @@
+ 	if (cellsum(W,n) >0.0+Wtol){
+ 		if(VerboseSmb() && sid==0 && IssmComm::GetRank()==0)_printf0_("      pore water refreeze\n");
+ 		// calculate maximum freeze amount, maxF [kg]
+-		for(int i=0;i<n;i++) maxF[i] = fmax(0.0, -((T[i] - CtoK) * m[i] * CI) / LF);
++		for(int i=0;i<n;i++) maxF[i] = max(0.0, -((T[i] - CtoK) * m[i] * CI) / LF);
+ 
+ 		// freeze pore water and change snow/ice properties
+-		for(int i=0;i<n;i++) dW[i] = fmin(maxF[i], W[i]);    // freeze mass [kg]   
++		for(int i=0;i<n;i++) dW[i] = min(maxF[i], W[i]);    // freeze mass [kg]   
+ 		for(int i=0;i<n;i++) W[i] -= dW[i];                                            // pore water mass [kg]
+ 		for(int i=0;i<n;i++) m[i] += dW[i];                                            // new mass [kg]
+ 		for(int i=0;i<n;i++) d[i] = m[i] / dz[i];                                    // density [kg m-3]   
+@@ -1355,7 +1355,7 @@
+ 	exsW=xNew<IssmDouble>(n); 
+ 	for(int i=0;i<n;i++){
+ 		Wi= (dIce - d[i]) * Swi * (m[i] / d[i]);        // irreducible water content [kg]
+-		exsW[i] = fmax(0.0, W[i] - Wi);                  // water "squeezed" from snow [kg]
++		exsW[i] = max(0.0, W[i] - Wi);                  // water "squeezed" from snow [kg]
+ 	}
+ 
+ 	//// MELT, PERCOLATION AND REFREEZE
+@@ -1367,7 +1367,7 @@
+ 		// if so redistribute temperature to lower cells (temperature surplus)
+ 		// (maximum T of snow before entire grid cell melts is a constant
+ 		// LF/CI = 159.1342)
+-		surpT=xNew<IssmDouble>(n); for(int i=0;i<n;i++)surpT[i] = fmax(0.0, exsT[i]- LF/CI);
++		surpT=xNew<IssmDouble>(n); for(int i=0;i<n;i++)surpT[i] = max(0.0, exsT[i]- LF/CI);
+ 
+ 		if (cellsum(surpT,n) > 0.0 + Ttol ){
+ 			// _printf_("T Surplus");
+@@ -1379,10 +1379,10 @@
+ 				// use surplus energy to increase the temperature of lower cell
+ 				T[i+1] = surpE[i]/m[i+1]/CI + T[i+1];
+ 
+-				exsT[i+1] = fmax(0.0, T[i+1] - CtoK) + exsT[i+1];
+-				T[i+1] = fmin(CtoK, T[i+1]);
++				exsT[i+1] = max(0.0, T[i+1] - CtoK) + exsT[i+1];
++				T[i+1] = min(CtoK, T[i+1]);
+ 
+-				surpT[i+1] = fmax(0.0, exsT[i+1] - LF/CI);
++				surpT[i+1] = max(0.0, exsT[i+1] - LF/CI);
+ 				surpE[i+1] = surpT[i+1] * CI * m[i+1];
+ 
+ 				// adjust current cell properties (again 159.1342 is the max T)
+@@ -1393,11 +1393,11 @@
+ 		}
+ 
+ 		// convert temperature excess to melt [kg]
+-		for(int i=0;i<n;i++) M[i] = fmin(exsT[i] * d[i] * dz[i] * CI / LF, m[i]);  // melt
++		for(int i=0;i<n;i++) M[i] = min(exsT[i] * d[i] * dz[i] * CI / LF, m[i]);  // melt
+ 		sumM = cellsum(M,n);                                                       // total melt [kg]
+ 
+ 		// calculate maximum refreeze amount, maxF [kg]
+-		for(int i=0;i<n;i++)maxF[i] = fmax(0.0, -((T[i] - CtoK) * d[i] * dz[i] * CI)/ LF);
++		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);
+@@ -1434,8 +1434,8 @@
+ 
+ 				m[i] = m[i] - M[i];                     // mass after melt
+ 				Wi = (dIce-d[i]) * Swi * (m[i]/d[i]);    // irreducible water 
+-				dW[i] = fmax(fmin(inM, Wi - W[i]),-1*W[i]);            // change in pore water
+-				R[i] = fmax(0.0, inM - dW[i]);             // runoff
++				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
+@@ -1446,8 +1446,8 @@
+ 
+ 				m[i] = m[i] - M[i];                     // mass after melt
+ 				Wi = (dIce-d[i]) * Swi * (m[i]/d[i]);    // irreducible water 
+-				dW[i] = fmax(fmin(inM, Wi - W[i]),-1*W[i]);              // change in pore water
+-				flxDn[i+1] = fmax(0.0, inM - dW[i]);         // meltwater out
++				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 
+ 			}
+@@ -1459,13 +1459,13 @@
+ 				m[i] = m[i] - M[i];
+ 				IssmDouble dz_0 = m[i]/d[i];          
+ 				IssmDouble dMax = (dIce - d[i])*dz_0;              // d max = dIce
+-				IssmDouble F1 = fmin(fmin(inM,dMax),maxF[i]);         // maximum refreeze               
++				IssmDouble F1 = min(min(inM,dMax),maxF[i]);         // maximum refreeze               
+ 				m[i] = m[i] + F1;                       // mass after refreeze
+ 				d[i] = m[i]/dz_0;
+ 
+ 				//-----------------------pore water-----------------------------
+ 				Wi = (dIce-d[i])* Swi * dz_0;            // irreducible water 
+-				dW[i] = fmin(inM - F1, Wi-W[i]);         // change in pore 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];
+ 				}
+@@ -1473,8 +1473,8 @@
+ 
+ 				if (dW[i] < 0.0-Wtol){                         // excess pore water
+ 					dMax = (dIce - d[i])*dz_0;          // maximum refreeze                                             
+-					IssmDouble maxF2 = fmin(dMax, maxF[i]-F1);      // maximum refreeze
+-					F2 = fmin(-1*dW[i], maxF2);            // pore water refreeze
++					IssmDouble maxF2 = min(dMax, maxF[i]-F1);      // maximum refreeze
++					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;
+@@ -1752,7 +1752,7 @@
+ 	for(int i=0;i<n;i++) if (W[i]<0.0-Wtol) _error_("negative pore water generated in melt equations\n");
+ 
+ 	/*only in forward mode! avoid round in AD mode as it is not differentiable: */
+-	#ifndef _HAVE_ADOLC_
++	#ifndef _HAVE_AD_
+ 	dm = round((mSum0 - mSum1 + mAdd)*100.0)/100.0;
+ 	dE = round(sumE0 - sumE1 - sumER +  addE);
+ 	if (dm !=0  || dE !=0) _error_("mass or energy are not conserved in melt equations\n"
+@@ -1914,8 +1914,8 @@
+ 				H = exp((-60000.0/(Tmean * R)) + (42400.0/(Tmean * R))) * (C * 9.81);
+ 				c0arth = 0.07 * H;
+ 				c1arth = 0.03 * H;
+-				M0 = fmax(1.435 - (0.151 * log(C)),0.25);
+-				M1 = fmax(2.366 - (0.293 * log(C)),0.25);
++				M0 = max(1.435 - (0.151 * log(C)),0.25);
++				M1 = max(2.366 - (0.293 * log(C)),0.25);
+ 				c0 = M0*c0arth;
+ 				c1 = M1*c1arth;
+ 				break;
+@@ -1925,8 +1925,8 @@
+ 				H = exp((-60000.0/(T[i] * R)) + (42400.0/(T[i] * R))) * (C * 9.81);
+ 				c0arth = 0.07 * H;
+ 				c1arth = 0.03 * H;
+-				M0 = fmax(1.042 - (0.0916 * log(C)),0.25);
+-				M1 = fmax(1.734 - (0.2039 * log(C)),0.25);
++				M0 = max(1.042 - (0.0916 * log(C)),0.25);
++				M1 = max(1.734 - (0.2039 * log(C)),0.25);
+ 				c0 = M0*c0arth;
+ 				c1 = M1*c1arth;
+ 				break;
+@@ -2020,7 +2020,7 @@
+ 	// calculate Monin-Obukhov stability factors 'coef_M' and 'coef_H'
+ 
+ 	// do not allow Ri to exceed 0.19
+-	Ri = fmin(Ri, 0.19);
++	Ri = min(Ri, 0.19);
+ 
+ 	// calculate momentum 'coefM' stability factor
+ 	if (Ri > 0.0+Ttol){
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 23241)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 23242)
+@@ -87,7 +87,7 @@
+ 	}
+ 
+ 	/*output*/
+-	#ifdef _HAVE_ADOLC_
++	#ifdef _HAVE_AD_
+ 	IssmPDouble* J_passive=xNew<IssmPDouble>(2*num);
+ 	for(int i=0;i<2*num;i++) J_passive[i]=reCast<IssmPDouble>(output[i]);
+ 	femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,J_passive,num,2,0,0));
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 23241)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 23242)
+@@ -96,7 +96,7 @@
+ 	if(!dakota_analysis){ //do not save this if we are running the control core from a qmu run!
+ 		femmodel->OutputControlsx(&femmodel->results);
+ 
+-		#ifdef _HAVE_ADOLC_
++		#ifdef _HAVE_AD_
+ 		IssmPDouble* J_passive=xNew<IssmPDouble>(nsteps);
+ 		for(int i=0;i<nsteps;i++) J_passive[i]=reCast<IssmPDouble>(J[i]);
+ 		femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,J_passive,nsteps,1,0,0));
Index: /issm/oecreview/Archive/23185-23389/ISSM-23242-23243.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23242-23243.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23242-23243.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 23242)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 23243)
+@@ -426,7 +426,7 @@
+ 			// 0.3 - 0.8um
+ 			IssmDouble a0 = min(0.98, 1 - 1.58 *pow(gsz,0.5));
+ 			// 0.8 - 1.5um
+-			IssmDouble a1 = max(0, 0.95 - 15.4 *pow(gsz,0.5));
++			IssmDouble a1 = max(0., 0.95 - 15.4 *pow(gsz,0.5));
+ 			// 1.5 - 2.8um
+ 			IssmDouble a2 = max(0.127, 0.88 + 346.3*gsz - 32.31*pow(gsz,0.5));
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23243-23244.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23243-23244.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23243-23244.diff	(revision 23390)
@@ -0,0 +1,152 @@
+Index: ../trunk-jpl/src/c/shared/Numerics/isnan.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/isnan.h	(revision 23243)
++++ ../trunk-jpl/src/c/shared/Numerics/isnan.h	(revision 23244)
+@@ -32,4 +32,10 @@
+ template <> int xIsInf<adouble> (const adouble& X);
+ #endif
+ 
++#if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
++#include "./types.h"
++template <> int xIsNan<IssmDouble> (const IssmDouble& X);
++template <> int xIsInf<IssmDouble> (const IssmDouble& X);
+ #endif
++
++#endif
+Index: ../trunk-jpl/src/c/shared/Numerics/recast.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/recast.h	(revision 23243)
++++ ../trunk-jpl/src/c/shared/Numerics/recast.h	(revision 23244)
+@@ -14,7 +14,7 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-#if !defined(_HAVE_ADOLC_) || defined(_WRAPPERS_)
++#if !defined(_HAVE_AD_) || defined(_WRAPPERS_)
+ 
+ template<class To, class From> To reCast(const From& from) {
+     return (To)from;
+@@ -33,9 +33,16 @@
+ /**
+  * partial specialization
+  */
++#ifdef _HAVE_ADOLC_
+ template<class To> struct ForPartialSpecialization<To,adouble> {
+     static  To reCast(const adouble& from ) { return (To) (from.getValue());}
+ };
++#endif
++#ifdef _HAVE_CODIPACK_
++template<class To> struct ForPartialSpecialization<To,IssmDouble> {
++	    static  To reCast(const IssmDouble& from ) { return (To) (from.getValue());}
++};
++#endif
+ 
+ #endif
+ 
+Index: ../trunk-jpl/src/c/shared/Numerics/numerics.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/numerics.h	(revision 23243)
++++ ../trunk-jpl/src/c/shared/Numerics/numerics.h	(revision 23244)
+@@ -19,10 +19,13 @@
+ #include "./constants.h"
+ #include "./OptPars.h"
+ 
++#if !defined(_HAVE_CODIPACK_)
++// already defined in codipack headers
+ IssmDouble  min(IssmDouble a,IssmDouble b);
+ IssmDouble  max(IssmDouble a,IssmDouble b);
++#endif
+ 
+-#ifdef _HAVE_ADOLC_
++#ifdef _HAVE_AD_
+ IssmPDouble  min(IssmPDouble a,IssmPDouble b);
+ IssmPDouble  max(IssmPDouble a,IssmPDouble b);
+ #endif
+Index: ../trunk-jpl/src/c/shared/Numerics/extrema.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/extrema.cpp	(revision 23243)
++++ ../trunk-jpl/src/c/shared/Numerics/extrema.cpp	(revision 23244)
+@@ -10,24 +10,28 @@
+ 
+ #include "./types.h"
+ 
++#ifndef _HAVE_CODIPACK_// already defined in codipack headers
+ IssmDouble min(IssmDouble a,IssmDouble b){
+ 	if (a<b)return a;
+ 	else return b;
+ }
++#endif
+ int min(int a,int b){
+ 	if (a<b)return a;
+ 	else return b;
+ }
++#ifndef _HAVE_CODIPACK_// already defined in codipack headers
+ IssmDouble max(IssmDouble a,IssmDouble b){
+ 	if (a>b)return a;
+ 	else return b;
+ }
++#endif
+ int max(int a,int b){
+ 	if (a>b)return a;
+ 	else return b;
+ }
+ 
+-#ifdef _HAVE_ADOLC_
++#ifdef _HAVE_AD_
+ IssmPDouble  min(IssmPDouble a,IssmPDouble b){
+ 	if (a<b)return a;
+ 	else return b;
+Index: ../trunk-jpl/src/c/shared/Numerics/isnan.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/isnan.cpp	(revision 23243)
++++ ../trunk-jpl/src/c/shared/Numerics/isnan.cpp	(revision 23244)
+@@ -12,10 +12,16 @@
+ template <> int xIsNan<adouble> (const adouble& X){
+   return std::isnan(X.getValue());
+ }
+-#endif
+-
+-#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
+ template <> int xIsInf<adouble> (const adouble& X){
+   return std::isinf(X.getValue());
+ }
+ #endif
++
++#if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
++template <> int xIsNan<IssmDouble> (const IssmDouble& X){
++	  return std::isnan(X.getValue());
++}
++template <> int xIsInf<IssmDouble> (const IssmDouble& X){
++	return std::isinf(X.getValue());
++}
++#endif
+Index: ../trunk-jpl/src/c/shared/Numerics/types.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/types.h	(revision 23243)
++++ ../trunk-jpl/src/c/shared/Numerics/types.h	(revision 23244)
+@@ -21,15 +21,20 @@
+ #endif  
+ 
+ #if defined(_HAVE_ADOLC_) &&  !defined(_WRAPPERS_)
++/*ADOLC typedefs*/
+ #include "adolc/adolc.h"
+-// for active variables
+-typedef adouble IssmDouble;
+-// for passive variables
++typedef adouble IssmDouble; /*for active variables*/
++typedef double IssmPDouble; /*for passive variables*/
++
++#elif defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
++/*CoDiPack typedefs*/
++#include <codi.hpp>
++typedef codi::RealReverse IssmDouble;
+ typedef double IssmPDouble;
++
++/*Non-AD typedefs*/
+ #else 
+-// see above
+ typedef double IssmDouble; 
+-// see above
+ typedef IssmDouble IssmPDouble;
+ #endif
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23244-23245.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23244-23245.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23244-23245.diff	(revision 23390)
@@ -0,0 +1,142 @@
+Index: ../trunk-jpl/src/m/classes/autodiff.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/autodiff.m	(revision 23244)
++++ ../trunk-jpl/src/m/classes/autodiff.m	(revision 23245)
+@@ -16,6 +16,7 @@
+ 		tbufsize     = NaN;
+ 		gcTriggerRatio = NaN;
+ 		gcTriggerMaxSize = NaN;
++		tapeAlloc = NaN;
+ 		end
+ 		%}}}
+ 	methods
+@@ -34,6 +35,7 @@
+ 		self.tbufsize     = 524288;
+ 		self.gcTriggerRatio=2.0;
+ 		self.gcTriggerMaxSize=65536;
++		self.tapeAlloc    = 15000000;
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+@@ -50,6 +52,7 @@
+ 			md = checkfield(md,'fieldname','autodiff.tbufsize','>=',16);
+ 			md = checkfield(md,'fieldname','autodiff.gcTriggerRatio','>=',0);
+ 			md = checkfield(md,'fieldname','autodiff.gcTriggerMaxSize','>=',65536);
++			md = checkfield(md,'fieldname','autodiff.tapeAlloc','>=',0);
+ 
+ 			%go through our dependents and independents and check consistency: 
+ 			for i=1:numel(self.dependents),
+@@ -74,6 +77,7 @@
+ 			fielddisplay(self,'tbufsize','Number of taylors per buffer (<=TBUFSIZE in usrparms.h)');
+ 			fielddisplay(self,'gcTriggerRatio','free location block sorting/consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio');
+ 			fielddisplay(self,'gcTriggerMaxSize','free location block sorting/consolidation triggered if the allocated locations exceed gcTriggerMaxSize');
++			fielddisplay(self,'tapeAlloc','Iteration count of a priori memory allocation of the AD tape');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+@@ -94,6 +98,7 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','tbufsize','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','gcTriggerRatio','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','gcTriggerMaxSize','format','Double');
++			WriteData(fid,prefix,'object',self,'fieldname','tapeAlloc','format','Integer');
+ 			%}}}
+ 			%process dependent variables {{{
+ 			num_dependent_objects=numel(self.dependents);
+Index: ../trunk-jpl/src/m/classes/autodiff.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/autodiff.py	(revision 23244)
++++ ../trunk-jpl/src/m/classes/autodiff.py	(revision 23245)
+@@ -24,6 +24,7 @@
+ 		self.tbufsize     = float('NaN')
+ 		self.gcTriggerMaxSize     = float('NaN')
+ 		self.gcTriggerRatio     = float('NaN')
++                self.tapeAlloc = float('NaN')
+ 		if not len(args):
+ 			self.setdefaultparameters()
+ 		else:
+@@ -42,6 +43,7 @@
+ 		s+="%s\n" % fielddisplay(self,'tbufsize',"Number of taylors per buffer (<=TBUFSIZE in usrparms.h)")
+ 		s+="%s\n" % fielddisplay(self,'gcTriggerRatio',"free location block sorting/consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio")
+ 		s+="%s\n" % fielddisplay(self,'gcTriggerMaxSize',"free location block sorting/consolidation triggered if the allocated locations exceed gcTriggerMaxSize)")
++                s+="%s\n" % fielddisplay(self,'tapeAlloc','Iteration count of a priori memory allocation of the AD tape');
+ 
+ 		return s
+ 	# }}}
+@@ -53,6 +55,7 @@
+ 		self.tbufsize     = 524288
+ 		self.gcTriggerRatio=2.0
+ 		self.gcTriggerMaxSize=65536
++                self.tapeAlloc    = 15000000;
+ 		return self
+ 	# }}}
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+@@ -67,6 +70,7 @@
+ 		md = checkfield(md,'fieldname','autodiff.tbufsize','>=',524288)
+ 		md = checkfield(md,'fieldname','autodiff.gcTriggerRatio','>=',2.0)
+ 		md = checkfield(md,'fieldname','autodiff.gcTriggerMaxSize','>=',65536)
++                md = checkfield(md,'fieldname','autodiff.tapeAlloc','>=',0);
+ 
+ 		#Driver value:
+ 		md = checkfield(md,'fieldname','autodiff.driver','values',['fos_forward','fov_forward','fov_forward_all','fos_reverse','fov_reverse','fov_reverse_all'])
+@@ -96,7 +100,8 @@
+ 		WriteData(fid,prefix,'object',self,'fieldname','tbufsize','format','Double');
+ 		WriteData(fid,prefix,'object',self,'fieldname','gcTriggerRatio','format','Double');
+ 		WriteData(fid,prefix,'object',self,'fieldname','gcTriggerMaxSize','format','Double');
+-		#}}}
++                WriteData(fid,prefix,'object',self,'fieldname','tapeAlloc','format','Integer');
++                #}}}
+ 		#process dependent variables {{{
+ 		num_dependent_objects=len(self.dependents)
+ 		WriteData(fid,prefix,'data',num_dependent_objects,'name','md.autodiff.num_dependent_objects','format','Integer')
+Index: ../trunk-jpl/src/m/classes/autodiff.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/autodiff.js	(revision 23244)
++++ ../trunk-jpl/src/m/classes/autodiff.js	(revision 23245)
+@@ -13,6 +13,7 @@
+ 		this.tbufsize     = 524288;
+ 		this.gcTriggerRatio=2.0;
+ 		this.gcTriggerMaxSize=65536;
++		this.tapeAlloc    = 15000000;
+ 
+ 	}// }}}
+ 	this.disp= function(){// {{{
+@@ -28,6 +29,7 @@
+ 		fielddisplay(this,'tbufsize','Number of taylors per buffer (<=TBUFSIZE in usrparms.h)');
+ 		fielddisplay(this,'gcTriggerRatio','free location block sorting/consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio');
+ 		fielddisplay(this,'gcTriggerMaxSize','free location block sorting/consolidation triggered if the allocated locations exceed gcTriggerMaxSize');
++		fielddisplay(this,'tapeAlloc','Iteration count of a priori memory allocation of the AD tape');
+ 
+ 	}// }}}
+ 	this.classname= function(){// {{{
+@@ -48,6 +50,7 @@
+ 			checkfield(md,'fieldname','autodiff.tbufsize','>=',16);
+ 			checkfield(md,'fieldname','autodiff.gcTriggerRatio','>=',0);
+ 			checkfield(md,'fieldname','autodiff.gcTriggerMaxSize','>=',65536);
++			checkfield(md,'fieldname','autodiff.tapeAlloc','>=',0);
+ 
+ 			//go through our dependents and independents and check consistency: 
+ 			for (var i=0;i<this.dependents.length;i++){
+@@ -78,6 +81,7 @@
+ 			WriteData(fid,prefix,'object',this,'fieldname','tbufsize','format','Double');
+ 			WriteData(fid,prefix,'object',this,'fieldname','gcTriggerRatio','format','Double');
+ 			WriteData(fid,prefix,'object',this,'fieldname','gcTriggerMaxSize','format','Double');
++			WriteData(fid,prefix,'object',this,'fieldname','tapeAlloc','format','Integer');
+ 			//}}}
+ 			//process dependent variables {{{
+ 			num_dependent_objects=this.dependents.length;
+@@ -215,6 +219,7 @@
+ 			this.tbufsize=NullFix(this.tbufsize,NaN);
+ 			this.gcTriggerRatio=NullFix(this.gcTriggerRatio,NaN);
+ 			this.gcTriggerMaxSize=NullFix(this.gcTriggerMaxSize,NaN);
++			this.tapeAlloc=NullFix(this.tapeAlloc,NaN);
+ 		}//}}}
+ 	//properties 
+ 	// {{{
+@@ -228,6 +233,7 @@
+ 	this.tbufsize     = NaN;
+ 	this.gcTriggerRatio = NaN;
+ 	this.gcTriggerMaxSize = NaN;
++	this.tapeAlloc = NaN;
+ 
+ 	this.setdefaultparameters();
+ 	//}}}
Index: /issm/oecreview/Archive/23185-23389/ISSM-23245-23246.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23245-23246.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23245-23246.diff	(revision 23390)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/wrappers/javascript/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 23245)
++++ ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 23246)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @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 23245)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 23246)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@
++AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @CODIPACKINCL@
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(MATLABWRAPPEREXT)
+Index: ../trunk-jpl/src/wrappers/python/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 23245)
++++ ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 23246)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @CODIPACKINCL@
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(PYTHONWRAPPEREXT)
Index: /issm/oecreview/Archive/23185-23389/ISSM-23246-23247.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23246-23247.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23246-23247.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/linux64_ross_dakota
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_dakota	(revision 23246)
++++ ../trunk-jpl/jenkins/linux64_ross_dakota	(revision 23247)
+@@ -31,7 +31,7 @@
+ 
+ #PYTHON and MATLAB testing
+ MATLAB_TEST=1
+-PYTHON_TEST=1
++PYTHON_TEST=0
+ 
+ #-----------------------------------#
+ # 3: External packages installation #
Index: /issm/oecreview/Archive/23185-23389/ISSM-23247-23248.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23247-23248.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23247-23248.diff	(revision 23390)
@@ -0,0 +1,71 @@
+Index: ../trunk-jpl/test/NightlyRun/test2084.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.py	(revision 23247)
++++ ../trunk-jpl/test/NightlyRun/test2084.py	(revision 23248)
+@@ -68,7 +68,7 @@
+ #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+=[4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9]
++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),
+@@ -88,7 +88,7 @@
+ 
+ #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+=[4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9]
++field_tolerances+=[3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6]
+ field_values+=[
+ np.array(md.results.LoveSolution.LoveHr)[:,0],
+ np.array(md.results.LoveSolution.LoveKr)[:,0],
+@@ -187,7 +187,7 @@
+ md.love.nfreq=len(md.love.frequencies)
+ 
+ field_names+=['LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart']
+-field_tolerances+=[4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9]
++field_tolerances+=[6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7]
+ field_values+=[
+ np.array(md.results.LoveSolution.LoveHr)[:,0],
+ np.array(md.results.LoveSolution.LoveKr)[:,0],
+Index: ../trunk-jpl/test/NightlyRun/test2084.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23247)
++++ ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23248)
+@@ -55,7 +55,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={field_names{:},'LoveH_loading_realpart','LoveK_loading_realpart','LoveL_loading_realpart','LoveH_loading_imagpart','LoveK_loading_imagpart','LoveL_loading_imagpart'};
+-field_tolerances={field_tolerances{:},4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9};
++field_tolerances={field_tolerances{:},5e-7,5e-7,5e-7,5e-7,5e-7,5e-7};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,:)),...
+ 	(md.results.LoveSolution.LoveKr(:,:)),...
+@@ -73,7 +73,7 @@
+ 
+ %tidal love numbers
+ field_names     ={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={field_tolerances{:},4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9};
++field_tolerances={field_tolerances{:},3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,1)),...
+ 	(md.results.LoveSolution.LoveKr(:,1)),...
+@@ -113,7 +113,7 @@
+ %md=solve(md,'lv');
+ %
+ %field_names     ={field_names{:},'LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart'};
+-%field_tolerances={field_tolerances{:},4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9};
++%field_tolerances={field_tolerances{:},6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7};
+ %field_values={field_values{:},...
+ %	(md.results.LoveSolution.LoveHr(:,1)),...
+ %	(md.results.LoveSolution.LoveKr(:,1)),...
+@@ -145,7 +145,7 @@
+ md.love.nfreq=length(md.love.frequencies);
+ 
+ field_names     ={field_names{:},'LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart'};
+-field_tolerances={field_tolerances{:},4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9};
++field_tolerances={field_tolerances{:},6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,1)),...
+ 	(md.results.LoveSolution.LoveKr(:,1)),...
Index: /issm/oecreview/Archive/23185-23389/ISSM-23248-23249.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23248-23249.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23248-23249.diff	(revision 23390)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test215.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test215.m	(revision 23248)
++++ ../trunk-jpl/test/NightlyRun/test215.m	(revision 23249)
+@@ -23,7 +23,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Gradient','Misfits','MaterialsRheologyBbar','Pressure','Vel','Vx','Vy'};
+-field_tolerances={4.6e-08,1e-08,2e-08,1e-09,2e-09,2e-08,2e-08};
++field_tolerances={4.6e-08,1e-08,2e-08,2e-09,3e-09,2e-08,2e-08};
+ field_values={...
+ 	(md.results.StressbalanceSolution.Gradient1),...
+ 	(md.results.StressbalanceSolution.J),...
+Index: ../trunk-jpl/test/NightlyRun/test215.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test215.py	(revision 23248)
++++ ../trunk-jpl/test/NightlyRun/test215.py	(revision 23249)
+@@ -36,7 +36,7 @@
+ 
+ # Fields and tolerances to track changes
+ field_names     =['Gradient','Misfits','MaterialsRheologyBbar','Pressure','Vel','Vx','Vy']
+-field_tolerances=[4.6e-08,1e-08,2e-09,1e-08,2e-09,2e-08,2e-08]
++field_tolerances=[4.6e-08,1e-08,2e-08,2e-09,3e-09,2e-08,2e-08]
+ field_values=[md.results.StressbalanceSolution.Gradient1,
+         md.results.StressbalanceSolution.J,
+         md.results.StressbalanceSolution.MaterialsRheologyBbar,
Index: /issm/oecreview/Archive/23185-23389/ISSM-23249-23250.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23249-23250.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23249-23250.diff	(revision 23390)
@@ -0,0 +1,144 @@
+Index: ../trunk-jpl/src/c/cores/adgradient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/adgradient_core.cpp	(revision 23249)
++++ ../trunk-jpl/src/c/cores/adgradient_core.cpp	(revision 23250)
+@@ -47,7 +47,7 @@
+ 
+ 	if(isautodiff){
+ 
+-		#ifdef _HAVE_ADOLC_
++		#if defined(_HAVE_ADOLC_)
+ 			if(VerboseAutodiff())_printf0_("   start ad core\n"); 
+ 
+ 			/*First, stop tracing: */
+@@ -181,6 +181,9 @@
+ 			xDelete(xp);
+ 			xDelete(totalgradient);
+ 			xDelete(axp); /*}}}*/
++
++		#elif defined(_HAVE_CODIPACK_)
++			fprintf(stderr, "*** Codipack adgradient_core()\n");
+ 		#else
+ 			_error_("Should not be requesting AD drivers when an AD library is not available!");
+ 		#endif
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23249)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23250)
+@@ -167,6 +167,8 @@
+ 
+ 	/*Print tape statistics so that user can kill this run if something is off already:*/
+ 	if(VerboseAutodiff()){ /*{{{*/
++
++		#ifdef _HAVE_ADOLC_
+ 		size_t  tape_stats[15];
+ 		tapestats(my_rank,tape_stats); //reading of tape statistics
+ 		int commSize=IssmComm::GetSize();
+@@ -207,6 +209,16 @@
+ 			delete []rstats;
+ 		}
+ 		delete [] sstats;
++		#endif
++
++		#ifdef _HAVE_CODIPACK_
++		#ifdef _AD_TAPE_ALLOC_
++		//_printf_("Allocation time  P(" << my_rank << "): " << alloc_profiler.DeltaTime(StartInit, FinishInit) << "\n");
++		#endif
++		std::stringstream out_s;
++		IssmDouble::getGlobalTape().printStatistics(out_s);
++		_printf0_("CoDiPack Profiling::Tape Statistics :\n" << out_s.str());
++		#endif
+ 	} /*}}}*/
+ 
+ 	/*diverse: */
+Index: ../trunk-jpl/src/c/cores/ad_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/ad_core.cpp	(revision 23249)
++++ ../trunk-jpl/src/c/cores/ad_core.cpp	(revision 23250)
+@@ -18,6 +18,9 @@
+ #include "../solutionsequences/solutionsequences.h"
+ /*}}}*/
+ 
++#ifdef _HAVE_CODIPACK_
++CoDi_global codi_global = {};
++#endif
+ void ad_core(FemModel* femmodel){
+ 
+ 	/*diverse: */
+@@ -40,7 +43,7 @@
+ 
+ 	if(isautodiff && !iscontrol){
+ 
+-		#ifdef _HAVE_ADOLC_
++		#if defined(_HAVE_ADOLC_)
+ 			if(VerboseAutodiff())_printf0_("   start ad core\n");
+ 
+ 			/*First, stop tracing: */
+@@ -317,6 +320,67 @@
+ 			xDelete(xp);
+ 			xDelete(axp); 
+ 			xDelete(driver);
++
++			#elif defined(_HAVE_CODIPACK_)
++			if(VerboseAutodiff())_printf0_("   start CoDiPack ad core\n");
++
++			/*First, stop tracing: */
++			auto& tape_codi = IssmDouble::getGlobalTape();
++			tape_codi.setPassive();
++
++			if(VerboseAutodiff()){ /*{{{*/
++				if(my_rank == 0) {
++					// FIXME codi "just because" for now
++					tape_codi.printStatistics(std::cout);
++					codi_global.print(std::cout);
++				}
++			}
++
++			/*retrieve parameters: */
++			femmodel->parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
++			femmodel->parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum);
++
++			/*if no dependents, no point in running a driver: */
++			if(!(num_dependents*num_independents)) return;
++
++			/*Branch according to AD driver: */
++			femmodel->parameters->FindParam(&driver,AutodiffDriverEnum);
++			if(VerboseAutodiff())_printf0_("   driver: " << driver << "\n");
++
++			if (strcmp(driver,"fos_reverse")==0) { /*{{{*/
++				if(VerboseAutodiff())_printf0_("   CoDiPack fos_reverse\n");
++				int     aDepIndex=0;
++				double *weightVectorTimesJac=NULL;
++
++				/*retrieve direction index: */
++				femmodel->parameters->FindParam(&aDepIndex,AutodiffFosReverseIndexEnum);
++				if (my_rank==0) {
++					if (aDepIndex<0 || aDepIndex>=num_dependents
++							|| codi_global.output_indices.size() <= aDepIndex){
++						_error_("index value for AutodiffFosReverseIndexEnum should be in [0,num_dependents-1]");
++					}
++					tape_codi.setGradient(codi_global.output_indices[aDepIndex], 1.0);
++				}
++
++				tape_codi.evaluate();
++
++				weightVectorTimesJac=xNew<double>(num_independents);
++				/*call driver: */
++				auto in_size = codi_global.input_indices.size();
++				for(size_t i = 0; i < in_size; ++i) {
++					weightVectorTimesJac[i] = tape_codi.getGradient(codi_global.input_indices[i]);
++				}
++
++				/*add to results*/
++				femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,AutodiffJacobianEnum,weightVectorTimesJac,num_independents,1,0,0.0));
++
++				/*free resources :*/
++				xDelete(weightVectorTimesJac);
++			} /*}}}*/
++			else _error_("driver: " << driver << " not yet supported!");
++
++			if(VerboseAutodiff())_printf0_("   end CoDiPack ad core\n");
++			xDelete(driver);
+ 		#else
+ 			_error_("Should not be requesting AD drivers when an AD library is not available!");
+ 		#endif
Index: /issm/oecreview/Archive/23185-23389/ISSM-23250-23251.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23250-23251.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23250-23251.diff	(revision 23390)
@@ -0,0 +1,763 @@
+Index: ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 23250)
++++ ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 23251)
+@@ -17,6 +17,7 @@
+ #include "../../classes/Params/Parameters.h"
+ #include "../mpi/issmmpi.h"
+ #include "../adolc/adolcincludes.h"
++#include "../codipack/codipackincludes.h"
+ #include "../issm/SparseRow.h"
+ #include "./mumpsincludes.h"
+ 
+@@ -97,7 +98,7 @@
+ 	MumpsFinalize(theMumpsStruc);
+ }
+ 
+-#ifdef _HAVE_ADOLC_
++#ifdef _HAVE_AD_
+ // prototype for active variant
+ void MumpsSolve(int n,
+ 		int nnz,
+@@ -353,8 +354,7 @@
+ }/*}}}*/
+ 
+ #ifdef _HAVE_ADOLC_
+-
+-int mumpsSolveEDF(int iArrLength, int* iArr, int /* ignored */, IssmPDouble* dp_x, int /* ignored */, IssmPDouble* dp_y) {
++int mumpsSolveEDF(int iArrLength, int* iArr, int /* ignored */, IssmPDouble* dp_x, int /* ignored */, IssmPDouble* dp_y){/*{{{*/
+   // unpack parameters
+   int n=iArr[0];
+   int nnz=iArr[1];
+@@ -380,9 +380,8 @@
+   xDelete(local_jcn);
+   xDelete(local_irn);
+   return 0;
+-}
+-
+-void MumpsSolve(int n,int nnz,int local_nnz,int* irn_loc,int* jcn_loc,IssmDouble *a_loc,IssmDouble *rhs,Parameters* parameters){
++}/*}}}*/
++void MumpsSolve(int n,int nnz,int local_nnz,int* irn_loc,int* jcn_loc,IssmDouble *a_loc,IssmDouble *rhs,Parameters* parameters){/*{{{*/
+   int packedDimsSparseArrLength=1+1+1+local_nnz+local_nnz;
+   int *packedDimsSparseArr=xNew<int>(packedDimsSparseArrLength);
+   packedDimsSparseArr[0]=n;
+@@ -424,12 +423,8 @@
+   xDelete(sol);
+   xDelete(pack_A_rhs);
+   xDelete(packedDimsSparseArr);
+-}
+-
+-int fos_reverse_mumpsSolveEDF(int iArrLength, int* iArr, 
+-			      int m, IssmPDouble *dp_U,
+-			      int nPlusNz, IssmPDouble *dp_Z,
+-			      IssmPDouble *dp_x, IssmPDouble *dp_y) {
++}/*}}}*/
++int fos_reverse_mumpsSolveEDF(int iArrLength, int* iArr, int m, IssmPDouble *dp_U, int nPlusNz, IssmPDouble *dp_Z, IssmPDouble *dp_x, IssmPDouble *dp_y) {/*{{{*/
+   // unpack parameters
+   int n=iArr[0];
+   int nnz=iArr[1];
+@@ -480,6 +475,153 @@
+   xDelete(local_jcn);
+   xDelete(local_irn);
+   return 3;
++}/*}}}*/
++#endif
++
++#ifdef _HAVE_CODIPACK_
++void MumpsSolve_codi_b(codi::DataStore* data) {/*{{{*/
++  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);
++  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(codi::DataStore* data) {/*{{{*/
++  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);
++}
++/*}}}*/
++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);
++  } else {
++    // if the tape is active valueB is stored in the dataHandler and deleted in the reverse sweep
++    xDelete(valueB);
++  }
++
++  xDelete(valueA);
++}
++/*}}}*/
+ #endif
+Index: ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 23250)
++++ ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 23251)
+@@ -13,6 +13,7 @@
+ #include "../../classes/Params/GenericParam.h"
+ #include "../../classes/Params/Parameters.h"
+ #include "../adolc/adolcincludes.h"
++#include "../codipack/codipackincludes.h"
+ #include "./gslincludes.h"
+ 
+ #ifdef _HAVE_GSL_
+@@ -250,3 +251,142 @@
+ }
+ /*}}}*/
+ #endif
++
++#ifdef _HAVE_CODIPACK_
++void SolverxSeq_codi_b(codi::DataStore* data) {/*{{{*/
++  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(codi::DataStore* data) {/*{{{*/
++  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);
++}
++/*}}}*/
++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.pushExternalFunction(&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);
++}
++/*}}}*/
++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: */
++
++	if(Kff_N!=pf_M)_error_("Right hand side vector of size " << pf_M << ", when matrix is of size " << Kff_M << "-" << Kff_N << " !");
++	if(Kff_M!=Kff_N)_error_("Stiffness matrix should be square!");
++
++	IssmDouble *x  = xNew<IssmDouble>(Kff_N,"t");
++
++	SolverxSeq(x,Kff,pf,Kff_N,parameters);
++
++	/*allocate output pointers: */
++	*px=x;
++}
++/*}}}*/
++#endif
+Index: ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23250)
++++ ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23251)
+@@ -18,7 +18,11 @@
+ #ifdef _HAVE_MPI_
+ 	/*Include header files: {{{*/
+ 	#ifdef _HAVE_AMPI_
+-		#include <ampi/ampi.h>
++		#ifdef _HAVE_ADJOINTMPI_
++			#include <ampi_tape.hpp>
++		#else
++			#include <ampi/ampi.h>
++		#endif
+ 	#elif  _HAVE_PETSC_MPI_ // Petsc now hides there MPI header. It can be reached through Petsc.
+ 		#include <petsc.h>
+ 	#else 
+@@ -34,8 +38,10 @@
+ 
+ 	// data types
+ 	#define ISSM_MPI_CHAR       MPI_CHAR
+-	#ifdef _HAVE_AMPI_
++	#if defined(_HAVE_AMPI_)
+ 		#define ISSM_MPI_DOUBLE    AMPI_ADOUBLE // corresponds to IssmDouble
++	#elif defined(_HAVE_ADJOINTMPI_)
++		#define ISSM_MPI_DOUBLE    AMPI_DOUBLE // corresponds to IssmDouble
+ 	#else 
+ 		#define ISSM_MPI_DOUBLE    MPI_DOUBLE  // corresponds to IssmDouble 
+ 	#endif
+Index: ../trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp	(revision 23250)
++++ ../trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp	(revision 23251)
+@@ -59,7 +59,7 @@
+ 		   comm);
+ # endif
+ #else
+-# ifdef _HAVE_ADOLC_
++# ifdef _HAVE_AD_
+   if (sendtype==ISSM_MPI_DOUBLE) { 
+     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
+     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
+@@ -96,7 +96,7 @@
+ # endif
+ #else
+   assert(sendcount==recvcounts[0]); // we handle only identical representations 
+-# ifdef _HAVE_ADOLC_
++# ifdef _HAVE_AD_
+   if (sendtype==ISSM_MPI_DOUBLE) { 
+     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
+     IssmDouble* activeRecvBuf=(IssmDouble*)(recvbuf)+displs[0];
+@@ -128,7 +128,7 @@
+ 		   comm);
+ # endif
+ #else
+-# ifdef _HAVE_ADOLC_
++#ifdef _HAVE_AD_
+   if (datatype==ISSM_MPI_DOUBLE) { 
+     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
+     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
+@@ -214,14 +214,18 @@
+ }/*}}}*/
+ int ISSM_MPI_Finalize(void){  /*{{{*/
+ 
+-  int rc=0;
+-#ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
+-  rc=AMPI_Finalize_NT();
+-# else
+-  rc=MPI_Finalize();
+-# endif
+-#endif
++	int rc=0;
++	#ifdef _HAVE_MPI_
++		#ifdef _HAVE_AMPI_
++			#ifdef _HAVE_ADJOINTMPI_
++				rc=AMPI_Finalize();
++			#else
++				rc=AMPI_Finalize_NT();
++			#endif
++		#else
++		  rc=MPI_Finalize();
++		#endif
++	#endif
+   return rc;
+ }/*}}}*/
+ int ISSM_MPI_Gather(void *sendbuf, int sendcnt, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm){  /*{{{*/
+@@ -249,7 +253,7 @@
+ 		comm);
+ # endif
+ #else
+-# ifdef _HAVE_ADOLC_
++# ifdef _HAVE_AD_
+   if (sendtype==ISSM_MPI_DOUBLE) { 
+     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
+     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
+@@ -289,7 +293,7 @@
+ # endif
+ #else
+   assert(sendcnt==recvcnts[0]); // we handle only identical representations 
+-# ifdef _HAVE_ADOLC_
++#ifdef _HAVE_AD_
+   if (sendtype==ISSM_MPI_DOUBLE) { 
+     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
+     IssmDouble* activeRecvBuf=(IssmDouble*)(recvbuf)+displs[0];
+@@ -303,14 +307,18 @@
+ }/*}}}*/
+ int ISSM_MPI_Init(int *argc, char ***argv){  /*{{{*/
+ 
+-  int rc=0;
+-#ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
+-  rc=AMPI_Init_NT(argc,argv);
+-# else
+-  rc=MPI_Init(argc,argv);
+-# endif
+-#endif
++	int rc=0;
++	#ifdef _HAVE_MPI_
++		#ifdef _HAVE_AMPI_
++			#ifdef _HAVE_ADJOINTMPI_
++				rc=AMPI_Init(argc,argv);
++			#else
++				rc=AMPI_Init_NT(argc,argv);
++			#endif
++		#else
++			rc=MPI_Init(argc,argv);
++		#endif
++	#endif
+   return rc;
+ }/*}}}*/
+ int ISSM_MPI_Recv(void *buf, int count, ISSM_MPI_Datatype datatype, int source, int tag, ISSM_MPI_Comm comm, ISSM_MPI_Status *status){ /*{{{*/
+@@ -323,7 +331,9 @@
+ 	       datatype,
+ 	       source,
+ 	       tag,
++			 #ifndef _HAVE_ADJOINTMPI_
+ 	       AMPI_FROM_SEND, // as long as there are no other variants
++			 #endif
+ 	       comm,
+ 	       status);
+ # else
+@@ -364,7 +374,7 @@
+ 		comm);
+ # endif
+ #else
+-# ifdef _HAVE_ADOLC_
++# ifdef _HAVE_AD_
+   if (datatype==ISSM_MPI_DOUBLE) { 
+     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
+     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
+@@ -401,7 +411,7 @@
+ 		 comm);
+ # endif
+ #else
+-# ifdef _HAVE_ADOLC_
++# ifdef _HAVE_AD_
+   if (sendtype==ISSM_MPI_DOUBLE) { 
+     IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;
+     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
+@@ -441,7 +451,7 @@
+ # endif
+ #else
+   assert(sendcnts[0]==recvcnt); // we handle only identical representations 
+-# ifdef _HAVE_ADOLC_
++# ifdef _HAVE_AD_
+   if (sendtype==ISSM_MPI_DOUBLE) { 
+     IssmDouble* activeSendBuf=(IssmDouble*)(sendbuf)+displs[0];
+     IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;
+@@ -463,7 +473,9 @@
+ 	       datatype,
+ 	       dest,
+ 	       tag,
++			 #ifndef _HAVE_ADJOINTMPI_
+ 	       AMPI_TO_RECV, // as long as there are no other variants
++			 #endif
+ 	       comm);
+ # else
+   rc=MPI_Send(buf, 
+@@ -491,6 +503,8 @@
+ 
+ #ifdef _HAVE_ADOLC_
+   ensureContiguousLocations(aSize);
++#else
++  fprintf(stderr, "*** Codipack ISSM_MPI_ContiguousInAdolc()\n");
+ #endif
+ }/*}}}*/
+ int ISSM_MPI_Comm_split(ISSM_MPI_Comm comm, int color, int key, ISSM_MPI_Comm *newcomm){ /*{{{*/
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23250)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23251)
+@@ -17,6 +17,11 @@
+ #include "../shared/Enum/Enum.h"
+ #include "../analyses/analyses.h"
+ 
++#if _HAVE_CODIPACK_
++#include <sstream> // for output of the CoDiPack tape
++extern CoDi_global codi_global;
++#endif
++
+ /*module includes: {{{*/
+ #include "../modules/ModelProcessorx/ModelProcessorx.h"
+ #include "../modules/VerticesDofx/VerticesDofx.h"
+@@ -1850,12 +1855,22 @@
+ 		if(num_dependents){
+ 			dependents=xNew<IssmPDouble>(num_dependents);
+ 
++			#if defined(_HAVE_CODIPACK_)
++			auto& tape_codi = IssmDouble::getGlobalTape();
++			#endif
++
+ 			/*Go through our dependent variables, and compute the response:*/
+ 			for(int i=0;i<dependent_objects->Size();i++){
+ 				DependentObject* dep=(DependentObject*)dependent_objects->GetObjectByOffset(i);
+ 				dep->Responsex(&output_value,this);
+ 				if (my_rank==0) {
+-					output_value>>=dependents[i];
++					#if defined(_HAVE_CODIPACK_)
++						tape_codi.registerOutput(output_value);
++						dependents[i] = output_value.getValue();
++						codi_global.output_indices.push_back(output_value.getGradientData());
++					#else
++						output_value>>=dependents[i];
++					#endif
+ 				}
+ 			}
+ 		}
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 23250)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 23251)
+@@ -27,6 +27,11 @@
+ #include "../shared/io/io.h"
+ #include "../shared/shared.h"
+ 
++#ifdef _HAVE_CODIPACK_
++extern CoDi_global codi_global;
++#include <sstream> // for output of the CoDiPack tape
++#endif
++
+ /*IoConstant class and methods*/
+ IoConstant::IoConstant(){/*{{{*/
+ 	this->isindependent = false;
+@@ -430,7 +435,8 @@
+ 
+ 	if(trace || (autodiff && !iscontrol)){
+ 
+-		#ifdef _HAVE_ADOLC_
++		#ifdef _HAVE_AD_
++		// FIXME codi here we should be able to execute codi version as normal
+ 		this->FetchData(&num_independent_objects,"md.autodiff.num_independent_objects");
+ 		if(num_independent_objects){
+ 			this->FetchData(&names,&temp,"md.autodiff.independent_object_names");
+@@ -459,7 +465,7 @@
+ 		}
+ 		#else
+ 		/*if we asked for AD computations, we have a problem!: */
+-		_error_("Cannot carry out AD mode computations without support of ADOLC compiled in!");
++		_error_("Cannot carry out AD mode computations without support of ADOLC or CoDiPack compiled in!");
+ 		#endif
+ 	}
+ }
+@@ -1701,7 +1707,7 @@
+ 	int Xcount = 0;
+ 	if(X) Xcount=*pXcount;
+ 
+-	#ifdef _HAVE_ADOLC_ //cannot come here unless you are running AD mode, from DeclaredIndependents:
++	#ifdef _HAVE_AD_ //cannot come here unless you are running AD mode, from DeclaredIndependents:
+ 
+ 	/*output: */
+ 	IssmPDouble  pscalar;
+@@ -1718,12 +1724,24 @@
+ 
+ 		/*Now, before we even broadcast this to other nodes, declare the scalar  as an independent variable!. If we 
+ 		 *have been supplied an X vector, use it instead of what we just read: */
+-		if(X){
+-			scalar<<=X[Xcount];
+-		}
+-		else{
+-			scalar<<=pscalar;
+-		}
++		#if defined(_HAVE_CODIPACK_)
++			// FIXME codi here we just assign instead of using "operator <<="
++			if(X){
++				scalar=X[Xcount];
++			} else {
++				scalar=pscalar;
++			}
++			auto& tape_codi = IssmDouble::getGlobalTape();
++			tape_codi.registerInput(scalar);
++			codi_global.input_indices.push_back(scalar.getGradientData());
++		#else
++			if(X){
++				scalar<<=X[Xcount];
++			}
++			else{
++				scalar<<=pscalar;
++			}
++		#endif
+ 	}
+ 
+ 	ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 
+@@ -1784,12 +1802,31 @@
+ 
+ 			/*Now, before we even broadcast this to other nodes, declare the whole matrix as a independent variable!
+ 			  If we have been supplied an X vector, use it instead of what we just read: */
+-			if(X){
+-				for(int i=0;i<M*N;i++) matrix[i]<<=X[Xcount+i];  /*<<= ADOLC overloaded operator to declare independent*/
+-			}
+-			else{
+-				for(int i=0;i<M*N;i++) matrix[i]<<=buffer[i];
+-			}
++			#if defined(_HAVE_CODIPACK_)
++				// FIXME codi here we just assign instead of using "operator <<="
++				auto& tape_codi = IssmDouble::getGlobalTape();
++				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());
++					}
++				}
++				else{
++					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());
++					}
++				}
++			#else /*ADOLC*/
++				if(X){
++					for(int i=0;i<M*N;i++) matrix[i]<<=X[Xcount+i];  /*<<= ADOLC overloaded operator to declare independent*/
++				}
++				else{
++					for(int i=0;i<M*N;i++) matrix[i]<<=buffer[i];
++				}
++			#endif
+ 		}
+ 		ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 
+ 
+@@ -1797,6 +1834,8 @@
+ 	}
+ 	else _error_("cannot declare the independent variable \"" << data_name <<  "\" if it's empty!");
+ 
++	// FIXME codi is that at all relevant to CoDiPack or can we simply assume the same?
++	
+ 	/*Add to data as independent*/
+ 	this->AddDataIndependent(new IoData(matrix,code,layout,M,N,data_name));
+ 
+@@ -2561,7 +2600,8 @@
+ 	this->FetchData(&iscontrol,"md.inversion.iscontrol");
+ 
+ 	if(trace || (autodiff && !iscontrol)){
+-		#ifdef _HAVE_ADOLC_
++
++		#if defined(_HAVE_ADOLC_)
+ 		/*Retrieve parameters: */
+ 		this->FetchData(&keep,"md.autodiff.keep");
+ 		int keepTaylors=keep?1:0;
+@@ -2578,7 +2618,35 @@
+ 		/*Start trace: */
+ 		int skipFileDeletion=1;
+ 		trace_on(my_rank,keepTaylors,reCast<size_t>(obufsize),reCast<size_t>(lbufsize),reCast<size_t>(cbufsize),reCast<size_t>(tbufsize),skipFileDeletion);
++
++		#elif defined(_HAVE_CODIPACK_)
++		//fprintf(stderr, "*** Codipack IoModel::StartTrace\n");
++		/*
++		 * FIXME codi
++		 * - ADOL-C variant uses fine grained tracing with various arguments
++		 * - 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();
++		tape_codi.setActive();
++		#if _AD_TAPE_ALLOC_
++		//alloc_profiler.Tag(StartInit, true);
++		IssmDouble x_t(1.0), y_t(1.0);
++		tape_codi.registerInput(y_t);
++		int codi_allocn = 0;
++		this->FetchData(&codi_allocn, AutodiffTapeAllocEnum);
++		for(int i = 0;i < codi_allocn;++i) {
++			x_t = y_t * y_t;
++		}
++		/*
++		std::stringstream out_s;
++		IssmDouble::getGlobalTape().printStatistics(out_s);
++		_printf0_("StartTrace::Tape Statistics	   : TapeAlloc count=[" << codi_allocn << "]\n" << out_s.str());
++		*/
++		tape_codi.reset();
++		//alloc_profiler.Tag(FinishInit, true);
+ 		#endif
++		#endif
+ 	}
+ 
+ }
Index: /issm/oecreview/Archive/23185-23389/ISSM-23251-23252.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23251-23252.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23251-23252.diff	(revision 23390)
@@ -0,0 +1,138 @@
+Index: ../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	(revision 23251)
++++ ../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	(revision 23252)
+@@ -93,7 +93,7 @@
+ }/*}}}*/
+ 
+ /*For autodiff, we sometimes need to cast our vectors to passive*/
+-#ifdef _HAVE_ADOLC_
++#ifdef _HAVE_AD_
+ void GetPassiveVectorFromControlInputsx(Vector<IssmPDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){/*{{{*/
+ 
+ 	/*Get active vector first*/
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 23251)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 23252)
+@@ -76,8 +76,9 @@
+ 		//fprintf(stderr, "*** Codipack CreateParametersAutodiff()\n");
+ 		/*initialize a placeholder to store solver pointers: {{{*/
+ 		/*Solver pointers depend on what type of solver we are implementing: */
+-		options=OptionsFromAnalysis(parameters,DefaultAnalysisEnum); //options database is not filled in yet, use default.
+-		ToolkitOptions::Init(options);
++		options=OptionsFromAnalysis(&toolkit,parameters,DefaultAnalysisEnum);
++		ToolkitOptions::Init(toolkit,options);
++		xDelete<char>(toolkit);
+ 
+ 		switch(IssmSolverTypeFromToolkitOptions()){
+ 			case MumpsEnum:{
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 23251)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 23252)
+@@ -50,12 +50,15 @@
+ 					 ./modules/BamgConvertMeshx/BamgConvertMeshx.cpp\
+ 					 ./modules/BamgTriangulatex/BamgTriangulatex.cpp
+ 
+-#do not include AmrBamg with ADOLC
++#do not include AmrBamg with AD
+ if ADOLC
+ else
++if CODIPACK
++else
+ issm_sources += ./classes/AmrBamg.cpp
+ endif
+ endif
++endif
+ #}}}
+ #Core sources{{{
+ issm_sources += ./datastructures/DataSet.cpp\
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 23251)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 23252)
+@@ -69,7 +69,7 @@
+ 	femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum);
+ 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,TransientRequestedOutputsEnum);
+ 
+-	#if defined(_HAVE_BAMG_) && !defined(_HAVE_ADOLC_)
++	#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+ 	if(amr_frequency){
+ 		femmodel->parameters->FindParam(&amr_restart,AmrRestartEnum);
+ 		if(amr_restart) femmodel->ReMesh();
+@@ -77,7 +77,7 @@
+ 	#endif
+ 
+ 	if(isoceancoupling){ /*{{{*/
+-		#ifndef _HAVE_ADOLC_
++		#ifndef _HAVE_AD_
+ 		if(VerboseSolution()) _printf0_("   ocean coupling: initialization \n");
+ 		int my_rank;
+ 		ISSM_MPI_Comm tomitgcmcomm;
+@@ -246,7 +246,7 @@
+ 
+ 		if(isoceancoupling){ /*{{{*/
+ 
+-			#ifndef _HAVE_ADOLC_
++			#ifndef _HAVE_AD_
+ 			if(VerboseSolution()) _printf0_("   ocean coupling: exchanging information\n");
+ 			int my_rank;
+ 			ISSM_MPI_Comm tomitgcmcomm;
+@@ -459,7 +459,7 @@
+ 		/*Adaptive mesh refinement*/
+ 		if(amr_frequency){
+ 
+-			#if !defined(_HAVE_ADOLC_)
++			#if !defined(_HAVE_AD_)
+ 			if(save_results) femmodel->WriteMeshInResults();
+ 			if(step%amr_frequency==0 && time<finaltime){
+ 				if(VerboseSolution()) _printf0_("   refining mesh\n");
+@@ -467,7 +467,7 @@
+ 			}
+ 
+ 			#else
+-			_error_("AMR not suppored with ADOLC");
++			_error_("AMR not suppored with AD");
+ 			#endif
+ 		}
+ 
+Index: ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23251)
++++ ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23252)
+@@ -10,7 +10,7 @@
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+ 
+-#if defined (_HAVE_M1QN3_) && !defined(_HAVE_ADOLC_)
++#if defined (_HAVE_M1QN3_) && !defined(_HAVE_AD_)
+ /*m1qn3 prototypes*/
+ extern "C" void *ctonbe_; // DIS mode : Conversion
+ extern "C" void *ctcabe_; // DIS mode : Conversion
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23251)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23252)
+@@ -2544,7 +2544,7 @@
+ /*}}}*/
+ 
+ /*AMR*/
+-#if !defined(_HAVE_ADOLC_)
++#ifndef _HAVE_AD_
+ void FemModel::ReMesh(void){/*{{{*/
+ 
+ 	/*Intermediaries*/
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 23251)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 23252)
+@@ -2634,7 +2634,7 @@
+ 		IssmDouble x_t(1.0), y_t(1.0);
+ 		tape_codi.registerInput(y_t);
+ 		int codi_allocn = 0;
+-		this->FetchData(&codi_allocn, AutodiffTapeAllocEnum);
++		this->FetchData(&codi_allocn,"md.autodiff.tapeAlloc");
+ 		for(int i = 0;i < codi_allocn;++i) {
+ 			x_t = y_t * y_t;
+ 		}
Index: /issm/oecreview/Archive/23185-23389/ISSM-23252-23253.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23252-23253.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23252-23253.diff	(revision 23390)
@@ -0,0 +1,10 @@
+Index: ../trunk-jpl/externalpackages/codipack/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/codipack/install.sh	(revision 23252)
++++ ../trunk-jpl/externalpackages/codipack/install.sh	(revision 23253)
+@@ -5,4 +5,4 @@
+ rm -rf install 
+ 
+ #Download development version
+-svn co https://github.com/SciCompKL/CoDiPack.git install
++svn co https://github.com/SciCompKL/CoDiPack.git/trunk install
Index: /issm/oecreview/Archive/23185-23389/ISSM-23253-23254.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23253-23254.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23253-23254.diff	(revision 23390)
@@ -0,0 +1,208 @@
+Index: ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23253)
++++ ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23254)
+@@ -39,9 +39,11 @@
+ 	// data types
+ 	#define ISSM_MPI_CHAR       MPI_CHAR
+ 	#if defined(_HAVE_AMPI_)
++		#ifdef _HAVE_ADJOINTMPI_
++		#define ISSM_MPI_DOUBLE    AMPI_DOUBLE // corresponds to IssmDouble
++		#else
+ 		#define ISSM_MPI_DOUBLE    AMPI_ADOUBLE // corresponds to IssmDouble
+-	#elif defined(_HAVE_ADJOINTMPI_)
+-		#define ISSM_MPI_DOUBLE    AMPI_DOUBLE // corresponds to IssmDouble
++		#endif
+ 	#else 
+ 		#define ISSM_MPI_DOUBLE    MPI_DOUBLE  // corresponds to IssmDouble 
+ 	#endif
+Index: ../trunk-jpl/src/c/classes/Params/Parameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 23253)
++++ ../trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 23254)
+@@ -718,7 +718,7 @@
+ /*}}}*/
+ 
+ /*Specific case with ADOL-C, we might need to get double params for m1qn3*/
+-#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_) 
++#if defined(_HAVE_AD_) && !defined(_WRAPPERS_) 
+ void Parameters::FindParamAndMakePassive(double* pscalar,int param_enum){ _assert_(this);/*{{{*/
+ 	_assert_(param_enum>ParametersSTARTEnum);
+ 	_assert_(param_enum<ParametersENDEnum);
+Index: ../trunk-jpl/src/c/classes/Params/Parameters.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/Parameters.h	(revision 23253)
++++ ../trunk-jpl/src/c/classes/Params/Parameters.h	(revision 23254)
+@@ -70,7 +70,7 @@
+ 		Param* FindParamObject(int enum_type);
+ 
+ 		/*Specific instantiations for IssmDouble*: */
+-		#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_) 
++		#if defined(_HAVE_AD_) && !defined(_WRAPPERS_) 
+ 		void  FindParamAndMakePassive(double* pscalar, int enum_type);
+ 		#endif
+ 
+Index: ../trunk-jpl/src/c/classes/Options/GenericOption.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Options/GenericOption.h	(revision 23253)
++++ ../trunk-jpl/src/c/classes/Options/GenericOption.h	(revision 23254)
+@@ -101,7 +101,7 @@
+ 		};/*}}}*/
+ };
+ 
+-#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_) 
++#if defined(_HAVE_AD_) && !defined(_WRAPPERS_) 
+ /*We hook off this specific specialization when not running ADOLC, otherwise we get a redeclaration with the next specialization*/
+ template <> inline void GenericOption<IssmPDouble*>::Get(IssmPDouble** pvalue){ /*{{{*/
+ 
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23253)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 23254)
+@@ -88,13 +88,13 @@
+    /*AMR stuff*/
+ 	this->parameters->FindParam(&amr_frequency,TransientAmrFrequencyEnum);
+ 	this->parameters->FindParam(&amr_frequency,TransientAmrFrequencyEnum);
+-	#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_ADOLC_)
++	#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
+ 	this->amr = NULL;
+ 	#endif
+-	#if defined(_HAVE_BAMG_) && !defined(_HAVE_ADOLC_)
++	#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+ 	this->amrbamg = NULL;
+ 	#endif
+-	#if !defined(_HAVE_ADOLC_)
++	#if !defined(_HAVE_AD_)
+ 	if(amr_frequency && solution_type==TransientSolutionEnum){
+ 		/*Verifications. AMR supports SSA, P1 and horizontal 2D domain*/
+ 		bool isSSA;
+@@ -151,10 +151,10 @@
+ 	this->InitFromFiles(rootpath,inputfilename,outputfilename,toolkitsfilename,lockfilename,restartfilename, solution_type,traceon,X);
+ 	profiler->Stop(MPROCESSOR);
+ 
+-	#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_ADOLC_)
++	#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
+ 	this->amr = NULL;
+ 	#endif
+-	#if defined(_HAVE_BAMG_) && !defined(_HAVE_ADOLC_)
++	#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+ 	this->amrbamg = NULL;
+ 	#endif
+ 
+@@ -188,11 +188,11 @@
+ 	if(parameters)delete parameters;
+ 	if(results)delete results;
+ 
+-	#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_ADOLC_)
++	#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
+ 	if(amr)delete amr;
+ 	#endif
+ 
+-	#if defined(_HAVE_BAMG_) && !defined(_HAVE_ADOLC_)
++	#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+ 	if(amrbamg)delete amrbamg;
+ 	#endif
+ 
+@@ -327,10 +327,10 @@
+ 	}
+ 
+ 	/*AMR, no copy for now*/
+-	#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_ADOLC_)
++	#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
+ 	this->amr = NULL;
+ 	#endif
+-	#if defined(_HAVE_BAMG_) && !defined(_HAVE_ADOLC_)
++	#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+ 	this->amrbamg = NULL;
+ 	#endif
+ 
+@@ -2563,11 +2563,11 @@
+ 	/*Branch to specific amr depending on requested method*/
+ 	this->parameters->FindParam(&amrtype,AmrTypeEnum);
+ 	switch(amrtype){
+-		#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_ADOLC_)
++		#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
+ 		case AmrNeopzEnum: this->ReMeshNeopz(&newnumberofvertices,&newnumberofelements,&newx,&newy,&newz,&newelementslist); break;
+ 								 #endif
+ 
+-		#if defined(_HAVE_BAMG_) && !defined(_HAVE_ADOLC_)
++		#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+ 		case AmrBamgEnum: this->ReMeshBamg(&newnumberofvertices,&newnumberofelements,&newx,&newy,&newz,&newelementslist); break;
+ 		#endif
+ 
+@@ -4919,7 +4919,7 @@
+ }/*}}}*/
+ #endif
+ 
+-#if defined(_HAVE_BAMG_) && !defined(_HAVE_ADOLC_)
++#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+ void FemModel::ReMeshBamg(int* pnewnumberofvertices,int* pnewnumberofelements,IssmDouble** pnewx,IssmDouble** pnewy,IssmDouble** pnewz,int** pnewelementslist){/*{{{*/
+ 
+ 	/*Output*/
+@@ -5245,7 +5245,7 @@
+ /*}}}*/
+ #endif
+ 
+-#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_ADOLC_)
++#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
+ void FemModel::ReMeshNeopz(int* pnewnumberofvertices,int* pnewnumberofelements,IssmDouble** pnewx,IssmDouble** pnewy,IssmDouble** pnewz,int** pnewelementslist){/*{{{*/
+ 
+ 	/*pnewelementslist keep vertices in Matlab indexing*/
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 23253)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 23254)
+@@ -19,10 +19,10 @@
+ class Materials;
+ class Profiler;
+ class Elements;
+-#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_ADOLC_)
++#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
+ #include "./AdaptiveMeshRefinement.h"
+ #endif
+-#if defined(_HAVE_BAMG_) && !defined(_HAVE_ADOLC_)
++#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+ #include "./AmrBamg.h"
+ #endif
+ /*}}}*/
+@@ -50,11 +50,11 @@
+ 		Vertices    *vertices;             //one set of vertices
+ 
+ 		//FIXME: do we want only one class and have virtual functions? or keep 2 classes, at least rename AdaptiveMeshRefinement -> AmrNeopz
+-		#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_ADOLC_)
++		#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
+ 		AdaptiveMeshRefinement *amr;		  //adaptive mesh refinement object. It keeps coarse mesh and execute refinement process
+ 		#endif
+ 
+-		#if defined(_HAVE_BAMG_) && !defined(_HAVE_ADOLC_)
++		#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+ 		AmrBamg *amrbamg; //adaptive mesh refinement object. It keeps coarse mesh and execute refinement process
+ 		#endif
+ 
+@@ -163,7 +163,7 @@
+ 		#endif
+ 
+ 		/*AMR*/
+-		#if !defined(_HAVE_ADOLC_)
++		#if !defined(_HAVE_AD_)
+ 		void ReMesh(void);
+ 		void BedrockFromMismipPlus(void);
+ 		void AdjustBaseThicknessAndMask(void);
+@@ -190,7 +190,7 @@
+ 		void GetZeroLevelSetPoints(IssmDouble** pzerolevelset_points,int &numberofpoints,int levelset_type);
+ 		#endif
+ 
+-		#if defined(_HAVE_BAMG_) && !defined(_HAVE_ADOLC_)
++		#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+ 		void ReMeshBamg(int* pnewnumberofvertices,int* pnewnumberofelements,IssmDouble** pnewx,IssmDouble** pnewy,IssmDouble** pnewz,int** pnewelementslist);
+ 		void InitializeAdaptiveRefinementBamg(void);
+ 		void GethmaxVerticesFromZeroLevelSetDistance(IssmDouble* hmaxvertices,int levelset_type);
+@@ -198,7 +198,7 @@
+ 		void GetVerticeDistanceToZeroLevelSet(IssmDouble** pverticedistance,int leveset_type);
+ 		#endif
+ 
+-		#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_ADOLC_)
++		#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
+ 		void ReMeshNeopz(int* pnewnumberofvertices,int* pnewnumberofelements,IssmDouble** pnewx,IssmDouble** pnewy,IssmDouble** pnewz,int** pnewelementslist);
+ 		void InitializeAdaptiveRefinementNeopz(void);
+ 		void GetElementDistanceToZeroLevelSet(IssmDouble** pelementdistance,int levelset_type);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23254-23255.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23254-23255.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23254-23255.diff	(revision 23390)
@@ -0,0 +1,157 @@
+Index: ../trunk-jpl/src/c/shared/Elements/PrintArrays.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Elements/PrintArrays.cpp	(revision 23254)
++++ ../trunk-jpl/src/c/shared/Elements/PrintArrays.cpp	(revision 23255)
+@@ -11,7 +11,7 @@
+ 	}  
+ 	_printf_("\n");
+ }
+-#ifdef _HAVE_ADOLC_
++#ifdef _HAVE_AD_
+ void printarray(IssmDouble* array,int lines,int cols){
+ 	_printf_("\n");
+ 	for(int i=0;i<lines;i++){  
+Index: ../trunk-jpl/src/c/shared/Elements/elements.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Elements/elements.h	(revision 23254)
++++ ../trunk-jpl/src/c/shared/Elements/elements.h	(revision 23255)
+@@ -41,7 +41,7 @@
+ 
+ /*Print arrays*/
+ void printarray(IssmPDouble* array,int lines,int cols=1);
+-#if _HAVE_ADOLC_  && !defined(_WRAPPERS_)
++#if _HAVE_AD_  && !defined(_WRAPPERS_)
+ void printarray(IssmDouble* array,int lines,int cols=1);
+ #endif
+ void printarray(int* array,int lines,int cols=1);
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 23254)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 23255)
+@@ -134,7 +134,7 @@
+ }
+ void UpdateElementsAndMaterialsControlAD(Elements* elements,Parameters* parameters,Materials* materials, IoModel* iomodel){
+ 
+-	#if defined(_HAVE_ADOLC_)
++	#if defined(_HAVE_AD_)
+ 	/*Intermediaries*/
+ 	int				num_independent_objects,M,N,M_par,N_par;
+ 	char**			names                   = NULL;
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 23254)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 23255)
+@@ -77,7 +77,8 @@
+ 	for(int i=0; i<num_basins;i++){
+ 		IssmDouble val=sqrt(dmax_basin[i]/dist_max)*(maxbox-1);
+ 
+-		#ifdef _HAVE_ADOLC_
++		#ifdef _HAVE_AD_
++		_error_("Check the implementation of floor below");
+ 		/*Do not use floor when AD is on*/
+ 		int k=0; while(k<val+.5){k++;}
+ 		nd[i]=k;
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 23254)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 23255)
+@@ -20,7 +20,7 @@
+ /*PetscVec constructors and destructor*/
+ PetscVec::PetscVec(){/*{{{*/
+ 	this->vector=NULL;
+-	#ifdef _HAVE_ADOLC_
++	#ifdef _HAVE_AD_
+ 	this->avector=NULL;
+ 	#endif
+ }
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 23254)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 23255)
+@@ -20,7 +20,7 @@
+ /*PetscMat constructors and destructor*/
+ PetscMat::PetscMat(){/*{{{*/
+ 	this->matrix=NULL;
+-	#ifdef _HAVE_ADOLC_
++	#ifdef _HAVE_AD_
+ 	this->amatrix=NULL;
+ 	#endif
+ 
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h	(revision 23254)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h	(revision 23255)
+@@ -24,7 +24,7 @@
+ 	public:
+ 		Vec vector;
+ 
+-		#ifdef _HAVE_ADOLC_
++		#ifdef _HAVE_AD_
+ 		IssmDouble* avector;
+ 		#endif
+ 
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h	(revision 23254)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h	(revision 23255)
+@@ -26,7 +26,7 @@
+ 	public:
+ 		Mat matrix;
+ 
+-		#ifdef _HAVE_ADOLC_
++		#ifdef _HAVE_AD_
+ 		IssmDouble* amatrix;
+ 		#endif
+ 
+Index: ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 23254)
++++ ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 23255)
+@@ -615,7 +615,8 @@
+     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.pushExternalFunction(&MumpsSolve_codi_b, dataHandler, &MumpsSolve_codi_delete);
++    //tape.pushExternalFunctionHandle(&MumpsSolve_codi_b, dataHandler, &MumpsSolve_codi_delete);
+   } else {
+     // if the tape is active valueB is stored in the dataHandler and deleted in the reverse sweep
+     xDelete(valueB);
+Index: ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23254)
++++ ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23255)
+@@ -97,7 +97,7 @@
+ /*Dynamically return ISSM_MPI type from variable type */
+ template <class T> ISSM_MPI_Datatype TypeToMPIType(){assert(false);};
+ template <> inline ISSM_MPI_Datatype TypeToMPIType<IssmDouble>(){return ISSM_MPI_DOUBLE;};
+-#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_) 
++#if defined(_HAVE_AD_) && !defined(_WRAPPERS_) 
+ template <> inline ISSM_MPI_Datatype TypeToMPIType<IssmPDouble>(){return ISSM_MPI_PDOUBLE;};
+ #endif
+ template <> inline ISSM_MPI_Datatype TypeToMPIType<int>(){return ISSM_MPI_INT;};
+Index: ../trunk-jpl/src/c/cores/controlad_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlad_core.cpp	(revision 23254)
++++ ../trunk-jpl/src/c/cores/controlad_core.cpp	(revision 23255)
+@@ -10,6 +10,7 @@
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+ 
++/*This file is probably never used!*/
+ #if defined (_HAVE_M1QN3_)  & defined (_HAVE_ADOLC_)
+ /*m1qn3 prototypes {{{*/
+ extern "C" void *ctonbe_; // DIS mode : Conversion
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 23254)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 23255)
+@@ -1761,7 +1761,7 @@
+ 	int Xcount = 0;
+ 	if(X) Xcount=*pXcount;
+ 
+-	#ifdef _HAVE_ADOLC_ //cannot come here unless you are running AD mode, from DeclaredIndependents:
++	#ifdef _HAVE_AD_ //cannot come here unless you are running AD mode, from DeclaredIndependents:
+ 
+ 	/*Intermediaries*/
+ 	int M,N;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23255-23256.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23255-23256.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23255-23256.diff	(revision 23390)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/src/m/classes/geometry.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.py	(revision 23255)
++++ ../trunk-jpl/src/m/classes/geometry.py	(revision 23256)
+@@ -12,11 +12,11 @@
+ 	"""
+ 
+ 	def __init__(self): # {{{
+-		self.surface           = float('NaN')
+-		self.thickness         = float('NaN')
++		self.surface		= float('NaN')
++		self.thickness		= float('NaN')
+ 		self.base               = float('NaN')
+-		self.bed        = float('NaN')
+-		self.hydrostatic_ratio = float('NaN')
++		self.bed		= float('NaN')
++		self.hydrostatic_ratio	= float('NaN')
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+Index: ../trunk-jpl/src/m/qmu/preqmu.py
+===================================================================
+--- ../trunk-jpl/src/m/qmu/preqmu.py	(revision 23255)
++++ ../trunk-jpl/src/m/qmu/preqmu.py	(revision 23256)
+@@ -44,8 +44,9 @@
+ 		if os.path.isdir(qmudir):
+ 			raise RuntimeError('Existing '+str(options.qmudir)+' directory, cannot overwrite. Specify "overwrite","y" option in solve arguments.')
+ 	
+-
+-	os.makedirs(qmudir)
++	# os.makedirs() raises error when dir exists, matlab's mkdir() does not
++	if not os.path.isdir(qmudir):
++		os.makedirs(qmudir)
+ 	os.chdir(qmudir)
+ 
+ 	# when running in library mode, the in file needs to be called md.miscellaneous.name.qmu.in
Index: /issm/oecreview/Archive/23185-23389/ISSM-23256-23257.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23256-23257.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23256-23257.diff	(revision 23390)
@@ -0,0 +1,76 @@
+Index: ../trunk-jpl/test/NightlyRun/test420.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test420.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test420.py	(revision 23257)
+@@ -0,0 +1,71 @@
++#Test Name: SquareSheetShelfDakotaScaledResponse
++
++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 partitioner import *
++
++md = triangle(model(),'../Exp/Square.exp',200000.)
++md = setmask(md,'../Exp/SquareShelf.exp','')
++md = parameterize(md,'../Par/SquareSheetShelf.py')
++md = setflowequation(md,'SSA','all')
++md.cluster = generic('name',gethostname(),'np',3)
++
++#partitioning
++md.qmu.numberofpartitions = 10
++md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions)
++md.qmu.partition = md.qmu.partition-1
++md.qmu.isdakota = 1
++
++#Dakota options
++
++#dakota version
++version = IssmConfig('_DAKOTA_VERSION_')
++version = float(version[0])
++
++#variables
++md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01)
++
++#responses
++md.qmu.responses.MaxVel = response_function.response_function('scaled_Thickness',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
++
++#method
++md.qmu.method = dakota_method.dakota_method('nond_l')
++
++#parameters
++md.qmu.params.direct = True
++md.qmu.params.interval_type = 'forward'
++
++if version >= 6:
++	md.qmu.params.analysis_driver = 'matlab'
++	md.qmu.params.evaluation_scheduling = 'master'
++	md.qmu.params.processors_per_evaluation = 2
++else:
++	md.qmu.params.analysis_driver = 'stressbalance'
++	md.qmu.params.evaluation_concurrency = 1
++
++#imperative! 
++md.stressbalance.reltol = 10**-5 #tighten for qmu analysese
++
++#solve
++md.verbose = verbose('000000000')	# this line is recommended
++md = solve(md,'Stressbalance','overwrite','y')
++md.qmu.results = md.results.dakota
++
++#test on thickness
++h = np.zeros((md.qmu.numberofpartitions,))
++for i in range(md.qmu.numberofpartitions):
++	h[i] = md.qmu.results.dresp_out[i].mean
++
++#project onto grid
++thickness = h[(md.qmu.partition).flatten()]
++
++#Fields and tolerances to track changes
++field_names      = ['Thickness']
++field_tolerances = [1e-10]
++field_values     = [thickness]
Index: /issm/oecreview/Archive/23185-23389/ISSM-23257-23258.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23257-23258.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23257-23258.diff	(revision 23390)
@@ -0,0 +1,67 @@
+Index: ../trunk-jpl/test/NightlyRun/test417.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test417.py	(revision 23257)
++++ ../trunk-jpl/test/NightlyRun/test417.py	(revision 23258)
+@@ -87,7 +87,7 @@
+ md = solve(md,'Stressbalance','overwrite','y')
+ 
+ #Fields and tolerances to track changes
+-md.qmu.results = md.results.dakota;
++md.qmu.results = md.results.dakota
+ 
+ #ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
+ #we recover those mass fluxes through the mean of the response.
+@@ -103,4 +103,4 @@
+ 
+ field_names      = ['moments']
+ field_tolerances = [1e-11]
+-field_values = [md.results.dakota.montecarlo]
++field_values     = [md.results.dakota.montecarlo]
+Index: ../trunk-jpl/test/NightlyRun/test418.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test418.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test418.py	(revision 23258)
+@@ -0,0 +1,43 @@
++#Test Name: SquareSheetShelfDiadSSA3dDakotaAreaAverage
++
++# this test may crash
++
++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 partitioner import *
++from AreaAverageOntoPartition import *
++
++#test partitioning, and partition averaging
++# python cannot handle resolutions greater than 30010
++md = triangle(model(),'../Exp/Square.exp',30000.)
++#print md.mesh.numberofvertices
++md = setmask(md,'../Exp/SquareShelf.exp','')
++md = parameterize(md,'../Par/SquareSheetShelf.py')
++md = setflowequation(md,'SSA','all')
++md.cluster = generic('name',gethostname(),'np',3)
++
++#partitioning
++md.qmu.numberofpartitions = 100
++
++#corrupted size vs. prev_size
++#Aborted (core dumped)
++md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions)
++
++
++md.qmu.partition=md.qmu.partition-1
++
++vector = np.arange(1,1+md.mesh.numberofvertices,1).reshape(-1,1)
++# double check this before committing:
++#print 'before AreaAverageOntoPartition'
++vector_on_partition = AreaAverageOntoPartition(md,vector)
++vector_on_nodes = vector_on_partition[md.qmu.partition+1]
++
++field_names      = ['vector_on_nodes']
++field_tolerances = [1e-11]
++field_values     = [vector_on_nodes]
Index: /issm/oecreview/Archive/23185-23389/ISSM-23258-23259.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23258-23259.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23258-23259.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/linux64_ross_dakota
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_dakota	(revision 23258)
++++ ../trunk-jpl/jenkins/linux64_ross_dakota	(revision 23259)
+@@ -31,7 +31,7 @@
+ 
+ #PYTHON and MATLAB testing
+ MATLAB_TEST=1
+-PYTHON_TEST=0
++PYTHON_TEST=1
+ 
+ #-----------------------------------#
+ # 3: External packages installation #
Index: /issm/oecreview/Archive/23185-23389/ISSM-23259-23260.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23259-23260.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23259-23260.diff	(revision 23390)
@@ -0,0 +1,29 @@
+Index: ../trunk-jpl/jenkins/linux64_ross_python
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_python	(revision 23259)
++++ ../trunk-jpl/jenkins/linux64_ross_python	(revision 23260)
+@@ -13,7 +13,7 @@
+ 	--with-python-numpy-dir=/home/jenkins/.local/lib/python2.7/site-packages/numpy \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+ 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
+-	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi -lmpifort" \
++	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+@@ -20,7 +20,7 @@
+ 	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
+-	--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9/ -lgfortran" \
++	--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9 -lgfortran" \
+ 	--with-m1qn3-dir=$ISSM_DIR/externalpackages/m1qn3/install \
+ 	--with-numthreads=4 \
+ 	--enable-development \
+@@ -58,5 +58,5 @@
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+ #by Matlab and runme.m
+ #ex: "'id',[101 102 103]"
+-PYTHON_NROPTIONS="--exclude_name 'Dakota'"
++PYTHON_NROPTIONS="benchmark 'nightly' --exclude_name 'Dakota'"
+ MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
Index: /issm/oecreview/Archive/23185-23389/ISSM-23260-23261.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23260-23261.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23260-23261.diff	(revision 23390)
@@ -0,0 +1,11 @@
+Index: ../trunk-jpl/jenkins/linux64_ross_python
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_python	(revision 23260)
++++ ../trunk-jpl/jenkins/linux64_ross_python	(revision 23261)
+@@ -58,5 +58,5 @@
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+ #by Matlab and runme.m
+ #ex: "'id',[101 102 103]"
+-PYTHON_NROPTIONS="benchmark 'nightly' --exclude_name 'Dakota'"
++PYTHON_NROPTIONS="--exclude_name 'Dakota' --numprocs 1"
+ MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
Index: /issm/oecreview/Archive/23185-23389/ISSM-23261-23262.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23261-23262.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23261-23262.diff	(revision 23390)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/jenkins/linux64_ross_python
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_python	(revision 23261)
++++ ../trunk-jpl/jenkins/linux64_ross_python	(revision 23262)
+@@ -49,14 +49,14 @@
+ 
+ #number of cpus used in ISSM installation and compilation (one is usually
+ #safer as some packages are very sensitive to parallel compilation)
+-NUMCPUS_INSTALL=10
++NUMCPUS_INSTALL=5
+ 
+ #number of cpus used in the nightly runs.
+-NUMCPUS_RUN=5
++NUMCPUS_RUN=3
+ 
+ #Nightly run options. The matlab routine runme.m will be called
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+ #by Matlab and runme.m
+ #ex: "'id',[101 102 103]"
+-PYTHON_NROPTIONS="--exclude_name 'Dakota' --numprocs 1"
++PYTHON_NROPTIONS="--exclude_name 'Dakota'"
+ MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
Index: /issm/oecreview/Archive/23185-23389/ISSM-23262-23263.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23262-23263.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23262-23263.diff	(revision 23390)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/jenkins/linux64_ross_python
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_python	(revision 23262)
++++ ../trunk-jpl/jenkins/linux64_ross_python	(revision 23263)
+@@ -9,6 +9,7 @@
+ #ISSM CONFIGURATION
+ ISSM_CONFIG='--prefix=$ISSM_DIR \
+ 	--disable-static \
++	--with-matlab-dir=$MATLAB_PATH \
+ 	--with-python-dir=/usr \
+ 	--with-python-numpy-dir=/home/jenkins/.local/lib/python2.7/site-packages/numpy \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+@@ -27,7 +28,7 @@
+ 	--enable-debugging '
+ 
+ #PYTHON and MATLAB testing
+-MATLAB_TEST=0
++MATLAB_TEST=1
+ PYTHON_TEST=1
+ 
+ #-----------------------------------#
Index: /issm/oecreview/Archive/23185-23389/ISSM-23263-23264.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23263-23264.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23263-23264.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/linux64_ross_python
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_python	(revision 23263)
++++ ../trunk-jpl/jenkins/linux64_ross_python	(revision 23264)
+@@ -28,7 +28,7 @@
+ 	--enable-debugging '
+ 
+ #PYTHON and MATLAB testing
+-MATLAB_TEST=1
++MATLAB_TEST=0
+ PYTHON_TEST=1
+ 
+ #-----------------------------------#
Index: /issm/oecreview/Archive/23185-23389/ISSM-23264-23265.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23264-23265.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23264-23265.diff	(revision 23390)
@@ -0,0 +1,228 @@
+Index: ../trunk-jpl/src/m/classes/clusters/tetralith.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/tetralith.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/clusters/tetralith.m	(revision 23265)
+@@ -0,0 +1,216 @@
++%teralith class definition
++%
++%   Usage:
++%      cluster=tetralith();
++%      cluster=tetralith('np',3);
++%      cluster=tetralith('np',3,'login','username');
++
++classdef tetralith
++	properties (SetAccess=public)  
++		% {{{
++		name           = 'tetralith';
++		login          = '';
++		numnodes       = 2;
++		cpuspernode    = 32;
++		mem            = 2000; %MB
++		queue          = 'normal';
++		time           = 2*60; %[minutes]
++		codepath       = '';
++		executionpath  = '';
++		interactive    = 0;
++		port           = [];
++		accountname    = '';
++		% }}}
++	end
++	methods
++		function cluster=tetralith(varargin) % {{{
++
++			%initialize cluster using default settings if provided
++			if (exist('tetralith_settings')==2), tetralith_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('    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={'normal','devel'};
++			queue_requirements_time=[7*24*60 60]; 
++			queue_requirements_np=[1024 2*32];
++
++			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.cpuspernode;
++		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,'#!/bin/bash\n');
++			fprintf(fid,'#\n');
++			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
++% 			fprintf(fid,'#SBATCH -p %s \n',cluster.partition);
++			fprintf(fid,'#SBATCH -A %s \n',cluster.accountname);
++% 			fprintf(fid,'#SBATCH --mail-type=ALL\n');
++			fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
++			%calculate walltime in hh:mm:ss format
++			walltime=datestr(cluster.time/(60*24),'HH:MM:SS')
++			fprintf(fid,'#SBATCH -t %s\n',walltime); %walltime should be in hh:mm:ss
++			fprintf(fid,'#SBATCH --mem=%i\n',cluster.mem);
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
++% 			fprintf(fid,'module load intelcomp/17.0.0\n') %module load not recommended within job script at Tetralith
++% 			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,'export ISSM_DIR="%s"\n',cluster.codepath); %FIXME
++			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);
++% 			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
++			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++% 			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++			 if ~io_gather, %concatenate the output files:
++				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			 end
++			 fclose(fid);
++		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,'#!/bin/bash\n');
++			fprintf(fid,'#\n');
++			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
++% 			fprintf(fid,'#SBATCH -p %s \n',cluster.partition);
++			fprintf(fid,'#SBATCH -A %s \n',cluster.accountname);
++% 			fprintf(fid,'#SBATCH --mail-type=ALL\n');
++			fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
++			%calculate walltime in hh:mm:ss format
++			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
++			fprintf(fid,'#SBATCH -t %s\n',walltime); %walltime should be in hh:mm:ss
++			fprintf(fid,'#SBATCH --mem=%i\n',cluster.mem);
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
++% 			fprintf(fid,'module load intelcomp/17.0.0\n') %module load not recommended within job script at Tetralith
++% 			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,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++% 			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);
++			 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);
++
++			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 && sbatch ' 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/tetralith.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/23185-23389/ISSM-23265-23266.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23265-23266.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23265-23266.diff	(revision 23390)
@@ -0,0 +1,86 @@
+Index: ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 23265)
++++ ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 23266)
+@@ -479,9 +479,14 @@
+ #endif
+ 
+ #ifdef _HAVE_CODIPACK_
+-void MumpsSolve_codi_b(codi::DataStore* data) {/*{{{*/
++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;
+@@ -523,7 +528,11 @@
+   xDelete(adjX);
+ }
+ /*}}}*/
+-void MumpsSolve_codi_delete(codi::DataStore* data) {/*{{{*/
++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;
+@@ -615,8 +624,8 @@
+     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, dataHandler, &MumpsSolve_codi_delete);
++	 //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);
+Index: ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 23265)
++++ ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 23266)
+@@ -253,9 +253,13 @@
+ #endif
+ 
+ #ifdef _HAVE_CODIPACK_
+-void SolverxSeq_codi_b(codi::DataStore* data) {/*{{{*/
+-  IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
++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;
+@@ -290,7 +294,11 @@
+   xDelete(adjX);
+ }
+ /*}}}*/
+-void SolverxSeq_codi_delete(codi::DataStore* data) {/*{{{*/
++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;
+@@ -364,7 +372,7 @@
+     // store other arguments
+     dataHandler->addData(n);
+ 
+-    tape.pushExternalFunction(&SolverxSeq_codi_b, dataHandler, &SolverxSeq_codi_delete);
++    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);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23266-23267.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23266-23267.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23266-23267.diff	(revision 23390)
@@ -0,0 +1,359 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 23266)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 23267)
+@@ -102,8 +102,8 @@
+ 		#if defined(_HAVE_AD_) 
+ 
+ 	if(isautodiff){
+-#if _HAVE_ADOLC_
+-		/*Copy some parameters from IoModel to parameters dataset: {{{*/
++		#if defined(_HAVE_ADOLC_)
++		/*Copy some parameters from IoModel to parameters dataset*/
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.obufsize",AutodiffObufsizeEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.cbufsize",AutodiffCbufsizeEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.lbufsize",AutodiffLbufsizeEnum));
+@@ -110,8 +110,14 @@
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.tbufsize",AutodiffTbufsizeEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.gcTriggerRatio",AutodiffGcTriggerRatioEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.gcTriggerMaxSize",AutodiffGcTriggerMaxSizeEnum));
+-		/*}}}*/
+-#endif
++
++		#elif defined(_HAVE_CODIPACK_)
++		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.tapeAlloc",AutodiffTapeAllocEnum));
++
++		#else
++		_error_("not supported yet");
++		#endif
++
+ 		/*retrieve driver: {{{*/
+ 		iomodel->FindConstant(&autodiff_driver,"md.autodiff.driver");
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.driver",AutodiffDriverEnum));
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23266)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23267)
+@@ -10,7 +10,12 @@
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+ 
+-#if defined (_HAVE_M1QN3_) && defined(_HAVE_ADOLC_)
++#ifdef _HAVE_CODIPACK_
++extern CoDi_global codi_global;
++#include <sstream> // for output of the CoDiPack tape
++#endif
++
++#if defined (_HAVE_M1QN3_) && defined(_HAVE_AD_)
+ /*m1qn3 prototypes*/
+ extern "C" void *ctonbe_; // DIS mode : Conversion
+ extern "C" void *ctcabe_; // DIS mode : Conversion
+@@ -34,6 +39,7 @@
+ /*m1qm3 functions*/
+ void simul_starttrace(FemModel* femmodel){/*{{{*/
+ 
++	#if defined(_HAVE_ADOLC_)
+ 	/*Retrive ADOLC parameters*/
+ 	IssmDouble gcTriggerRatio;
+ 	IssmDouble gcTriggerMaxSize;
+@@ -56,7 +62,115 @@
+ 	int keepTaylors=1;
+ 	int my_rank=IssmComm::GetRank();
+ 	trace_on(my_rank,keepTaylors,reCast<size_t>(obufsize),reCast<size_t>(lbufsize),reCast<size_t>(cbufsize),reCast<size_t>(tbufsize),skipFileDeletion);
++
++	#elif defined(_HAVE_CODIPACK_)
++
++		//fprintf(stderr, "*** Codipack IoModel::StartTrace\n");
++		/*
++		 * FIXME codi
++		 * - ADOL-C variant uses fine grained tracing with various arguments
++		 * - 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();
++		tape_codi.setActive();
++		#if _AD_TAPE_ALLOC_
++		//alloc_profiler.Tag(StartInit, true);
++		IssmDouble x_t(1.0), y_t(1.0);
++		tape_codi.registerInput(y_t);
++		int codi_allocn = 0;
++		femmodel->parameters->FindParam(&codi_allocn,AutodiffTapeAllocEnum);
++		for(int i = 0;i < codi_allocn;++i) {
++			x_t = y_t * y_t;
++		}
++		/*
++		std::stringstream out_s;
++		IssmDouble::getGlobalTape().printStatistics(out_s);
++		_printf0_("StartTrace::Tape Statistics	   : TapeAlloc count=[" << codi_allocn << "]\n" << out_s.str());
++		*/
++		tape_codi.reset();
++		//alloc_profiler.Tag(FinishInit, true);
++		#endif
++
++	#else
++	_error_("not implemented");
++	#endif
+ }/*}}}*/
++void simul_stoptrace(){/*{{{*/
++
++	#if defined(_HAVE_ADOLC_)
++	trace_off();
++	if(VerboseAutodiff()){ /*{{{*/
++
++		#ifdef _HAVE_ADOLC_
++		int my_rank=IssmComm::GetRank();
++		size_t  tape_stats[15];
++		tapestats(my_rank,tape_stats); //reading of tape statistics
++		int commSize=IssmComm::GetSize();
++		int *sstats=new int[7];
++		sstats[0]=tape_stats[NUM_OPERATIONS];
++		sstats[1]=tape_stats[OP_FILE_ACCESS];
++		sstats[2]=tape_stats[NUM_LOCATIONS];
++		sstats[3]=tape_stats[LOC_FILE_ACCESS];
++		sstats[4]=tape_stats[NUM_VALUES];
++		sstats[5]=tape_stats[VAL_FILE_ACCESS];
++		sstats[6]=tape_stats[TAY_STACK_SIZE];
++		int *rstats=NULL;
++		if (my_rank==0) rstats=new int[commSize*7];
++		ISSM_MPI_Gather(sstats,7,ISSM_MPI_INT,rstats,7,ISSM_MPI_INT,0,IssmComm::GetComm());
++		if (my_rank==0) {
++			int offset=50;
++			int rOffset=(commSize/10)+1;
++			_printf_("   ADOLC statistics: \n");
++			_printf_("     "<<setw(offset)<<left<<"#independents: " <<setw(12)<<right<<tape_stats[NUM_INDEPENDENTS] << "\n");
++			_printf_("     "<<setw(offset)<<left<<"#dependents: " <<setw(12)<<right<<tape_stats[NUM_DEPENDENTS] << "\n");
++			_printf_("     "<<setw(offset)<<left<<"max #live active variables: " <<setw(12)<<right<<tape_stats[NUM_MAX_LIVES] << "\n");
++			_printf_("     operations: entry size "<< sizeof(unsigned char) << " Bytes \n");
++			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffObufsizeEnum) " <<setw(12)<<right<<tape_stats[OP_BUFFER_SIZE] << "\n");
++			for (int r=0;r<commSize;++r)
++			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+0] << (rstats[r*7+1]?" ->file":"") << "\n");
++			_printf_("     locations: entry size " << sizeof(locint) << " Bytes\n");
++			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffLbufsizeEnum) " <<setw(12)<<right<<tape_stats[LOC_BUFFER_SIZE] << "\n");
++			for (int r=0;r<commSize;++r)
++			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+2] << (rstats[r*7+3]?" ->file":"") << "\n");
++			_printf_("     constant values: entry size " << sizeof(double) << " Bytes\n");
++			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffCbufsizeEnum) " <<setw(12)<<right<<tape_stats[VAL_BUFFER_SIZE] << "\n");
++			for (int r=0;r<commSize;++r)
++			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+4] << (rstats[r*7+5]?" ->file":"") << "\n");
++			_printf_("     Taylor stack: entry size " << sizeof(revreal) << " Bytes\n");
++			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffTbufsizeEnum) " <<setw(12)<<right<<tape_stats[TAY_BUFFER_SIZE] << "\n");
++			for (int r=0;r<commSize;++r)
++			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+6] << (rstats[r*7+6]>tape_stats[TAY_BUFFER_SIZE]?" ->file":"") << "\n");
++			delete []rstats;
++		}
++		delete [] sstats;
++		#endif
++
++		#ifdef _HAVE_CODIPACK_
++		#ifdef _AD_TAPE_ALLOC_
++		//_printf_("Allocation time  P(" << my_rank << "): " << alloc_profiler.DeltaTime(StartInit, FinishInit) << "\n");
++		#endif
++		std::stringstream out_s;
++		IssmDouble::getGlobalTape().printStatistics(out_s);
++		_printf0_("CoDiPack Profiling::Tape Statistics :\n" << out_s.str());
++		#endif
++	} /*}}}*/
++
++	#elif defined(_HAVE_CODIPACK_)
++	auto& tape_codi = IssmDouble::getGlobalTape();
++	tape_codi.setPassive();
++	if(VerboseAutodiff()){
++		int my_rank=IssmComm::GetRank();
++		if(my_rank == 0) {
++			// FIXME codi "just because" for now
++			tape_codi.printStatistics(std::cout);
++			codi_global.print(std::cout);
++		}
++	}
++	#else
++	_error_("not implemented");
++	#endif
++}/*}}}*/
+ void simul_ad(long* indic,long* n,double* X,double* pf,double* G,long izs[1],float rzs[1],void* dzs){/*{{{*/
+ 
+ 	/*Get rank*/
+@@ -72,9 +186,8 @@
+ 	int N_add = 0;
+ 	int* control_enum = NULL;
+ 
+-	if (solution_type == TransientSolutionEnum){
+-		femmodel = input_struct->femmodel->copy();
+-	}
++	/*In transient, we need to make sure we do not modify femmodel at each iteration, make a copy*/
++	if(solution_type == TransientSolutionEnum) femmodel = input_struct->femmodel->copy();
+ 
+ 	IssmPDouble*  Jlist        = input_struct->Jlist;
+ 	int           JlistM       = input_struct->M;
+@@ -116,11 +229,25 @@
+ #else
+ 	IssmDouble* aX=xNew<IssmDouble>(intn);
+ #endif
++
++	#if defined(_HAVE_ADOLC_)
+ 	if(my_rank==0){
+ 		for(int i=0;i<intn;i++){
+ 			aX[i]<<=X[i];
+ 		}
+ 	}
++	#elif defined(_HAVE_CODIPACK_)
++	auto& tape_codi = IssmDouble::getGlobalTape();
++	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());
++		}
++	}
++	#else
++	_error_("not suppoted");
++	#endif
+ 
+ 	ISSM_MPI_Bcast(aX,intn,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+ 	SetControlInputsFromVectorx(femmodel,aX);
+@@ -154,73 +281,28 @@
+ 		DependentObject* dep=(DependentObject*)dependent_objects->GetObjectByOffset(i);
+ 		if(solution_type==TransientSolutionEnum) output_value = dep->GetValue();
+ 		if(solution_type!=TransientSolutionEnum) dep->Responsex(&output_value,femmodel);
+-		if (my_rank==0) {
++		if(my_rank==0) {
++
++			#if defined(_HAVE_CODIPACK_)
++			tape_codi.registerOutput(output_value);
++			dependents[i] = output_value.getValue();
++			codi_global.output_indices.push_back(output_value.getGradientData());
++
++			#elif defined(_HAVE_ADOLC_)
+ 			output_value>>=dependents[i];
++
++			#else
++			_error_("not suppoted");
++			#endif
+ 			J+=output_value;
+ 		}
+ 	}
+ 
+ 	/*Turning off trace tape*/
+-	trace_off();
++	simul_stoptrace();
+ 	//time_t now = time(NULL);
+ 	//if(my_rank==0) _printf_("\nTIME: "<<now<<"\n");
+ 
+-	/*Print tape statistics so that user can kill this run if something is off already:*/
+-	if(VerboseAutodiff()){ /*{{{*/
+-
+-		#ifdef _HAVE_ADOLC_
+-		size_t  tape_stats[15];
+-		tapestats(my_rank,tape_stats); //reading of tape statistics
+-		int commSize=IssmComm::GetSize();
+-		int *sstats=new int[7];
+-		sstats[0]=tape_stats[NUM_OPERATIONS];
+-		sstats[1]=tape_stats[OP_FILE_ACCESS];
+-		sstats[2]=tape_stats[NUM_LOCATIONS];
+-		sstats[3]=tape_stats[LOC_FILE_ACCESS];
+-		sstats[4]=tape_stats[NUM_VALUES];
+-		sstats[5]=tape_stats[VAL_FILE_ACCESS];
+-		sstats[6]=tape_stats[TAY_STACK_SIZE];
+-		int *rstats=NULL;
+-		if (my_rank==0) rstats=new int[commSize*7];
+-		ISSM_MPI_Gather(sstats,7,ISSM_MPI_INT,rstats,7,ISSM_MPI_INT,0,IssmComm::GetComm());
+-		if (my_rank==0) {
+-			int offset=50;
+-			int rOffset=(commSize/10)+1;
+-			_printf_("   ADOLC statistics: \n");
+-			_printf_("     "<<setw(offset)<<left<<"#independents: " <<setw(12)<<right<<tape_stats[NUM_INDEPENDENTS] << "\n");
+-			_printf_("     "<<setw(offset)<<left<<"#dependents: " <<setw(12)<<right<<tape_stats[NUM_DEPENDENTS] << "\n");
+-			_printf_("     "<<setw(offset)<<left<<"max #live active variables: " <<setw(12)<<right<<tape_stats[NUM_MAX_LIVES] << "\n");
+-			_printf_("     operations: entry size "<< sizeof(unsigned char) << " Bytes \n");
+-			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffObufsizeEnum) " <<setw(12)<<right<<tape_stats[OP_BUFFER_SIZE] << "\n");
+-			for (int r=0;r<commSize;++r)
+-			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+0] << (rstats[r*7+1]?" ->file":"") << "\n");
+-			_printf_("     locations: entry size " << sizeof(locint) << " Bytes\n");
+-			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffLbufsizeEnum) " <<setw(12)<<right<<tape_stats[LOC_BUFFER_SIZE] << "\n");
+-			for (int r=0;r<commSize;++r)
+-			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+2] << (rstats[r*7+3]?" ->file":"") << "\n");
+-			_printf_("     constant values: entry size " << sizeof(double) << " Bytes\n");
+-			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffCbufsizeEnum) " <<setw(12)<<right<<tape_stats[VAL_BUFFER_SIZE] << "\n");
+-			for (int r=0;r<commSize;++r)
+-			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+4] << (rstats[r*7+5]?" ->file":"") << "\n");
+-			_printf_("     Taylor stack: entry size " << sizeof(revreal) << " Bytes\n");
+-			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffTbufsizeEnum) " <<setw(12)<<right<<tape_stats[TAY_BUFFER_SIZE] << "\n");
+-			for (int r=0;r<commSize;++r)
+-			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+6] << (rstats[r*7+6]>tape_stats[TAY_BUFFER_SIZE]?" ->file":"") << "\n");
+-			delete []rstats;
+-		}
+-		delete [] sstats;
+-		#endif
+-
+-		#ifdef _HAVE_CODIPACK_
+-		#ifdef _AD_TAPE_ALLOC_
+-		//_printf_("Allocation time  P(" << my_rank << "): " << alloc_profiler.DeltaTime(StartInit, FinishInit) << "\n");
+-		#endif
+-		std::stringstream out_s;
+-		IssmDouble::getGlobalTape().printStatistics(out_s);
+-		_printf0_("CoDiPack Profiling::Tape Statistics :\n" << out_s.str());
+-		#endif
+-	} /*}}}*/
+-
+ 	/*diverse: */
+ 	int  dummy;
+ 	int  num_independents=0;
+@@ -246,6 +328,9 @@
+ 		num_independents = 0;
+ 	}
+ 
++	#if defined(_HAVE_ADOLC_)
++	/*Get gradient for ADOLC {{{*/
++
+ 	/*get the EDF pointer:*/
+ 	ext_diff_fct *anEDF_for_solverx_p=xDynamicCast<GenericParam<Adolc_edf> * >(femmodel->parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p;
+ 
+@@ -289,7 +374,42 @@
+ 		xDelete(weightVectorTimesJac);
+ 		xDelete(aWeightVector);
+ 	}
++	/*}}}*/
++	#elif defined(_HAVE_CODIPACK_)
++	/*Get gradient for CoDiPack{{{*/
++	if(VerboseAutodiff())_printf0_("   CoDiPack fos_reverse\n");
++	int     aDepIndex=0; /*FIXME: do we really need this?*/
+ 
++	/*retrieve direction index: */
++	femmodel->parameters->FindParam(&aDepIndex,AutodiffFosReverseIndexEnum);
++	if (my_rank==0) {
++		if (aDepIndex<0 || aDepIndex>=num_dependents || codi_global.output_indices.size() <= aDepIndex){
++			_error_("index value for AutodiffFosReverseIndexEnum should be in [0,num_dependents-1]");
++		}
++		tape_codi.setGradient(codi_global.output_indices[aDepIndex], 1.0);
++	}
++	tape_codi.evaluate();
++
++	weightVectorTimesJac=xNew<double>(num_independents);
++	/*call driver: */
++	auto in_size = codi_global.input_indices.size();
++	for(size_t i = 0; i < in_size; ++i) {
++		weightVectorTimesJac[i] = tape_codi.getGradient(codi_global.input_indices[i]);
++	}
++
++	/*Add to totalgradient: */
++	totalgradient=xNewZeroInit<IssmPDouble>(num_independents_old);
++	if(my_rank==0) for(int i=0;i<num_independents;i++) {
++		totalgradient[i]+=weightVectorTimesJac[i];
++	}
++
++	/*free resources :*/
++	xDelete(weightVectorTimesJac);
++	/*}}}*/
++	#else
++	_error_("not suppoted");
++	#endif
++
+ 	/*Broadcast gradient to other ranks*/
+ 	ISSM_MPI_Bcast(totalgradient,num_independents_old,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
+ 	/*Check size of Jlist to avoid crashes*/
+@@ -550,5 +670,5 @@
+ }/*}}}*/
+ 
+ #else
+-void controladm1qn3_core(FemModel* femmodel){_error_("M1QN3 or ADOLC not installed");}
++void controladm1qn3_core(FemModel* femmodel){_error_("M1QN3 or ADOLC/CoDiPack not installed");}
+ #endif //_HAVE_M1QN3_
Index: /issm/oecreview/Archive/23185-23389/ISSM-23267-23268.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23267-23268.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23267-23268.diff	(revision 23390)
@@ -0,0 +1,219 @@
+Index: ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23267)
++++ ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23268)
+@@ -11,7 +11,7 @@
+ #include "../solutionsequences/solutionsequences.h"
+ 
+ #if defined (_HAVE_M1QN3_) && !defined(_HAVE_AD_)
+-/*m1qn3 prototypes*/
++/*m1qn3 prototypes {{{*/
+ extern "C" void *ctonbe_; // DIS mode : Conversion
+ extern "C" void *ctcabe_; // DIS mode : Conversion
+ extern "C" void *euclid_; // Scalar product
+@@ -33,8 +33,9 @@
+ 	int         N;
+ 	int*        i;
+ } m1qn3_struct;
++/*}}}*/
+ 
+-void controlm1qn3_core(FemModel* femmodel){
++void controlm1qn3_core(FemModel* femmodel){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	long         omode;
+@@ -172,11 +173,9 @@
+ 	xDelete<double>(scaling_factors);
+ 	xDelete<double>(mystruct.Jlist);
+ 	xDelete<int>(mystruct.i);
+-}
++}/*}}}*/
++void simul(long* indic,long* n,double* X,double* pf,double* G,long izs[1],float rzs[1],void* dzs){/*{{{*/
+ 
+-/*Cost function definition*/
+-void simul(long* indic,long* n,double* X,double* pf,double* G,long izs[1],float rzs[1],void* dzs){
+-
+ 	/*Recover Arguments*/
+ 	m1qn3_struct *input_struct = (m1qn3_struct*)dzs;
+ 	FemModel     *femmodel     = input_struct->femmodel;
+@@ -277,10 +276,8 @@
+ 	xDelete<IssmDouble>(XU);
+ 	xDelete<IssmDouble>(XL);
+ 	xDelete<IssmDouble>(scaling_factors);
+-}
++}/*}}}*/
+ 
+ #else
+-void controlm1qn3_core(FemModel* femmodel){
+-	_error_("M1QN3 not installed");
+-}
++void controlm1qn3_core(FemModel* femmodel){_error_("M1QN3 not installed");}
+ #endif //_HAVE_M1QN3_
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23267)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23268)
+@@ -16,7 +16,7 @@
+ #endif
+ 
+ #if defined (_HAVE_M1QN3_) && defined(_HAVE_AD_)
+-/*m1qn3 prototypes*/
++/*m1qn3 prototypes {{{*/
+ extern "C" void *ctonbe_; // DIS mode : Conversion
+ extern "C" void *ctcabe_; // DIS mode : Conversion
+ extern "C" void *euclid_; // Scalar product
+@@ -35,6 +35,7 @@
+ 	int          N;
+ 	int*         i;
+ } m1qn3_struct;
++/*}}}*/
+ 
+ /*m1qm3 functions*/
+ void simul_starttrace(FemModel* femmodel){/*{{{*/
+@@ -90,6 +91,8 @@
+ 		*/
+ 		tape_codi.reset();
+ 		//alloc_profiler.Tag(FinishInit, true);
++		#else
++		tape_codi.reset();
+ 		#endif
+ 
+ 	#else
+@@ -180,11 +183,8 @@
+ 	m1qn3_struct *input_struct = (m1qn3_struct*)dzs;
+ 
+ 	FemModel* femmodel = input_struct->femmodel;
+-	int num_responses,num_controls,numberofvertices,solution_type;
++	int num_responses,num_controls,solution_type;
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+-	int* N = NULL;
+-	int N_add = 0;
+-	int* control_enum = NULL;
+ 
+ 	/*In transient, we need to make sure we do not modify femmodel at each iteration, make a copy*/
+ 	if(solution_type == TransientSolutionEnum) femmodel = input_struct->femmodel->copy();
+@@ -196,13 +196,15 @@
+ 	int           intn         = (int)*n;
+ 
+ 	/*Recover some parameters*/
+-	IssmDouble* scaling_factors = NULL;
++	IssmDouble *scaling_factors = NULL;
++	int        *N               = NULL;
++	int        *control_enum    = NULL;
+ 	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+ 	femmodel->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+ 	femmodel->parameters->FindParam(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
+ 	femmodel->parameters->FindParam(&N,NULL,ControlInputSizeNEnum);
+ 	femmodel->parameters->FindParam(&control_enum,NULL,InversionControlParametersEnum);
+-	numberofvertices=femmodel->vertices->NumberOfVertices();
++	int numberofvertices=femmodel->vertices->NumberOfVertices();
+ 
+ 	/*Constrain input vector and update controls*/
+ 	double  *XL = NULL;
+@@ -210,7 +212,7 @@
+ 	GetPassiveVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+ 	GetPassiveVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+ 
+-	N_add = 0;
++	int N_add = 0;
+ 	for (int c=0;c<num_controls;c++){
+ 		for(int i=0;i<numberofvertices*N[c];i++){
+ 			int index = N_add*numberofvertices+i;
+@@ -303,20 +305,12 @@
+ 	//time_t now = time(NULL);
+ 	//if(my_rank==0) _printf_("\nTIME: "<<now<<"\n");
+ 
+-	/*diverse: */
+-	int  dummy;
+-	int  num_independents=0;
+-
+ 	/*intermediary: */
++	int          num_independents=intn;
+ 	IssmPDouble *aWeightVector=NULL;
+ 	IssmPDouble *weightVectorTimesJac=NULL;
++	IssmPDouble *totalgradient=xNewZeroInit<IssmPDouble>(num_independents);
+ 
+-	/*output: */
+-	IssmPDouble *totalgradient=NULL;
+-
+-	/*retrieve parameters: */
+-	num_independents = intn;
+-
+ 	/*if no dependents, no point in running a driver: */
+ 	if(!(num_dependents*num_independents)) _error_("this is not allowed");
+ 
+@@ -340,8 +334,6 @@
+ 
+ 	/* Ok, now we are going to call the fos_reverse in a loop on the index, from 0 to num_dependents, so
+ 	 * as to generate num_dependents gradients: */
+-	totalgradient=xNewZeroInit<IssmPDouble>(num_independents_old);
+-
+ 	for(int aDepIndex=0;aDepIndex<num_dependents_old;aDepIndex++){
+ 
+ 		/*initialize direction index in the weights vector: */
+@@ -378,33 +370,29 @@
+ 	#elif defined(_HAVE_CODIPACK_)
+ 	/*Get gradient for CoDiPack{{{*/
+ 	if(VerboseAutodiff())_printf0_("   CoDiPack fos_reverse\n");
+-	int     aDepIndex=0; /*FIXME: do we really need this?*/
+ 
+-	/*retrieve direction index: */
+-	femmodel->parameters->FindParam(&aDepIndex,AutodiffFosReverseIndexEnum);
+-	if (my_rank==0) {
+-		if (aDepIndex<0 || aDepIndex>=num_dependents || codi_global.output_indices.size() <= aDepIndex){
+-			_error_("index value for AutodiffFosReverseIndexEnum should be in [0,num_dependents-1]");
+-		}
+-		tape_codi.setGradient(codi_global.output_indices[aDepIndex], 1.0);
+-	}
+-	tape_codi.evaluate();
++	/* call the fos_reverse in a loop on the index, from 0 to num_dependents, so
++	 * as to generate num_dependents gradients: */
++	for(int aDepIndex=0;aDepIndex<num_dependents_old;aDepIndex++){
+ 
+-	weightVectorTimesJac=xNew<double>(num_independents);
+-	/*call driver: */
+-	auto in_size = codi_global.input_indices.size();
+-	for(size_t i = 0; i < in_size; ++i) {
+-		weightVectorTimesJac[i] = tape_codi.getGradient(codi_global.input_indices[i]);
+-	}
++		/*initialize direction index in the weights vector: */
++		aWeightVector=xNewZeroInit<IssmPDouble>(num_dependents);
++		if(my_rank==0)  tape_codi.setGradient(codi_global.output_indices[aDepIndex],1.0);
++		tape_codi.evaluate();
+ 
+-	/*Add to totalgradient: */
+-	totalgradient=xNewZeroInit<IssmPDouble>(num_independents_old);
+-	if(my_rank==0) for(int i=0;i<num_independents;i++) {
+-		totalgradient[i]+=weightVectorTimesJac[i];
++		/*Get gradient for this dependent */
++		weightVectorTimesJac=xNew<IssmPDouble>(num_independents);
++		auto in_size = codi_global.input_indices.size();
++		for(size_t i = 0; i < in_size; ++i) {
++			weightVectorTimesJac[i] = tape_codi.getGradient(codi_global.input_indices[i]);
++		}
++		if(my_rank==0) for(int i=0;i<num_independents;i++) {
++			totalgradient[i]+=weightVectorTimesJac[i];
++		}
++		/*free resources :*/
++		xDelete(weightVectorTimesJac);
++		xDelete(aWeightVector);
+ 	}
+-
+-	/*free resources :*/
+-	xDelete(weightVectorTimesJac);
+ 	/*}}}*/
+ 	#else
+ 	_error_("not suppoted");
+@@ -425,12 +413,6 @@
+ 	for(int i=0;i<num_responses;i++) Jlist[(*Jlisti)*JlistN+i] = reCast<IssmPDouble>(dependents[i]);
+ 	Jlist[(*Jlisti)*JlistN+num_responses] = reCast<IssmPDouble>(J);
+ 
+-/*
+-	IssmDouble* test = xNew<IssmDouble>(intn);
+-	femmodel->parameters->FindParam(&test,NULL,InversionXBestEnum);
+-	for(int i=0;i<10;i++)_printf_("X "<<test[i]<<"\n");
+-	xDelete<IssmDouble>(intn);
+-*/
+ 	if(*indic==0){
+ 		/*dry run, no gradient required*/
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23268-23269.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23268-23269.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23268-23269.diff	(revision 23390)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.py	(revision 23268)
++++ ../trunk-jpl/test/NightlyRun/runme.py	(revision 23269)
+@@ -81,26 +81,21 @@
+ 	#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')
+-	#print 'list_ids =',list_ids
+ 
+ 	i1,i2=parallelrange(rank,numprocs,len(list_ids))    #Get tests for this cpu only
+ 	list_ids=list_ids[i1:i2+1]
+-	#print 'list_ids after parallelrange =',list_ids
+ 	
+-	if id:
++	if np.size(id) > 0:
+ 		test_ids = set(GetIds(id)).intersection(set(list_ids))
+ 	else:
+ 		# if no tests are specifically provided, do them all
+ 		test_ids = set(list_ids)
+ 		
+-	#print 'test_ids after list =',test_ids
+ 	# }}}
+ 	#GET exclude {{{
+ 	exclude_ids = GetIds(exclude)
+ 
+ 	test_ids=test_ids.difference(exclude_ids)
+-	#print 'test_ids after exclude =',sorted(test_ids)
+-	#return
+ 	# }}}
+ 	#Process Ids according to benchmarks {{{
+ 	if benchmark=='nightly':
+@@ -123,10 +118,8 @@
+ 		test_ids=test_ids.intersection(set(range(2001,2500)))
+ 	elif benchmark=='adolc':
+ 		test_ids=test_ids.intersection(set(range(3001,3200)))
+-	#print 'test_ids after benchmark =',test_ids
+ 	test_ids=list(test_ids)
+ 	test_ids.sort()
+-	#print 'test_ids after sort =',test_ids
+ 	# }}}
+ 
+ 	#Loop over tests and launch sequence
Index: /issm/oecreview/Archive/23185-23389/ISSM-23269-23270.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23269-23270.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23269-23270.diff	(revision 23390)
@@ -0,0 +1,64 @@
+Index: ../trunk-jpl/src/m/partition/AreaAverageOntoPartition.py
+===================================================================
+--- ../trunk-jpl/src/m/partition/AreaAverageOntoPartition.py	(nonexistent)
++++ ../trunk-jpl/src/m/partition/AreaAverageOntoPartition.py	(revision 23270)
+@@ -0,0 +1,59 @@
++import numpy as np
++
++def AreaAverageOntoPartition(md,vector,layer=None):
++	'''AREAAVERAGEONTOPARTITION 
++   compute partition values for a certain vector expressed on the vertices of the mesh.
++   Use area weighted average.
++
++   Usage:
++      average=AreaAverageOntoPartition(md,vector)
++      average=AreaAverageOntoPartition(md,vector,layer) #if in 3D, chose which layer is partitioned
++'''
++	#some checks
++	if len(np.shape(md.mesh)) == 3:
++		if layer == None:
++			raise RuntimeError('AreaAverageOntoPartition: layer should be provided onto which Area Averaging occurs')
++		
++		#save 3D model
++		md3d = md
++
++		md.mesh.elements = md.mesh.elements2d
++		md.mesh.x = md.mesh.x2d
++		md.mesh.y = md.mesh.y2d
++		md.mesh.numberofvertices = md.mesh.numberofvertices2d
++		md.mesh.numberofelements = md.mesh.numberofelements2d
++		md.qmu.vertex_weight = []
++		md.mesh.vertexconnectivity = []
++
++		#run connectivity routine
++		md = adjacency(md)
++
++		#finally, project vector: 
++		vector = project2d(md3d,vector,layer)
++		md.qmu.partition = project2d(md3d,md3d.qmu.partition,layer)
++
++
++	#ok, first check that part is Matlab indexed
++	#part = md.qmu.partition
++
++	#some check: 
++	if md.qmu.numberofpartitions != max(md.qmu.partition):
++		raise RuntimeError('AreaAverageOntoPartition error message: ''npart'' should be equal to max(md.qmu.partition)')
++
++
++	#initialize output
++	partvector = np.zeros((max(md.qmu.partition),))
++
++	#start weight average
++	weightedvector = vector*md.qmu.vertex_weight
++	for i in range(max(md.qmu.partition)):
++		pos=np.where(md.qmu.partition==i)
++		partvector[i]=sum(weightedvector[pos])/sum(md.qmu.vertex_weight[pos])
++
++
++	#in 3D, restore 3D model:
++	if len(np.shape(md.mesh)) == 3:
++		md = md3d
++
++	return partvector
++
Index: /issm/oecreview/Archive/23185-23389/ISSM-23270-23271.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23270-23271.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23270-23271.diff	(revision 23390)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/test/NightlyRun/test2084.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23270)
++++ ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23271)
+@@ -113,7 +113,7 @@
+ %md=solve(md,'lv');
+ %
+ %field_names     ={field_names{:},'LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart'};
+-%field_tolerances={field_tolerances{:},6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7};
++%field_tolerances={field_tolerances{:},2e-6,2e-6,2e-6,2e-6,2e-6,2e-6,2e-6,2e-6,2e-6};
+ %field_values={field_values{:},...
+ %	(md.results.LoveSolution.LoveHr(:,1)),...
+ %	(md.results.LoveSolution.LoveKr(:,1)),...
+@@ -145,7 +145,7 @@
+ md.love.nfreq=length(md.love.frequencies);
+ 
+ field_names     ={field_names{:},'LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart'};
+-field_tolerances={field_tolerances{:},6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7};
++field_tolerances={field_tolerances{:},2e-6,2e-6,2e-6,2e-6,2e-6,2e-6,2e-6,2e-6,2e-6};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,1)),...
+ 	(md.results.LoveSolution.LoveKr(:,1)),...
+Index: ../trunk-jpl/test/NightlyRun/test2084.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.py	(revision 23270)
++++ ../trunk-jpl/test/NightlyRun/test2084.py	(revision 23271)
+@@ -187,7 +187,7 @@
+ md.love.nfreq=len(md.love.frequencies)
+ 
+ field_names+=['LoveH_loadingVSS96_elastic','LoveK_loadingVSS96_elastic','LoveL_loadingVSS96_elastic','LoveH_loadingVSS96_realpart','LoveK_loadingVSS96_realpart','LoveL_loadingVSS96_realpart','LoveH_loadingVSS96_imagpart','LoveK_loadingVSS96_imagpart','LoveL_loadingVSS96_imagpart']
+-field_tolerances+=[6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7,6e-7]
++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],
Index: /issm/oecreview/Archive/23185-23389/ISSM-23271-23272.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23271-23272.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23271-23272.diff	(revision 23390)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test2084.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.py	(revision 23271)
++++ ../trunk-jpl/test/NightlyRun/test2084.py	(revision 23272)
+@@ -88,7 +88,7 @@
+ 
+ #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+=[3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6]
++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],
+Index: ../trunk-jpl/test/NightlyRun/test2084.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23271)
++++ ../trunk-jpl/test/NightlyRun/test2084.m	(revision 23272)
+@@ -73,7 +73,7 @@
+ 
+ %tidal love numbers
+ field_names     ={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={field_tolerances{:},3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6,3e-6};
++field_tolerances={field_tolerances{:},8e-6,8e-6,8e-6,8e-6,8e-6,8e-6,8e-6,8e-6,8e-6};
+ field_values={field_values{:},...
+ 	(md.results.LoveSolution.LoveHr(:,1)),...
+ 	(md.results.LoveSolution.LoveKr(:,1)),...
Index: /issm/oecreview/Archive/23185-23389/ISSM-23272-23273.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23272-23273.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23272-23273.diff	(revision 23390)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/jenkins/macosx_pine-island_dakota
+===================================================================
+--- ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23272)
++++ ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23273)
+@@ -6,7 +6,7 @@
+ #MATLAB path
+ MATLAB_PATH="/Applications/MATLAB_R2015b.app/"
+ 
+-#ISSM CONFIGURATION 
++#ISSM CONFIGURATION
+ ISSM_CONFIG='--prefix=$ISSM_DIR \
+ 	--with-matlab-dir=$MATLAB_PATH \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+@@ -26,7 +26,7 @@
+ 
+ #PYTHON and MATLAB testing
+ MATLAB_TEST=1
+-PYTHON_TEST=0
++PYTHON_TEST=1
+ 
+ #-----------------------------------#
+ # 3: External packages installation #
+@@ -58,6 +58,6 @@
+ #Nightly run options. The matlab routine runme.m will be called
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+ #by Matlab and runme.m
+-#ex: "'id',[101 102 103]"  ERRORS ARE LARGE FOR: 418 420 
+-PYTHON_NROPTIONS=""
++#ex: "'id',[101 102 103]"  ERRORS ARE LARGE FOR: 418 420
++PYTHON_NROPTIONS="--exclude 119 243 514 701 702 703 234 235 418 420 --include_name 'Dakota'"
+ MATLAB_NROPTIONS="'exclude',[119,243,514,701,702,703,234,235,418,420]"
Index: /issm/oecreview/Archive/23185-23389/ISSM-23273-23274.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23273-23274.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23273-23274.diff	(revision 23390)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/jenkins/macosx_pine-island_dakota
+===================================================================
+--- ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23273)
++++ ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23274)
+@@ -26,7 +26,7 @@
+ 
+ #PYTHON and MATLAB testing
+ MATLAB_TEST=1
+-PYTHON_TEST=1
++PYTHON_TEST=0
+ 
+ #-----------------------------------#
+ # 3: External packages installation #
+@@ -59,5 +59,5 @@
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+ #by Matlab and runme.m
+ #ex: "'id',[101 102 103]"  ERRORS ARE LARGE FOR: 418 420
+-PYTHON_NROPTIONS="--exclude 119 243 514 701 702 703 234 235 418 420 --include_name 'Dakota'"
++PYTHON_NROPTIONS=""
+ MATLAB_NROPTIONS="'exclude',[119,243,514,701,702,703,234,235,418,420]"
Index: /issm/oecreview/Archive/23185-23389/ISSM-23274-23275.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23274-23275.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23274-23275.diff	(revision 23390)
@@ -0,0 +1,133 @@
+Index: ../trunk-jpl/jenkins/macosx_pine-island_dakota_static
+===================================================================
+--- ../trunk-jpl/jenkins/macosx_pine-island_dakota_static	(revision 23274)
++++ ../trunk-jpl/jenkins/macosx_pine-island_dakota_static	(revision 23275)
+@@ -3,9 +3,9 @@
+ #-------------------------------#
+ 
+ #MATLAB path
+-MATLAB_PATH="/Applications/MATLAB_R2015b.app/"
++MATLAB_PATH="/Applications/MATLAB_R2015b.app"
+ 
+-#ISSM CONFIGURATION 
++#ISSM CONFIGURATION
+ ISSM_CONFIG='--prefix=$ISSM_DIR \
+ 	--disable-static \
+ 	--enable-standalone-executables \
+@@ -55,12 +55,12 @@
+ NUMCPUS_INSTALL=4
+ 
+ #number of cpus used in the nightly runs.
+-NUMCPUS_RUN=2
++NUMCPUS_RUN=4
+ 
+ #Nightly run options. The matlab routine runme.m will be called
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+ #by Matlab and runme.m
+ #ex: "'id',[101 102 103]"
+-##                           bamg mesh   FS                     
++##                           bamg mesh   FS
+ #PYTHON_NROPTIONS="--exclude_name 'Dakota'"
+ #MATLAB_NROPTIONS="'exclude',[243,701,702,703,435,IdFromString('Dakota')]"
+Index: ../trunk-jpl/jenkins/macosx_pine-island_examples
+===================================================================
+--- ../trunk-jpl/jenkins/macosx_pine-island_examples	(revision 23274)
++++ ../trunk-jpl/jenkins/macosx_pine-island_examples	(revision 23275)
+@@ -4,9 +4,9 @@
+ #-------------------------------#
+ 
+ #MATLAB path
+-MATLAB_PATH="/Applications/MATLAB_R2015b.app/"
++MATLAB_PATH="/Applications/MATLAB_R2015b.app"
+ 
+-#ISSM CONFIGURATION 
++#ISSM CONFIGURATION
+ ISSM_CONFIG='--prefix=$ISSM_DIR \
+ 	--with-matlab-dir=$MATLAB_PATH \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+Index: ../trunk-jpl/jenkins/macosx_pine-island
+===================================================================
+--- ../trunk-jpl/jenkins/macosx_pine-island	(revision 23274)
++++ ../trunk-jpl/jenkins/macosx_pine-island	(revision 23275)
+@@ -4,7 +4,7 @@
+ #-------------------------------#
+ 
+ #MATLAB path
+-MATLAB_PATH="/Applications/MATLAB_R2015b.app/"
++MATLAB_PATH="/Applications/MATLAB_R2015b.app"
+ 
+ #ISSM CONFIGURATION
+ ISSM_CONFIG='--prefix=$ISSM_DIR \
+@@ -47,7 +47,7 @@
+ NUMCPUS_INSTALL=4
+ 
+ #number of cpus used in the nightly runs.
+-NUMCPUS_RUN=2
++NUMCPUS_RUN=4
+ 
+ #Nightly run options. The matlab routine runme.m will be called
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+Index: ../trunk-jpl/jenkins/macosx_pine-island_static
+===================================================================
+--- ../trunk-jpl/jenkins/macosx_pine-island_static	(revision 23274)
++++ ../trunk-jpl/jenkins/macosx_pine-island_static	(revision 23275)
+@@ -4,7 +4,7 @@
+ #-------------------------------#
+ 
+ #MATLAB path
+-MATLAB_PATH="/Applications/MATLAB_R2015b.app/"
++MATLAB_PATH="/Applications/MATLAB_R2015b.app"
+ 
+ #ISSM CONFIGURATION
+ ISSM_CONFIG='--prefix=$ISSM_DIR \
+@@ -54,7 +54,7 @@
+ NUMCPUS_INSTALL=4
+ 
+ #number of cpus used in the nightly runs.
+-NUMCPUS_RUN=2
++NUMCPUS_RUN=4
+ 
+ #Nightly run options. The matlab routine runme.m will be called
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+Index: ../trunk-jpl/jenkins/macosx_pine-island_dakota
+===================================================================
+--- ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23274)
++++ ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23275)
+@@ -4,11 +4,13 @@
+ #-------------------------------#
+ 
+ #MATLAB path
+-MATLAB_PATH="/Applications/MATLAB_R2015b.app/"
++MATLAB_PATH="/Applications/MATLAB_R2015b.app"
+ 
+ #ISSM CONFIGURATION
+ ISSM_CONFIG='--prefix=$ISSM_DIR \
+ 	--with-matlab-dir=$MATLAB_PATH \
++	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 \
++	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+ 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
+ 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi" \
+@@ -26,7 +28,7 @@
+ 
+ #PYTHON and MATLAB testing
+ MATLAB_TEST=1
+-PYTHON_TEST=0
++PYTHON_TEST=1
+ 
+ #-----------------------------------#
+ # 3: External packages installation #
+@@ -53,11 +55,11 @@
+ NUMCPUS_INSTALL=4
+ 
+ #number of cpus used in the nightly runs.
+-NUMCPUS_RUN=2
++NUMCPUS_RUN=4
+ 
+ #Nightly run options. The matlab routine runme.m will be called
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+ #by Matlab and runme.m
+ #ex: "'id',[101 102 103]"  ERRORS ARE LARGE FOR: 418 420
+-PYTHON_NROPTIONS=""
++PYTHON_NROPTIONS="--exclude 119 243 514 701 702 703 234 235 418 420 --include_name 'Dakota'"
+ MATLAB_NROPTIONS="'exclude',[119,243,514,701,702,703,234,235,418,420]"
Index: /issm/oecreview/Archive/23185-23389/ISSM-23275-23276.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23275-23276.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23275-23276.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/macosx_pine-island_dakota
+===================================================================
+--- ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23275)
++++ ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23276)
+@@ -9,7 +9,7 @@
+ #ISSM CONFIGURATION
+ ISSM_CONFIG='--prefix=$ISSM_DIR \
+ 	--with-matlab-dir=$MATLAB_PATH \
+-	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 \
++	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/bin \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+ 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
Index: /issm/oecreview/Archive/23185-23389/ISSM-23276-23277.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23276-23277.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23276-23277.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/macosx_pine-island_dakota
+===================================================================
+--- ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23276)
++++ ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23277)
+@@ -9,7 +9,7 @@
+ #ISSM CONFIGURATION
+ ISSM_CONFIG='--prefix=$ISSM_DIR \
+ 	--with-matlab-dir=$MATLAB_PATH \
+-	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/bin \
++	--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 \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+ 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
Index: /issm/oecreview/Archive/23185-23389/ISSM-23277-23278.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23277-23278.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23277-23278.diff	(revision 23390)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/test/NightlyRun/test211.js
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test211.js	(revision 23277)
++++ ../trunk-jpl/test/NightlyRun/test211.js	(revision 23278)
+@@ -11,12 +11,12 @@
+ 
+ //Fields and tolerances to track changes
+ field_names=[
+-	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', 
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', 
++	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',
+ 	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'];
+ field_tolerances=[
+ 	2e-08,2e-08,5e-05,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,
+-	5e-06,5e-06,8e-05,5e-06,1e-07,5e-07,5e-07,5e-07,3e-06,5e-05,
++	5e-06,5e-06,8e-05,5e-06,3e-07,5e-07,5e-07,5e-07,3e-06,5e-05,
+ 	8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05];
+ field_values=[
+ 	(md.results.TransientSolution[0](1).Vx),
+Index: ../trunk-jpl/test/NightlyRun/test211.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test211.py	(revision 23277)
++++ ../trunk-jpl/test/NightlyRun/test211.py	(revision 23278)
+@@ -25,8 +25,8 @@
+ 						 'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',
+ 						 'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[2e-08,2e-08,5e-05,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,
+-									5e-06,5e-06,8e-05,5e-06,1e-07,5e-07,5e-07,5e-07,3e-06,5e-05,
+-									8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05]
++				  5e-06,5e-06,8e-05,5e-06,3e-07,5e-07,5e-07,5e-07,3e-06,5e-05,
++				  8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05]
+ field_values=[md.results.TransientSolution[0].Vx,
+ 							md.results.TransientSolution[0].Vy,
+ 							md.results.TransientSolution[0].Vz,
+Index: ../trunk-jpl/test/NightlyRun/test211.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test211.m	(revision 23277)
++++ ../trunk-jpl/test/NightlyRun/test211.m	(revision 23278)
+@@ -15,7 +15,7 @@
+ 	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={...
+ 	2e-08,2e-08,5e-05,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,...
+-	5e-06,5e-06,8e-05,5e-06,1e-07,5e-07,5e-07,5e-07,3e-06,5e-05,...
++	5e-06,5e-06,8e-05,5e-06,3e-07,5e-07,5e-07,5e-07,3e-06,5e-05,...
+ 	8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
Index: /issm/oecreview/Archive/23185-23389/ISSM-23278-23279.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23278-23279.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23278-23279.diff	(revision 23390)
@@ -0,0 +1,18 @@
+Index: ../trunk-jpl/externalpackages/adjointmpi/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/adjointmpi/install.sh	(revision 23278)
++++ ../trunk-jpl/externalpackages/adjointmpi/install.sh	(revision 23279)
+@@ -2,10 +2,10 @@
+ set -eu
+ 
+ #Some cleanup
+-rm -rf install
++rm -rf install src
+ 
+-#Almost the same as adjoinable mpi but some adaptations to CoDiPack https://github.com/michel2323/AdjointMPI
+-svn co https://github.com/michel2323/AdjointMPI.git/trunk src
++#Almost the same as adjoinable mpi but some adaptations to CoDiPack 
++svn co https://github.com/michel2323/AdjointMPI.git/branches/doubleFixMaster src
+ mkdir install
+ 
+ cd src
Index: /issm/oecreview/Archive/23185-23389/ISSM-23279-23280.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23279-23280.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23279-23280.diff	(revision 23390)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 23279)
++++ ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 23280)
+@@ -25,6 +25,11 @@
+ #include <dmumps_c.h>
+ 
+ void MumpsInit(DMUMPS_STRUC_C &theMumpsStruc){ 
++	theMumpsStruc.n = 0;
++	theMumpsStruc.nz = 0;
++	theMumpsStruc.a = NULL;
++	theMumpsStruc.jcn = NULL;
++	theMumpsStruc.irn = NULL;
+ 	theMumpsStruc.par          = 1;  
+ 	theMumpsStruc.sym          = 0;
+ 	#ifdef _HAVE_MPI_
+Index: ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23279)
++++ ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23280)
+@@ -39,11 +39,7 @@
+ 	// data types
+ 	#define ISSM_MPI_CHAR       MPI_CHAR
+ 	#if defined(_HAVE_AMPI_)
+-		#ifdef _HAVE_ADJOINTMPI_
+-		#define ISSM_MPI_DOUBLE    AMPI_DOUBLE // corresponds to IssmDouble
+-		#else
+ 		#define ISSM_MPI_DOUBLE    AMPI_ADOUBLE // corresponds to IssmDouble
+-		#endif
+ 	#else 
+ 		#define ISSM_MPI_DOUBLE    MPI_DOUBLE  // corresponds to IssmDouble 
+ 	#endif
Index: /issm/oecreview/Archive/23185-23389/ISSM-23280-23281.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23280-23281.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23280-23281.diff	(revision 23390)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23280)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23281)
+@@ -240,6 +240,7 @@
+ 	}
+ 	#elif defined(_HAVE_CODIPACK_)
+ 	auto& tape_codi = IssmDouble::getGlobalTape();
++	codi_global.input_indices.clear();
+ 	if(my_rank==0){
+ 		for (int i=0;i<intn;i++) {
+ 			aX[i]=X[i];
+@@ -279,6 +280,9 @@
+ 
+ 	/*Go through our dependent variables, and compute the response:*/
+ 	dependents=xNew<IssmPDouble>(num_dependents);
++	#if defined(_HAVE_CODIPACK_)
++	codi_global.output_indices.clear();
++	#endif
+ 	for(int i=0;i<dependent_objects->Size();i++){
+ 		DependentObject* dep=(DependentObject*)dependent_objects->GetObjectByOffset(i);
+ 		if(solution_type==TransientSolutionEnum) output_value = dep->GetValue();
+@@ -384,6 +388,7 @@
+ 		weightVectorTimesJac=xNew<IssmPDouble>(num_independents);
+ 		auto in_size = codi_global.input_indices.size();
+ 		for(size_t i = 0; i < in_size; ++i) {
++			_assert_(i<num_independents);
+ 			weightVectorTimesJac[i] = tape_codi.getGradient(codi_global.input_indices[i]);
+ 		}
+ 		if(my_rank==0) for(int i=0;i<num_independents;i++) {
Index: /issm/oecreview/Archive/23185-23389/ISSM-23281-23282.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23281-23282.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23281-23282.diff	(revision 23390)
@@ -0,0 +1,89 @@
+Index: ../trunk-jpl/test/NightlyRun/test702.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test702.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test702.py	(revision 23282)
+@@ -0,0 +1,84 @@
++#Test Name: FlowbandFSsheetshelf
++import numpy as np
++#from scipy.interpolate import interp1d
++from model import  * 
++from setflowequation import  * 
++from solve import  *
++from NowickiProfile import *
++from bamgflowband import *
++from paterson import *
++
++#mesh parameters
++x = np.arange(-5,5.5,.5).T
++[b,h,sea] = NowickiProfile(x)
++x = x * 10**3
++h = h * 10**3
++b = (b-sea) * 10**3
++
++#mesh domain
++md = bamgflowband(model(),x,b+h,b,'hmax',150.)
++
++#parameterize
++md.geometry.surface = np.interp(md.mesh.x,x,b+h)
++md.geometry.base = np.interp(md.mesh.x,x,b)
++md.geometry.thickness = md.geometry.surface - md.geometry.base
++
++#mask
++md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
++md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0
++md.mask.groundedice_levelset = -0.5*np.ones((md.mesh.numberofvertices))
++md.mask.groundedice_levelset[np.where(md.mesh.x<0)]=0.5
++
++#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,))
++
++#damage
++md.damage.D = np.zeros((md.mesh.numberofvertices,))
++md.damage.spcdamage = float('NaN') * np.ones((md.mesh.numberofvertices,))
++
++#friciton
++md.friction.coefficient = np.zeros((md.mesh.numberofvertices,))
++md.friction.coefficient[np.where(md.mesh.vertexflags(1))] = 20
++md.friction.p = np.ones((md.mesh.numberofelements,))
++md.friction.q = np.ones((md.mesh.numberofelements,))
++
++#boundary conditions
++md.stressbalance.spcvx = float('NaN') * np.ones((md.mesh.numberofvertices,))
++md.stressbalance.spcvy = float('NaN') * np.ones((md.mesh.numberofvertices,))
++md.stressbalance.spcvz = float('NaN') * np.ones((md.mesh.numberofvertices,))
++md.stressbalance.referential = float('NaN') * np.ones((md.mesh.numberofvertices,6))
++md.stressbalance.loadingforce = np.zeros((md.mesh.numberofvertices,3))
++md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 800.
++md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0.
++
++#misc
++md = setflowequation(md,'FS','all')
++md.stressbalance.abstol = float('NaN')
++md.stressbalance.FSreconditioning = 1
++md.stressbalance.maxiter = 20
++md.flowequation.augmented_lagrangian_r = 10000.
++md.flowequation.augmented_lagrangian_rhop = 10000.
++md.initialization.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.y)
++md.miscellaneous.name = 'test702'
++md.groundingline.migration = 'None'
++md.cluster = generic('np',2)
++
++#Fields and tolerances to track changes
++field_names = []
++field_tolerances = []
++field_values = []
++for i in ['MINI','MINIcondensed','TaylorHood','XTaylorHood','LATaylorHood']:
++	print ' '
++	print '======Testing ' +i+ ' Full-Stokes Finite element====='
++	md.flowequation.fe_FS = i
++	md = solve(md,'Stressbalance')
++	field_names.extend(['Vx'+i,'Vy'+i,'Vel'+i,'Pressure'+i])
++	field_tolerances.extend([8e-5,8e-5,8e-5,1e-08])
++	field_values.extend([
++		md.results.StressbalanceSolution.Vx,
++		md.results.StressbalanceSolution.Vy,
++		md.results.StressbalanceSolution.Vel,
++		md.results.StressbalanceSolution.Pressure
++		])
Index: /issm/oecreview/Archive/23185-23389/ISSM-23282-23283.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23282-23283.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23282-23283.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/macosx_pine-island_dakota
+===================================================================
+--- ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23282)
++++ ../trunk-jpl/jenkins/macosx_pine-island_dakota	(revision 23283)
+@@ -10,7 +10,7 @@
+ ISSM_CONFIG='--prefix=$ISSM_DIR \
+ 	--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 \
++	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+ 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+ 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
+ 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi" \
Index: /issm/oecreview/Archive/23185-23389/ISSM-23283-23284.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23283-23284.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23283-23284.diff	(revision 23390)
@@ -0,0 +1,40 @@
+Index: ../trunk-jpl/src/m/modules/MeshPartition.m
+===================================================================
+--- ../trunk-jpl/src/m/modules/MeshPartition.m	(revision 23283)
++++ ../trunk-jpl/src/m/modules/MeshPartition.m	(revision 23284)
+@@ -2,7 +2,7 @@
+ %MESHPARTITION - Partition mesh according to the number of areas, using Metis library.
+ %
+ %	   Usage:
+-%			[element_partitioning,node_partitioning]=MeshPartition(md,numpartitions)");
++%			[element_partitioning,node_partitioning]=MeshPartition(md,numpartitions);
+ %
+ %	   element_partitioning: Vector of partitioning area numbers, for every element.
+ %	   node_partitioning: Vector of partitioning area numbers, for every node.
+@@ -34,4 +34,4 @@
+ end
+ 
+ % Call mex module
+-[element_partitioning, node_partitioning] = MeshPartition_matlab(numberofvertices,elements,numberofvertices2d,elements2d,numberoflayers,meshelementtype,numpartitions);
++[element_partitioning, node_partitioning] = MeshPartition_matlab(numberofvertices,elements,numberofvertices2d,elements2d,numberoflayers,elementtype,numpartitions);
+Index: ../trunk-jpl/src/m/modules/MeshPartition.py
+===================================================================
+--- ../trunk-jpl/src/m/modules/MeshPartition.py	(revision 23283)
++++ ../trunk-jpl/src/m/modules/MeshPartition.py	(revision 23284)
+@@ -8,7 +8,7 @@
+ 	'''MESHPARTITION - Partition mesh according to the number of areas, using Metis library.
+ 
+ 	   Usage:
+-			[element_partitioning,node_partitioning]=MeshPartition(md.mesh,numpartitions)")
++			[element_partitioning,node_partitioning]=MeshPartition(md.mesh,numpartitions)
+ 
+ 	   element_partitioning: Vector of partitioning area numbers, for every element.
+ 	   node_partitioning: Vector of partitioning area numbers, for every node.
+@@ -37,6 +37,6 @@
+ 		elementtype = 'Tria'
+ 
+ 	#Call module
+-	[element_partitioning, node_partitioning] = MeshPartition_python(numberofvertices, elements, numberofvertices2d, elements2d, numberoflayers, meshelementtype, numpartitions)
++	[element_partitioning, node_partitioning] = MeshPartition_python(numberofvertices, elements, numberofvertices2d, elements2d, numberoflayers,elementtype, numpartitions)
+ 
+ 	return [element_partitioning, node_partitioning]
Index: /issm/oecreview/Archive/23185-23389/ISSM-23284-23285.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23284-23285.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23284-23285.diff	(revision 23390)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.h	(revision 23284)
++++ ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.h	(revision 23285)
+@@ -7,5 +7,5 @@
+ #include "../../classes/classes.h"
+ 
+ /* local prototypes: */
+-void CoordinateSystemTransformx(IssmDouble** px_dest,IssmDouble** py_dest,IssmDouble* x_src,IssmDouble* y_src,int size,const char* str_src,const char* str_dst);
++void CoordinateSystemTransformx(double** px_dest,double** py_dest,double* x_src,double* y_src,int size,const char* str_src,const char* str_dst);
+ #endif  
+Index: ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp	(revision 23284)
++++ ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp	(revision 23285)
+@@ -8,7 +8,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include <proj_api.h>
+ 
+-void CoordinateSystemTransformx(IssmDouble** px_dest,IssmDouble** py_dest,IssmDouble* x_src,IssmDouble* y_src,int size,const char* str_src,const char* str_dst){
++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_PROJ4_)
+ 	_error_("proj.4 has not been installed");
+@@ -16,8 +16,8 @@
+ 
+ 	/*Allocate output and initialize values as src*/
+ 	_assert_(size>0);
+-	IssmDouble* x_dest = xNew<IssmDouble>(size);
+-	IssmDouble* y_dest = xNew<IssmDouble>(size);
++	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];
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp	(revision 23284)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp	(revision 23285)
+@@ -31,7 +31,7 @@
+ 			for(i=0;i<iomodel->numberofelements;i++){
+ 				for(j=0;j<3;j++){
+ 					if(my_nodes[3*i+j]){ 
+-						nodes->AddObject(new Node(id0+3*i+j+1,id0+3*i+j,lid++,iomodel->elements[+3*i+j]-1,iomodel,analysis,approximation));
++						nodes->AddObject(new Node(id0+3*i+j+1,id0+3*i+j,lid++,iomodel->elements[3*i+j]-1,iomodel,analysis,approximation));
+ 
+ 					}
+ 				}
Index: /issm/oecreview/Archive/23185-23389/ISSM-23285-23286.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23285-23286.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23285-23286.diff	(revision 23390)
@@ -0,0 +1,11 @@
+Index: ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23285)
++++ ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23286)
+@@ -279,5 +279,5 @@
+ }/*}}}*/
+ 
+ #else
+-void controlm1qn3_core(FemModel* femmodel){_error_("M1QN3 not installed");}
++void controlm1qn3_core(FemModel* femmodel){_error_("M1QN3 not installed (or you might have turned AD on)");}
+ #endif //_HAVE_M1QN3_
Index: /issm/oecreview/Archive/23185-23389/ISSM-23286-23287.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23286-23287.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23286-23287.diff	(revision 23390)
@@ -0,0 +1,34 @@
+Index: ../trunk-jpl/src/wrappers/IssmConfig/IssmConfig.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/IssmConfig/IssmConfig.cpp	(revision 23286)
++++ ../trunk-jpl/src/wrappers/IssmConfig/IssmConfig.cpp	(revision 23287)
+@@ -68,6 +68,16 @@
+ 		value = 1.;
+ 		#endif
+ 	}
++	else if(strcmp(name,"_HAVE_ADOLC_")==0){
++		#ifdef _HAVE_ADOLC_
++		value = 1.;
++		#endif
++	}
++	else if(strcmp(name,"_HAVE_CODIPACK_")==0){
++		#ifdef _HAVE_CODIPACK_
++		value = 1.;
++		#endif
++	}
+ 	else if(strcmp(name,"_HAVE_PETSC_")==0){
+ 		#ifdef _HAVE_PETSC_
+ 		value = 1.;
+Index: ../trunk-jpl/src/wrappers/DistanceToMaskBoundary/DistanceToMaskBoundary.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/DistanceToMaskBoundary/DistanceToMaskBoundary.cpp	(revision 23286)
++++ ../trunk-jpl/src/wrappers/DistanceToMaskBoundary/DistanceToMaskBoundary.cpp	(revision 23287)
+@@ -42,7 +42,7 @@
+ 	FetchData(&mask,NULL,NULL,MASK);
+ 
+ 	/*Call core of computation: */
+-	DistanceToMaskBoundaryx(&distance,x,y,mask,nods);
++	//DistanceToMaskBoundaryx(&distance,x,y,mask,nods);
+ 
+ 	/*Write results: */
+ 	WriteData(DISTANCE,distance,nods);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23287-23288.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23287-23288.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23287-23288.diff	(revision 23390)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/wrappers/DistanceToMaskBoundary/DistanceToMaskBoundary.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/DistanceToMaskBoundary/DistanceToMaskBoundary.cpp	(revision 23287)
++++ ../trunk-jpl/src/wrappers/DistanceToMaskBoundary/DistanceToMaskBoundary.cpp	(revision 23288)
+@@ -42,6 +42,7 @@
+ 	FetchData(&mask,NULL,NULL,MASK);
+ 
+ 	/*Call core of computation: */
++	_error_("messing up with AD, is this fonction really used??");
+ 	//DistanceToMaskBoundaryx(&distance,x,y,mask,nods);
+ 
+ 	/*Write results: */
Index: /issm/oecreview/Archive/23185-23389/ISSM-23288-23289.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23288-23289.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23288-23289.diff	(revision 23390)
@@ -0,0 +1,82 @@
+Index: ../trunk-jpl/jenkins/linux64_ross_codi
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_codi	(nonexistent)
++++ ../trunk-jpl/jenkins/linux64_ross_codi	(revision 23289)
+@@ -0,0 +1,70 @@
++#
++#-------------------------------#
++# 1: ISSM general configuration #
++#-------------------------------#
++
++#MATLAB path
++MATLAB_PATH="/usr/local/MATLAB/R2015a"
++
++#ISSM CONFIGURATION
++ISSM_CONFIG='--prefix=$ISSM_DIR\
++				--without-kriging \
++				--without-kml \
++				--without-GiaIvins \
++				--without-Love \
++				--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
++				--with-matlab-dir=$MATLAB_PATH \
++				--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
++				--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
++				--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpifort -lmpi" \
++				--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++				--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
++				--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
++				--with-numthreads=4  \
++				--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
++				--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9/ -lgfortran" \
++				--with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \
++				--with-codipack-dir="$ISSM_DIR/externalpackages/codipack/install" \
++				--enable-tape-alloc \
++				--with-cxxoptflags="-DAD_TYPE=codi::RealReverse" \
++				--with-adjointmpi-dir="$ISSM_DIR/externalpackages/adjointmpi/install" \
++				--enable-development \
++				--enable-debugging '
++
++#PYTHON and MATLAB testing
++MATLAB_TEST=1
++PYTHON_TEST=0
++
++#-----------------------------------#
++# 3: External packages installation #
++#-----------------------------------#
++
++#List of external pakages to be installed and their installation scripts
++EXTERNALPACKAGES="autotools install.sh
++					 cmake install.sh
++					 mpich install-3.2-linux64.sh
++					 petsc install-3.7-linux64.sh
++					 metis install-5.0.1-linux64.sh
++					 triangle install-linux64.sh
++					 gsl install-linux64.sh
++					 adjointmpi install.sh
++					 codipack install.sh
++					 shell2junit install.sh"
++
++#-----------------#
++# 4: test options #
++#-----------------#
++
++#number of cpus used in ISSM installation and compilation (one is usually
++#safer as some packages are very sensitive to parallel compilation)
++NUMCPUS_INSTALL=5
++
++#number of cpus used in the nightly runs.
++NUMCPUS_RUN=1
++
++#Nightly run options. The matlab routine runme.m will be called
++#as follows: runme($MATLAB_NROPTIONS). The options must be understandable
++#by Matlab and runme.m
++#ex: "'id',[101 102 103]"
++MATLAB_NROPTIONS="'benchmark','all','id',[3105]"
++PYTHON_NROPTIONS="--benchmark='all' -i 3105"
+
+Property changes on: ../trunk-jpl/jenkins/linux64_ross_codi
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/23185-23389/ISSM-23289-23290.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23289-23290.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23289-23290.diff	(revision 23390)
@@ -0,0 +1,53 @@
+Index: ../trunk-jpl/test/NightlyRun/test3015.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3015.m	(revision 23289)
++++ ../trunk-jpl/test/NightlyRun/test3015.m	(revision 23290)
+@@ -14,15 +14,26 @@
+ 
+ %setup autodiff parameters
+ index=1; %this is the scalar component we are checking against
+-md.autodiff.independents={...
+-	independent('name','md.geometry.thickness','type','vertex','nods',md.mesh.numberofvertices,'fos_forward_index',index)
+-	};
+ 
+-md.autodiff.dependents={...
+-	dependent('name','IceVolume','type','scalar')...
++if IssmConfig('_HAVE_CODIPACK_')
++	md.autodiff.independents={...
++		independent('name','md.geometry.thickness','type','vertex','nods',md.mesh.numberofvertices)
+ 	};
+-md.autodiff.driver='fos_forward';
++	md.autodiff.dependents={...
++		dependent('name','IceVolume','type','scalar','fos_reverse_index',index)...
++		};
++	md.autodiff.driver='fos_reverse';
++else
++	md.autodiff.independents={...
++		independent('name','md.geometry.thickness','type','vertex','nods',md.mesh.numberofvertices,'fos_forward_index',index)
++	};
+ 
++	md.autodiff.dependents={...
++		dependent('name','IceVolume','type','scalar')...
++		};
++	md.autodiff.driver='fos_forward';
++end
++
+ %parameters for the step-wise derivative
+ delta=0.001;
+ h1=md.geometry.thickness(index);
+@@ -69,9 +80,13 @@
+ 
+ md=solve(md,'Masstransport');
+ %retrieve directly
+-dVdh_ad=md.results.MasstransportSolution.AutodiffJacobian;
++if IssmConfig('_HAVE_CODIPACK_')
++	dVdh_ad=md.results.MasstransportSolution.AutodiffJacobian(index);
++else
++	dVdh_ad=md.results.MasstransportSolution.AutodiffJacobian;
++end
+ 
+-disp(sprintf('dV/dh: analytical:  %16.16g\n       using adolc:  %16.16g\n',dVdh_an,dVdh_ad));
++disp(sprintf('dV/dh: analytical:  %16.16g\n       using ad:    %16.16g\n',dVdh_an,dVdh_ad));
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'dV/dh'};
Index: /issm/oecreview/Archive/23185-23389/ISSM-23290-23291.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23290-23291.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23290-23291.diff	(revision 23390)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/jenkins/linux64_ross_codi
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_codi	(revision 23290)
++++ ../trunk-jpl/jenkins/linux64_ross_codi	(revision 23291)
+@@ -40,16 +40,17 @@
+ #-----------------------------------#
+ 
+ #List of external pakages to be installed and their installation scripts
+-EXTERNALPACKAGES="autotools install.sh
+-					 cmake install.sh
+-					 mpich install-3.2-linux64.sh
+-					 petsc install-3.7-linux64.sh
+-					 metis install-5.0.1-linux64.sh
+-					 triangle install-linux64.sh
+-					 gsl install-linux64.sh
+-					 adjointmpi install.sh
+-					 codipack install.sh
+-					 shell2junit install.sh"
++EXTERNALPACKAGES="autotools   install.sh
++                  cmake       install.sh
++                  mpich       install-3.2-linux64.sh
++                  petsc       install-3.7-linux64.sh
++                  metis       install-5.0.1-linux64.sh
++                  triangle    install-linux64.sh
++                  gsl         install-linux64.sh
++                  m1qn3       install.sh
++                  adjointmpi  install.sh
++                  codipack    install.sh
++                  shell2junit install.sh"
+ 
+ #-----------------#
+ # 4: test options #
Index: /issm/oecreview/Archive/23185-23389/ISSM-23291-23292.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23291-23292.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23291-23292.diff	(revision 23390)
@@ -0,0 +1,56 @@
+Index: ../trunk-jpl/test/NightlyRun/test3480.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3480.m	(revision 23291)
++++ ../trunk-jpl/test/NightlyRun/test3480.m	(revision 23292)
+@@ -17,6 +17,7 @@
+ md.inversion=adm1qn3inversion(md.inversion);
+ md.inversion.iscontrol=1;
+ md.autodiff.isautodiff=1;
++md.autodiff.driver='fos_reverse';
+ 
+ md.friction.coefficient(1:md.mesh.numberofvertices,1)=50;
+ md.autodiff.independents = {independent('name','FrictionCoefficient',...
+@@ -54,6 +55,9 @@
+ md.autodiff.dependents{1} = dependent('name','Outputdefinition1','type','scalar','fos_reverse_index',1);
+ md.inversion.maxiter = 2;
+ md.cluster=generic('name',oshostname(),'np',3);
++if IssmConfig('_HAVE_CODIPACK_')
++	md.cluster.np=1;
++end
+ md=solve(md,'transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test3481.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3481.m	(revision 23291)
++++ ../trunk-jpl/test/NightlyRun/test3481.m	(revision 23292)
+@@ -17,6 +17,7 @@
+ md.inversion=adm1qn3inversion(md.inversion);
+ md.inversion.iscontrol=1;
+ md.autodiff.isautodiff=1;
++md.autodiff.driver='fos_reverse';
+ 
+ md.friction.coefficient(1:md.mesh.numberofvertices,1)=50;
+ md.friction.coefficient(1:md.mesh.numberofvertices,2)=25;
+@@ -60,6 +61,9 @@
+ md.autodiff.dependents{1} = dependent('name','Outputdefinition1','type','scalar','fos_reverse_index',1);
+ md.inversion.maxiter = 2;
+ md.cluster=generic('name',oshostname(),'np',3);
++if IssmConfig('_HAVE_CODIPACK_')
++	md.cluster.np=1;
++end
+ md=solve(md,'transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/jenkins/linux64_ross_codi
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_codi	(revision 23291)
++++ ../trunk-jpl/jenkins/linux64_ross_codi	(revision 23292)
+@@ -67,5 +67,5 @@
+ #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+ #by Matlab and runme.m
+ #ex: "'id',[101 102 103]"
+-MATLAB_NROPTIONS="'benchmark','all','id',[3105]"
+-PYTHON_NROPTIONS="--benchmark='all' -i 3105"
++MATLAB_NROPTIONS="'benchmark','all','id',[3015,3119,3480]"
++PYTHON_NROPTIONS="--benchmark='all' -i 3015 3119 3480"
Index: /issm/oecreview/Archive/23185-23389/ISSM-23292-23293.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23292-23293.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23292-23293.diff	(revision 23390)
@@ -0,0 +1,70 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 23292)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 23293)
+@@ -228,6 +228,7 @@
+ 	xDelete<IssmDouble>(independents_fullmin);
+ 	xDelete<IssmDouble>(independents_fullmax);
+ 	xDelete<int>(start_point);
++	xDelete<int>(control_sizes);
+ 	/*Step2: create cost functions (dependents)*/
+ 
+ 	return;
+Index: ../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	(revision 23292)
++++ ../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	(revision 23293)
+@@ -32,6 +32,8 @@
+ 		}
+ 
+ 		xDelete<int>(control_type);
++		xDelete<int>(M);
++		xDelete<int>(N);
+ 	}
+ 	else{
+ 
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23292)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23293)
+@@ -321,14 +321,14 @@
+ 	/*for adolc to run in parallel, we 0 out on rank~=0. But we still keep track of num_dependents:*/
+ 	int num_dependents_old   = num_dependents;
+ 	int num_independents_old = num_independents;
++
++	#if defined(_HAVE_ADOLC_)
++	/*Get gradient for ADOLC {{{*/
+ 	if(my_rank!=0){
+ 		num_dependents   = 0;
+ 		num_independents = 0;
+ 	}
+ 
+-	#if defined(_HAVE_ADOLC_)
+-	/*Get gradient for ADOLC {{{*/
+-
+ 	/*get the EDF pointer:*/
+ 	ext_diff_fct *anEDF_for_solverx_p=xDynamicCast<GenericParam<Adolc_edf> * >(femmodel->parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p;
+ 
+@@ -381,7 +381,12 @@
+ 
+ 		/*initialize direction index in the weights vector: */
+ 		aWeightVector=xNewZeroInit<IssmPDouble>(num_dependents);
+-		if(my_rank==0)  tape_codi.setGradient(codi_global.output_indices[aDepIndex],1.0);
++		if(my_rank==0){
++			if(aDepIndex<0 || aDepIndex>=num_dependents || codi_global.output_indices.size() <= aDepIndex){
++				_error_("index value for AutodiffFosReverseIndexEnum should be in [0,num_dependents-1]");
++			}
++			tape_codi.setGradient(codi_global.output_indices[aDepIndex],1.0);
++		}
+ 		tape_codi.evaluate();
+ 
+ 		/*Get gradient for this dependent */
+@@ -460,6 +465,8 @@
+ 	*Jlisti = (*Jlisti) +1;
+ 	xDelete<double>(XU);
+ 	xDelete<double>(XL);
++	xDelete<int>(control_enum);
++	xDelete<int>(N);
+ 	xDelete<IssmDouble>(scaling_factors);
+ 	xDelete<IssmPDouble>(totalgradient);
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23293-23294.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23293-23294.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23293-23294.diff	(revision 23390)
@@ -0,0 +1,19 @@
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 23293)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 23294)
+@@ -263,10 +263,10 @@
+ 			}
+ 
+ 			for(i=0;i<num_procs;i++){
+-				if(row_indices_fromcpu[i]) ISSM_MPI_Scatterv( row_indices_forcpu, sendcnts, displs, ISSM_MPI_INT, row_indices_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
+-				if(col_indices_fromcpu[i]) ISSM_MPI_Scatterv( col_indices_forcpu, sendcnts, displs, ISSM_MPI_INT, col_indices_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
+-				if(values_fromcpu[i])      ISSM_MPI_Scatterv( values_forcpu, sendcnts, displs, ISSM_MPI_DOUBLE, values_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_DOUBLE, i, comm);
+-				if(modes_fromcpu[i])       ISSM_MPI_Scatterv( modes_forcpu, sendcnts, displs, ISSM_MPI_INT, modes_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
++				ISSM_MPI_Scatterv( row_indices_forcpu, sendcnts, displs, ISSM_MPI_INT, row_indices_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
++				ISSM_MPI_Scatterv( col_indices_forcpu, sendcnts, displs, ISSM_MPI_INT, col_indices_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
++				ISSM_MPI_Scatterv( values_forcpu, sendcnts, displs, ISSM_MPI_DOUBLE, values_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_DOUBLE, i, comm);
++				ISSM_MPI_Scatterv( modes_forcpu, sendcnts, displs, ISSM_MPI_INT, modes_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
+ 			}
+ 			/*}}}*/
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23305-23306.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23305-23306.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23305-23306.diff	(revision 23390)
@@ -0,0 +1,232 @@
+Index: ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23305)
++++ ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23306)
+@@ -10,7 +10,7 @@
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+ 
+-#if defined (_HAVE_M1QN3_) && !defined(_HAVE_AD_)
++#if defined (_HAVE_M1QN3_)
+ /*m1qn3 prototypes {{{*/
+ extern "C" void *ctonbe_; // DIS mode : Conversion
+ extern "C" void *ctcabe_; // DIS mode : Conversion
+@@ -27,8 +27,8 @@
+ 
+ /*Use struct to provide arguments*/
+ typedef struct{
+-	FemModel  * femmodel;
+-	IssmDouble* Jlist;
++	FemModel   * femmodel;
++	IssmPDouble* Jlist;
+ 	int         M;
+ 	int         N;
+ 	int*        i;
+@@ -43,8 +43,8 @@
+ 	int          maxsteps,maxiter;
+ 	int          intn,numberofvertices,num_controls,num_cost_functions,solution_type;
+ 	IssmDouble  *scaling_factors = NULL;
+-	IssmDouble  *X  = NULL;
+-	IssmDouble  *G  = NULL;
++	double      *X  = NULL;
++	double      *G  = NULL;
+ 
+ 	/*Recover some parameters*/
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+@@ -52,8 +52,8 @@
+ 	femmodel->parameters->FindParam(&num_cost_functions,InversionNumCostFunctionsEnum);
+ 	femmodel->parameters->FindParam(&maxsteps,InversionMaxstepsEnum);
+ 	femmodel->parameters->FindParam(&maxiter,InversionMaxiterEnum);
+-	femmodel->parameters->FindParam(&dxmin,InversionDxminEnum);
+-	femmodel->parameters->FindParam(&gttol,InversionGttolEnum);
++	femmodel->parameters->FindParamAndMakePassive(&dxmin,InversionDxminEnum);
++	femmodel->parameters->FindParamAndMakePassive(&gttol,InversionGttolEnum);
+ 	femmodel->parameters->FindParam(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
+ 	femmodel->parameters->SetParam(false,SaveResultsEnum);
+ 	numberofvertices=femmodel->vertices->NumberOfVertices();
+@@ -77,8 +77,8 @@
+ 	long nsim  = long(maxiter);/*Maximum number of function calls*/
+ 
+ 	/*Get initial guess*/
+-	Vector<IssmDouble> *Xpetsc = NULL;
+-	GetVectorFromControlInputsx(&Xpetsc,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
++	Vector<double> *Xpetsc = NULL;
++	GetPassiveVectorFromControlInputsx(&Xpetsc,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
+ 	X = Xpetsc->ToMPISerial();
+ 	Xpetsc->GetSize(&intn);
+ 	delete Xpetsc;
+@@ -92,7 +92,7 @@
+ 	for(int c=0;c<num_controls;c++){
+ 		for(int i=0;i<numberofvertices;i++){
+ 			int index = numberofvertices*c+i;
+-			X[index] = X[index]/scaling_factors[c];
++			X[index] = X[index]/reCast<double>(scaling_factors[c]);
+ 		}
+ 	}
+ 
+@@ -111,7 +111,7 @@
+ 	mystruct.femmodel = femmodel;
+ 	mystruct.M        = maxiter;
+ 	mystruct.N        = num_cost_functions+1;
+-	mystruct.Jlist    = xNewZeroInit<IssmDouble>(mystruct.M*mystruct.N);
++	mystruct.Jlist    = xNewZeroInit<IssmPDouble>(mystruct.M*mystruct.N);
+ 	mystruct.i        = xNewZeroInit<int>(1);
+ 
+ 	/*Initialize Gradient and cost function of M1QN3*/
+@@ -140,20 +140,36 @@
+ 	}
+ 
+ 	/*Constrain solution vector*/
+-	IssmDouble  *XL = NULL;
+-	IssmDouble  *XU = NULL;
+-	GetVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+-	GetVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	double  *XL = NULL;
++	double  *XU = NULL;
++	GetPassiveVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetPassiveVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+ 	for(int c=0;c<num_controls;c++){
+ 		for(int i=0;i<numberofvertices;i++){
+ 			int index = numberofvertices*c+i;
+-			X[index] = X[index]*scaling_factors[c];
++			X[index] = X[index]*reCast<double>(scaling_factors[c]);
+ 			if(X[index]>XU[index]) X[index]=XU[index];
+ 			if(X[index]<XL[index]) X[index]=XL[index];
+ 		}
+ 	}
++
++	/*Set X as our new control (need to recast)*/
++	#ifdef _HAVE_AD_
++	IssmDouble* aX=xNew<IssmDouble>(intn);
++	IssmDouble* aG=xNew<IssmDouble>(intn);
++	for(int i=0;i<intn;i++) {
++		aX[i] = reCast<IssmDouble>(X[i]); 
++		aG[i] = reCast<IssmDouble>(G[i]);
++	}
++	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,aG);
++	SetControlInputsFromVectorx(femmodel,aX);
++	xDelete(aX);
++	xDelete(aG);
++	#else
+ 	SetControlInputsFromVectorx(femmodel,X);
+ 	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,G);
++	#endif
++
+ 	femmodel->OutputControlsx(&femmodel->results);
+ 	femmodel->results->AddObject(new GenericExternalResult<double*>(femmodel->results->Size()+1,JEnum,mystruct.Jlist,(*mystruct.i),mystruct.N,0,0));
+ 
+@@ -170,7 +186,7 @@
+ 	xDelete<double>(dz);
+ 	xDelete<double>(XU);
+ 	xDelete<double>(XL);
+-	xDelete<double>(scaling_factors);
++	xDelete<IssmDouble>(scaling_factors);
+ 	xDelete<double>(mystruct.Jlist);
+ 	xDelete<int>(mystruct.i);
+ }/*}}}*/
+@@ -179,7 +195,7 @@
+ 	/*Recover Arguments*/
+ 	m1qn3_struct *input_struct = (m1qn3_struct*)dzs;
+ 	FemModel     *femmodel     = input_struct->femmodel;
+-	IssmDouble   *Jlist        = input_struct->Jlist;
++	IssmPDouble  *Jlist        = input_struct->Jlist;
+ 	int           JlistM       = input_struct->M;
+ 	int           JlistN       = input_struct->N;
+ 	int          *Jlisti       = input_struct->i;
+@@ -194,19 +210,31 @@
+ 	numberofvertices=femmodel->vertices->NumberOfVertices();
+ 
+ 	/*Constrain input vector and update controls*/
+-	IssmDouble  *XL = NULL;
+-	IssmDouble  *XU = NULL;
++	double *XL = NULL;
++	double *XU = NULL;
++	#ifdef _HAVE_AD_
++	GetPassiveVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetPassiveVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	#else
+ 	GetVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+ 	GetVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	#endif
+ 	for(int c=0;c<num_controls;c++){
+ 		for(int i=0;i<numberofvertices;i++){
+ 			int index = numberofvertices*c+i;
+-			X[index] = X[index]*scaling_factors[c];
++			X[index] = X[index]*reCast<double>(scaling_factors[c]);
+ 			if(X[index]>XU[index]) X[index]=XU[index];
+ 			if(X[index]<XL[index]) X[index]=XL[index];
+ 		}
+ 	}
++	#ifdef _HAVE_AD_
++	IssmDouble* aX=xNew<IssmDouble>(*n);
++	for(int i=0;i<*n;i++) aX[i] = reCast<IssmDouble>(X[i]); 
++	SetControlInputsFromVectorx(femmodel,aX);
++	xDelete(aX);
++	#else
+ 	SetControlInputsFromVectorx(femmodel,X);
++	#endif
+ 
+ 	/*Compute solution and adjoint*/
+ 	void (*solutioncore)(FemModel*)=NULL;
+@@ -220,11 +248,13 @@
+ 
+ 	/*Compute objective function*/
+ 	IssmDouble* Jtemp = NULL;
+-	femmodel->CostFunctionx(pf,&Jtemp,NULL);
++	IssmDouble  J;
++	femmodel->CostFunctionx(&J,&Jtemp,NULL);
++	*pf = reCast<double>(J);
+ 	_printf0_("f(x) = "<<setw(12)<<setprecision(7)<<*pf<<"  |  ");
+ 
+ 	/*Record cost function values and delete Jtemp*/
+-	for(int i=0;i<num_responses;i++) Jlist[(*Jlisti)*JlistN+i] = Jtemp[i];
++	for(int i=0;i<num_responses;i++) Jlist[(*Jlisti)*JlistN+i] = reCast<double>(Jtemp[i]);
+ 	Jlist[(*Jlisti)*JlistN+num_responses] = *pf;
+ 	xDelete<IssmDouble>(Jtemp);
+ 
+@@ -237,8 +267,8 @@
+ 		_printf0_("\n");
+ 
+ 		*Jlisti = (*Jlisti) +1;
+-		xDelete<IssmDouble>(XU);
+-		xDelete<IssmDouble>(XL);
++		xDelete<double>(XU);
++		xDelete<double>(XL);
+ 		return;
+ 	}
+ 
+@@ -249,7 +279,7 @@
+ 	/*Compute gradient*/
+ 	IssmDouble* G2 = NULL;
+ 	Gradjx(&G2,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+-	for(long i=0;i<*n;i++) G[i] = -G2[i];
++	for(long i=0;i<*n;i++) G[i] = -reCast<double>(G2[i]);
+ 	xDelete<IssmDouble>(G2);
+ 
+ 	/*Constrain Gradient*/
+@@ -259,8 +289,8 @@
+ 			int index = numberofvertices*c+i;
+ 			if(X[index]>=XU[index]) G[index]=0.;
+ 			if(X[index]<=XL[index]) G[index]=0.;
+-			G[index] = G[index]*scaling_factors[c];
+-			X[index] = X[index]/scaling_factors[c];
++			G[index] = G[index]*reCast<double>(scaling_factors[c]);
++			X[index] = X[index]/reCast<double>(scaling_factors[c]);
+ 			Gnorm += G[index]*G[index];
+ 		}
+ 	}
+@@ -273,11 +303,11 @@
+ 
+ 	/*Clean-up and return*/
+ 	*Jlisti = (*Jlisti) +1;
+-	xDelete<IssmDouble>(XU);
+-	xDelete<IssmDouble>(XL);
++	xDelete<double>(XU);
++	xDelete<double>(XL);
+ 	xDelete<IssmDouble>(scaling_factors);
+ }/*}}}*/
+ 
+ #else
+-void controlm1qn3_core(FemModel* femmodel){_error_("M1QN3 not installed (or you might have turned AD on)");}
++void controlm1qn3_core(FemModel* femmodel){_error_("M1QN3 not installed");}
+ #endif //_HAVE_M1QN3_
Index: /issm/oecreview/Archive/23185-23389/ISSM-23306-23307.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23306-23307.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23306-23307.diff	(revision 23390)
@@ -0,0 +1,94 @@
+Index: ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23306)
++++ ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23307)
+@@ -38,13 +38,13 @@
+ void controlm1qn3_core(FemModel* femmodel){/*{{{*/
+ 
+ 	/*Intermediaries*/
+-	long         omode;
+-	double       f,dxmin,gttol; 
+-	int          maxsteps,maxiter;
+-	int          intn,numberofvertices,num_controls,num_cost_functions,solution_type;
+-	IssmDouble  *scaling_factors = NULL;
+-	double      *X  = NULL;
+-	double      *G  = NULL;
++	long    omode;
++	double  f,dxmin,gttol; 
++	int     maxsteps,maxiter;
++	int     intn,numberofvertices,num_controls,num_cost_functions,solution_type;
++	double *scaling_factors = NULL;
++	double *X  = NULL;
++	double *G  = NULL;
+ 
+ 	/*Recover some parameters*/
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+@@ -92,7 +92,7 @@
+ 	for(int c=0;c<num_controls;c++){
+ 		for(int i=0;i<numberofvertices;i++){
+ 			int index = numberofvertices*c+i;
+-			X[index] = X[index]/reCast<double>(scaling_factors[c]);
++			X[index] = X[index]/scaling_factors[c];
+ 		}
+ 	}
+ 
+@@ -147,7 +147,7 @@
+ 	for(int c=0;c<num_controls;c++){
+ 		for(int i=0;i<numberofvertices;i++){
+ 			int index = numberofvertices*c+i;
+-			X[index] = X[index]*reCast<double>(scaling_factors[c]);
++			X[index] = X[index]*scaling_factors[c];
+ 			if(X[index]>XU[index]) X[index]=XU[index];
+ 			if(X[index]<XL[index]) X[index]=XL[index];
+ 		}
+@@ -186,7 +186,7 @@
+ 	xDelete<double>(dz);
+ 	xDelete<double>(XU);
+ 	xDelete<double>(XL);
+-	xDelete<IssmDouble>(scaling_factors);
++	xDelete<double>(scaling_factors);
+ 	xDelete<double>(mystruct.Jlist);
+ 	xDelete<int>(mystruct.i);
+ }/*}}}*/
+@@ -202,10 +202,10 @@
+ 
+ 	/*Recover some parameters*/
+ 	int num_responses,num_controls,numberofvertices,solution_type;
+-	IssmDouble* scaling_factors = NULL;
++	double* scaling_factors = NULL;
+ 	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+ 	femmodel->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+-	femmodel->parameters->FindParam(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
++	femmodel->parameters->FindParamAndMakePassive(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	numberofvertices=femmodel->vertices->NumberOfVertices();
+ 
+@@ -222,7 +222,7 @@
+ 	for(int c=0;c<num_controls;c++){
+ 		for(int i=0;i<numberofvertices;i++){
+ 			int index = numberofvertices*c+i;
+-			X[index] = X[index]*reCast<double>(scaling_factors[c]);
++			X[index] = X[index]*scaling_factors[c];
+ 			if(X[index]>XU[index]) X[index]=XU[index];
+ 			if(X[index]<XL[index]) X[index]=XL[index];
+ 		}
+@@ -289,8 +289,8 @@
+ 			int index = numberofvertices*c+i;
+ 			if(X[index]>=XU[index]) G[index]=0.;
+ 			if(X[index]<=XL[index]) G[index]=0.;
+-			G[index] = G[index]*reCast<double>(scaling_factors[c]);
+-			X[index] = X[index]/reCast<double>(scaling_factors[c]);
++			G[index] = G[index]*scaling_factors[c];
++			X[index] = X[index]/scaling_factors[c];
+ 			Gnorm += G[index]*G[index];
+ 		}
+ 	}
+@@ -305,7 +305,7 @@
+ 	*Jlisti = (*Jlisti) +1;
+ 	xDelete<double>(XU);
+ 	xDelete<double>(XL);
+-	xDelete<IssmDouble>(scaling_factors);
++	xDelete<double>(scaling_factors);
+ }/*}}}*/
+ 
+ #else
Index: /issm/oecreview/Archive/23185-23389/ISSM-23307-23308.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23307-23308.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23307-23308.diff	(revision 23390)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp	(revision 23307)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp	(revision 23308)
+@@ -14,6 +14,7 @@
+ #include "../../../shared/Exceptions/exceptions.h"
+ #include "../../../shared/io/Comm/IssmComm.h"
+ #include "../../../shared/Enum/Enum.h"
++#include "../../../shared/io/Print/Print.h"
+ 
+ void	PetscSolve(PetscVec** puf, PetscMat* Kff, PetscVec* pf, PetscVec* uf0,PetscVec* df, Parameters* parameters){ /*{{{*/
+ 
+@@ -155,6 +156,7 @@
+ 	/*Check convergence*/
+ 	KSPGetIterationNumber(ksp,&iteration_number);
+ 	if (iteration_number<0) _error_("Solver diverged at iteration number: " << -iteration_number);
++	if (VerboseSolver())  _printf0_("Petsc: "<< iteration_number << " KSP iterations\n"); 
+ 
+ 	/*Free resources:*/
+ 	KSPFree(&ksp);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23308-23309.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23308-23309.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23308-23309.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23308)
++++ ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23309)
+@@ -54,7 +54,7 @@
+ 	femmodel->parameters->FindParam(&maxiter,InversionMaxiterEnum);
+ 	femmodel->parameters->FindParamAndMakePassive(&dxmin,InversionDxminEnum);
+ 	femmodel->parameters->FindParamAndMakePassive(&gttol,InversionGttolEnum);
+-	femmodel->parameters->FindParam(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
++	femmodel->parameters->FindParamAndMakePassive(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
+ 	femmodel->parameters->SetParam(false,SaveResultsEnum);
+ 	numberofvertices=femmodel->vertices->NumberOfVertices();
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23309-23310.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23309-23310.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23309-23310.diff	(revision 23390)
@@ -0,0 +1,45 @@
+Index: ../trunk-jpl/src/c/classes/Params/Parameters.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/Parameters.h	(revision 23309)
++++ ../trunk-jpl/src/c/classes/Params/Parameters.h	(revision 23310)
+@@ -52,6 +52,7 @@
+ 		void  FindParam(FILE** pfid,int enum_type);
+ 		void  FindParam(DataSet** pdataset, int enum_type);
+ 		void  FindParamAndMakePassive(IssmPDouble* pscalar, int enum_type);
++		void  FindParamAndMakePassive(IssmPDouble** pvec,int* pM,int enum_type);
+ 		void  FindParamInDataset(IssmDouble** pIssmDoublearray,int* pM,int* pN,int dataset_type,int enum_type);
+ 
+ 		void  SetParam(bool boolean,int enum_type);
+Index: ../trunk-jpl/src/c/classes/Params/Parameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 23309)
++++ ../trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 23310)
+@@ -439,6 +439,28 @@
+ 	*pscalar=reCast<IssmPDouble>(intermediary);
+ }
+ /*}}}*/
++void Parameters::FindParamAndMakePassive(IssmPDouble** pvec,int* pM, int param_enum){ _assert_(this);/*{{{*/
++
++	_assert_(param_enum>ParametersSTARTEnum);
++	_assert_(param_enum<ParametersENDEnum);
++
++	int index = param_enum - ParametersSTARTEnum -1;
++
++	/*Output*/
++	int         n;
++	IssmDouble* vector = NULL;
++
++	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
++	this->params[index]->GetParameterValue(&vector,&n);
++
++	/*Make output passive*/
++	IssmPDouble* output = xNew<IssmPDouble>(n);
++	for(int i=0;i<n;i++) output[i] = reCast<IssmPDouble>(vector[i]);
++
++	/*assign output pointers*/
++	if(pvec) *pvec = output;
++	if(pM)   *pM   = n;
++}/*}}}*/
+ void Parameters::FindParamInDataset(IssmDouble** pIssmDoublearray,int* pM,int* pN,int dataset_type,int enum_type){/*{{{*/
+ 	_assert_(this);
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23310-23311.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23310-23311.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23310-23311.diff	(revision 23390)
@@ -0,0 +1,184 @@
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 23310)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 23311)
+@@ -80,8 +80,8 @@
+ 	if(VerboseControl()) _printf0_("   preparing final solution\n");
+ 	IssmDouble  *XL = NULL;
+ 	IssmDouble  *XU = NULL;
+-	GetVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+-	GetVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	GetVectorFromControlInputsx(&XL,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetVectorFromControlInputsx(&XU,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+ 	for(long i=0;i<nsize;i++){
+ 		if(X0[i]>XU[i]) X0[i]=XU[i];
+ 		if(X0[i]<XL[i]) X0[i]=XL[i];
+@@ -133,8 +133,8 @@
+ 	/*Constrain input vector*/
+ 	IssmDouble  *XL = NULL;
+ 	IssmDouble  *XU = NULL;
+-	GetVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+-	GetVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	GetVectorFromControlInputsx(&XL,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetVectorFromControlInputsx(&XU,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+ 	for(long i=0;i<nsize;i++){
+ 		if(X[i]>XU[i]) X[i]=XU[i];
+ 		if(X[i]<XL[i]) X[i]=XL[i];
+@@ -224,8 +224,8 @@
+ 	/*Constrain input vector*/
+ 	IssmDouble  *XL = NULL;
+ 	IssmDouble  *XU = NULL;
+-	GetVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+-	GetVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	GetVectorFromControlInputsx(&XL,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetVectorFromControlInputsx(&XU,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+ 	for(long i=0;i<nsize;i++){
+ 		if(X[i]>XU[i]) X[i]=XU[i];
+ 		if(X[i]<XL[i]) X[i]=XL[i];
+Index: ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23310)
++++ ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23311)
+@@ -77,11 +77,7 @@
+ 	long nsim  = long(maxiter);/*Maximum number of function calls*/
+ 
+ 	/*Get initial guess*/
+-	Vector<double> *Xpetsc = NULL;
+-	GetPassiveVectorFromControlInputsx(&Xpetsc,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
+-	X = Xpetsc->ToMPISerial();
+-	Xpetsc->GetSize(&intn);
+-	delete Xpetsc;
++	GetPassiveVectorFromControlInputsx(&X,&intn,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
+ 	_assert_(intn==numberofvertices*num_controls);
+ 
+ 	/*Get problem dimension and initialize gradient and initial guess*/
+@@ -142,8 +138,8 @@
+ 	/*Constrain solution vector*/
+ 	double  *XL = NULL;
+ 	double  *XU = NULL;
+-	GetPassiveVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+-	GetPassiveVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	GetPassiveVectorFromControlInputsx(&XL,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetPassiveVectorFromControlInputsx(&XU,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+ 	for(int c=0;c<num_controls;c++){
+ 		for(int i=0;i<numberofvertices;i++){
+ 			int index = numberofvertices*c+i;
+@@ -212,13 +208,8 @@
+ 	/*Constrain input vector and update controls*/
+ 	double *XL = NULL;
+ 	double *XU = NULL;
+-	#ifdef _HAVE_AD_
+-	GetPassiveVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+-	GetPassiveVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+-	#else
+-	GetVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+-	GetVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+-	#endif
++	GetPassiveVectorFromControlInputsx(&XL,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetPassiveVectorFromControlInputsx(&XU,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+ 	for(int c=0;c<num_controls;c++){
+ 		for(int i=0;i<numberofvertices;i++){
+ 			int index = numberofvertices*c+i;
+Index: ../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	(revision 23310)
++++ ../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	(revision 23311)
+@@ -8,9 +8,8 @@
+ 
+ /* local prototypes: */
+ void	GetVectorFromControlInputsx( Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
+-void	GetVectorFromControlInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
++void	GetVectorFromControlInputsx( IssmDouble** pvector,int* pN, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
+ 
+-void	GetPassiveVectorFromControlInputsx(Vector<double>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
+-void	GetPassiveVectorFromControlInputsx(double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
++void	GetPassiveVectorFromControlInputsx(double** pvector,int* pN, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
+ 
+ #endif  /* _GETVECTORFROMCONTROLINPUTSXX_H */
+Index: ../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	(revision 23310)
++++ ../trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	(revision 23311)
+@@ -77,54 +77,31 @@
+ 	}
+ 
+ }/*}}}*/
+-void GetVectorFromControlInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){/*{{{*/
++void GetVectorFromControlInputsx( IssmDouble** pvector,int *pN, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){/*{{{*/
+ 
+ 	/*intermediary: */
++	int                 N;
+ 	Vector<IssmDouble>* vec_vector=NULL;
+ 
++	/*Get PETSc vector*/
+ 	GetVectorFromControlInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters,data);
++
++	/*Serialize*/
++	vec_vector->GetSize(&N);
+ 	IssmDouble* vector=vec_vector->ToMPISerial();
+-
+-	/*Free ressources:*/
+ 	delete vec_vector;
+ 
+ 	/*Assign output pointers:*/
+ 	*pvector=vector;
++	if(pN) *pN=N;
+ }/*}}}*/
+ 
+ /*For autodiff, we sometimes need to cast our vectors to passive*/
+ #ifdef _HAVE_AD_
+-void GetPassiveVectorFromControlInputsx(Vector<IssmPDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){/*{{{*/
++void GetPassiveVectorFromControlInputsx(IssmPDouble** pvector,int* pN, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){/*{{{*/
+ 
+ 	/*Get active vector first*/
+ 	Vector<IssmDouble>*   activevector=NULL;
+-	Vector<IssmPDouble>*  vector=NULL;
+-	int                   size;
+-
+-	/*Retrieve some parameters*/
+-	GetVectorFromControlInputsx(&activevector, elements,nodes, vertices, loads, materials, parameters,data);
+-
+-	/*Serialize vector*/
+-	activevector->GetSize(&size);
+-	IssmDouble* dactivevector=activevector->ToMPISerial();
+-
+-	/*Cast to passive*/
+-	vector=new Vector<IssmPDouble>(size);
+-	for(int i=0;i<size;i++){
+-		vector->SetValue(i,reCast<IssmPDouble>(dactivevector[i]),INS_VAL);
+-	}
+-	vector->Assemble();
+-
+-	/*Assign output pointers:*/
+-	delete activevector;
+-	xDelete<IssmDouble>(dactivevector);
+-	*pvector=vector;
+-
+-}/*}}}*/
+-void GetPassiveVectorFromControlInputsx(IssmPDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){/*{{{*/
+-
+-	/*Get active vector first*/
+-	Vector<IssmDouble>*   activevector=NULL;
+ 	IssmPDouble*          vector=NULL;
+ 	int                   size;
+ 
+@@ -143,16 +120,12 @@
+ 	delete activevector;
+ 	xDelete<IssmDouble>(dactivevector);
+ 	*pvector=vector;
++	if(pN) *pN=size;
+ 
+ }/*}}}*/
+ #else
+-void GetPassiveVectorFromControlInputsx(Vector<IssmPDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){/*{{{*/
++void GetPassiveVectorFromControlInputsx(IssmPDouble** pvector,int* pN, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){/*{{{*/
+ 
+-	GetVectorFromControlInputsx(pvector, elements,nodes, vertices, loads, materials, parameters,data);
+-
++	GetVectorFromControlInputsx(pvector,pN,elements,nodes, vertices, loads, materials, parameters,data);
+ }/*}}}*/
+-void GetPassiveVectorFromControlInputsx(IssmPDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){/*{{{*/
+-
+-	GetVectorFromControlInputsx(pvector, elements,nodes, vertices, loads, materials, parameters,data);
+-}/*}}}*/
+ #endif
Index: /issm/oecreview/Archive/23185-23389/ISSM-23315-23316.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23315-23316.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23315-23316.diff	(revision 23390)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23315)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23316)
+@@ -579,8 +579,8 @@
+ 	/*Constrain solution vector*/
+ 	double  *XL = NULL;
+ 	double  *XU = NULL;
+-	GetPassiveVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+-	GetPassiveVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	GetPassiveVectorFromControlInputsx(&XL,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetPassiveVectorFromControlInputsx(&XU,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+ 
+ 	N_add = 0;
+ 	for (int c=0;c<num_controls;c++){
Index: /issm/oecreview/Archive/23185-23389/ISSM-23316-23317.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23316-23317.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23316-23317.diff	(revision 23390)
@@ -0,0 +1,787 @@
+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/Archive245.arch
+===================================================================
+--- ../trunk-jpl/test/Archives/Archive245.arch	(nonexistent)
++++ ../trunk-jpl/test/Archives/Archive245.arch	(revision 23317)
+
+Property changes on: ../trunk-jpl/test/Archives/Archive245.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test245.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test245.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test245.m	(revision 23317)
+@@ -0,0 +1,47 @@
++%Test Name: SquareShelfTranIspddSicopolisSSA2d
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++
++% Use of SMBpddSicopolis
++md.smb = SMBpddSicopolis();
++% initalize pdd fields
++md.smb=initialize(md.smb,md);
++md.smb.s0p=md.geometry.surface;
++md.smb.s0t=md.geometry.surface;
++
++% 
++md.smb.monthlytemperatures=[]; md.smb.precipitation=[]; md.smb.precipitation=[];
++temp_ma_present=-10*ones(md.mesh.numberofvertices,1)-md.smb.rlaps*md.geometry.surface/1000;
++temp_mj_present=10*ones(md.mesh.numberofvertices,1)-md.smb.rlaps*md.geometry.surface/1000;
++precipitation=5*ones(md.mesh.numberofvertices,1);
++for imonth=0:11
++    md.smb.monthlytemperatures(1:md.mesh.numberofvertices,imonth+1)=md.materials.meltingpoint+temp_ma_present+(temp_mj_present-temp_ma_present)*sin(double(imonth+1-4)*pi/6.0);
++    md.smb.monthlytemperatures(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
++    md.smb.precipitation(1:md.mesh.numberofvertices,imonth+1)=precipitation;
++    md.smb.precipitation(md.mesh.numberofvertices+1,imonth+1)=((imonth+1)/12);
++end
++
++% time steps and resolution
++md.timestepping.time_step=1;
++md.settings.output_frequency=1;
++md.timestepping.final_time=2;
++
++md.transient.issmb=1;
++md.transient.ismasstransport=1;
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++
++md.transient.requested_outputs={'default','TemperaturePDD'};
++md.cluster=generic('name',oshostname(),'np',1); % 3 for the cluster
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'TemperaturePDD1','SmbMassBalance1','TemperaturePDD2','SmbMassBalance2'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).TemperaturePDD),...
++	(md.results.TransientSolution(1).SmbMassBalance),...
++	(md.results.TransientSolution(2).TemperaturePDD),...
++	(md.results.TransientSolution(2).SmbMassBalance),...
++	};
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 23316)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 23317)
+@@ -42,8 +42,9 @@
+ 	if (iomodel->solution_enum==TransientSolutionEnum){
+ 		int smb_model;
+ 		iomodel->FindConstant(&smb_model,"md.smb.model");
+-		if(smb_model==SMBpddEnum)     isdynamic=true;
+-		if(smb_model==SMBd18opddEnum) isdynamic=true;
++		if(smb_model==SMBpddEnum)				isdynamic=true;
++		if(smb_model==SMBd18opddEnum)			isdynamic=true;
++		if(smb_model==SMBpddSicopolisEnum)	isdynamic=true;
+ 	}
+ 
+ 	/*Convert spcs from temperatures to enthalpy*/
+@@ -1199,6 +1200,8 @@
+ 		}
+ 		_assert_((Hc+Ht)>0.);
+ 		lambda = Hc/(Hc+Ht);
++		_assert_(lambda>=0.);
++		_assert_(lambda<=1.);
+ 		kappa  = kappa_c*kappa_t/(lambda*kappa_t+(1.-lambda)*kappa_c); // ==(lambda/kappa_c + (1.-lambda)/kappa_t)^-1
+ 	}	
+ 
+Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 23316)
++++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 23317)
+@@ -32,8 +32,9 @@
+ 	else if (iomodel->solution_enum==TransientSolutionEnum){
+ 		int smb_model;
+ 		iomodel->FindConstant(&smb_model,"md.smb.model");
+-		if(smb_model==SMBpddEnum) isdynamic=true;
+-		if(smb_model==SMBd18opddEnum) isdynamic=true;
++		if(smb_model==SMBpddEnum)				isdynamic=true;
++		if(smb_model==SMBd18opddEnum)			isdynamic=true;
++		if(smb_model==SMBpddSicopolisEnum)  isdynamic=true;
+ 	}
+ 	else{
+ 		_error_("Solution "<<EnumToStringx(iomodel->solution_enum)<<" not supported yet");
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 23316)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 23317)
+@@ -4,6 +4,9 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ 
++// FIX
++#include "./shared/io/Print/Print.h"
++
+ /*Model processing*/
+ void SmbAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+ 	/*No constraints*/
+@@ -20,7 +23,7 @@
+ void SmbAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+ 
+ 	int    smb_model;
+-	bool   isdelta18o,ismungsm,isd18opd,issetpddfac,isprecipscaled,istemperaturescaled;
++	bool   isdelta18o,ismungsm,isd18opd,issetpddfac,isprecipscaled,istemperaturescaled,isfirnwarming;
+ 
+ 	/*Update elements: */
+ 	int counter=0;
+@@ -87,6 +90,16 @@
+ 				iomodel->FetchDataToInput(elements,"md.smb.monthlytemperatures",SmbMonthlytemperaturesEnum);
+ 			}
+ 			break;
++		case SMBpddSicopolisEnum:
++			iomodel->FetchDataToInput(elements,"md.smb.s0p",SmbS0pEnum);
++			iomodel->FetchDataToInput(elements,"md.smb.s0t",SmbS0tEnum);
++			iomodel->FindConstant(&isfirnwarming,"md.smb.isfirnwarming");
++			iomodel->FetchDataToInput(elements,"md.smb.smb_corr",SmbSmbCorrEnum);
++			iomodel->FetchDataToInput(elements,"md.smb.precipitation",SmbPrecipitationEnum);
++			iomodel->FetchDataToInput(elements,"md.smb.monthlytemperatures",SmbMonthlytemperaturesEnum);
++			iomodel->FetchDataToInput(elements,"md.smb.precipitation_anomaly",SmbPrecipitationsAnomalyEnum);
++			iomodel->FetchDataToInput(elements,"md.smb.temperature_anomaly",SmbTemperaturesAnomalyEnum);
++			break;
+ 		case SMBd18opddEnum:
+ 			iomodel->FindConstant(&istemperaturescaled,"md.smb.istemperaturescaled");
+ 			iomodel->FindConstant(&isprecipscaled,"md.smb.isprecipscaled");
+@@ -147,7 +160,7 @@
+ 
+ 	int     numoutputs;
+ 	char**  requestedoutputs = NULL;
+-	bool    isdelta18o,ismungsm,isd18opd,issetpddfac,interp;
++	bool    isdelta18o,ismungsm,isd18opd,issetpddfac,interp,isfirnwarming;
+ 	int     smb_model;
+ 	IssmDouble *temp = NULL;
+ 	int         N,M;
+@@ -214,6 +227,9 @@
+ 				iomodel->DeleteData(temp,"md.smb.delta18o_surface");
+ 			}
+ 			break;
++		case SMBpddSicopolisEnum:
++			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isfirnwarming",SmbIssetpddfacEnum));
++			break;
+ 		case SMBd18opddEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.ismungsm",SmbIsmungsmEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isd18opd",SmbIsd18opdEnum));
+@@ -287,6 +303,10 @@
+ 			if(VerboseSolution()) _printf0_("   call positive degree day module\n");
+ 			PositiveDegreeDayx(femmodel);
+ 			break;
++		case SMBpddSicopolisEnum:
++			if(VerboseSolution()) _printf0_("   call SICOPOLIS positive degree day module\n");
++			PositiveDegreeDaySicopolisx(femmodel);
++			break;
+ 		case SMBd18opddEnum:
+ 			bool isd18opd;
+ 			femmodel->parameters->FindParam(&isd18opd,SmbIsd18opdEnum);
+@@ -295,7 +315,7 @@
+ 				Delta18opdParameterizationx(femmodel);
+ 				if(VerboseSolution()) _printf0_("   call positive degree day module\n");
+ 				PositiveDegreeDayx(femmodel);
+-			} 
++			}
+ 			break;
+ 		case SMBgradientsEnum:
+ 			if(VerboseSolution())_printf0_("	call smb gradients module\n");
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 23316)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 23317)
+@@ -1156,6 +1156,11 @@
+ 	XTaylorHoodEnum,
+ 	XYEnum,
+ 	XYZEnum,
++	SMBpddSicopolisEnum,
++	SmbIsfirnwarmingEnum,
++	SmbSmbCorrEnum,
++	SmbTemperaturesAnomalyEnum,
++	SmbPrecipitationsAnomalyEnum,
+ 	/*}}}*/
+ 	/*Unused?{{{*/
+ 	BalancethicknessD0Enum,
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 23316)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 23317)
+@@ -172,6 +172,7 @@
+ 		case 7: return SMBhenningEnum;
+ 		case 8: return SMBgembEnum;
+ 		case 9: return SMBgradientselaEnum;
++		case 10: return SMBpddSicopolisEnum;
+ 		default: _error_("Marshalled SMB code \""<<enum_in<<"\" not supported yet");
+ 	}
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 23317)
+@@ -0,0 +1,131 @@
++/* file:  PddSurfaceMassBlanceSicopolis.cpp
++   Calculating the surface mass balance using the adapted PDD routine from SICOPOLIS.
++ */
++
++#include "./elements.h"
++#include "../Numerics/numerics.h"
++
++IssmDouble PddSurfaceMassBalanceSicopolis(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec,
++				 IssmDouble* melt, IssmDouble* accu, IssmDouble* melt_star, IssmDouble* t_ampl, IssmDouble* p_ampl,
++				 IssmDouble yts, IssmDouble s, IssmDouble desfac,
++				 IssmDouble s0t, IssmDouble s0p, IssmDouble rlaps,
++				 IssmDouble rho_water,IssmDouble rho_ice){
++
++  int			imonth;				// month counter
++  IssmDouble B;					// output: surface mass balance (m/a IE), melt+accumulation
++  IssmDouble frac_solid, snowfall, rainfall, runoff; 
++  IssmDouble saccu;				// yearly surface accumulation (m/a IE)
++  IssmDouble smelt;				// yearly melt (m/a IE)
++  IssmDouble smelt_star;		// yearly ...
++  IssmDouble precip;				// total precipitation during 1 year
++  IssmDouble sconv;				//rhow_rain/rhoi / 12 months
++  IssmDouble st;					// elevation between altitude of the temp record and current altitude
++  IssmDouble sp;					// elevation between altitude of the prec record and current altitude
++  IssmDouble q;					// q is desert/elev. fact
++  IssmDouble pdd;					// pdd factor (a * degC)
++  IssmDouble tstar;				// monthly temp. after lapse rate correction (degC)
++  IssmDouble precip_star;		// monthly precip after correction (m/a IE)
++  IssmDouble beta1 = 2.73;		// 3 mm IE/(d*deg C),  ablation factor for snow per positive degree day.
++  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 */
++  beta1=beta1*(0.001*365)*sconv; // (mm WE)/(d*deg C) --> (m IE)/(a*deg C)
++  beta2=beta2*(0.001*365)*sconv; // (mm WE)/(d*deg C) --> (m IE)/(a*deg C)
++
++  /* initalize fields */
++  precip=0.0;
++  tstar=0.0;
++  snowfall=0.0;
++  pdd=0.0;
++  /* seasonal loop */
++  for(imonth=0;imonth<12;imonth++){
++
++    /********* Surface temperature correction *******/    
++    st=(s-s0t)/1000.;
++
++    // FIXME rlaps ??
++	 rlaps=-6.309e-03+(-5.426e-03-(-6.309e-03))*sin((imonth+1-4)*PI/6.0)*1000.0;
++    monthlytemperatures[imonth]=monthlytemperatures[imonth]-rlaps*st;//*max(st,1e-3);
++    tstar=monthlytemperatures[imonth]+t_ampl[0];
++
++    /********* Precipitation correction *************/
++    /* Ref: Vizcaino et al 2010; DOI 10.1007/s00382-009-0591-y */
++    if(s0p<2000.0)
++      q=exp(desfac*(max(s,2000.0)-2000.0));
++	 else
++      q=exp(desfac*(max(s,2000.0)-s0p));
++
++    precip_star=q*monthlyprec[imonth]*sconv*p_ampl[0]*yts; // convert precip from m/s -> m/a
++    precip=precip+precip_star*inv_twelve;
++
++    /********* compute PDD **************************/
++    /* Ref: Calov & Greve 2005 Journal of Glaciology, Vol. 51, No. 172, 2005, Correspondence */
++	 IssmDouble s_stat=5.0;
++    IssmDouble inv_sqrt2pi =1.0/sqrt(2.0*PI);
++    IssmDouble inv_s_stat  =1.0/s_stat;
++    IssmDouble inv_sqrt2   =1.0/sqrt(2.0);
++    pdd=pdd+(s_stat*inv_sqrt2pi*exp(-0.5*pow(tstar*inv_s_stat,2))
++				 +0.5*tstar*erfc(-tstar*inv_s_stat*inv_sqrt2))*inv_twelve;
++
++	 /*Partition of precip in solid and liquid parts, Bales et al. (2009) */
++	 IssmDouble temp_rain=7.2;		// Threshold monthly mean temperature for
++											// precipitation = 101% rain, in deg C
++	 IssmDouble temp_snow=-11.6;  // Threshold monthly mean temperature for
++											// precipitation = 100% snow, in deg C
++
++	 IssmDouble coeff1=5.4714e-01;	// Coefficients
++	 IssmDouble coeff2=-9.1603e-02;	// of
++	 IssmDouble coeff3=-3.314e-03;	// the
++	 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)
++	  frac_solid = 1.0;
++	 else{ 
++		 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 */ 
++
++  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;
++		  smelt      = 0.0;
++		  runoff     = smelt;
++	  }
++	  else{
++		  smelt_star = Pmax*snowfall;
++		  smelt      = beta2*(pdd-(smelt_star-rainfall)/beta1);
++		  runoff     = smelt;
++	  }
++  } 
++  else{
++	  smelt_star = Pmax*snowfall;
++	  smelt      = beta2*pdd;
++	  runoff     = smelt+rainfall-Pmax*snowfall;
++  }
++   
++  saccu = precip;	
++
++  /* asign output*/
++  melt[0]=runoff/yts;
++  accu[0]=saccu/yts;
++  melt_star[0]=smelt_star/yts;
++  B=(saccu-runoff)/yts;
++
++  return B;
++}
+Index: ../trunk-jpl/src/c/shared/Elements/elements.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Elements/elements.h	(revision 23316)
++++ ../trunk-jpl/src/c/shared/Elements/elements.h	(revision 23317)
+@@ -23,6 +23,10 @@
+ 				 IssmDouble s0p, IssmDouble rlaps, IssmDouble rlapslgm,
+ 				 IssmDouble TdiffTime,IssmDouble sealevTime,IssmDouble pddsnowfac,IssmDouble pddicefac,
+ 				 IssmDouble rho_water, IssmDouble rho_ice);
++IssmDouble PddSurfaceMassBalanceSicopolis(IssmDouble* monthlytemperatures,  IssmDouble* monthlyprec,
++				 IssmDouble* melt, IssmDouble* accu, IssmDouble* melt_star, IssmDouble* t_ampl, IssmDouble* p_ampl,
++				 IssmDouble yts, IssmDouble s, IssmDouble desfac,IssmDouble s0t,
++				 IssmDouble s0p, IssmDouble rlaps, IssmDouble rho_water, IssmDouble rho_ice);
+ void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
+ 					     IssmDouble Delta18oPresent, IssmDouble Delta18oLgm, IssmDouble Delta18oTime,
+ 					     IssmDouble* PrecipitationsPresentday,
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 23316)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 23317)
+@@ -15,6 +15,7 @@
+ void MungsmtpParameterizationx(FemModel* femmodel);
+ void Delta18opdParameterizationx(FemModel* femmodel);
+ void PositiveDegreeDayx(FemModel* femmodel);
++void PositiveDegreeDaySicopolisx(FemModel* femmodel);
+ void SmbHenningx(FemModel* femmodel);
+ void SmbComponentsx(FemModel* femmodel);
+ void SmbMeltComponentsx(FemModel* femmodel); 
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 23316)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 23317)
+@@ -261,6 +261,17 @@
+ 	xDelete<IssmDouble>(pdds);
+ 	xDelete<IssmDouble>(pds);
+ }/*}}}*/
++void PositiveDegreeDaySicopolisx(FemModel* femmodel){/*{{{*/
++	
++	bool isfirnwarming;
++	femmodel->parameters->FindParam(&isfirnwarming,SmbIssetpddfacEnum);
++	
++	for(int i=0;i<femmodel->elements->Size();i++){
++		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
++		element->PositiveDegreeDaySicopolis(isfirnwarming);
++	}
++
++}/*}}}*/
+ void SmbHenningx(FemModel* femmodel){/*{{{*/
+ 
+ 	/*Intermediaries*/
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 23316)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 23317)
+@@ -174,6 +174,7 @@
+ 					./shared/Elements/LliboutryDuval.cpp \
+ 					./shared/Elements/PrintArrays.cpp\
+ 					./shared/Elements/PddSurfaceMassBalance.cpp\
++					./shared/Elements/PddSurfaceMassBalanceSicopolis.cpp\
+ 					./shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp\
+ 					./shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp\
+ 					./shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp\
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 23316)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 23317)
+@@ -370,12 +370,14 @@
+ 				femmodel->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum);
+ 				femmodel->parameters->FindParam(&smb_model,SmbEnum);
+ 				if(isenthalpy){
+-					if(smb_model==SMBpddEnum)     ResetBoundaryConditions(femmodel,EnthalpyAnalysisEnum);
+-					if(smb_model==SMBd18opddEnum) ResetBoundaryConditions(femmodel,EnthalpyAnalysisEnum);
++					if(smb_model==SMBpddEnum)				ResetBoundaryConditions(femmodel,EnthalpyAnalysisEnum);
++					if(smb_model==SMBd18opddEnum)			ResetBoundaryConditions(femmodel,EnthalpyAnalysisEnum);
++					if(smb_model==SMBpddSicopolisEnum)	ResetBoundaryConditions(femmodel,EnthalpyAnalysisEnum);
+ 				}
+ 				else{
+-					if(smb_model==SMBpddEnum)     ResetBoundaryConditions(femmodel,ThermalAnalysisEnum);
+-					if(smb_model==SMBd18opddEnum) ResetBoundaryConditions(femmodel,ThermalAnalysisEnum);
++					if(smb_model==SMBpddEnum)				ResetBoundaryConditions(femmodel,ThermalAnalysisEnum);
++					if(smb_model==SMBd18opddEnum)			ResetBoundaryConditions(femmodel,ThermalAnalysisEnum);
++					if(smb_model==SMBpddSicopolisEnum)	ResetBoundaryConditions(femmodel,ThermalAnalysisEnum);
+ 				}
+ 			}
+ 			thermal_core(femmodel);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 23316)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 23317)
+@@ -144,6 +144,7 @@
+ 		ElementMatrix*     NewElementMatrixCoupling(int number_nodes,int approximation_enum=NoneApproximationEnum);
+ 		ElementVector*     NewElementVector(int approximation_enum=NoneApproximationEnum);
+ 		void               PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm,bool issetpddfac);
++		void               PositiveDegreeDaySicopolis(bool isfirnwarming);
+ 		IssmDouble         PureIceEnthalpy(IssmDouble pressure);
+ 		void               ResultInterpolation(int* pinterpolation,int*nodesperelement,int* parray_size, int output_enum);
+ 		void               ResultToPatch(IssmDouble* values,int nodesperelement,int output_enum);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 23316)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 23317)
+@@ -2560,6 +2560,171 @@
+ 
+ }
+ /*}}}*/
++void       Element::PositiveDegreeDaySicopolis(bool isfirnwarming){/*{{{*/
++
++	/* General FIXMEs: get Tmelting point, pddicefactor, pddsnowfactor, sigma from parameters/user input */
++
++	int  numvertices = this->GetNumberOfVertices();
++
++	int        i;
++	IssmDouble* smb=xNew<IssmDouble>(numvertices);		// surface mass balance
++	IssmDouble* melt=xNew<IssmDouble>(numvertices);		// melting comp. of surface mass balance
++	IssmDouble* accu=xNew<IssmDouble>(numvertices);		// accuumulation comp. of surface mass balance
++	IssmDouble* melt_star=xNew<IssmDouble>(numvertices);
++	IssmDouble* monthlytemperatures=xNew<IssmDouble>(12*numvertices);
++	IssmDouble* monthlyprec=xNew<IssmDouble>(12*numvertices);
++	IssmDouble* yearlytemperatures=xNew<IssmDouble>(numvertices); memset(yearlytemperatures, 0., numvertices*sizeof(IssmDouble));
++	IssmDouble* s=xNew<IssmDouble>(numvertices);			// actual surface height
++	IssmDouble* s0p=xNew<IssmDouble>(numvertices);		// reference elevation for precip.
++	IssmDouble* s0t=xNew<IssmDouble>(numvertices);		// reference elevation for temperature
++	IssmDouble* smbcorr=xNew<IssmDouble>(numvertices); // surface mass balance correction; will be added after pdd call
++	IssmDouble* p_ampl=xNew<IssmDouble>(numvertices);	// precip anomaly
++	IssmDouble* t_ampl=xNew<IssmDouble>(numvertices);	// remperature anomaly
++	IssmDouble rho_water,rho_ice,desfac,rlaps;
++	IssmDouble inv_twelve=1./12.;								//factor for monthly average
++	IssmDouble time,yts,time_yr;
++
++	/*Get material parameters :*/
++	rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
++	rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
++	
++	/*Get parameters for height corrections*/
++	desfac=this->matpar->GetMaterialParameter(SmbDesfacEnum);
++	rlaps=this->matpar->GetMaterialParameter(SmbRlapsEnum);
++	
++	/*Recover monthly temperatures and precipitation*/
++	Input*     input=this->inputs->GetInput(SmbMonthlytemperaturesEnum); _assert_(input);
++	Input*     input2=this->inputs->GetInput(SmbPrecipitationEnum); _assert_(input2);
++	/*Recover smb correction term */
++	Input*     input3=this->inputs->GetInput(SmbSmbCorrEnum); _assert_(input3);
++	
++	/* Get time */
++	this->parameters->FindParam(&time,TimeEnum);
++	this->parameters->FindParam(&yts,ConstantsYtsEnum);
++	time_yr=floor(time/yts)*yts;
++
++	/* Set parameters for finrnwarming */
++	IssmDouble MU_0         = 9.7155; //Firn-warming correction, in (d*deg C)/(mm WE)
++	IssmDouble mu           = MU_0*(1000.0*86400.0)*(rho_ice/rho_water);   // (d*deg C)/(mm WE) --> (s*deg C)/(m IE)
++	
++	/*loop over vertices: */
++	Gauss* gauss=this->NewGauss();
++	for(int month=0;month<12;month++){
++		for(int iv=0;iv<numvertices;iv++){
++			gauss->GaussVertex(iv);
++			input->GetInputValue(&monthlytemperatures[iv*12+month],gauss,(month+1)/12.*yts);
++			monthlytemperatures[iv*12+month]=monthlytemperatures[iv*12+month]-273.15; // conversion from Kelvin to celcius for PDD module
++			input2->GetInputValue(&monthlyprec[iv*12+month],gauss,(month+1)/12.*yts);
++			monthlyprec[iv*12+month]=monthlyprec[iv*12+month]*yts;
++		}
++	}
++
++	/*Recover info at the vertices: */
++	GetInputListOnVertices(&s[0],SurfaceEnum);
++	GetInputListOnVertices(&s0p[0],SmbS0pEnum);
++	GetInputListOnVertices(&s0t[0],SmbS0tEnum);
++	GetInputListOnVertices(&smbcorr[0],SmbSmbCorrEnum);
++	GetInputListOnVertices(&t_ampl[0],SmbTemperaturesAnomalyEnum);
++	GetInputListOnVertices(&p_ampl[0],SmbPrecipitationsAnomalyEnum);
++
++	/*measure the surface mass balance*/
++	for (int iv = 0; iv<numvertices; iv++){
++		smb[iv]=PddSurfaceMassBalanceSicopolis(&monthlytemperatures[iv*12], &monthlyprec[iv*12],
++					&melt[iv], &accu[iv], &melt_star[iv], &t_ampl[iv], &p_ampl[iv], yts, s[iv],
++					desfac, s0t[iv], s0p[iv],rlaps,rho_water,rho_ice);
++
++		/* make correction */
++		smb[iv] = smb[iv]+smbcorr[iv];
++		/*Get yearlytemperatures */
++		for(int month=0;month<12;month++) yearlytemperatures[iv]=yearlytemperatures[iv]+((monthlytemperatures[iv*12+month]+273.15)+t_ampl[iv])*inv_twelve; // Has to be in Kelvin
++	
++		if(isfirnwarming){ 
++			if(melt_star[iv]>=melt[iv]){
++				yearlytemperatures[iv]= yearlytemperatures[iv]+mu*(melt_star[iv]-melt[iv]);
++			}
++			else{
++				yearlytemperatures[iv]= yearlytemperatures[iv];
++			}
++		}
++		if (yearlytemperatures[iv]>273.15) yearlytemperatures[iv]=273.15;
++	}
++
++	switch(this->ObjectEnum()){
++		case TriaEnum:
++			// this->inputs->AddInput(new TriaInput(TemperatureEnum,&yearlytemperatures[0],P1Enum));
++			this->inputs->AddInput(new TriaInput(TemperaturePDDEnum,&yearlytemperatures[0],P1Enum));
++			this->inputs->AddInput(new TriaInput(SmbMassBalanceEnum,&smb[0],P1Enum));
++			this->inputs->AddInput(new TriaInput(SmbAccumulationEnum,&accu[0],P1Enum));
++			this->inputs->AddInput(new TriaInput(SmbMeltEnum,&melt[0],P1Enum));
++			break;
++		case PentaEnum:
++			bool isthermal;
++			this->parameters->FindParam(&isthermal,TransientIsthermalEnum);
++			if(isthermal){
++				bool isenthalpy;
++				this->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum);
++				if(IsOnSurface()){
++					/*Here, we want to change the BC of the thermal model, keep
++					 * the temperatures as they are for the base of the penta and
++					 * use yearlytemperatures for the top*/
++					GetInputListOnVertices(&s[0],TemperatureEnum);
++					yearlytemperatures[0] = s[0];
++					yearlytemperatures[1] = s[1];
++					yearlytemperatures[2] = s[2];
++					this->inputs->AddInput(new PentaInput(TemperatureEnum,&yearlytemperatures[0],P1Enum));
++					if(isenthalpy){
++						/*Convert that to enthalpy for the enthalpy model*/
++						IssmDouble enthalpy[6];
++						GetInputListOnVertices(&enthalpy[0],EnthalpyEnum);
++						ThermalToEnthalpy(&enthalpy[3],yearlytemperatures[3],0.,0.);
++						ThermalToEnthalpy(&enthalpy[4],yearlytemperatures[4],0.,0.);
++						ThermalToEnthalpy(&enthalpy[5],yearlytemperatures[5],0.,0.);
++						this->inputs->AddInput(new PentaInput(EnthalpyEnum,&enthalpy[0],P1Enum));
++					}
++				}
++			}
++			this->inputs->AddInput(new PentaInput(SmbMassBalanceEnum,&smb[0],P1Enum));
++			this->inputs->AddInput(new PentaInput(TemperaturePDDEnum,&yearlytemperatures[0],P1Enum));
++			this->inputs->AddInput(new PentaInput(SmbAccumulationEnum,&accu[0],P1Enum));
++			this->inputs->AddInput(new PentaInput(SmbMeltEnum,&melt[0],P1Enum));
++			this->InputExtrude(TemperaturePDDEnum,-1);
++			this->InputExtrude(SmbMassBalanceEnum,-1);
++			this->InputExtrude(SmbAccumulationEnum,-1);
++			this->InputExtrude(SmbMeltEnum,-1);
++			break;
++		case TetraEnum:
++			if(IsOnSurface()){
++				GetInputListOnVertices(&s[0],TemperatureEnum);
++				yearlytemperatures[0] = s[0];
++				yearlytemperatures[1] = s[1];
++				yearlytemperatures[2] = s[2];
++				this->inputs->AddInput(new TetraInput(TemperatureEnum,&yearlytemperatures[0],P1Enum));
++			}
++			this->inputs->AddInput(new TetraInput(SmbMassBalanceEnum,&smb[0],P1Enum));
++			this->inputs->AddInput(new TetraInput(TemperaturePDDEnum,&yearlytemperatures[0],P1Enum));
++			this->InputExtrude(TemperaturePDDEnum,-1);
++			this->InputExtrude(SmbMassBalanceEnum,-1);
++			break;
++		default: _error_("Not implemented yet");
++	}
++
++	/*clean-up*/
++	delete gauss;
++	xDelete<IssmDouble>(monthlytemperatures);
++	xDelete<IssmDouble>(monthlyprec);
++	xDelete<IssmDouble>(smb);
++	xDelete<IssmDouble>(melt);
++	xDelete<IssmDouble>(accu);
++	xDelete<IssmDouble>(yearlytemperatures);
++	xDelete<IssmDouble>(s);
++	xDelete<IssmDouble>(s0t);
++	xDelete<IssmDouble>(s0p);
++	xDelete<IssmDouble>(t_ampl); 
++	xDelete<IssmDouble>(p_ampl); 
++	xDelete<IssmDouble>(smbcorr);
++	xDelete<IssmDouble>(melt_star);
++}
++/*}}}*/
+ IssmDouble Element::PureIceEnthalpy(IssmDouble pressure){/*{{{*/
+ 	return this->matpar->PureIceEnthalpy(pressure);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Materials/Matpar.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 23316)
++++ ../trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 23317)
+@@ -106,6 +106,10 @@
+ 					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
+ 					iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
+ 					break;
++				case SMBpddSicopolisEnum:
++					iomodel->FindConstant(&this->desfac,"md.smb.desfac");
++					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
++					break;
+ 				case SMBd18opddEnum:
+ 					iomodel->FindConstant(&this->desfac,"md.smb.desfac");
+ 					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
+@@ -210,6 +214,10 @@
+ 								iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
+ 								iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
+ 								break;
++							case SMBpddSicopolisEnum:
++								iomodel->FindConstant(&this->desfac,"md.smb.desfac");
++								iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
++								break;
+ 							case SMBd18opddEnum:
+ 								iomodel->FindConstant(&this->desfac,"md.smb.desfac");
+ 								iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
+Index: ../trunk-jpl/src/m/classes/SMBpddSicopolis.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBpddSicopolis.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/SMBpddSicopolis.m	(revision 23317)
+@@ -0,0 +1,133 @@
++%SMBpddSicopolis Class definition
++%
++%   Usage:
++%      SMBpddSicopolis=SMBpddSicopolis();
++
++classdef SMBpddSicopolis
++	properties (SetAccess=public) 
++		precipitation					= NaN;
++		monthlytemperatures			= NaN;
++		temperature_anomaly			= NaN;
++		precipitation_anomaly		= NaN;
++		smb_corr							= NaN;
++		desfac							= 0;
++		s0p								= NaN;
++		s0t								= NaN;
++		rlaps								= 0;
++		isfirnwarming					= 0;
++		requested_outputs				= {};
++	end
++	methods
++		function self = SMBpddSicopolis(varargin) % {{{
++			switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = extrude(self,md) % {{{
++			self.precipitation=project3d(md,'vector',self.precipitation,'type','node');
++			self.monthlytemperatures=project3d(md,'vector',self.monthlytemperatures,'type','node');
++			self.temperature_anomaly=project3d(md,'vector',self.temperature_anomaly,'type','node');
++			self.precipitation_anomaly=project3d(md,'vector',self.precipitation_anomaly,'type','node');
++			self.smb_corr=project3d(md,'vector',self.smb_corr,'type','node');
++			self.s0p=project3d(md,'vector',self.s0p,'type','node');
++			self.s0t=project3d(md,'vector',self.s0t,'type','node');
++
++		end % }}}
++		function list = defaultoutputs(self,md) % {{{
++			list = {''};
++		end % }}}
++		function self = initialize(self,md) % {{{
++                    
++			if isnan(self.s0p),
++				self.s0p=zeros(md.mesh.numberofvertices,1);
++				disp('      no SMBpddSicopolis.s0p specified: values set as zero');
++			end
++			if isnan(self.s0t),
++				self.s0t=zeros(md.mesh.numberofvertices,1);
++				disp('      no SMBpddSicopolis.s0t specified: values set as zero');
++			end
++			if isnan(self.temperature_anomaly),
++				self.temperature_anomaly=zeros(md.mesh.numberofvertices,1);
++				disp('      no SMBpddSicopolis.temperature_anomaly specified: values set as zero');
++			end
++			if isnan(self.precipitation_anomaly),
++				self.precipitation_anomaly=ones(md.mesh.numberofvertices,1);
++				disp('      no SMBpddSicopolis.precipitation_anomaly specified: values set as ones');
++			end
++			if isnan(self.smb_corr),
++				self.smb_corr=zeros(md.mesh.numberofvertices,1);
++				disp('      no SMBpddSicopolis.smb_corr specified: values set as zero');
++			end
++
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++
++		  self.isfirnwarming		= 1;
++		  self.desfac				= -log(2.0)/1000;
++		  self.rlaps				= 7.4;
++                  
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			if (strcmp(solution,'TransientSolution') & md.transient.issmb == 0), return; end
++
++			if ismember('MasstransportAnalysis',analyses),
++				md = checkfield(md,'fieldname','smb.desfac','<=',1,'numel',1);
++				md = checkfield(md,'fieldname','smb.s0p','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++				md = checkfield(md,'fieldname','smb.s0t','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++				md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',1);
++				md = checkfield(md,'fieldname','smb.monthlytemperatures','timeseries',1,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices+1 12]);
++				md = checkfield(md,'fieldname','smb.precipitation','timeseries',1,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices+1 12]);
++			end
++			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
++			
++		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   surface forcings parameters:'));
++
++			disp(sprintf('\n   SICOPOLIS PDD scheme (Calov & Greve, 2005) :'));
++			fielddisplay(self,'monthlytemperatures','monthly surface temperatures [K]');
++			fielddisplay(self,'precipitation','monthly surface precipitation [m/yr water eq]');
++			fielddisplay(self,'temperature_anomaly','anomaly to monthly reference temperature (additive; [K])');
++			fielddisplay(self,'precipitation_anomaly','anomaly to monthly precipitation (multiplicative, e.g. q=q0*exp(0.070458*DeltaT) after Huybrechts (2002)); [no unit])');
++			fielddisplay(self,'smb_corr','correction of smb after PDD call [m/a]');
++			fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]');
++			fielddisplay(self,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]');
++			fielddisplay(self,'rlaps','present day lapse rate (default is 7.4 degree/km)');
++			fielddisplay(self,'desfac','desertification elevation factor (default is -log(2.0)/1000)');
++			fielddisplay(self,'isfirnwarming','is firnwarming (Reeh 1991) activated (0 or 1, default is 1)');
++			fielddisplay(self,'requested_outputs','additional outputs requested (TemperaturePDD, SmbAccumulation, SmbMelt)');
++		end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++
++			yts=md.constants.yts;
++
++			WriteData(fid,prefix,'name','md.smb.model','data',10,'format','Integer');
++
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isfirnwarming','format','Boolean');
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double');
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double');
++
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperature_anomaly','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation_anomaly','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','smb_corr','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++
++			%process requested outputs
++			outputs = self.requested_outputs;
++			pos  = find(ismember(outputs,'default'));
++			if ~isempty(pos),
++				outputs(pos) = [];                         %remove 'default' from outputs
++				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
++			end
++			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
++
++		end % }}}
++	end
++end
Index: /issm/oecreview/Archive/23185-23389/ISSM-23317-23318.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23317-23318.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23317-23318.diff	(revision 23390)
@@ -0,0 +1,334 @@
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 23317)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 23318)
+@@ -8,41 +8,252 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ 
++#ifdef _HAVE_CODIPACK_
++extern CoDi_global codi_global;
++#include <sstream> // for output of the CoDiPack tape
++#endif
++
++#ifdef _HAVE_AD_
++void simul_starttrace2(FemModel* femmodel){/*{{{*/
++
++	#if defined(_HAVE_ADOLC_)
++	/*Retrive ADOLC parameters*/
++	IssmDouble gcTriggerRatio;
++	IssmDouble gcTriggerMaxSize;
++	IssmDouble obufsize;
++	IssmDouble lbufsize;
++	IssmDouble cbufsize;
++	IssmDouble tbufsize;
++	femmodel->parameters->FindParam(&gcTriggerRatio,AutodiffGcTriggerRatioEnum);
++	femmodel->parameters->FindParam(&gcTriggerMaxSize,AutodiffGcTriggerMaxSizeEnum);
++	femmodel->parameters->FindParam(&obufsize,AutodiffObufsizeEnum);
++	femmodel->parameters->FindParam(&lbufsize,AutodiffLbufsizeEnum);
++	femmodel->parameters->FindParam(&cbufsize,AutodiffCbufsizeEnum);
++	femmodel->parameters->FindParam(&tbufsize,AutodiffTbufsizeEnum);
++
++	/*Set garbage collection parameters: */
++	setStoreManagerControl(reCast<IssmPDouble>(gcTriggerRatio),reCast<size_t>(gcTriggerMaxSize));
++
++	/*Start trace: */
++	int skipFileDeletion=1;
++	int keepTaylors=1;
++	int my_rank=IssmComm::GetRank();
++	trace_on(my_rank,keepTaylors,reCast<size_t>(obufsize),reCast<size_t>(lbufsize),reCast<size_t>(cbufsize),reCast<size_t>(tbufsize),skipFileDeletion);
++
++	#elif defined(_HAVE_CODIPACK_)
++
++		//fprintf(stderr, "*** Codipack IoModel::StartTrace\n");
++		/*
++		 * FIXME codi
++		 * - ADOL-C variant uses fine grained tracing with various arguments
++		 * - 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();
++		tape_codi.setActive();
++		#if _AD_TAPE_ALLOC_
++		//alloc_profiler.Tag(StartInit, true);
++		IssmDouble x_t(1.0), y_t(1.0);
++		tape_codi.registerInput(y_t);
++		int codi_allocn = 0;
++		femmodel->parameters->FindParam(&codi_allocn,AutodiffTapeAllocEnum);
++		for(int i = 0;i < codi_allocn;++i) {
++			x_t = y_t * y_t;
++		}
++		/*
++		std::stringstream out_s;
++		IssmDouble::getGlobalTape().printStatistics(out_s);
++		_printf0_("StartTrace::Tape Statistics	   : TapeAlloc count=[" << codi_allocn << "]\n" << out_s.str());
++		*/
++		tape_codi.reset();
++		//alloc_profiler.Tag(FinishInit, true);
++		#else
++		tape_codi.reset();
++		#endif
++
++	#else
++	_error_("not implemented");
++	#endif
++}/*}}}*/
++void simul_stoptrace2(){/*{{{*/
++
++	#if defined(_HAVE_ADOLC_)
++	trace_off();
++	if(VerboseAutodiff()){ /*{{{*/
++
++		#ifdef _HAVE_ADOLC_
++		int my_rank=IssmComm::GetRank();
++		size_t  tape_stats[15];
++		tapestats(my_rank,tape_stats); //reading of tape statistics
++		int commSize=IssmComm::GetSize();
++		int *sstats=new int[7];
++		sstats[0]=tape_stats[NUM_OPERATIONS];
++		sstats[1]=tape_stats[OP_FILE_ACCESS];
++		sstats[2]=tape_stats[NUM_LOCATIONS];
++		sstats[3]=tape_stats[LOC_FILE_ACCESS];
++		sstats[4]=tape_stats[NUM_VALUES];
++		sstats[5]=tape_stats[VAL_FILE_ACCESS];
++		sstats[6]=tape_stats[TAY_STACK_SIZE];
++		int *rstats=NULL;
++		if (my_rank==0) rstats=new int[commSize*7];
++		ISSM_MPI_Gather(sstats,7,ISSM_MPI_INT,rstats,7,ISSM_MPI_INT,0,IssmComm::GetComm());
++		if (my_rank==0) {
++			int offset=50;
++			int rOffset=(commSize/10)+1;
++			_printf_("   ADOLC statistics: \n");
++			_printf_("     "<<setw(offset)<<left<<"#independents: " <<setw(12)<<right<<tape_stats[NUM_INDEPENDENTS] << "\n");
++			_printf_("     "<<setw(offset)<<left<<"#dependents: " <<setw(12)<<right<<tape_stats[NUM_DEPENDENTS] << "\n");
++			_printf_("     "<<setw(offset)<<left<<"max #live active variables: " <<setw(12)<<right<<tape_stats[NUM_MAX_LIVES] << "\n");
++			_printf_("     operations: entry size "<< sizeof(unsigned char) << " Bytes \n");
++			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffObufsizeEnum) " <<setw(12)<<right<<tape_stats[OP_BUFFER_SIZE] << "\n");
++			for (int r=0;r<commSize;++r)
++			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+0] << (rstats[r*7+1]?" ->file":"") << "\n");
++			_printf_("     locations: entry size " << sizeof(locint) << " Bytes\n");
++			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffLbufsizeEnum) " <<setw(12)<<right<<tape_stats[LOC_BUFFER_SIZE] << "\n");
++			for (int r=0;r<commSize;++r)
++			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+2] << (rstats[r*7+3]?" ->file":"") << "\n");
++			_printf_("     constant values: entry size " << sizeof(double) << " Bytes\n");
++			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffCbufsizeEnum) " <<setw(12)<<right<<tape_stats[VAL_BUFFER_SIZE] << "\n");
++			for (int r=0;r<commSize;++r)
++			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+4] << (rstats[r*7+5]?" ->file":"") << "\n");
++			_printf_("     Taylor stack: entry size " << sizeof(revreal) << " Bytes\n");
++			_printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffTbufsizeEnum) " <<setw(12)<<right<<tape_stats[TAY_BUFFER_SIZE] << "\n");
++			for (int r=0;r<commSize;++r)
++			 _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+6] << (rstats[r*7+6]>tape_stats[TAY_BUFFER_SIZE]?" ->file":"") << "\n");
++			delete []rstats;
++		}
++		delete [] sstats;
++		#endif
++
++		#ifdef _HAVE_CODIPACK_
++		#ifdef _AD_TAPE_ALLOC_
++		//_printf_("Allocation time  P(" << my_rank << "): " << alloc_profiler.DeltaTime(StartInit, FinishInit) << "\n");
++		#endif
++		std::stringstream out_s;
++		IssmDouble::getGlobalTape().printStatistics(out_s);
++		_printf0_("CoDiPack Profiling::Tape Statistics :\n" << out_s.str());
++		#endif
++	} /*}}}*/
++
++	#elif defined(_HAVE_CODIPACK_)
++	auto& tape_codi = IssmDouble::getGlobalTape();
++	tape_codi.setPassive();
++	if(VerboseAutodiff()){
++		int my_rank=IssmComm::GetRank();
++		if(my_rank == 0) {
++			// FIXME codi "just because" for now
++			tape_codi.printStatistics(std::cout);
++			codi_global.print(std::cout);
++		}
++	}
++	#else
++	_error_("not implemented");
++	#endif
++}/*}}}*/
++#endif
++
+ void controlvalidation_core(FemModel* femmodel){
+ 
+ 	int         solution_type,n;
+ 	int         num_responses;
+-	IssmDouble  j0,j,yts;
++	IssmDouble  j0,j;
+ 	IssmDouble  Ialpha,exponent,alpha;
+ 	IssmDouble* scaling_factors = NULL;
+ 	IssmDouble* jlist = NULL;
+-	IssmDouble *G = NULL;
+-	IssmDouble *X = NULL;
+-	IssmDouble *X0= NULL;
++	int my_rank=IssmComm::GetRank();
+ 
+-	/*Solution and Adjoint core pointer*/
+-	void (*solutioncore)(FemModel*) = NULL;
+-	void (*adjointcore)(FemModel*)  = NULL;
+-
+ 	/*Recover parameters used throughout the solution*/
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->SetParam(false,SaveResultsEnum);
+ 	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+-	femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	femmodel->parameters->FindParam(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
+ 
+ 	/*Get initial guess*/
+-	Vector<IssmDouble> *Xpetsc = NULL;
+-	GetVectorFromControlInputsx(&Xpetsc,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
+-	Xpetsc->GetSize(&n);
+-	X0 = Xpetsc->ToMPISerial();
+-	delete Xpetsc;
++	IssmPDouble* X0 = NULL;
++	GetPassiveVectorFromControlInputsx(&X0,&n,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
+ 
+-	/*Allocate current vector*/
+-	X = xNew<IssmDouble>(n);
++	/*Allocate vectors*/
++	IssmDouble*  X = xNew<IssmDouble>(n);
++	IssmPDouble* G = xNew<IssmPDouble>(n);
+ 
+ 	/*out of solution_type, figure out solution core and adjoint function pointer*/
++	void (*solutioncore)(FemModel*)=NULL;
+ 	CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type);
++
++	#if defined(_HAVE_ADOLC_)
++	/*{{{*/
++	IssmDouble* aX=xNew<IssmDouble>(n);
++	if(my_rank==0){
++		for(int i=0;i<intn;i++){
++			aX[i]<<=X0[i];
++		}
++	}
++	_error_("not implemented yet...");
++	/*}}}*/
++	#elif defined(_HAVE_CODIPACK_)
++	simul_starttrace2(femmodel);
++	IssmDouble* aX=xNew<IssmDouble>(n);
++	auto& tape_codi = IssmDouble::getGlobalTape();
++	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());
++		}
++	}
++	SetControlInputsFromVectorx(femmodel,aX);
++	xDelete(aX);
++
++	if(VerboseControl()) _printf0_("   Compute Initial cost function\n");
++	solutioncore(femmodel);
++
++	/*Get Dependents*/
++	IssmDouble  output_value;
++	int         num_dependents;
++	IssmPDouble *dependents;
++	DataSet*    dependent_objects=NULL;
++	IssmDouble	J=0.;
++	femmodel->parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
++	femmodel->parameters->FindParam(&dependent_objects,AutodiffDependentObjectsEnum);
++
++	/*Go through our dependent variables, and compute the response:*/
++	dependents=xNew<IssmPDouble>(num_dependents);
++	codi_global.output_indices.clear();
++	for(int i=0;i<dependent_objects->Size();i++){
++		DependentObject* dep=(DependentObject*)dependent_objects->GetObjectByOffset(i);
++		if(solution_type==TransientSolutionEnum){
++			output_value = dep->GetValue();
++		}
++		else{
++			dep->Responsex(&output_value,femmodel);
++		}
++		_printf0_("=== output ="<<output_value<<" \n");
++		if(my_rank==0) {
++			tape_codi.registerOutput(output_value);
++			dependents[i] = output_value.getValue();
++			codi_global.output_indices.push_back(output_value.getGradientData());
++			J+=output_value;
++		}
++	}
++	j0 = J;
++	_printf0_("Initial cost function J(x) = "<<setw(12)<<setprecision(7)<<j0<<"\n");
++	_assert_(j0>0.); 
++	simul_stoptrace2();
++	/*initialize direction index in the weights vector: */
++	if(my_rank==0){
++		tape_codi.setGradient(codi_global.output_indices[0],1.0);
++	}
++	tape_codi.evaluate();
++
++	/*Get gradient for this dependent */
++	auto in_size = codi_global.input_indices.size();
++	for(size_t i = 0; i < in_size; ++i) {
++		G[i] = tape_codi.getGradient(codi_global.input_indices[i]);
++	}
++	#else
++	/*{{{*/
++	void (*adjointcore)(FemModel*)  = NULL;
+ 	AdjointCorePointerFromSolutionEnum(&adjointcore,solution_type);
+ 
+ 	if(VerboseControl()) _printf0_("   Compute Initial solution\n");
+@@ -58,6 +269,8 @@
+ 	if(VerboseControl()) _printf0_("   Compute Gradient\n");
+ 	Gradjx(&G,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+ 	for(int i=0;i<n;i++) G[i] = -G[i];
++	/*}}}*/
++	#endif
+ 
+ 	/*Allocate output*/
+ 	int num = 26;
+@@ -75,11 +288,27 @@
+ 		/*Calculate j(k+alpha delta k) */
+ 		SetControlInputsFromVectorx(femmodel,X);
+ 		solutioncore(femmodel);
++
++		#if defined(_HAVE_CODIPACK_)
++		j=0.;
++		for(int i=0;i<dependent_objects->Size();i++){
++			DependentObject* dep=(DependentObject*)dependent_objects->GetObjectByOffset(i);
++			if(solution_type==TransientSolutionEnum){
++				output_value = dep->GetValue();
++			}
++			else{
++				dep->Responsex(&output_value,femmodel);
++			}
++			j+=output_value;
++		}
++		#else
+ 		femmodel->CostFunctionx(&j,NULL,NULL);
++		#endif
+ 
+ 		IssmDouble Den = 0.;
+ 		for(int i=0;i<n;i++) Den += alpha* G[i] * scaling_factors[0];
+ 		Ialpha = fabs((j - j0)/Den - 1.);
++		_assert_(fabs(Den)>0.); 
+ 
+ 		_printf0_(" " << setw(11) << setprecision (5)<<alpha<<" " << setw(11) << setprecision (5)<<Ialpha<<"\n");
+ 		output[m*2+0] = alpha;
+@@ -92,16 +321,20 @@
+ 	for(int i=0;i<2*num;i++) J_passive[i]=reCast<IssmPDouble>(output[i]);
+ 	femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,J_passive,num,2,0,0));
+ 	xDelete<IssmPDouble>(J_passive);
++	IssmDouble* aG=xNew<IssmDouble>(n);
++	for(int i=0;i<n;i++) aG[i] = G[i];
++	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,aG);
++	xDelete<IssmDouble>(aG);
+ 	#else
+ 	femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,output,num,2,0,0));
++	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,G);
+ 	#endif
+-	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,G);
+ 	femmodel->OutputControlsx(&femmodel->results);
+ 
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(output);
+-	xDelete<IssmDouble>(G);
++	xDelete<IssmPDouble>(G);
+ 	xDelete<IssmDouble>(X);
+-	xDelete<IssmDouble>(X0);
++	xDelete<double>(X0);
+ 	xDelete<IssmDouble>(scaling_factors);
+ }
Index: /issm/oecreview/Archive/23185-23389/ISSM-23318-23319.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23318-23319.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23318-23319.diff	(revision 23390)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 23318)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 23319)
+@@ -2510,7 +2510,9 @@
+ 
+ 	/*recover my_rank:*/
+ 	my_rank=IssmComm::GetRank();
+-	_assert_(strncmp(data_name,mddot,3)==0);
++	if(strncmp(data_name,mddot,3)!=0){
++		_error_("Cannot fetch \""<<data_name<<"\" does not start with \""<<mddot<<"\"");
++	}
+ 
+ 	/*Go find in the binary file, the position of the data we want to fetch: */
+ 	if(my_rank==0){
Index: /issm/oecreview/Archive/23185-23389/ISSM-23319-23320.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23319-23320.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23319-23320.diff	(revision 23390)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 23319)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 23320)
+@@ -233,6 +233,6 @@
+ 
+ 	return;
+ #else 
+-	_error_("ADOLC not compiled");
++	_error_("AD not compiled");
+ #endif
+ }
Index: /issm/oecreview/Archive/23185-23389/ISSM-23320-23321.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23320-23321.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23320-23321.diff	(revision 23390)
@@ -0,0 +1,18 @@
+Index: ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 23320)
++++ ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 23321)
+@@ -68,8 +68,13 @@
+     IssmDouble inv_sqrt2pi =1.0/sqrt(2.0*PI);
+     IssmDouble inv_s_stat  =1.0/s_stat;
+     IssmDouble inv_sqrt2   =1.0/sqrt(2.0);
++
++	 #if defined(_HAVE_ADOLC_)
+     pdd=pdd+(s_stat*inv_sqrt2pi*exp(-0.5*pow(tstar*inv_s_stat,2))
+ 				 +0.5*tstar*erfc(-tstar*inv_s_stat*inv_sqrt2))*inv_twelve;
++	 #else
++	 _error_("Cannot differentiate erfc, talk to ADOLC folks (http://functions.wolfram.com/GammaBetaErf/Erfc/20/01/)");
++	 #endif
+ 
+ 	 /*Partition of precip in solid and liquid parts, Bales et al. (2009) */
+ 	 IssmDouble temp_rain=7.2;		// Threshold monthly mean temperature for
Index: /issm/oecreview/Archive/23185-23389/ISSM-23321-23322.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23321-23322.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23321-23322.diff	(revision 23390)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 23321)
++++ ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 23322)
+@@ -4,6 +4,7 @@
+ 
+ #include "./elements.h"
+ #include "../Numerics/numerics.h"
++#include "../Exceptions/exceptions.h"
+ 
+ IssmDouble PddSurfaceMassBalanceSicopolis(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec,
+ 				 IssmDouble* melt, IssmDouble* accu, IssmDouble* melt_star, IssmDouble* t_ampl, IssmDouble* p_ampl,
Index: /issm/oecreview/Archive/23185-23389/ISSM-23322-23323.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23322-23323.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23322-23323.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 23322)
++++ ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 23323)
+@@ -70,7 +70,7 @@
+     IssmDouble inv_s_stat  =1.0/s_stat;
+     IssmDouble inv_sqrt2   =1.0/sqrt(2.0);
+ 
+-	 #if defined(_HAVE_ADOLC_)
++	 #if !defined(_HAVE_ADOLC_)
+     pdd=pdd+(s_stat*inv_sqrt2pi*exp(-0.5*pow(tstar*inv_s_stat,2))
+ 				 +0.5*tstar*erfc(-tstar*inv_s_stat*inv_sqrt2))*inv_twelve;
+ 	 #else
Index: /issm/oecreview/Archive/23185-23389/ISSM-23323-23324.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23323-23324.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23323-23324.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 23323)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 23324)
+@@ -184,7 +184,7 @@
+ 	/*{{{*/
+ 	IssmDouble* aX=xNew<IssmDouble>(n);
+ 	if(my_rank==0){
+-		for(int i=0;i<intn;i++){
++		for(int i=0;i<n;i++){
+ 			aX[i]<<=X0[i];
+ 		}
+ 	}
Index: /issm/oecreview/Archive/23185-23389/ISSM-23324-23325.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23324-23325.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23324-23325.diff	(revision 23390)
@@ -0,0 +1,27 @@
+Index: ../trunk-jpl/externalpackages/README
+===================================================================
+--- ../trunk-jpl/externalpackages/README	(revision 23324)
++++ ../trunk-jpl/externalpackages/README	(nonexistent)
+@@ -1,22 +0,0 @@
+-To install all the ISSM libraries:
+-
+-1/ go into each library folder and type install.sh . 
+-
+-2/ There is no guarantee the compilation will work on all systems. A lot of tweaking of the 
+-install.sh files will probably be involved. Especially, the configuration part of the install.
+-
+-Update: 
+-now install.sh can call configure.sh for the most complex libraries, ie Petsc and Dakota. For those 
+-libraries, go in the configs/ directory, pick up the correct configuration file and copy it to the top 
+-folder of the library compilation. Tweak if necessary.
+-
+-machine characteristics:
+-
+--astrid: linux 64 bits
+--castor: altix 64 bits
+--cosmos: JPL cluster 32 bits
+--macmathieu: iMac 24" 2009 32 bits
+--macbookmathieu: MacBook Pro 13" 2010; OS X 10.6.7; 2.4GHz Intel Core 2 Duo 64 bits
+--maceric: MacBook Pro 15" 2010 32 bits
+--ogive: Mac Pro 2008 32 bits
+--pleiades: AMES cluster
Index: /issm/oecreview/Archive/23185-23389/ISSM-23327-23328.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23327-23328.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23327-23328.diff	(revision 23390)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 23327)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 23328)
+@@ -264,7 +264,7 @@
+ void PositiveDegreeDaySicopolisx(FemModel* femmodel){/*{{{*/
+ 	
+ 	bool isfirnwarming;
+-	femmodel->parameters->FindParam(&isfirnwarming,SmbIssetpddfacEnum);
++	femmodel->parameters->FindParam(&isfirnwarming,SmbIsfirnwarmingEnum);
+ 	
+ 	for(int i=0;i<femmodel->elements->Size();i++){
+ 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 23327)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 23328)
+@@ -228,7 +228,7 @@
+ 			}
+ 			break;
+ 		case SMBpddSicopolisEnum:
+-			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isfirnwarming",SmbIssetpddfacEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isfirnwarming",SmbIsfirnwarmingEnum));
+ 			break;
+ 		case SMBd18opddEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.ismungsm",SmbIsmungsmEnum));
Index: /issm/oecreview/Archive/23185-23389/ISSM-23328-23329.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23328-23329.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23328-23329.diff	(revision 23390)
@@ -0,0 +1,199 @@
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 23328)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 23329)
+@@ -298,6 +298,7 @@
+ 		case SmbIsdelta18oEnum : return "SmbIsdelta18o";
+ 		case SmbIsdensificationEnum : return "SmbIsdensification";
+ 		case SmbIsgraingrowthEnum : return "SmbIsgraingrowth";
++		case SmbIsfirnwarmingEnum : return "SmbIsfirnwarming";
+ 		case SmbIsmeltEnum : return "SmbIsmelt";
+ 		case SmbIsmungsmEnum : return "SmbIsmungsm";
+ 		case SmbIssetpddfacEnum : return "SmbIssetpddfac";
+@@ -583,6 +584,7 @@
+ 		case SmbPddfacSnowEnum : return "SmbPddfacSnow";
+ 		case SmbPEnum : return "SmbP";
+ 		case SmbPrecipitationEnum : return "SmbPrecipitation";
++		case SmbPrecipitationsAnomalyEnum : return "SmbPrecipitationsAnomaly";
+ 		case SmbPrecipitationsLgmEnum : return "SmbPrecipitationsLgm";
+ 		case SmbPrecipitationsPresentdayEnum : return "SmbPrecipitationsPresentday";
+ 		case SmbPrecipitationsReconstructedEnum : return "SmbPrecipitationsReconstructed";
+@@ -594,7 +596,9 @@
+ 		case SmbS0tEnum : return "SmbS0t";
+ 		case SmbSizeiniEnum : return "SmbSizeini";
+ 		case SmbSmbrefEnum : return "SmbSmbref";
++		case SmbSmbCorrEnum : return "SmbSmbCorr";
+ 		case SmbTaEnum : return "SmbTa";
++		case SmbTemperaturesAnomalyEnum : return "SmbTemperaturesAnomaly";
+ 		case SmbTemperaturesLgmEnum : return "SmbTemperaturesLgm";
+ 		case SmbTemperaturesPresentdayEnum : return "SmbTemperaturesPresentday";
+ 		case SmbTemperaturesReconstructedEnum : return "SmbTemperaturesReconstructed";
+@@ -1099,6 +1103,7 @@
+ 		case SmbMAddEnum : return "SmbMAdd";
+ 		case SMBmeltcomponentsEnum : return "SMBmeltcomponents";
+ 		case SMBpddEnum : return "SMBpdd";
++		case SMBpddSicopolisEnum : return "SMBpddSicopolis";
+ 		case SmbRlapsEnum : return "SmbRlaps";
+ 		case SmbRlapslgmEnum : return "SmbRlapslgm";
+ 		case SmbSolutionEnum : return "SmbSolution";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 23328)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 23329)
+@@ -304,6 +304,7 @@
+ 	      else if (strcmp(name,"SmbIsdelta18o")==0) return SmbIsdelta18oEnum;
+ 	      else if (strcmp(name,"SmbIsdensification")==0) return SmbIsdensificationEnum;
+ 	      else if (strcmp(name,"SmbIsgraingrowth")==0) return SmbIsgraingrowthEnum;
++	      else if (strcmp(name,"SmbIsfirnwarming")==0) return SmbIsfirnwarmingEnum;
+ 	      else if (strcmp(name,"SmbIsmelt")==0) return SmbIsmeltEnum;
+ 	      else if (strcmp(name,"SmbIsmungsm")==0) return SmbIsmungsmEnum;
+ 	      else if (strcmp(name,"SmbIssetpddfac")==0) return SmbIssetpddfacEnum;
+@@ -381,11 +382,11 @@
+ 	      else if (strcmp(name,"TransientIsthermal")==0) return TransientIsthermalEnum;
+ 	      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=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"WorldComm")==0) return WorldCommEnum;
++	      if (strcmp(name,"Velocity")==0) return VelocityEnum;
++	      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;
+@@ -504,11 +505,11 @@
+ 	      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=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"LevelsetfunctionSlopeX")==0) return LevelsetfunctionSlopeXEnum;
++	      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,"LoadingforceX")==0) return LoadingforceXEnum;
+ 	      else if (strcmp(name,"LoadingforceY")==0) return LoadingforceYEnum;
+@@ -595,6 +596,7 @@
+ 	      else if (strcmp(name,"SmbPddfacSnow")==0) return SmbPddfacSnowEnum;
+ 	      else if (strcmp(name,"SmbP")==0) return SmbPEnum;
+ 	      else if (strcmp(name,"SmbPrecipitation")==0) return SmbPrecipitationEnum;
++	      else if (strcmp(name,"SmbPrecipitationsAnomaly")==0) return SmbPrecipitationsAnomalyEnum;
+ 	      else if (strcmp(name,"SmbPrecipitationsLgm")==0) return SmbPrecipitationsLgmEnum;
+ 	      else if (strcmp(name,"SmbPrecipitationsPresentday")==0) return SmbPrecipitationsPresentdayEnum;
+ 	      else if (strcmp(name,"SmbPrecipitationsReconstructed")==0) return SmbPrecipitationsReconstructedEnum;
+@@ -606,7 +608,9 @@
+ 	      else if (strcmp(name,"SmbS0t")==0) return SmbS0tEnum;
+ 	      else if (strcmp(name,"SmbSizeini")==0) return SmbSizeiniEnum;
+ 	      else if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
++	      else if (strcmp(name,"SmbSmbCorr")==0) return SmbSmbCorrEnum;
+ 	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
++	      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;
+@@ -624,14 +628,14 @@
+ 	      else if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
+ 	      else if (strcmp(name,"SmbZY")==0) return SmbZYEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+-	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      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;
+-         else stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"StrainRatexz")==0) return StrainRatexzEnum;
++	      else if (strcmp(name,"StrainRatexz")==0) return StrainRatexzEnum;
+ 	      else if (strcmp(name,"StrainRateyy")==0) return StrainRateyyEnum;
+ 	      else if (strcmp(name,"StrainRateyz")==0) return StrainRateyzEnum;
+ 	      else if (strcmp(name,"StrainRatezz")==0) return StrainRatezzEnum;
+@@ -747,14 +751,14 @@
+ 	      else if (strcmp(name,"Dense")==0) return DenseEnum;
+ 	      else if (strcmp(name,"DependentObject")==0) return DependentObjectEnum;
+ 	      else if (strcmp(name,"DepthAverageAnalysis")==0) return DepthAverageAnalysisEnum;
+-	      else if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
+ 	      else if (strcmp(name,"DeviatoricStressErrorEstimator")==0) return DeviatoricStressErrorEstimatorEnum;
+ 	      else if (strcmp(name,"Divergence")==0) return DivergenceEnum;
+ 	      else if (strcmp(name,"Domain3Dsurface")==0) return Domain3DsurfaceEnum;
+-         else stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"DoubleArrayInput")==0) return DoubleArrayInputEnum;
++	      else if (strcmp(name,"DoubleArrayInput")==0) return DoubleArrayInputEnum;
+ 	      else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
+ 	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
+ 	      else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
+@@ -870,14 +874,14 @@
+ 	      else if (strcmp(name,"SpatialLinearFloatingMeltRate")==0) return SpatialLinearFloatingMeltRateEnum;
+ 	      else if (strcmp(name,"LliboutryDuval")==0) return LliboutryDuvalEnum;
+ 	      else if (strcmp(name,"Loads")==0) return LoadsEnum;
+-	      else if (strcmp(name,"LoveAnalysis")==0) return LoveAnalysisEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      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=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"LoveKernelsReal")==0) return LoveKernelsRealEnum;
++	      else if (strcmp(name,"LoveKernelsReal")==0) return LoveKernelsRealEnum;
+ 	      else if (strcmp(name,"LoveKi")==0) return LoveKiEnum;
+ 	      else if (strcmp(name,"LoveKr")==0) return LoveKrEnum;
+ 	      else if (strcmp(name,"LoveLi")==0) return LoveLiEnum;
+@@ -993,14 +997,14 @@
+ 	      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;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"Outputdefinition48")==0) return Outputdefinition48Enum;
++	      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 if (strcmp(name,"Outputdefinition50")==0) return Outputdefinition50Enum;
+@@ -1116,16 +1120,17 @@
+ 	      else if (strcmp(name,"SmbFAC")==0) return SmbFACEnum;
+ 	      else if (strcmp(name,"SMBforcing")==0) return SMBforcingEnum;
+ 	      else if (strcmp(name,"SMBgcm")==0) return SMBgcmEnum;
+-	      else if (strcmp(name,"SMBgemb")==0) return SMBgembEnum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"SMBgemb")==0) return SMBgembEnum;
+ 	      else if (strcmp(name,"SMBgradientsela")==0) return SMBgradientselaEnum;
+ 	      else if (strcmp(name,"SMBgradients")==0) return SMBgradientsEnum;
+ 	      else if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"SmbMAdd")==0) return SmbMAddEnum;
++	      else if (strcmp(name,"SmbMAdd")==0) return SmbMAddEnum;
+ 	      else if (strcmp(name,"SMBmeltcomponents")==0) return SMBmeltcomponentsEnum;
+ 	      else if (strcmp(name,"SMBpdd")==0) return SMBpddEnum;
++	      else if (strcmp(name,"SMBpddSicopolis")==0) return SMBpddSicopolisEnum;
+ 	      else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
+ 	      else if (strcmp(name,"SmbRlapslgm")==0) return SmbRlapslgmEnum;
+ 	      else if (strcmp(name,"SmbSolution")==0) return SmbSolutionEnum;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23329-23330.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23329-23330.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23329-23330.diff	(revision 23390)
@@ -0,0 +1,60 @@
+Index: ../trunk-jpl/jenkins/linux64_caladan_ad
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_caladan_ad	(revision 23329)
++++ ../trunk-jpl/jenkins/linux64_caladan_ad	(revision 23330)
+@@ -31,7 +31,6 @@
+ 					cmake install.sh                
+ 					 mpich install-3.2-linux64.sh
+ 					 petsc install-3.7-linux64.sh
+-					 metis install-5.0.1-linux64.sh
+ 					 triangle install-linux64.sh 
+ 					 gsl install-linux64.sh 
+ 					 adolc install.sh
+Index: ../trunk-jpl/jenkins/linux64_caladan_ampi
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_caladan_ampi	(revision 23329)
++++ ../trunk-jpl/jenkins/linux64_caladan_ampi	(revision 23330)
+@@ -40,7 +40,6 @@
+ 					 cmake install.sh 
+ 					 mpich install-3.2-linux64.sh
+ 					 petsc install-3.7-linux64.sh
+-					 metis install-5.0.1-linux64.sh
+ 					 triangle install-linux64.sh 
+ 					 gsl install-linux64.sh 
+ 					 adjoinablempi install.sh
+Index: ../trunk-jpl/jenkins/linux64_ross_ad
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_ad	(revision 23329)
++++ ../trunk-jpl/jenkins/linux64_ross_ad	(revision 23330)
+@@ -36,7 +36,6 @@
+ 					 cmake install.sh
+ 					 mpich install-3.2-linux64.sh
+ 					 petsc install-3.7-linux64.sh
+-					 metis install-5.0.1-linux64.sh
+ 					 triangle install-linux64.sh
+ 					 gsl install-linux64.sh
+ 					 adolc install.sh
+Index: ../trunk-jpl/jenkins/linux64_ross_ampi
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_ampi	(revision 23329)
++++ ../trunk-jpl/jenkins/linux64_ross_ampi	(revision 23330)
+@@ -43,7 +43,6 @@
+ 					 cmake install.sh
+ 					 mpich install-3.2-linux64.sh
+ 					 petsc install-3.7-linux64.sh
+-					 metis install-5.0.1-linux64.sh
+ 					 triangle install-linux64.sh
+ 					 gsl install-linux64.sh
+ 					 adjoinablempi install.sh
+Index: ../trunk-jpl/jenkins/linux64_ross_codi
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_ross_codi	(revision 23329)
++++ ../trunk-jpl/jenkins/linux64_ross_codi	(revision 23330)
+@@ -44,7 +44,6 @@
+                   cmake       install.sh
+                   mpich       install-3.2-linux64.sh
+                   petsc       install-3.7-linux64.sh
+-                  metis       install-5.0.1-linux64.sh
+                   triangle    install-linux64.sh
+                   gsl         install-linux64.sh
+                   m1qn3       install.sh
Index: /issm/oecreview/Archive/23185-23389/ISSM-23330-23331.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23330-23331.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23330-23331.diff	(revision 23390)
@@ -0,0 +1,83 @@
+Index: ../trunk-jpl/src/m/classes/cfdragcoeffabsgrad.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/cfdragcoeffabsgrad.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/cfdragcoeffabsgrad.m	(revision 23331)
+@@ -0,0 +1,78 @@
++%CFDRAGCOEFFABSGRAD class definition
++%
++%   Usage:
++%      cfdragcoeffabsgrad=cfdragcoeffabsgrad();
++%      cfdragcoeffabsgrad=cfdragcoeffabsgrad('name','SurfaceAltimetry',...
++%                    'definitionstring','Outputdefinition1',... 
++%							'model_string','Surface',...
++%                    'weights',ones(md.mesh.numberofvertices,1),...
++%                    'weights_string','WeightsSurfaceObservations');
++%
++%
++
++classdef cfdragcoeffabsgrad
++	properties (SetAccess=public)
++		%cfdragcoeffabsgrad
++		name               = '';
++		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
++		weights            = NaN; %weight coefficients for every vertex
++		weights_string     = ''; %string to identify this particular set of weights
++		cumulated          = NaN; %do we cumulate cfdragcoeffabsgrad through time?
++	end
++	
++	methods
++		function self = extrude(self,md) % {{{
++			if ~isnan(self.weights)
++				self.weights=project3d(md,'vector',self.weights,'type','node');
++			end
++		end % }}}
++		function self = cfdragcoeffabsgrad(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.weights=getfieldvalue(options,'weights',NaN);
++				self.weights_string=getfieldvalue(options,'weights_string','');
++
++			end
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			if ~ischar(self.name),
++				error('cfdragcoeffabsgrad 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.weights','field',self.weights,'timeseries',1,'NaN',1,'Inf',1);
++
++		end % }}}
++		function md = disp(self) % {{{
++		
++			disp(sprintf('   TimeMisfit:\n'));
++
++			fielddisplay(self,'name','identifier for this cfdragcoeffabsgrad response');
++			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
++			fielddisplay(self,'weights','weights (at vertices) to apply to the cfdragcoeffabsgrad');
++			fielddisplay(self,'weights_string','string for weights for identification purposes');
++
++		end % }}}
++		function md = marshall(self,prefix,md,fid) % {{{
++
++		WriteData(fid,prefix,'data',self.name,'name','md.cfdragcoeffabsgrad.name','format','String');
++		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cfdragcoeffabsgrad.definitionstring','format','String');
++		WriteData(fid,prefix,'data',self.weights,'name','md.cfdragcoeffabsgrad.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++		WriteData(fid,prefix,'data',self.weights_string,'name','md.cfdragcoeffabsgrad.weights_string','format','String');
++		end % }}}
++	end
++end
Index: /issm/oecreview/Archive/23185-23389/ISSM-23331-23332.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23331-23332.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23331-23332.diff	(revision 23390)
@@ -0,0 +1,50 @@
+Index: ../trunk-jpl/src/m/plot/googlemaps.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/googlemaps.m	(revision 23331)
++++ ../trunk-jpl/src/m/plot/googlemaps.m	(revision 23332)
+@@ -122,7 +122,22 @@
+ 			'&sensor=false'...
+ 			'&scale=' num2str(scale)];
+ 		url = ['http://maps.google.com/maps/api/staticmap?' params];
+-		[X, map]=imread(url,'png');
++		count = 0;
++		countmax = 10;
++		while(true)
++			try,
++				[X, map]=imread(url,'png');
++				break;
++			catch me,
++				count = count+1;
++				disp('Failed, trying again... (' num2str(countmax-count) ' more attempts)');
++				pause(.3);
++				if count>countmax,
++					disp('Giving up...');
++					rethrow(me);
++				end
++			end
++		end
+ 		X=ind2rgb(X,map);
+ 		indx1 = floor(x*width)+1;
+ 		indx2 = min(floor(dx),floor(x*width)+size(X,2));
+Index: ../trunk-jpl/src/m/plot/applyoptions.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/applyoptions.m	(revision 23331)
++++ ../trunk-jpl/src/m/plot/applyoptions.m	(revision 23332)
+@@ -141,6 +141,8 @@
+ if getfieldvalue(options,'colorbar',1)==1,
+ 	if exist(options,'colorbarcornerposition'),
+ 		c=colorbar(getfieldvalue(options,'colorbarcornerposition'),'peer',gca);
++	elseif exist(options,'colorbarpos') & ischar(getfieldvalue(options,'colorbarpos')),
++		c=colorbar(getfieldvalue(options,'colorbarpos'));
+ 	else 
+ 		c=colorbar('peer',gca);
+ 	end
+@@ -150,7 +152,7 @@
+ 		lim=[lim(1) lim(1)+(lim(2)-lim(1))/getfieldvalue(options,'wrapping')];
+ 		set(c,'Ylim',lim);
+ 	end
+-	if exist(options,'colorbarpos'),
++	if exist(options,'colorbarpos') & isnumeric(getfieldvalue(options,'colorbarpos')),
+ 		set(c,'Position',getfieldvalue(options,'colorbarpos'));
+ 	end
+ 	if exist(options,'log'),
Index: /issm/oecreview/Archive/23185-23389/ISSM-23332-23333.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23332-23333.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23332-23333.diff	(revision 23390)
@@ -0,0 +1,235 @@
+Index: ../trunk-jpl/test/NightlyRun/test245.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test245.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test245.py	(revision 23333)
+@@ -0,0 +1,59 @@
++#Test Name: SquareShelfTranIspddSicopolisSSA2d
++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 SMBpddSicopolis import *
++
++md = triangle(model(),'../Exp/Square.exp',150000.)
++md = setmask(md,'all','')
++md = parameterize(md,'../Par/SquareShelf.py')
++
++# Use of SMBpddSicopolis
++md.smb  =  SMBpddSicopolis()
++# initalize pdd fields
++md.smb.initialize(md)
++md.smb.s0p = md.geometry.surface
++md.smb.s0t = md.geometry.surface
++
++# 
++md.smb.monthlytemperatures = np.empty((md.mesh.numberofvertices+1,12))
++md.smb.precipitation = np.empty((md.mesh.numberofvertices+1,12))
++temp_ma_present = -10. * np.ones((md.mesh.numberofvertices,)) - md.smb.rlaps * md.geometry.surface / 1000.
++temp_mj_present = 10. * np.ones((md.mesh.numberofvertices,)) - md.smb.rlaps * md.geometry.surface / 1000.
++precipitation = 5. * np.ones((md.mesh.numberofvertices,))
++for imonth in range(12): 
++	md.smb.monthlytemperatures[0:md.mesh.numberofvertices,imonth] = md.materials.meltingpoint + temp_ma_present + (temp_mj_present - temp_ma_present) * np.sin((imonth + 1. - 4.) * np.pi / 6.0)
++	md.smb.monthlytemperatures[md.mesh.numberofvertices,imonth] = ((imonth+1)/12.)
++	md.smb.precipitation[0:md.mesh.numberofvertices,imonth] = precipitation
++	md.smb.precipitation[md.mesh.numberofvertices,imonth] = ((imonth+1)/12.)
++
++# time steps and resolution
++md.timestepping.time_step = 1
++md.settings.output_frequency = 1
++md.timestepping.final_time = 2
++
++md.transient.issmb = 1
++md.transient.ismasstransport = 1
++md.transient.isstressbalance = 0
++md.transient.isthermal = 0
++
++md.transient.requested_outputs = ['default','TemperaturePDD']
++md.cluster = generic('name',gethostname(),'np',1) # 3 for the cluster
++md = solve(md,'Transient')
++
++#Fields and tolerances to track changes
++field_names      = ['TemperaturePDD1','SmbMassBalance1','TemperaturePDD2','SmbMassBalance2']
++field_tolerances = [1e-13,1e-13,1e-13,1e-13]
++field_values = [
++	md.results.TransientSolution[0].TemperaturePDD,
++	md.results.TransientSolution[0].SmbMassBalance,
++	md.results.TransientSolution[1].TemperaturePDD,
++	md.results.TransientSolution[1].SmbMassBalance,
++	]
++
+Index: ../trunk-jpl/src/m/classes/SMBpddSicopolis.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBpddSicopolis.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/SMBpddSicopolis.py	(revision 23333)
+@@ -0,0 +1,153 @@
++import numpy as np
++from fielddisplay import fielddisplay
++from checkfield import checkfield
++from WriteData import WriteData
++from project3d import project3d
++from MatlabFuncs import *
++from helpers import *
++
++class SMBpddSicopolis(object):
++	"""
++	SMBpddSicopolis Class definition
++
++	Usage:
++		SMBpddSicopolis=SMBpddSicopolis()
++"""
++
++	def __init__(self): # {{{
++		self.precipitation			= float('NaN')
++		self.monthlytemperatures		= float('NaN')
++		self.temperature_anomaly		= float('NaN')
++		self.precipitation_anomaly		= float('NaN')
++		self.smb_corr				= float('NaN')
++		self.desfac				= 0
++		self.s0p				= float('NaN')
++		self.s0t				= float('NaN')
++		self.rlaps				= 0
++		self.isfirnwarming			= 0
++		self.requested_outputs			= []
++		
++		self.setdefaultparameters()
++	# }}}
++	
++	@staticmethod
++	def SMBpddSicopolis(*args): # {{{
++		nargin = len(args)
++
++		if nargin == 0:
++			return SMBpddSicopolis()
++		else:
++			raise RuntimeError('SMBpddSicopolis: constructor not supported')
++	# }}}
++
++	def extrude(self,md): # {{{
++		self.precipitation = project3d(md,'vector',self.precipitation,'type','node')
++		self.monthlytemperatures = project3d(md,'vector',self.monthlytemperatures,'type','node')
++		self.temperature_anomaly = project3d(md,'vector',self.temperature_anomaly,'type','node')
++		self.precipitation_anomaly = project3d(md,'vector',self.precipitation_anomaly,'type','node')
++		self.smb_corr = project3d(md,'vector',self.smb_corr,'type','node')
++		self.s0p = project3d(md,'vector',self.s0p,'type','node')
++		self.s0t = project3d(md,'vector',self.s0t,'type','node')
++	# }}}
++
++	def defaultoutputs(self,md): # {{{
++		l = ['']
++		return l
++	# }}}
++
++	def initialize(self,md): # {{{
++            
++		if np.isnan(self.s0p):
++			self.s0p = np.zeros((md.mesh.numberofvertices,))
++			print '      no SMBpddSicopolis.s0p specified: values set as zero'
++		
++		if np.isnan(self.s0t):
++			self.s0t = np.zeros((md.mesh.numberofvertices,))
++			print '      no SMBpddSicopolis.s0t specified: values set as zero'
++		
++		if np.isnan(self.temperature_anomaly):
++			self.temperature_anomaly = np.zeros((md.mesh.numberofvertices,))
++			print '      no SMBpddSicopolis.temperature_anomaly specified: values set as zero'
++		
++		if np.isnan(self.precipitation_anomaly):
++			self.precipitation_anomaly = np.ones((md.mesh.numberofvertices,))
++			print '      no SMBpddSicopolis.precipitation_anomaly specified: values set as ones'
++		
++		if np.isnan(self.smb_corr):
++			self.smb_corr = np.zeros((md.mesh.numberofvertices,))
++			print '      no SMBpddSicopolis.smb_corr specified: values set as zero'
++	# }}}
++
++	def setdefaultparameters(self): # {{{
++
++	  self.isfirnwarming	= 1
++	  self.desfac		= -np.log(2.0)/1000
++	  self.rlaps		= 7.4
++          
++	# }}}
++
++	def checkconsistency(self,md,solution,analyses): # {{{
++
++		if (strcmp(solution,'TransientSolution') and md.transient.issmb == 0):
++			return 
++
++		if 'MasstransportAnalysis' in analyses:
++			md = checkfield(md,'fieldname','smb.desfac','<=',1,'numel',1)
++			md = checkfield(md,'fieldname','smb.s0p','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1])
++			md = checkfield(md,'fieldname','smb.s0t','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1])
++			md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',1)
++			md = checkfield(md,'fieldname','smb.monthlytemperatures','timeseries',1,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices+1,12])
++			md = checkfield(md,'fieldname','smb.precipitation','timeseries',1,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices+1,12])
++		
++		md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1)
++		
++		return md
++	# }}}
++
++	def __repr__(self): # {{{
++		string = '   surface forcings parameters:'
++		string += '\n   SICOPOLIS PDD scheme (Calov & Greve, 2005) :'
++
++		string = "%s\n%s"%(string,fielddisplay(self,'monthlytemperatures','monthly surface temperatures [K]'))
++		string = "%s\n%s"%(string,fielddisplay(self,'precipitation','monthly surface precipitation [m/yr water eq]'))
++		string = "%s\n%s"%(string,fielddisplay(self,'temperature_anomaly','anomaly to monthly reference temperature (additive [K])'))
++		string = "%s\n%s"%(string,fielddisplay(self,'precipitation_anomaly','anomaly to monthly precipitation (multiplicative, e.g. q=q0*exp(0.070458*DeltaT) after Huybrechts (2002)) [no unit])'))
++		string = "%s\n%s"%(string,fielddisplay(self,'smb_corr','correction of smb after PDD call [m/a]'))
++		string = "%s\n%s"%(string,fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
++		string = "%s\n%s"%(string,fielddisplay(self,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))
++		string = "%s\n%s"%(string,fielddisplay(self,'rlaps','present day lapse rate (default is 7.4 degree/km)'))
++		string = "%s\n%s"%(string,fielddisplay(self,'desfac','desertification elevation factor (default is -log(2.0)/1000)'))
++		string = "%s\n%s"%(string,fielddisplay(self,'isfirnwarming','is firnwarming (Reeh 1991) activated (0 or 1, default is 1)'))
++		string = "%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested (TemperaturePDD, SmbAccumulation, SmbMelt)'))
++	# }}}
++
++	def marshall(self,prefix,md,fid): # {{{
++
++		yts=md.constants.yts
++
++		WriteData(fid,prefix,'name','md.smb.model','data',10,'format','Integer')
++
++		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isfirnwarming','format','Boolean')
++		WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double')
++		WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1)
++		WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1)
++		WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double')
++
++		WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
++		WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
++		WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperature_anomaly','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
++		WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation_anomaly','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
++		WriteData(fid,prefix,'object',self,'class','smb','fieldname','smb_corr','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
++
++		#process requested outputs
++		outputs = self.requested_outputs
++		pos  = np.where('default' in outputs)
++		if not isempty(pos):
++			outputs[pos] = []                         #remove 'default' from outputs
++			outputs      = [outputs,defaultoutputs(self,md)] #add defaults
++		
++		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
++
++	# }}}
++	
++
+Index: ../trunk-jpl/src/m/qmu/helpers.py
+===================================================================
+--- ../trunk-jpl/src/m/qmu/helpers.py	(revision 23332)
++++ ../trunk-jpl/src/m/qmu/helpers.py	(revision 23333)
+@@ -249,7 +249,7 @@
+ 	except (TypeError):
+ 		pass
+ 
+-	# if all of that fails, then if is not empty
++	# if all of that fails, then it is not empty
+ 	return False
+ 
+ def fieldnames(x,ignore_internals = True):
Index: /issm/oecreview/Archive/23185-23389/ISSM-23333-23334.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23333-23334.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23333-23334.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/plot/googlemaps.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/googlemaps.m	(revision 23333)
++++ ../trunk-jpl/src/m/plot/googlemaps.m	(revision 23334)
+@@ -130,7 +130,7 @@
+ 				break;
+ 			catch me,
+ 				count = count+1;
+-				disp('Failed, trying again... (' num2str(countmax-count) ' more attempts)');
++				disp(['Failed, trying again... (' num2str(countmax-count) ' more attempts)']);
+ 				pause(.3);
+ 				if count>countmax,
+ 					disp('Giving up...');
Index: /issm/oecreview/Archive/23185-23389/ISSM-23334-23335.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23334-23335.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23334-23335.diff	(revision 23390)
@@ -0,0 +1,44 @@
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 23334)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 23335)
+@@ -123,7 +123,6 @@
+ 	bool   ismovingfront;
+ 	bool   isoceancoupling;
+ 	bool   issmb;
+-	int    basalforcingsmodel;
+ 
+ 	/*Fetch data needed: */
+ 	iomodel->FindConstant(&stabilization,"md.masstransport.stabilization");
+@@ -132,7 +131,6 @@
+ 	iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront");
+ 	iomodel->FindConstant(&isoceancoupling,"md.transient.isoceancoupling");
+ 	iomodel->FindConstant(&issmb,"md.transient.issmb");
+-	iomodel->FindConstant(&basalforcingsmodel,"md.basalforcings.model");
+ 
+ 	/*Finite element type*/
+ 	finiteelement = P1Enum;
+@@ -157,11 +155,6 @@
+ 	iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(elements,"md.mask.groundedice_levelset",MaskGroundediceLevelsetEnum);
+ 	iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
+-	if (basalforcingsmodel==SpatialLinearFloatingMeltRateEnum){
+-		iomodel->FetchDataToInput(elements,"md.basalforcings.deepwater_melting_rate",BasalforcingsDeepwaterMeltingRateEnum);
+-		iomodel->FetchDataToInput(elements,"md.basalforcings.deepwater_elevation",BasalforcingsDeepwaterElevationEnum);
+-		iomodel->FetchDataToInput(elements,"md.basalforcings.upperwater_elevation",BasalforcingsUpperwaterElevationEnum);
+-	}
+ 	iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum);
+ 	iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum);
+ 
+@@ -181,6 +174,11 @@
+ 			break;
+ 		case MantlePlumeGeothermalFluxEnum:
+ 			break;
++		case SpatialLinearFloatingMeltRateEnum:
++			iomodel->FetchDataToInput(elements,"md.basalforcings.deepwater_melting_rate",BasalforcingsDeepwaterMeltingRateEnum);
++			iomodel->FetchDataToInput(elements,"md.basalforcings.deepwater_elevation",BasalforcingsDeepwaterElevationEnum);
++			iomodel->FetchDataToInput(elements,"md.basalforcings.upperwater_elevation",BasalforcingsUpperwaterElevationEnum);
++			break;
+ 		case BasalforcingsPicoEnum:
+ 			iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsPicoBasinIdEnum);
+ 			break;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23335-23336.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23335-23336.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23335-23336.diff	(revision 23390)
@@ -0,0 +1,81 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 23335)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 23336)
+@@ -765,7 +765,31 @@
+ 	}
+ 	if(isFS){
+ 		iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum,0.);
+-		iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum,0.);
++
++		/*Add basal forcings to compute melt rate*/
++		int basalforcing_model;
++		iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
++		switch(basalforcing_model){
++			case FloatingMeltRateEnum:
++				iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
++				break;
++			case LinearFloatingMeltRateEnum:
++				break;
++			case MismipFloatingMeltRateEnum:
++				break;
++			case MantlePlumeGeothermalFluxEnum:
++				break;
++			case SpatialLinearFloatingMeltRateEnum:
++				iomodel->FetchDataToInput(elements,"md.basalforcings.deepwater_melting_rate",BasalforcingsDeepwaterMeltingRateEnum);
++				iomodel->FetchDataToInput(elements,"md.basalforcings.deepwater_elevation",BasalforcingsDeepwaterElevationEnum);
++				iomodel->FetchDataToInput(elements,"md.basalforcings.upperwater_elevation",BasalforcingsUpperwaterElevationEnum);
++				break;
++			case BasalforcingsPicoEnum:
++				iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsPicoBasinIdEnum);
++				break;
++			default:
++				_error_("Basal forcing model "<<EnumToStringx(basalforcing_model)<<" not supported yet");
++		}
+ 	}
+ 	/*LATH parameters*/
+ 	iomodel->FindConstant(&fe_FS,"md.flowequation.fe_FS");
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 23335)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 23336)
+@@ -79,7 +79,6 @@
+ 	iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum,0.);
+-	iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
+ 	iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum);
+ 	iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum);
+ 	if(iomodel->domaindim==3){
+@@ -89,6 +88,31 @@
+ 		iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
+ 		iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+ 	}
++
++	/*Get what we need for ocean-induced basal melting*/
++	int basalforcing_model;
++	iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
++	switch(basalforcing_model){
++		case FloatingMeltRateEnum:
++			iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
++			break;
++		case LinearFloatingMeltRateEnum:
++			break;
++		case MismipFloatingMeltRateEnum:
++			break;
++		case MantlePlumeGeothermalFluxEnum:
++			break;
++		case SpatialLinearFloatingMeltRateEnum:
++			iomodel->FetchDataToInput(elements,"md.basalforcings.deepwater_melting_rate",BasalforcingsDeepwaterMeltingRateEnum);
++			iomodel->FetchDataToInput(elements,"md.basalforcings.deepwater_elevation",BasalforcingsDeepwaterElevationEnum);
++			iomodel->FetchDataToInput(elements,"md.basalforcings.upperwater_elevation",BasalforcingsUpperwaterElevationEnum);
++			break;
++		case BasalforcingsPicoEnum:
++			iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsPicoBasinIdEnum);
++			break;
++		default:
++			_error_("Basal forcing model "<<EnumToStringx(basalforcing_model)<<" not supported yet");
++	}
+ }/*}}}*/
+ void FreeSurfaceBaseAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ }/*}}}*/
Index: /issm/oecreview/Archive/23185-23389/ISSM-23336-23337.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23336-23337.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23336-23337.diff	(revision 23390)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/c/cores/stressbalance_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 23336)
++++ ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 23337)
+@@ -74,6 +74,10 @@
+ 
+ 	/*Compute vertical velocities*/
+ 	if (domaintype==Domain3DEnum && (isSIA || isSSA || isL1L2 || isHO)){
++
++		/*We need basal melt rates for vertical velocity*/
++		bmb_core(femmodel);
++
+ 		analysis = new StressbalanceVerticalAnalysis();
+ 		analysis->Core(femmodel);
+ 		delete analysis;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23337-23338.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23337-23338.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23337-23338.diff	(revision 23390)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 23337)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 23338)
+@@ -109,8 +109,8 @@
+ 		iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
+ 		iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+ 	}
+-	iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
+-	iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum,0.);
++	//iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
++	//iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum,0.);
+ 	//iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum);
+ 	iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum,0.);
+ 	iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum,0.);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23338-23339.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23338-23339.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23338-23339.diff	(revision 23390)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/test/NightlyRun/test701.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test701.py	(revision 23338)
++++ ../trunk-jpl/test/NightlyRun/test701.py	(revision 23339)
+@@ -41,6 +41,7 @@
+ md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices,))
+ md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 0.
+ md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0.
++md.basalforcings.floatingice_melting_rate=np.zeros((md.mesh.numberofvertices,))
+ 
+ #Misc
+ md = setflowequation(md,'FS','all')
+Index: ../trunk-jpl/test/NightlyRun/test702.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test702.py	(revision 23338)
++++ ../trunk-jpl/test/NightlyRun/test702.py	(revision 23339)
+@@ -52,6 +52,7 @@
+ md.stressbalance.loadingforce = np.zeros((md.mesh.numberofvertices,3))
+ md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 800.
+ md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0.
++md.basalforcings.floatingice_melting_rate=np.zeros((md.mesh.numberofvertices,))
+ 
+ #misc
+ md = setflowequation(md,'FS','all')
+Index: ../trunk-jpl/test/NightlyRun/test701.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test701.m	(revision 23338)
++++ ../trunk-jpl/test/NightlyRun/test701.m	(revision 23339)
+@@ -34,6 +34,7 @@
+ md.stressbalance.spcvz = NaN*ones(md.mesh.numberofvertices,1);
+ md.stressbalance.spcvx(find(vertexflags(md.mesh,4)))=0;
+ md.stressbalance.spcvy(find(vertexflags(md.mesh,4)))=0;
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ 
+ %Misc
+ md=setflowequation(md,'FS','all');
+Index: ../trunk-jpl/test/NightlyRun/test702.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test702.m	(revision 23338)
++++ ../trunk-jpl/test/NightlyRun/test702.m	(revision 23339)
+@@ -33,6 +33,7 @@
+ md.stressbalance.loadingforce=0*ones(md.mesh.numberofvertices,3);
+ md.stressbalance.spcvx(find(vertexflags(md.mesh,4)))=800;
+ md.stressbalance.spcvy(find(vertexflags(md.mesh,4)))=0;
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ 
+ %Misc
+ md=setflowequation(md,'FS','all');
Index: /issm/oecreview/Archive/23185-23389/ISSM-23339-23340.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23339-23340.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23339-23340.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 23339)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 23340)
+@@ -109,7 +109,7 @@
+ 		iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
+ 		iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+ 	}
+-	//iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
+ 	//iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum,0.);
+ 	//iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum);
+ 	iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum,0.);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23340-23341.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23340-23341.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23340-23341.diff	(revision 23390)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 23340)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 23341)
+@@ -110,8 +110,33 @@
+ 		iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+ 	}
+ 	iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
+-	//iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum,0.);
+ 	//iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum);
++
++
++	/*Add basal forcings to compute melt rate*/
++	int basalforcing_model;
++	iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
++	switch(basalforcing_model){
++		case FloatingMeltRateEnum:
++			iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
++			break;
++		case LinearFloatingMeltRateEnum:
++			break;
++		case MismipFloatingMeltRateEnum:
++			break;
++		case MantlePlumeGeothermalFluxEnum:
++			break;
++		case SpatialLinearFloatingMeltRateEnum:
++			iomodel->FetchDataToInput(elements,"md.basalforcings.deepwater_melting_rate",BasalforcingsDeepwaterMeltingRateEnum);
++			iomodel->FetchDataToInput(elements,"md.basalforcings.deepwater_elevation",BasalforcingsDeepwaterElevationEnum);
++			iomodel->FetchDataToInput(elements,"md.basalforcings.upperwater_elevation",BasalforcingsUpperwaterElevationEnum);
++			break;
++		case BasalforcingsPicoEnum:
++			iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsPicoBasinIdEnum);
++			break;
++		default:
++			_error_("Basal forcing model "<<EnumToStringx(basalforcing_model)<<" not supported yet");
++	}
+ 	iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum,0.);
+ 	iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum,0.);
+ }/*}}}*/
Index: /issm/oecreview/Archive/23185-23389/ISSM-23341-23342.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23341-23342.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23341-23342.diff	(revision 23390)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 23341)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 23342)
+@@ -591,7 +591,7 @@
+ 	dnl python specifics
+ 	if test "x$HAVE_PYTHON" = "xyes"; then
+ 		AC_MSG_CHECKING([for python version])
+-		dnl Query Python for its version number.  Getting [:3] seems to be the
++		dnl Query Python for its version number. Getting [:3] seems to be the
+ 		dnl best way to do this; it's what "site.py" does in the standard library.
+ 		PYTHON_VERSION=$($PYTHON_ROOT/bin/python -c "import sys; print sys.version[[:3]]")
+ 		AC_MSG_RESULT($PYTHON_VERSION)
+@@ -644,6 +644,11 @@
+ 	  AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory.]),
+ 	  [PYTHON_NUMPY_ROOT=$withval],[PYTHON_NUMPY_ROOT="no"])
+ 
++	dnl you can find numpy by typing
++	dnl >>> import numpy
++	dnl >>> numpy.__file__
++	dnl '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc'
++
+ 	dnl Check whether numpy is enabled
+ 	AC_MSG_CHECKING(for python-numpy)
+ 	if test "x$PYTHON_NUMPY_ROOT" = "xno" ; then
+@@ -2165,6 +2170,13 @@
+ 		esac
+ 		AC_DEFINE([_MULTITHREADING_],[1],[with numthreads enabled])
+ 	fi
++	dnl check that it is an integer
++	if [[ "$NUMTHREADS_VALUE" -eq   "$NUMTHREADS_VALUE" 2> /dev/null ]] ; then
++	 dnl cool we have an integer
++	 :
++	else
++	 AC_MSG_ERROR([Number of threads provided ($NUMTHREADS_VALUE) is not an integer]);
++	fi
+ 	AC_DEFINE_UNQUOTED([_NUMTHREADS_],[$NUMTHREADS_VALUE],[number of threads])
+ 	AC_SUBST([MULTITHREADINGLIB])
+ 	AC_MSG_RESULT($NUMTHREADS_VALUE)
Index: /issm/oecreview/Archive/23185-23389/ISSM-23348-23349.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23348-23349.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23348-23349.diff	(revision 23390)
@@ -0,0 +1,169 @@
+Index: ../trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp	(revision 23348)
++++ ../trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp	(revision 23349)
+@@ -41,7 +41,7 @@
+   int rc=0;
+   assert(sendcount==recvcount || sendtype==recvtype); // we handle only identical representations
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Allgather(sendbuf,
+ 		    sendcount,
+ 		    sendtype,
+@@ -75,7 +75,7 @@
+   int rc=0;
+   assert(sendtype==recvtype); // we handle only identical representations
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Allgatherv(sendbuf,
+ 		     sendcount,
+ 		     sendtype,
+@@ -112,7 +112,7 @@
+ 
+   int rc=0;
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Allreduce(sendbuf,
+ 		    recvbuf,
+ 		    count,
+@@ -144,7 +144,7 @@
+ 
+   int rc=0;
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Barrier(comm);
+ # else 
+   rc=MPI_Barrier(comm);
+@@ -158,7 +158,7 @@
+ 
+   int rc=0;
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Bcast(buffer, 
+ 		count,
+ 		datatype,
+@@ -180,7 +180,7 @@
+ 
+   int rc=0;
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   assert(0); // to be implemented
+ # else 
+   rc=MPI_Comm_free(comm);
+@@ -216,9 +216,12 @@
+ 
+ 	int rc=0;
+ 	#ifdef _HAVE_MPI_
+-		#ifdef _HAVE_AMPI_
+-			#ifdef _HAVE_ADJOINTMPI_
++		#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
++			#if defined(_HAVE_ADJOINTMPI_)
+ 				rc=AMPI_Finalize();
++			#elif defined(_HAVE_MEDIPACK_)
++				TOOL::finalize();
++				rc=AMPI_Finalize();
+ 			#else
+ 				rc=AMPI_Finalize_NT();
+ 			#endif
+@@ -233,7 +236,7 @@
+   int rc=0;
+   assert(sendtype==recvtype && sendcnt==recvcnt); // we handle only identical representations
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Gather(sendbuf,
+ 		 sendcnt,
+ 		 sendtype,
+@@ -270,7 +273,7 @@
+   int rc=0;
+   assert(sendtype==recvtype); // we handle only identical representations
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Gatherv(sendbuf,
+ 		  sendcnt,
+ 		  sendtype,
+@@ -309,9 +312,12 @@
+ 
+ 	int rc=0;
+ 	#ifdef _HAVE_MPI_
+-		#ifdef _HAVE_AMPI_
+-			#ifdef _HAVE_ADJOINTMPI_
++		#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
++			#if defined(_HAVE_ADJOINTMPI_)
+ 				rc=AMPI_Init(argc,argv);
++			#elif defined(_HAVE_MEDIPACK_)
++				rc=AMPI_Init(argc,argv);
++				TOOL::init();
+ 			#else
+ 				rc=AMPI_Init_NT(argc,argv);
+ 			#endif
+@@ -325,7 +331,7 @@
+ 
+   int rc=0;
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Recv(buf, 
+ 	       count,
+ 	       datatype,
+@@ -356,7 +362,7 @@
+ 
+   int rc=0;
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Reduce(sendbuf,
+ 		 recvbuf,
+ 		 count,
+@@ -391,7 +397,7 @@
+   int rc=0;
+   assert(sendtype==recvtype && sendcnt==recvcnt); // we handle only identical representations
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Scatter(sendbuf,
+ 		  sendcnt,
+ 		  sendtype,
+@@ -428,7 +434,7 @@
+   int rc=0;
+   assert(sendtype==recvtype); // we handle only identical representations
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Scatterv(sendbuf,
+ 		   sendcnts,
+ 		   displs,
+@@ -467,7 +473,7 @@
+ 
+   int rc=0;
+ #ifdef _HAVE_MPI_
+-# ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+   rc=AMPI_Send(buf, 
+ 	       count,
+ 	       datatype,
+@@ -511,7 +517,7 @@
+ 
+ int rc=0;
+ #ifdef _HAVE_MPI_
+-#ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+ rc=MPI_Comm_split(comm, color, key, newcomm);
+ #else
+ rc=MPI_Comm_split(comm, color, key, newcomm);
+@@ -525,7 +531,7 @@
+ 
+ 	int rc=0;
+ #ifdef _HAVE_MPI_
+-#ifdef _HAVE_AMPI_
++#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
+ 	rc=MPI_Intercomm_create(comm,local_leader,peer_comm,remote_leader,tag,newintercomm);
+ #else
+ 	rc=MPI_Intercomm_create(comm,local_leader,peer_comm,remote_leader,tag,newintercomm);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23349-23350.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23349-23350.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23349-23350.diff	(revision 23390)
@@ -0,0 +1,103 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 23349)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 23350)
+@@ -988,6 +988,38 @@
+ 	fi
+ 	AM_CONDITIONAL([ADJOINTMPI], [test x$HAVE_ADJOINTMPI = xyes])
+ 	dnl }}}
++	dnl medipack (CoDiPack, ADOLC dev){{{
++	AC_ARG_WITH([medipack-dir],
++	  AS_HELP_STRING([--with-medipack-dir=DIR], [MeDiPack root directory.]),
++	  [MEDIPACK_ROOT=$withval],[MEDIPACK_ROOT="no"])
++
++	dnl Check whether medipack is enabled
++	AC_MSG_CHECKING([for medipack])
++	if test "x$MEDIPACK_ROOT" = "xno" ; then
++		HAVE_MEDIPACK=no
++	else
++		HAVE_MEDIPACK=yes
++		if ! test -d "$MEDIPACK_ROOT"; then
++			AC_MSG_ERROR([medipack directory provided ($MEDIPACK_ROOT) does not exist]);
++		fi
++	fi
++	AC_MSG_RESULT($HAVE_MEDIPACK)
++
++	dnl medipack headers and libraries
++	if test "x$HAVE_MEDIPACK" == "xyes"; then
++		if test "x$CODIPACK_ROOT" == "xno"; then
++			AC_MSG_ERROR([cannot run MeDiPack without CoDiPack]);
++		fi
++		MEDIPACKINCL="-I$MEDIPACK_ROOT/include -I$MEDIPACK_ROOT/src"
++		dnl Also set _HAVE_AMPI_, because the interface is (almost) the
++		dnl same as for adjoinable mpi...
++		AC_DEFINE([_HAVE_AMPI_],[1],[with adjoint mpi in ISSM src])
++		AC_DEFINE([_HAVE_MEDIPACK_],[1],[with MeDiPack in ISSM src])
++		AC_SUBST([MEDIPACKINCL])
++	fi
++	AM_CONDITIONAL([MEDIPACK], [test x$HAVE_MEDIPACK = xyes])
++
++	dnl }}}
+ 	dnl rose{{{
+ 	AC_ARG_WITH([rose-dir],
+ 	  AS_HELP_STRING([--with-rose-dir=DIR], [rose root directory.]),
+@@ -2234,6 +2266,9 @@
+ 		if test "$HAVE_ADOLC" = "yes"  && test "$HAVE_PETSC" = "yes" ; then
+ 			AC_MSG_ERROR([cannot compile ISSM with both PETSc and adolc]);
+ 		fi
++		if test "$HAVE_ADOLC" = "yes"  && test "$HAVE_CODIPACK" = "yes" ; then
++			AC_MSG_ERROR([cannot compile ISSM with both ADOLC and CoDiPack]);
++		fi
+ 		dnl check that if we run meteoio, we have snowpack also
+ 		if test "$HAVE_METEOIO" = "yes"  && test "$HAVE_SNOWPACK" = "no" ; then
+ 			AC_MSG_ERROR([cannot compile MeteoIO package without Snowpack!]);
+Index: ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23349)
++++ ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23350)
+@@ -123,6 +123,7 @@
+ 				&gttol,normtype,&impres,&io,imode,&omode,&niter,&nsim,iz,dz,&ndz,
+ 				&reverse,&indic,izs,rzs,(void*)&mystruct);
+ 
++	/*Print exit flag*/
+ 	switch(int(omode)){
+ 		case 0:  _printf0_("   Stop requested (indic = 0)\n"); break;
+ 		case 1:  _printf0_("   Convergence reached (gradient satisfies stopping criterion)\n"); break;
+Index: ../trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp	(revision 23349)
++++ ../trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp	(revision 23350)
+@@ -1 +1,14 @@
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#if defined(_HAVE_ADJOINTMPI_)
+ #include "externals/ampi_interface_realreverse.cpp"
++#elif defined(_HAVE_MEDIPACK_)
++#include "medi/medi.cpp"
++#else
++#error "Cannot compile without MeDiPack and AdjointMpi"
++#endif
++
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 23349)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 23350)
+@@ -323,10 +323,13 @@
+ 					./classes/Inputs/PentaInput.cpp\
+ 					./classes/Inputs/TetraInput.cpp
+ #}}}
+-# ADJOINTMPI sources {{{
++#ADJOINTMPI/MeDiPack sources {{{
+ if ADJOINTMPI
+ issm_sources += ./toolkits/codipack/ampi_interface.cpp
+ endif
++if MEDIPACK
++issm_sources += ./toolkits/codipack/ampi_interface.cpp
++endif
+ # }}}
+ #DAKOTA sources  {{{
+ if DAKOTA
Index: /issm/oecreview/Archive/23185-23389/ISSM-23350-23351.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23350-23351.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23350-23351.diff	(revision 23390)
@@ -0,0 +1,41 @@
+Index: ../trunk-jpl/test/NightlyRun/test211.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test211.m	(revision 23350)
++++ ../trunk-jpl/test/NightlyRun/test211.m	(revision 23351)
+@@ -15,7 +15,7 @@
+ 	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={...
+ 	2e-08,2e-08,5e-05,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,...
+-	5e-06,5e-06,8e-05,5e-06,3e-07,5e-07,5e-07,5e-07,3e-06,5e-05,...
++	5e-06,5e-06,8e-05,5e-06,5e-07,5e-07,5e-07,5e-07,3e-06,5e-05,...
+ 	8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test211.js
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test211.js	(revision 23350)
++++ ../trunk-jpl/test/NightlyRun/test211.js	(revision 23351)
+@@ -16,7 +16,7 @@
+ 	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'];
+ field_tolerances=[
+ 	2e-08,2e-08,5e-05,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,
+-	5e-06,5e-06,8e-05,5e-06,3e-07,5e-07,5e-07,5e-07,3e-06,5e-05,
++	5e-06,5e-06,8e-05,5e-06,5e-07,5e-07,5e-07,5e-07,3e-06,5e-05,
+ 	8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05];
+ field_values=[
+ 	(md.results.TransientSolution[0](1).Vx),
+Index: ../trunk-jpl/test/NightlyRun/test211.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test211.py	(revision 23350)
++++ ../trunk-jpl/test/NightlyRun/test211.py	(revision 23351)
+@@ -25,8 +25,8 @@
+ 						 'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',
+ 						 'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[2e-08,2e-08,5e-05,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,
+-				  5e-06,5e-06,8e-05,5e-06,3e-07,5e-07,5e-07,5e-07,3e-06,5e-05,
+-				  8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05]
++        5e-06,5e-06,8e-05,5e-06,5e-07,5e-07,5e-07,5e-07,3e-06,5e-05,
++        8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05]
+ field_values=[md.results.TransientSolution[0].Vx,
+ 							md.results.TransientSolution[0].Vy,
+ 							md.results.TransientSolution[0].Vz,
Index: /issm/oecreview/Archive/23185-23389/ISSM-23351-23352.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23351-23352.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23351-23352.diff	(revision 23390)
@@ -0,0 +1,111 @@
+Index: ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23351)
++++ ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23352)
+@@ -17,9 +17,24 @@
+ 
+ #ifdef _HAVE_MPI_
+ 	/*Include header files: {{{*/
+-	#ifdef _HAVE_AMPI_
+-		#ifdef _HAVE_ADJOINTMPI_
++	#if defined(_HAVE_AMPI_)
++		#if defined(_HAVE_ADJOINTMPI_)
+ 			#include <ampi_tape.hpp>
++
++		#elif defined(_HAVE_MEDIPACK_)
++			#include "medi/medi.hpp"
++			using namespace medi;
++			#include "medi/codiMediPackTypes.hpp"
++			#if defined(_HAVE_CODIPACK_)
++			#define TOOL CoDiPackTool<IssmDouble>
++			#define AMPI_ADOUBLE TOOL::MPI_TYPE
++			#elif defined(_HAVE_ADOLC_)
++			#include "adolc/medipacksupport.h"
++			#define TOOL AdolcTool
++			#else
++			#error "don't know about AD tool"
++			#endif
++
+ 		#else
+ 			#include <ampi/ampi.h>
+ 		#endif
+@@ -30,34 +45,61 @@
+ 	#endif
+ 	/*}}}*/
+ 	/*MPI defines: *{{{*/
++
+ 	// types
++	#if defined(_HAVE_MEDIPACK_)
++	typedef AMPI_Comm             ISSM_MPI_Comm;
++	typedef AMPI_Datatype         ISSM_MPI_Datatype;
++	typedef AMPI_Op               ISSM_MPI_Op;
++	typedef AMPI_Status           ISSM_MPI_Status;
++	#else
+ 	typedef MPI_Comm             ISSM_MPI_Comm;
+ 	typedef MPI_Datatype         ISSM_MPI_Datatype;
+ 	typedef MPI_Op               ISSM_MPI_Op;
+ 	typedef MPI_Status           ISSM_MPI_Status;
+-
+-	// data types
+-	#define ISSM_MPI_CHAR       MPI_CHAR
+-	#if defined(_HAVE_AMPI_)
+-		#define ISSM_MPI_DOUBLE    AMPI_ADOUBLE // corresponds to IssmDouble
+-	#else 
+-		#define ISSM_MPI_DOUBLE    MPI_DOUBLE  // corresponds to IssmDouble 
+ 	#endif
+-	#define ISSM_MPI_PDOUBLE    MPI_DOUBLE  // corresponds to IssmPDouble
+-	#define ISSM_MPI_INT        MPI_INT
+ 
++	#if defined(_HAVE_MEDIPACK_)
++	#define ISSM_MPI_CHAR       AMPI_CHAR
++	#define ISSM_MPI_DOUBLE     AMPI_ADOUBLE // corresponds to IssmDouble
++	#define ISSM_MPI_PDOUBLE    AMPI_DOUBLE  // corresponds to IssmPDouble
++	#define ISSM_MPI_INT        AMPI_INT
++	
+ 	// operations
+-	#define ISSM_MPI_MAX        MPI_MAX
+-	#define ISSM_MPI_MIN        MPI_MIN
+-	#define ISSM_MPI_PROD       MPI_PROD
+-	#define ISSM_MPI_SUM        MPI_SUM
+-
++	#define ISSM_MPI_MAX        AMPI_MAX
++	#define ISSM_MPI_MIN        AMPI_MIN
++	#define ISSM_MPI_PROD       AMPI_PROD
++	#define ISSM_MPI_SUM        AMPI_SUM
++	
+ 	// others
+-	#define ISSM_MPI_COMM_WORLD    MPI_COMM_WORLD
+-	#define ISSM_MPI_STATUS_IGNORE MPI_STATUS_IGNORE
+-	#define ISSM_MPI_ANY_TAG       MPI_ANY_TAG
+-	#define ISSM_MPI_ANY_SOURCE    MPI_ANY_SOURCE
++	#define ISSM_MPI_COMM_WORLD    AMPI_COMM_WORLD
++	#define ISSM_MPI_STATUS_IGNORE AMPI_STATUS_IGNORE
++	#define ISSM_MPI_ANY_TAG       AMPI_ANY_TAG
++	#define ISSM_MPI_ANY_SOURCE    AMPI_ANY_SOURCE
+ 
++	#else
++		#if defined(_HAVE_AMPI_)
++			#define ISSM_MPI_DOUBLE    AMPI_ADOUBLE // corresponds to IssmDouble
++		#else 
++			#define ISSM_MPI_DOUBLE    MPI_DOUBLE  // corresponds to IssmDouble 
++		#endif
++		#define ISSM_MPI_PDOUBLE    MPI_DOUBLE  // corresponds to IssmPDouble
++		#define ISSM_MPI_INT        MPI_INT
++		#define ISSM_MPI_CHAR       MPI_CHAR
++
++		// operations
++		#define ISSM_MPI_MAX        MPI_MAX
++		#define ISSM_MPI_MIN        MPI_MIN
++		#define ISSM_MPI_PROD       MPI_PROD
++		#define ISSM_MPI_SUM        MPI_SUM
++
++		// others
++		#define ISSM_MPI_COMM_WORLD    MPI_COMM_WORLD
++		#define ISSM_MPI_STATUS_IGNORE MPI_STATUS_IGNORE
++		#define ISSM_MPI_ANY_TAG       MPI_ANY_TAG
++		#define ISSM_MPI_ANY_SOURCE    MPI_ANY_SOURCE
++	#endif
++
+     /*other include files: */
+ 	#include "./commops/commops.h"
+ 	/*}}}*/
Index: /issm/oecreview/Archive/23185-23389/ISSM-23352-23353.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23352-23353.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23352-23353.diff	(revision 23390)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/externalpackages/medipack/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/medipack/install.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/medipack/install.sh	(revision 23353)
+@@ -0,0 +1,8 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install 
++
++#Download development version
++svn co https://github.com/SciCompKL/MeDiPack/trunk install
+
+Property changes on: ../trunk-jpl/externalpackages/medipack/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/23185-23389/ISSM-23353-23354.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23353-23354.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23353-23354.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/groundingline.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/groundingline.m	(revision 23353)
++++ ../trunk-jpl/src/m/classes/groundingline.m	(revision 23354)
+@@ -32,7 +32,7 @@
+ 			md = checkfield(md,'fieldname','groundingline.friction_interpolation','values',{'NoFrictionOnPartiallyFloating' 'SubelementFriction1' 'SubelementFriction2'});
+ 			md = checkfield(md,'fieldname','groundingline.melt_interpolation','values',{'NoMeltOnPartiallyFloating' 'SubelementMelt1' 'SubelementMelt2' 'FullMeltOnPartiallyFloating'});
+ 
+-			if ~strcmp(self.migration,'None'),
++			if ~strcmp(self.migration,'None') & strcmp(solution,'TransientSolution') & md.transient.isgroundingline==1,
+ 				if isnan(md.geometry.bed),
+ 					md = checkmessage(md,['requesting grounding line migration, but bathymetry is absent!']);
+ 				end
Index: /issm/oecreview/Archive/23185-23389/ISSM-23354-23355.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23354-23355.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23354-23355.diff	(revision 23390)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/m/classes/groundingline.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/groundingline.py	(revision 23354)
++++ ../trunk-jpl/src/m/classes/groundingline.py	(revision 23355)
+@@ -44,7 +44,7 @@
+ 		md = checkfield(md,'fieldname','groundingline.friction_interpolation','values',['SubelementFriction1','SubelementFriction2','NoFrictionOnPartiallyFloating'])
+ 		md = checkfield(md,'fieldname','groundingline.melt_interpolation','values',['SubelementMelt1','SubelementMelt2','NoMeltOnPartiallyFloating','FullMeltOnPartiallyFloating'])
+ 
+-		if not m.strcmp(self.migration,'None'):
++		if(not m.strcmp(self.migration,'None') and md.transient.isgroundingline and solution=='TransientSolution'):
+ 			if np.any(np.isnan(md.geometry.bed)):
+ 				md.checkmessage("requesting grounding line migration, but bathymetry is absent!")
+ 			pos=np.nonzero(md.mask.groundedice_levelset>0.)[0]
+Index: ../trunk-jpl/src/m/classes/groundingline.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/groundingline.js	(revision 23354)
++++ ../trunk-jpl/src/m/classes/groundingline.js	(revision 23355)
+@@ -28,7 +28,7 @@
+ 			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'){
++			if(this.migration !='None' & md.trans.isgroundingline==1 & solution == 'TransientSolution'){
+ 				if (isNaN(md.geometry.bed)){
+ 					md.checkmessage('requesting grounding line migration, but bathymetry is absent!');
+ 				}
Index: /issm/oecreview/Archive/23185-23389/ISSM-23357-23358.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23357-23358.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23357-23358.diff	(revision 23390)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 23357)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 23358)
+@@ -2269,6 +2269,9 @@
+ 		if test "$HAVE_ADOLC" = "yes"  && test "$HAVE_CODIPACK" = "yes" ; then
+ 			AC_MSG_ERROR([cannot compile ISSM with both ADOLC and CoDiPack]);
+ 		fi
++		if test "$HAVE_ADJOINTMPI" = "yes"  && test "$HAVE_MEDIPACK" = "yes" ; then
++			AC_MSG_ERROR([cannot compile ISSM with both MeDiPack and AdjointMPI]);
++		fi
+ 		dnl check that if we run meteoio, we have snowpack also
+ 		if test "$HAVE_METEOIO" = "yes"  && test "$HAVE_SNOWPACK" = "no" ; then
+ 			AC_MSG_ERROR([cannot compile MeteoIO package without Snowpack!]);
Index: /issm/oecreview/Archive/23185-23389/ISSM-23358-23359.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23358-23359.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23358-23359.diff	(revision 23390)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/test/NightlyRun/test3480.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3480.m	(revision 23358)
++++ ../trunk-jpl/test/NightlyRun/test3480.m	(revision 23359)
+@@ -55,9 +55,6 @@
+ md.autodiff.dependents{1} = dependent('name','Outputdefinition1','type','scalar','fos_reverse_index',1);
+ md.inversion.maxiter = 2;
+ md.cluster=generic('name',oshostname(),'np',3);
+-if IssmConfig('_HAVE_CODIPACK_')
+-	md.cluster.np=1;
+-end
+ md=solve(md,'transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test3481.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3481.m	(revision 23358)
++++ ../trunk-jpl/test/NightlyRun/test3481.m	(revision 23359)
+@@ -61,9 +61,6 @@
+ md.autodiff.dependents{1} = dependent('name','Outputdefinition1','type','scalar','fos_reverse_index',1);
+ md.inversion.maxiter = 2;
+ md.cluster=generic('name',oshostname(),'np',3);
+-if IssmConfig('_HAVE_CODIPACK_')
+-	md.cluster.np=1;
+-end
+ md=solve(md,'transient');
+ 
+ %Fields and tolerances to track changes
Index: /issm/oecreview/Archive/23185-23389/ISSM-23365-23366.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23365-23366.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23365-23366.diff	(revision 23390)
@@ -0,0 +1,1114 @@
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 23365)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 23366)
+@@ -37,7 +37,6 @@
+ 
+ 	/*Figure out smb model: */
+ 	iomodel->FindConstant(&smb_model,"md.smb.model");
+-
+ 	switch(smb_model){
+ 		case SMBforcingEnum:
+ 			iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum,0.);
+@@ -151,6 +150,12 @@
+ 			iomodel->FetchDataToInput(elements,"md.smb.melt",SmbMeltEnum,0.);
+ 			iomodel->FetchDataToInput(elements,"md.smb.refreeze",SmbRefreezeEnum,0.);
+ 			break;
++		case SMBgradientscomponentsEnum:
++			iomodel->FetchDataToInput(elements,"md.smb.accualti",SmbAccualtiEnum);
++			iomodel->FetchDataToInput(elements,"md.smb.accugrad",SmbAccugradEnum);
++			iomodel->FetchDataToInput(elements,"md.smb.runoffalti",SmbRunoffaltiEnum);
++			iomodel->FetchDataToInput(elements,"md.smb.runoffgrad",SmbRunoffgradEnum);
++			break;
+ 		default:
+ 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+ 	}
+@@ -261,6 +266,20 @@
+ 		case SMBmeltcomponentsEnum:
+ 			/*Nothing to add to parameters*/
+ 			break;
++		case SMBgradientscomponentsEnum:
++				parameters->AddObject(iomodel->CopyConstantObject("md.smb.accualti",SmbAccualtiEnum));
++				parameters->AddObject(iomodel->CopyConstantObject("md.smb.accugrad",SmbAccugradEnum));
++				parameters->AddObject(iomodel->CopyConstantObject("md.smb.runoffalti",SmbRunoffaltiEnum));
++				parameters->AddObject(iomodel->CopyConstantObject("md.smb.runoffgrad",SmbRunoffgradEnum));
++
++			  iomodel->FetchData(&temp,&N,&M,"md.smb.accuref"); _assert_(N==2);
++			  parameters->AddObject(new TransientParam(SmbAccurefEnum,&temp[0],&temp[M],interp,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));
++			  iomodel->DeleteData(temp,"md.smb.runoffref");
++			break;
+ 		default:
+ 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+ 	}
+@@ -295,11 +314,11 @@
+ 			if(isdelta18o){
+ 				if(VerboseSolution()) _printf0_("   call Delta18oParameterization module\n");
+ 				Delta18oParameterizationx(femmodel);
+-			} 
++			}
+ 			if(ismungsm){
+ 				if(VerboseSolution()) _printf0_("   call MungsmtpParameterization module\n");
+ 				MungsmtpParameterizationx(femmodel);
+-			} 
++			}
+ 			if(VerboseSolution()) _printf0_("   call positive degree day module\n");
+ 			PositiveDegreeDayx(femmodel);
+ 			break;
+@@ -340,6 +359,10 @@
+ 		case SMBgcmEnum:
+ 			/*Nothing to be done*/
+ 			break;
++		case SMBgradientscomponentsEnum:
++			if(VerboseSolution())_printf0_("	call smb gradients components module\n");
++			SmbGradientsComponentsx(femmodel);
++			break;
+ 		default:
+ 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+ 	}
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 23365)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 23366)
+@@ -272,6 +272,9 @@
+ 	SettingsResultsOnNodesEnum,
+ 	SettingsSolverResidueThresholdEnum,
+ 	SettingsWaitonlockEnum,
++	SmbAccualtiEnum,
++	SmbAccugradEnum,
++	SmbAccurefEnum,
+ 	SmbAdThreshEnum,
+ 	SmbAIceEnum,
+ 	SmbAIdxEnum,
+@@ -303,6 +306,9 @@
+ 	SmbNumRequestedOutputsEnum,
+ 	SmbPfacEnum,
+ 	SmbRequestedOutputsEnum,
++	SmbRunoffaltiEnum,
++	SmbRunoffgradEnum,
++	SmbRunoffrefEnum,
+ 	SmbSealevEnum,
+ 	SmbSwIdxEnum,
+ 	SmbT0dryEnum,
+@@ -527,9 +533,9 @@
+ 	SealevelUEsaRateEnum,
+ 	SealevelNEsaRateEnum,
+ 	SealevelRSLRateEnum,
+-	SealevelUEsaEnum, 
++	SealevelUEsaEnum,
+ 	SealevelRSLEustaticRateEnum,
+-	SealevelNEsaEnum, 
++	SealevelNEsaEnum,
+ 	SealevelUGiaEnum,
+ 	SealevelNGiaEnum,
+ 	SealevelRSLEnum,
+@@ -1100,6 +1106,7 @@
+ 	SMBmeltcomponentsEnum,
+ 	SMBpddEnum,
+ 	SMBpddSicopolisEnum,
++	SMBgradientscomponentsEnum,
+ 	SmbRlapsEnum,
+ 	SmbRlapslgmEnum,
+ 	SmbSolutionEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 23365)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 23366)
+@@ -280,6 +280,9 @@
+ 		case SettingsResultsOnNodesEnum : return "SettingsResultsOnNodes";
+ 		case SettingsSolverResidueThresholdEnum : return "SettingsSolverResidueThreshold";
+ 		case SettingsWaitonlockEnum : return "SettingsWaitonlock";
++		case SmbAccualtiEnum : return "SmbAccualti";
++		case SmbAccugradEnum : return "SmbAccugrad";
++		case SmbAccurefEnum : return "SmbAccuref";
+ 		case SmbAdThreshEnum : return "SmbAdThresh";
+ 		case SmbAIceEnum : return "SmbAIce";
+ 		case SmbAIdxEnum : return "SmbAIdx";
+@@ -311,6 +314,9 @@
+ 		case SmbNumRequestedOutputsEnum : return "SmbNumRequestedOutputs";
+ 		case SmbPfacEnum : return "SmbPfac";
+ 		case SmbRequestedOutputsEnum : return "SmbRequestedOutputs";
++		case SmbRunoffaltiEnum : return "SmbRunoffalti";
++		case SmbRunoffgradEnum : return "SmbRunoffgrad";
++		case SmbRunoffrefEnum : return "SmbRunoffref";
+ 		case SmbSealevEnum : return "SmbSealev";
+ 		case SmbSwIdxEnum : return "SmbSwIdx";
+ 		case SmbT0dryEnum : return "SmbT0dry";
+@@ -1104,6 +1110,7 @@
+ 		case SMBmeltcomponentsEnum : return "SMBmeltcomponents";
+ 		case SMBpddEnum : return "SMBpdd";
+ 		case SMBpddSicopolisEnum : return "SMBpddSicopolis";
++		case SMBgradientscomponentsEnum : return "SMBgradientscomponents";
+ 		case SmbRlapsEnum : return "SmbRlaps";
+ 		case SmbRlapslgmEnum : return "SmbRlapslgm";
+ 		case SmbSolutionEnum : return "SmbSolution";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 23365)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 23366)
+@@ -286,6 +286,9 @@
+ 	      else if (strcmp(name,"SettingsResultsOnNodes")==0) return SettingsResultsOnNodesEnum;
+ 	      else if (strcmp(name,"SettingsSolverResidueThreshold")==0) return SettingsSolverResidueThresholdEnum;
+ 	      else if (strcmp(name,"SettingsWaitonlock")==0) return SettingsWaitonlockEnum;
++	      else if (strcmp(name,"SmbAccualti")==0) return SmbAccualtiEnum;
++	      else if (strcmp(name,"SmbAccugrad")==0) return SmbAccugradEnum;
++	      else if (strcmp(name,"SmbAccuref")==0) return SmbAccurefEnum;
+ 	      else if (strcmp(name,"SmbAdThresh")==0) return SmbAdThreshEnum;
+ 	      else if (strcmp(name,"SmbAIce")==0) return SmbAIceEnum;
+ 	      else if (strcmp(name,"SmbAIdx")==0) return SmbAIdxEnum;
+@@ -317,6 +320,9 @@
+ 	      else if (strcmp(name,"SmbNumRequestedOutputs")==0) return SmbNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SmbPfac")==0) return SmbPfacEnum;
+ 	      else if (strcmp(name,"SmbRequestedOutputs")==0) return SmbRequestedOutputsEnum;
++	      else if (strcmp(name,"SmbRunoffalti")==0) return SmbRunoffaltiEnum;
++	      else if (strcmp(name,"SmbRunoffgrad")==0) return SmbRunoffgradEnum;
++	      else if (strcmp(name,"SmbRunoffref")==0) return SmbRunoffrefEnum;
+ 	      else if (strcmp(name,"SmbSealev")==0) return SmbSealevEnum;
+ 	      else if (strcmp(name,"SmbSwIdx")==0) return SmbSwIdxEnum;
+ 	      else if (strcmp(name,"SmbT0dry")==0) return SmbT0dryEnum;
+@@ -376,16 +382,16 @@
+ 	      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 stage=4;
++   }
++   if(stage==4){
++	      if (strcmp(name,"TransientIsslr")==0) return TransientIsslrEnum;
+ 	      else if (strcmp(name,"TransientIssmb")==0) return TransientIssmbEnum;
+ 	      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;
+-         else stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"Velocity")==0) return VelocityEnum;
++	      else if (strcmp(name,"Velocity")==0) return VelocityEnum;
+ 	      else if (strcmp(name,"WorldComm")==0) return WorldCommEnum;
+ 	      else if (strcmp(name,"ParametersEND")==0) return ParametersENDEnum;
+ 	      else if (strcmp(name,"InputsSTART")==0) return InputsSTARTEnum;
+@@ -499,16 +505,16 @@
+ 	      else if (strcmp(name,"HydrologyDrainageRate")==0) return HydrologyDrainageRateEnum;
+ 	      else if (strcmp(name,"Ice")==0) return IceEnum;
+ 	      else if (strcmp(name,"IceMaskNodeActivation")==0) return IceMaskNodeActivationEnum;
+-	      else if (strcmp(name,"Input")==0) return InputEnum;
++         else stage=5;
++   }
++   if(stage==5){
++	      if (strcmp(name,"Input")==0) return InputEnum;
+ 	      else if (strcmp(name,"InversionCostFunctionsCoefficients")==0) return InversionCostFunctionsCoefficientsEnum;
+ 	      else if (strcmp(name,"InversionSurfaceObs")==0) return InversionSurfaceObsEnum;
+ 	      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=5;
+-   }
+-   if(stage==5){
+-	      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,"LoadingforceX")==0) return LoadingforceXEnum;
+@@ -622,16 +628,16 @@
+ 	      else if (strcmp(name,"SmbV")==0) return SmbVEnum;
+ 	      else if (strcmp(name,"SmbVz")==0) return SmbVzEnum;
+ 	      else if (strcmp(name,"SmbW")==0) return SmbWEnum;
+-	      else if (strcmp(name,"SmbWini")==0) return SmbWiniEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      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 if (strcmp(name,"SmbZY")==0) return SmbZYEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+-         else stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
++	      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;
+@@ -745,16 +751,16 @@
+ 	      else if (strcmp(name,"DataSet")==0) return DataSetEnum;
+ 	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
+ 	      else if (strcmp(name,"DataSetParam")==0) return DataSetParamEnum;
+-	      else if (strcmp(name,"DefaultAnalysis")==0) return DefaultAnalysisEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"DefaultAnalysis")==0) return DefaultAnalysisEnum;
+ 	      else if (strcmp(name,"DefaultCalving")==0) return DefaultCalvingEnum;
+ 	      else if (strcmp(name,"DegreeOfChannelization")==0) return DegreeOfChannelizationEnum;
+ 	      else if (strcmp(name,"Dense")==0) return DenseEnum;
+ 	      else if (strcmp(name,"DependentObject")==0) return DependentObjectEnum;
+ 	      else if (strcmp(name,"DepthAverageAnalysis")==0) return DepthAverageAnalysisEnum;
+-         else stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
++	      else if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
+ 	      else if (strcmp(name,"DeviatoricStressErrorEstimator")==0) return DeviatoricStressErrorEstimatorEnum;
+ 	      else if (strcmp(name,"Divergence")==0) return DivergenceEnum;
+ 	      else if (strcmp(name,"Domain3Dsurface")==0) return Domain3DsurfaceEnum;
+@@ -868,16 +874,16 @@
+ 	      else if (strcmp(name,"LACrouzeixRaviart")==0) return LACrouzeixRaviartEnum;
+ 	      else if (strcmp(name,"LambdaS")==0) return LambdaSEnum;
+ 	      else if (strcmp(name,"LATaylorHood")==0) return LATaylorHoodEnum;
+-	      else if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum;
+ 	      else if (strcmp(name,"LevelsetfunctionPicard")==0) return LevelsetfunctionPicardEnum;
+ 	      else if (strcmp(name,"LinearFloatingMeltRate")==0) return LinearFloatingMeltRateEnum;
+ 	      else if (strcmp(name,"SpatialLinearFloatingMeltRate")==0) return SpatialLinearFloatingMeltRateEnum;
+ 	      else if (strcmp(name,"LliboutryDuval")==0) return LliboutryDuvalEnum;
+ 	      else if (strcmp(name,"Loads")==0) return LoadsEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      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;
+@@ -991,16 +997,16 @@
+ 	      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,"Outputdefinition39")==0) return Outputdefinition39Enum;
+ 	      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;
+ 	      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;
+@@ -1114,16 +1120,16 @@
+ 	      else if (strcmp(name,"SmbAnalysis")==0) return SmbAnalysisEnum;
+ 	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
+ 	      else if (strcmp(name,"SMBd18opdd")==0) return SMBd18opddEnum;
+-	      else if (strcmp(name,"SmbDesfac")==0) return SmbDesfacEnum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"SmbDesfac")==0) return SmbDesfacEnum;
+ 	      else if (strcmp(name,"SmbDpermil")==0) return SmbDpermilEnum;
+ 	      else if (strcmp(name,"SmbDzAdd")==0) return SmbDzAddEnum;
+ 	      else if (strcmp(name,"SmbFAC")==0) return SmbFACEnum;
+ 	      else if (strcmp(name,"SMBforcing")==0) return SMBforcingEnum;
+ 	      else if (strcmp(name,"SMBgcm")==0) return SMBgcmEnum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"SMBgemb")==0) return SMBgembEnum;
++	      else if (strcmp(name,"SMBgemb")==0) return SMBgembEnum;
+ 	      else if (strcmp(name,"SMBgradientsela")==0) return SMBgradientselaEnum;
+ 	      else if (strcmp(name,"SMBgradients")==0) return SMBgradientsEnum;
+ 	      else if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum;
+@@ -1131,6 +1137,7 @@
+ 	      else if (strcmp(name,"SMBmeltcomponents")==0) return SMBmeltcomponentsEnum;
+ 	      else if (strcmp(name,"SMBpdd")==0) return SMBpddEnum;
+ 	      else if (strcmp(name,"SMBpddSicopolis")==0) return SMBpddSicopolisEnum;
++	      else if (strcmp(name,"SMBgradientscomponents")==0) return SMBgradientscomponentsEnum;
+ 	      else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
+ 	      else if (strcmp(name,"SmbRlapslgm")==0) return SmbRlapslgmEnum;
+ 	      else if (strcmp(name,"SmbSolution")==0) return SmbSolutionEnum;
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 23365)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 23366)
+@@ -173,6 +173,7 @@
+ 		case 8: return SMBgembEnum;
+ 		case 9: return SMBgradientselaEnum;
+ 		case 10: return SMBpddSicopolisEnum;
++		case 11: return SMBgradientscomponentsEnum;
+ 		default: _error_("Marshalled SMB code \""<<enum_in<<"\" not supported yet");
+ 	}
+ }/*}}}*/
+@@ -205,32 +206,32 @@
+ 		case 2: return HydrologyshreveEnum;
+ 		case 3: return HydrologyshaktiEnum;
+ 		case 4: return HydrologypismEnum;
+-		default: _error_("Marshalled hydrology code \""<<enum_in<<"\" not supported yet"); 
++		default: _error_("Marshalled hydrology code \""<<enum_in<<"\" not supported yet");
+ 	}
+ }/*}}}*/
+ int IoCodeToEnumMaterials(int enum_in){/*{{{*/
+ 	switch(enum_in){
+ 		case 1: return MatdamageiceEnum;
+-		case 2: return MatestarEnum; 
++		case 2: return MatestarEnum;
+ 		case 3: return MaticeEnum;
+ 		case 4: return MatenhancediceEnum;
+ 		case 5: return MatlithoEnum;
+ 		case 6: return MaterialsEnum;
+-		default: _error_("Marshalled materials code \""<<enum_in<<"\" not supported yet"); 
++		default: _error_("Marshalled materials code \""<<enum_in<<"\" not supported yet");
+ 	}
+ }/*}}}*/
+ int IoCodeToEnumTimestepping(int enum_in){/*{{{*/
+ 	switch(enum_in){
+ 		case 1: return FixedTimesteppingEnum;
+-		case 2: return AdaptiveTimesteppingEnum; 
+-		default: _error_("Marshalled materials code \""<<enum_in<<"\" not supported yet"); 
++		case 2: return AdaptiveTimesteppingEnum;
++		default: _error_("Marshalled materials code \""<<enum_in<<"\" not supported yet");
+ 	}
+ }/*}}}*/
+ int IoCodeToEnumAmr(int enum_in){/*{{{*/
+ 	switch(enum_in){
+ 		case 1: return AmrBamgEnum;
+-		case 2: return AmrNeopzEnum; 
+-		default: _error_("Marshalled AMR code \""<<enum_in<<"\" not supported yet"); 
++		case 2: return AmrNeopzEnum;
++		default: _error_("Marshalled AMR code \""<<enum_in<<"\" not supported yet");
+ 	}
+ }/*}}}*/
+ 
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 23365)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 23366)
+@@ -1,5 +1,5 @@
+ /*!\file SurfaceMassBalancex
+- * \brief: calculates SMB 
++ * \brief: calculates SMB
+  */
+ 
+ #include "./SurfaceMassBalancex.h"
+@@ -104,7 +104,7 @@
+ 		/*Loop over all vertices, calculate SMB*/
+ 		for(v=0;v<numvertices;v++){
+ 			// if surface is above the ELA
+-			if(s[v]>ela[v]){		
++			if(s[v]>ela[v]){
+ 				smb[v]=b_pos[v]*(s[v]-ela[v]);
+ 			}
+ 			// if surface is below or equal to the ELA
+@@ -166,7 +166,7 @@
+ 	//    INPUT parameters: ni: working size of arrays
+ 	//    INPUT: surface elevation (m): hd(NA)
+ 	//    monthly mean surface sealevel temperature (degrees C): vTempsea(NA
+-	//    ,NTIME) 
++	//    ,NTIME)
+ 	//    monthly mean precip rate (m/yr water equivalent): vPrec(NA,NTIME)
+ 	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
+ 	//    mean annual surface temperature (degrees C): Tsurf(NA)
+@@ -173,13 +173,13 @@
+ 
+ 	int    i, it, jj, itm;
+ 	IssmDouble DT = 0.02, sigfac, snormfac;
+-	IssmDouble signorm = 5.5;      // signorm : sigma of the temperature distribution for a normal day 
++	IssmDouble signorm = 5.5;      // signorm : sigma of the temperature distribution for a normal day
+ 	IssmDouble siglim;       // sigma limit for the integration which is equal to 2.5 sigmanorm
+ 	IssmDouble signormc = signorm - 0.5;     // sigma of the temperature distribution for cloudy day
+ 	IssmDouble siglimc, siglim0, siglim0c;
+ 	IssmDouble tstep, tsint, tint, tstepc;
+ 	int    NPDMAX = 1504, NPDCMAX = 1454;
+-	//IssmDouble pdds[NPDMAX]={0}; 
++	//IssmDouble pdds[NPDMAX]={0};
+ 	//IssmDouble pds[NPDCMAX]={0};
+ 	IssmDouble pddt, pd ; // pd : snow/precip fraction, precipitation falling as snow
+ 	IssmDouble PDup, PDCUT = 2.0;    // PDcut: rain/snow cutoff temperature (C)
+@@ -192,8 +192,8 @@
+ 	IssmDouble *pds     = NULL;
+ 	Element    *element = NULL;
+ 
+-	pdds=xNew<IssmDouble>(NPDMAX+1); 
+-	pds=xNew<IssmDouble>(NPDCMAX+1); 
++	pdds=xNew<IssmDouble>(NPDMAX+1);
++	pds=xNew<IssmDouble>(NPDCMAX+1);
+ 
+ 	// Get ismungsm parameter
+ 	femmodel->parameters->FindParam(&ismungsm,SmbIsmungsmEnum);
+@@ -215,7 +215,7 @@
+ 	itm = reCast<int,IssmDouble>((2*siglim/DT + 1.5));
+ 
+ 	if(itm >= NPDMAX) _error_("increase NPDMAX in massBalance.cpp");
+-	for(it = 0; it < itm; it++){  
++	for(it = 0; it < itm; it++){
+ 		//    tstar = REAL(it)*DT-siglim;
+ 		tstar = it*DT-siglim;
+ 		tint = tsint;
+@@ -262,10 +262,10 @@
+ 	xDelete<IssmDouble>(pds);
+ }/*}}}*/
+ void PositiveDegreeDaySicopolisx(FemModel* femmodel){/*{{{*/
+-	
++
+ 	bool isfirnwarming;
+ 	femmodel->parameters->FindParam(&isfirnwarming,SmbIsfirnwarmingEnum);
+-	
++
+ 	for(int i=0;i<femmodel->elements->Size();i++){
+ 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+ 		element->PositiveDegreeDaySicopolis(isfirnwarming);
+@@ -356,9 +356,9 @@
+ 
+ 		/*Allocate all arrays*/
+ 		int         numvertices = element->GetNumberOfVertices();
+-		IssmDouble* acc         = xNew<IssmDouble>(numvertices); 
++		IssmDouble* acc         = xNew<IssmDouble>(numvertices);
+ 		IssmDouble* evap        = xNew<IssmDouble>(numvertices);
+-		IssmDouble* runoff      = xNew<IssmDouble>(numvertices); 
++		IssmDouble* runoff      = xNew<IssmDouble>(numvertices);
+ 		IssmDouble* smb         = xNew<IssmDouble>(numvertices);
+ 
+ 		/*Recover Smb Components*/
+@@ -398,7 +398,7 @@
+ 		/*Allocate all arrays*/
+ 		int         numvertices = element->GetNumberOfVertices();
+ 		IssmDouble* acc         = xNew<IssmDouble>(numvertices);
+-		IssmDouble* evap        = xNew<IssmDouble>(numvertices); 
++		IssmDouble* evap        = xNew<IssmDouble>(numvertices);
+ 		IssmDouble* melt        = xNew<IssmDouble>(numvertices);
+ 		IssmDouble* refreeze    = xNew<IssmDouble>(numvertices);
+ 		IssmDouble* smb         = xNew<IssmDouble>(numvertices);
+@@ -424,3 +424,16 @@
+ 	}
+ 
+ }/*}}}*/
++void SmbGradientsComponentsx(FemModel* femmodel){/*{{{*/
++
++	// void SurfaceMassBalancex(hd,agd,ni){
++	//    INPUT parameters: ni: working size of arrays
++	//    INPUT: surface elevation (m): hd(NA)
++	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
++
++	for(int i=0;i<femmodel->elements->Size();i++){
++		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
++		element->SmbGradCompParameterization();
++	}
++
++}/*}}}*/
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 23365)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 23366)
+@@ -1,6 +1,6 @@
+ /*!\file:  SurfaceMassBalancex.h
+  * \brief header file for SMB
+- */ 
++ */
+ 
+ #ifndef _SurfaceMassBalancex_H
+ #define _SurfaceMassBalancex_H
+@@ -18,17 +18,17 @@
+ void PositiveDegreeDaySicopolisx(FemModel* femmodel);
+ void SmbHenningx(FemModel* femmodel);
+ void SmbComponentsx(FemModel* femmodel);
+-void SmbMeltComponentsx(FemModel* femmodel); 
+-
++void SmbMeltComponentsx(FemModel* femmodel);
++void SmbGradientsComponentsx(FemModel* femmodel);
+ /*GEMB: */
+ void       Gembx(FemModel* femmodel);
+-void       GembgridInitialize(IssmDouble** pdz, int* psize, IssmDouble zTop, IssmDouble dzTop, IssmDouble zMax, IssmDouble zY); 
++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* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid);
+ void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble as, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid);
+ void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid);
+-void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx,IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble dIce, int sid); 
++void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx,IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble dIce, int sid);
+ void melt(IssmDouble* pM, IssmDouble* pR, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble dIce, int sid);
+ void densification(IssmDouble** pd,IssmDouble** pdz, IssmDouble* T, IssmDouble* re, int denIdx, IssmDouble C, IssmDouble dt, IssmDouble Tmean, IssmDouble dIce, int m, int sid);
+ void turbulentFlux(IssmDouble* pshf, IssmDouble* plhf, IssmDouble* pEC, IssmDouble Ta, IssmDouble Ts, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble ds, IssmDouble Ws, IssmDouble Vz, IssmDouble Tz, IssmDouble dIce, int sid);
+Index: ../trunk-jpl/src/c/classes/Materials/Matpar.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 23365)
++++ ../trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 23366)
+@@ -114,7 +114,7 @@
+ 					iomodel->FindConstant(&this->desfac,"md.smb.desfac");
+ 					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
+ 					iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
+-					iomodel->FindConstant(&this->dpermil,"md.smb.dpermil");					
++					iomodel->FindConstant(&this->dpermil,"md.smb.dpermil");
+ 				case SMBgradientsEnum:
+ 					/*Nothing to add*/
+ 					break;
+@@ -130,6 +130,9 @@
+ 				case SMBmeltcomponentsEnum:
+ 					/*Nothing to add*/
+ 					break;
++				case SMBgradientscomponentsEnum:
++					/*Nothing to add*/
++					break;
+ 				default:
+ 					_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+ 			}
+@@ -173,11 +176,11 @@
+ 
+ 			break;
+ 		case MaterialsEnum:
+-			//we have several types of materials. Retrieve this info first: 
++			//we have several types of materials. Retrieve this info first:
+ 			iomodel->FetchData(&nature,&nnat,&dummy,"md.materials.nature");
+ 
+-			//go through list of materials, and create constant parameters accordingly: 
+-			for(int i=0;i<nnat;i++){ 
++			//go through list of materials, and create constant parameters accordingly:
++			for(int i=0;i<nnat;i++){
+ 				switch(IoCodeToEnumMaterials(nature[i])){ //{{{
+ 					case MatlithoEnum:
+ 						break;
+@@ -222,7 +225,7 @@
+ 								iomodel->FindConstant(&this->desfac,"md.smb.desfac");
+ 								iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
+ 								iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
+-								iomodel->FindConstant(&this->dpermil,"md.smb.dpermil");					
++								iomodel->FindConstant(&this->dpermil,"md.smb.dpermil");
+ 							case SMBgradientsEnum:
+ 								/*Nothing to add*/
+ 								break;
+@@ -240,7 +243,7 @@
+ 								break;
+ 							default:
+ 								_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+-						} 
++						}
+ 						if(hydrology_model==HydrologydcEnum){
+ 							iomodel->FindConstant(&this->sediment_compressibility,"md.hydrology.sediment_compressibility");
+ 							iomodel->FindConstant(&this->sediment_porosity,"md.hydrology.sediment_porosity");
+@@ -357,7 +360,7 @@
+ void Matpar::DeepEcho(void){/*{{{*/
+ 
+ 	this->Echo();
+-}		
++}
+ /*}}}*/
+ void Matpar::Echo(void){/*{{{*/
+ 
+@@ -388,18 +391,18 @@
+ 	_printf_("   sediment_compressibility: " << sediment_compressibility << "\n");
+ 	_printf_("   sediment_porosity: " << sediment_porosity << "\n");
+ 	_printf_("   sediment_thickness: " << sediment_thickness << "\n");
+-	_printf_("   water_compressibility: " << water_compressibility << "\n");	
+-	_printf_("   epl_compressibility: " << epl_compressibility << "\n");	
+-	_printf_("   epl_porosity: " << epl_porosity << "\n");	
+-	_printf_("   epl_init_thickness: " << epl_init_thickness << "\n");	
+-	_printf_("   epl_colapse_thickness: " << epl_colapse_thickness << "\n");	
+-	_printf_("   epl_max_thickness: " << epl_max_thickness << "\n");	
+-	_printf_("   epl_conductivity: " << epl_conductivity << "\n");	
+-	_printf_("   lithosphere_shear_modulus: " << lithosphere_shear_modulus << "\n");	
+-	_printf_("   lithosphere_density: " << lithosphere_density << "\n");	
+-	_printf_("   mantle_shear_modulus: " << mantle_shear_modulus << "\n");	
+-	_printf_("   mantle_density: " << mantle_density << "\n");	
+-	_printf_("   earth_density: " << earth_density << "\n");	
++	_printf_("   water_compressibility: " << water_compressibility << "\n");
++	_printf_("   epl_compressibility: " << epl_compressibility << "\n");
++	_printf_("   epl_porosity: " << epl_porosity << "\n");
++	_printf_("   epl_init_thickness: " << epl_init_thickness << "\n");
++	_printf_("   epl_colapse_thickness: " << epl_colapse_thickness << "\n");
++	_printf_("   epl_max_thickness: " << epl_max_thickness << "\n");
++	_printf_("   epl_conductivity: " << epl_conductivity << "\n");
++	_printf_("   lithosphere_shear_modulus: " << lithosphere_shear_modulus << "\n");
++	_printf_("   lithosphere_density: " << lithosphere_density << "\n");
++	_printf_("   mantle_shear_modulus: " << mantle_shear_modulus << "\n");
++	_printf_("   mantle_density: " << mantle_density << "\n");
++	_printf_("   earth_density: " << earth_density << "\n");
+ 	return;
+ }
+ /*}}}*/
+@@ -519,7 +522,7 @@
+ 		case  SmbDpermilEnum:
+ 			this->dpermil=constant;
+ 			break;
+-		default: 
++		default:
+ 			break;
+ 	}
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 23365)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 23366)
+@@ -1,8 +1,8 @@
+ /*!\file:  Element.h
+  * \brief abstract class for Element object
+- * This class is a place holder for the Tria and the Penta elements. 
++ * This class is a place holder for the Tria and the Penta elements.
+  * It is derived from Element, so DataSets can contain them.
+- */ 
++ */
+ 
+ #ifndef _ELEMENT_H_
+ #define _ELEMENT_H_
+@@ -49,7 +49,7 @@
+ 		int* element_type_list;
+ 		int  element_type;
+ 
+-	public: 
++	public:
+ 		/*Constructors/Destructores*/
+ 		Element();
+ 		~Element();
+@@ -67,6 +67,7 @@
+ 		void               DeleteMaterials(void);
+ 		void               Delta18oParameterization(void);
+ 		void               Delta18opdParameterization(void);
++		void               SmbGradCompParameterization(void);
+ 		IssmDouble         Divergence(void);
+ 		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);
+@@ -129,16 +130,16 @@
+ 		void               InputUpdateFromConstant(IssmDouble constant, int name);
+ 		void               InputUpdateFromConstant(int constant, int name);
+ 		void               InputUpdateFromConstant(bool constant, int name);
+-		bool               IsFloating(); 
++		bool               IsFloating();
+ 		bool               IsIceInElement();
+ 		bool               IsLandInElement();
+ 		bool               IsWaterInElement();
+-		void               LinearFloatingiceMeltingRate(); 
+-		void               SpatialLinearFloatingiceMeltingRate(); 
+-		void               MantlePlumeGeothermalFlux(); 
++		void               LinearFloatingiceMeltingRate();
++		void               SpatialLinearFloatingiceMeltingRate();
++		void               MantlePlumeGeothermalFlux();
+ 		void               MarshallElement(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction,int numanalyses);
+ 		void               MigrateGroundingLine(IssmDouble* sheet_ungrounding);
+-		void               MismipFloatingiceMeltingRate(); 
++		void               MismipFloatingiceMeltingRate();
+ 		void               MungsmtpParameterization(void);
+ 		ElementMatrix*     NewElementMatrix(int approximation_enum=NoneApproximationEnum);
+ 		ElementMatrix*     NewElementMatrixCoupling(int number_nodes,int approximation_enum=NoneApproximationEnum);
+@@ -240,7 +241,7 @@
+ 		virtual void       InputUpdateFromSolutionOneDof(IssmDouble* solution,int inputenum)=0;
+ 		virtual bool       IsFaceOnBoundary(void)=0;
+ 		virtual bool       IsIcefront(void)=0;
+-		virtual bool       IsNodeOnShelfFromFlags(IssmDouble* flags)=0; 
++		virtual bool       IsNodeOnShelfFromFlags(IssmDouble* flags)=0;
+ 		virtual bool       IsOnBase()=0;
+ 		virtual bool       IsOnSurface()=0;
+ 		virtual bool       IsZeroLevelset(int levelset_enum)=0;
+@@ -330,7 +331,7 @@
+ 		virtual IssmDouble    GetAreaSpherical(void)=0;
+ 		virtual IssmDouble    OceanAverage(IssmDouble* Sg)=0;
+ 		virtual IssmDouble    OceanArea(void)=0;
+-		virtual void          SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,IssmDouble eartharea)=0; 
++		virtual void          SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,IssmDouble eartharea)=0;
+ 		virtual void          SealevelriseEustatic(Vector<IssmDouble>* pSgi,IssmDouble* peustatic,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble oceanarea,IssmDouble eartharea)=0;
+ 		virtual void          SealevelriseNonEustatic(Vector<IssmDouble>* pSgo,IssmDouble* Sg_old,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble eartharea)=0;
+ 		virtual void          SealevelriseGeodetic(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* Sg,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz,IssmDouble eartharea,int horiz)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 23365)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 23366)
+@@ -654,6 +654,76 @@
+ 
+ }
+ /*}}}*/
++void       Element::SmbGradCompParameterization(void){/*{{{*/
++
++	/*Are we on the base? If not, return*/
++	if(!IsOnBase()) return;
++	int        numvertices = this->GetNumberOfVertices();
++
++	int        i;
++	IssmDouble accuref, runoffref; //reference values at given altitude
++	IssmDouble accualti, runoffalti; //reference altitudes
++	IssmDouble accugrad, runoffgrad; //gradients from reference altitude
++	IssmDouble rho_water, rho_ice;
++	IssmDouble time;
++
++	IssmDouble*		smb		 = xNew<IssmDouble>(numvertices);
++	IssmDouble*		surf	 = xNew<IssmDouble>(numvertices);
++	IssmDouble*		accu	 = xNew<IssmDouble>(numvertices);
++	IssmDouble*		runoff = xNew<IssmDouble>(numvertices);
++
++	/*Get material parameters :*/
++	rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
++	rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
++
++	/*Recover parameters*/
++	parameters->FindParam(&time,TimeEnum);
++	parameters->FindParam(&accualti,SmbAccualtiEnum);
++	parameters->FindParam(&accugrad,SmbAccugradEnum);
++	parameters->FindParam(&runoffalti,SmbRunoffaltiEnum);
++	parameters->FindParam(&runoffgrad,SmbRunoffgradEnum);
++
++	/*Recover reference values at current time*/
++	parameters->FindParam(&accuref,SmbAccurefEnum,time);
++	parameters->FindParam(&runoffref,SmbRunoffrefEnum,time);
++
++	/*Recover surface elevation*/
++	GetInputListOnVertices(&surf[0],SurfaceEnum);
++
++	/*Compute the temperature and precipitation*/
++	for(int iv=0;iv<numvertices;iv++){
++		accu[iv]=max(0.,(accuref+(surf[iv]-accualti)*accugrad));
++		runoff[iv]=max(0.,(runoffref+(surf[iv]-runoffalti)*runoffgrad));
++		smb[iv]=(accu[iv]-runoff[iv])*rho_ice/rho_water;
++	}
++	switch(this->ObjectEnum()){
++	case TriaEnum:
++		this->inputs->AddInput(new TriaInput(SmbMassBalanceEnum,&smb[0],P1Enum));
++		this->inputs->AddInput(new TriaInput(SmbRunoffEnum,&runoff[0],P1Enum));
++		break;
++	case PentaEnum:
++		this->inputs->AddInput(new PentaInput(SmbMassBalanceEnum,&smb[0],P1Enum));
++		this->inputs->AddInput(new PentaInput(SmbRunoffEnum,&runoff[0],P1Enum));
++		this->InputExtrude(SmbMassBalanceEnum,-1);
++		this->InputExtrude(SmbRunoffEnum,-1);
++		break;
++	case TetraEnum:
++		this->inputs->AddInput(new TetraInput(SmbMassBalanceEnum,&smb[0],P1Enum));
++		this->inputs->AddInput(new TetraInput(SmbRunoffEnum,&runoff[0],P1Enum));
++		this->InputExtrude(SmbMassBalanceEnum,-1);
++		this->InputExtrude(SmbRunoffEnum,-1);
++		break;
++	default: _error_("Not implemented yet");
++	}
++	/* this->AddInput(SmbMassBalanceEnum,smb,P1Enum); */
++	/* this->AddInput(SmbRunoffEnum,runoff,P1Enum); */
++	/*clean-up*/
++	xDelete<IssmDouble>(surf);
++	xDelete<IssmDouble>(accu);
++	xDelete<IssmDouble>(runoff);
++	xDelete<IssmDouble>(smb);
++}
++/*}}}*/
+ IssmDouble Element::Divergence(void){/*{{{*/
+ 	/*Compute element divergence*/
+ 
+@@ -2587,17 +2657,17 @@
+ 	/*Get material parameters :*/
+ 	rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+ 	rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+-	
++
+ 	/*Get parameters for height corrections*/
+ 	desfac=this->matpar->GetMaterialParameter(SmbDesfacEnum);
+ 	rlaps=this->matpar->GetMaterialParameter(SmbRlapsEnum);
+-	
++
+ 	/*Recover monthly temperatures and precipitation*/
+ 	Input*     input=this->inputs->GetInput(SmbMonthlytemperaturesEnum); _assert_(input);
+ 	Input*     input2=this->inputs->GetInput(SmbPrecipitationEnum); _assert_(input2);
+ 	/*Recover smb correction term */
+ 	Input*     input3=this->inputs->GetInput(SmbSmbCorrEnum); _assert_(input3);
+-	
++
+ 	/* Get time */
+ 	this->parameters->FindParam(&time,TimeEnum);
+ 	this->parameters->FindParam(&yts,ConstantsYtsEnum);
+@@ -2606,7 +2676,7 @@
+ 	/* Set parameters for finrnwarming */
+ 	IssmDouble MU_0         = 9.7155; //Firn-warming correction, in (d*deg C)/(mm WE)
+ 	IssmDouble mu           = MU_0*(1000.0*86400.0)*(rho_ice/rho_water);   // (d*deg C)/(mm WE) --> (s*deg C)/(m IE)
+-	
++
+ 	/*loop over vertices: */
+ 	Gauss* gauss=this->NewGauss();
+ 	for(int month=0;month<12;month++){
+@@ -2637,8 +2707,8 @@
+ 		smb[iv] = smb[iv]+smbcorr[iv];
+ 		/*Get yearlytemperatures */
+ 		for(int month=0;month<12;month++) yearlytemperatures[iv]=yearlytemperatures[iv]+((monthlytemperatures[iv*12+month]+273.15)+t_ampl[iv])*inv_twelve; // Has to be in Kelvin
+-	
+-		if(isfirnwarming){ 
++
++		if(isfirnwarming){
+ 			if(melt_star[iv]>=melt[iv]){
+ 				yearlytemperatures[iv]= yearlytemperatures[iv]+mu*(melt_star[iv]-melt[iv]);
+ 			}
+@@ -2719,8 +2789,8 @@
+ 	xDelete<IssmDouble>(s);
+ 	xDelete<IssmDouble>(s0t);
+ 	xDelete<IssmDouble>(s0p);
+-	xDelete<IssmDouble>(t_ampl); 
+-	xDelete<IssmDouble>(p_ampl); 
++	xDelete<IssmDouble>(t_ampl);
++	xDelete<IssmDouble>(p_ampl);
+ 	xDelete<IssmDouble>(smbcorr);
+ 	xDelete<IssmDouble>(melt_star);
+ }
+@@ -2732,8 +2802,8 @@
+ 
+ 	/*Some intputs need to be computed, even if they are already in inputs, they might not be up to date!*/
+ 	switch(output_enum){
+-		case ViscousHeatingEnum: this->ViscousHeatingCreateInput(); break;
+-		case StressMaxPrincipalEnum: this->StressMaxPrincipalCreateInput(); break;
++	case ViscousHeatingEnum: this->ViscousHeatingCreateInput(); break;
++	case StressMaxPrincipalEnum: this->StressMaxPrincipalCreateInput(); break;
+ 		case StressTensorxxEnum:
+ 		case StressTensorxyEnum:
+ 		case StressTensorxzEnum:
+@@ -2746,7 +2816,7 @@
+ 		case StrainRateyyEnum:
+ 		case StrainRateyzEnum:
+ 		case StrainRatezzEnum:
+-		case StrainRateeffectiveEnum: this->ComputeStrainRate(); break;
++	  case StrainRateeffectiveEnum: this->ComputeStrainRate(); break;
+ 		case DeviatoricStressxxEnum:
+ 		case DeviatoricStressxyEnum:
+ 		case DeviatoricStressxzEnum:
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23365)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23366)
+@@ -104,7 +104,6 @@
+ 		iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
+ 		iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+ 	}
+-
+ 	if(isefficientlayer){
+ 		iomodel->FetchDataToInput(elements,"md.hydrology.mask_eplactive_node",HydrologydcMaskEplactiveNodeEnum);
+ 		iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadHydrostepEnum);
+@@ -341,14 +340,16 @@
+ 
+ 	/*Intermediaries */
+ 	bool       active_element,isefficientlayer;
++	int        smb_model;
+ 	IssmDouble dt,scalar,sediment_storing;
+ 	IssmDouble water_head,sediment_transmitivity;
+-	IssmDouble water_load,transfer;
++	IssmDouble water_load,runoff_value,transfer;
+ 	IssmDouble Jdet;
+ 
+ 	IssmDouble *xyz_list             = NULL;
+ 	Input*      active_element_input = NULL;
+-	Input*      old_wh_input = NULL;
++	Input*      old_wh_input         = NULL;
++	Input*      surface_runoff_input = NULL;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = basalelement->GetNumberOfNodes();
+@@ -360,18 +361,23 @@
+ 	/*Retrieve all inputs and parameters*/
+ 	basalelement->GetVerticesCoordinates(&xyz_list);
+ 	//basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
+-	basalelement ->FindParam(&dt,HydrologydtEnum);
++	basalelement->FindParam(&dt,HydrologydtEnum);
+ 	basalelement->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum);
++	basalelement->FindParam(&smb_model,SmbEnum);
+ 
+-	Input* sed_head_input = basalelement->GetInput(SedimentHeadHydrostepEnum);
+-	Input* epl_head_input = basalelement->GetInput(EplHeadHydrostepEnum);
+-	Input* base_input		  = basalelement->GetInput(BaseEnum);
+-	Input* water_input	  = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(water_input);
+-	Input* SedTrans_input = basalelement->GetInput(HydrologydcSedimentTransmitivityEnum); _assert_(SedTrans_input);
++	Input*	sed_head_input			 = basalelement->GetInput(SedimentHeadHydrostepEnum);
++	Input*	epl_head_input			 = basalelement->GetInput(EplHeadHydrostepEnum);
++	Input*	base_input					 = basalelement->GetInput(BaseEnum);
++	Input*	basal_melt_input		 = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(basal_melt_input);
++	Input*	SedTrans_input			 = basalelement->GetInput(HydrologydcSedimentTransmitivityEnum); _assert_(SedTrans_input);
+ 
+ 	if(dt!= 0.){
+ 		old_wh_input = basalelement->GetInput(SedimentHeadOldEnum);                  _assert_(old_wh_input);
+ 	}
++	if(smb_model==SMBgradientscomponentsEnum){
++		surface_runoff_input = basalelement->GetInput(SmbRunoffEnum);
++	}
++
+ 	/*Transfer related Inputs*/
+ 	if(isefficientlayer){
+ 		active_element_input = basalelement->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input);
+@@ -387,8 +393,9 @@
+ 
+ 		/*Loading term*/
+ 		if(!isefficientlayer){
+-			water_input->GetInputValue(&water_load,gauss);
+-			scalar = Jdet*gauss->weight*(water_load);
++			basal_melt_input->GetInputValue(&water_load,gauss);
++			surface_runoff_input->GetInputValue(&runoff_value,gauss);
++			scalar = Jdet*gauss->weight*(water_load+runoff_value);
+ 			//scalar = Jdet*gauss->weight*(water_load)/sediment_transmitivity;
+ 			if(dt!=0.) scalar = scalar*dt;
+ 			for(int i=0;i<numnodes;i++){
+@@ -399,8 +406,9 @@
+ 			/*if EPL is present and active input is there not here*/
+ 			active_element_input->GetInputValue(&active_element);
+ 			if(!active_element){
+-				water_input->GetInputValue(&water_load,gauss);
+-				scalar = Jdet*gauss->weight*(water_load);
++				basal_melt_input->GetInputValue(&water_load,gauss);
++				surface_runoff_input->GetInputValue(&runoff_value,gauss);
++				scalar = Jdet*gauss->weight*(water_load+runoff_value);
+ 				//scalar = Jdet*gauss->weight*(water_load)/sediment_transmitivity;
+ 				if(dt!=0.) scalar = scalar*dt;
+ 				for(int i=0;i<numnodes;i++){
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23365)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23366)
+@@ -312,14 +312,16 @@
+ 		return NULL;
+ 	}
+ 	/*Intermediaries */
++	int        smb_model;
+ 	IssmDouble dt,scalar,water_head;
+-	IssmDouble water_load,transfer;
++	IssmDouble water_load,transfer,runoff_value;
+ 	IssmDouble epl_storing,epl_transmitivity;
+ 	IssmDouble Jdet;
+ 	IssmDouble residual,connectivity;
+ 
+-	IssmDouble *xyz_list     = NULL;
+-	Input*      old_wh_input = NULL;
++	IssmDouble		*xyz_list							= NULL;
++	Input*				 old_wh_input					= NULL;
++	Input*				 surface_runoff_input = NULL;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes    = basalelement->GetNumberOfNodes();
+@@ -333,17 +335,22 @@
+ 	basalelement->GetVerticesCoordinates(&xyz_list);
+ 	//basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
+ 	basalelement ->FindParam(&dt,HydrologydtEnum);
++	basalelement ->FindParam(&smb_model,SmbEnum);
+ 
+-	Input* epl_thick_input = basalelement->GetInput(HydrologydcEplThicknessHydrostepEnum); _assert_(epl_thick_input);
+-	Input* sed_head_input  = basalelement->GetInput(SedimentHeadHydrostepEnum); _assert_(sed_head_input);
+-	Input* epl_head_input	 = basalelement->GetInput(EplHeadHydrostepEnum); _assert_(epl_head_input);
+-	Input* water_input		 = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(water_input);
+-	Input* residual_input  = basalelement->GetInput(SedimentHeadResidualEnum); _assert_(residual_input);
+-	Input* base_input			 = basalelement->GetInput(BaseEnum); _assert_(base_input);
++	Input*	epl_thick_input			 = basalelement->GetInput(HydrologydcEplThicknessHydrostepEnum); _assert_(epl_thick_input);
++	Input*	sed_head_input			 = basalelement->GetInput(SedimentHeadHydrostepEnum); _assert_(sed_head_input);
++	Input*	epl_head_input			 = basalelement->GetInput(EplHeadHydrostepEnum); _assert_(epl_head_input);
++	Input*	basal_melt_input		 = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(basal_melt_input);
++	Input*	residual_input			 = basalelement->GetInput(SedimentHeadResidualEnum); _assert_(residual_input);
++	Input*	base_input					 = basalelement->GetInput(BaseEnum); _assert_(base_input);
+ 
+ 	if(dt!= 0.){
+ 		old_wh_input = basalelement->GetInput(EplHeadOldEnum);            _assert_(old_wh_input);
+ 	}
++	if(smb_model==SMBgradientscomponentsEnum){
++		surface_runoff_input = basalelement->GetInput(SmbRunoffEnum);
++	}
++
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss           = basalelement->NewGauss(2);
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+@@ -354,8 +361,9 @@
+ 		epl_transmitivity = EplTransmitivity(basalelement,gauss,epl_thick_input,epl_head_input,base_input);
+ 
+ 		/*Loading term*/
+-		water_input->GetInputValue(&water_load,gauss);
+-		scalar = Jdet*gauss->weight*(water_load);
++		basal_melt_input->GetInputValue(&water_load,gauss);
++		surface_runoff_input->GetInputValue(&runoff_value,gauss);
++		scalar = Jdet*gauss->weight*(water_load+runoff_value);
+ 		//scalar = Jdet*gauss->weight*(water_load)/epl_transmitivity;
+ 		if(dt!=0.) scalar = scalar*dt;
+ 		for(int i=0;i<numnodes;i++)pe->values[i]+=scalar*basis[i];
+@@ -523,6 +531,7 @@
+ 	IssmDouble  dt,A;
+ 	IssmDouble  EPLgrad2;
+ 	IssmDouble  EPL_N;
++	IssmDouble  opening,closing;
+ 
+ 	femmodel->parameters->FindParam(&domaintype,DomainTypeEnum);
+ 	femmodel->parameters->FindParam(&iseplthickcomp,HydrologydcEplThickCompEnum);
+@@ -588,9 +597,22 @@
+ 				/*Get then the square of the gradient of EPL heads*/
+ 				EPLgrad2 = (epl_slopeX[i]*epl_slopeX[i])+(epl_slopeY[i]*epl_slopeY[i]);
+ 				/*And proceed to the real thing*/
+-				thickness[i] = old_thickness[i]/(1.0
+-																				 -((rho_water*gravity*epl_conductivity*EPLgrad2*dt)/(rho_ice*latentheat))
+-																				 +((2.0*A*dt*pow(EPL_N,n))/(pow(n,n))));
++				opening=(rho_water*gravity*epl_conductivity*EPLgrad2*dt)/(rho_ice*latentheat);
++				closing=(2.0*A*dt*pow(EPL_N,n))/(pow(n,n));
++				/*implicit*/
++				thickness[i] = old_thickness[i]/(1.0-opening+closing);
++				/*explicit*/
++				//thickness[i] = old_thickness[i]*(1.0+opening-closing);
++				/*centered*/
++				//thickness[i] = old_thickness[i]*(1.0+opening-closing)/(1.0-opening+closing);
++
++				if(element->nodes[i]->Sid()==2299){
++					printf("for node %i \n",element->nodes[i]->Sid());
++					printf(" old thickness is  %g \n",old_thickness[i]);
++					printf(" new thickness is  %g \n",thickness[i]);
++					printf(" closing is %g \n",((2.0*A*dt*pow(EPL_N,n))/(pow(n,n))));
++					printf(" opening is %g \n",((rho_water*gravity*epl_conductivity*EPLgrad2*dt)/(rho_ice*latentheat)));
++				}
+ 				/*Take care of otherthikening*/
+ 				if(thickness[i]>max_thick){
+ 					thickness[i] = max_thick;
+@@ -688,7 +710,11 @@
+ 		if(old_active[i]>0.){
+ 			vec_mask->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL);
+ 			/* If epl thickness gets under colapse thickness, close the layer */
++				if(element->nodes[i]->Sid()==2299){
++					printf("thickness for maksing for node %i is %g \n",element->nodes[i]->Sid(),epl_thickness[i]);}
+ 			if(epl_thickness[i]<colapse_thick){
++				if(element->nodes[i]->Sid()==2299){
++					printf("maksing node %i\n",element->nodes[i]->Sid());}
+ 				vec_mask->SetValue(basalelement->nodes[i]->Sid(),0.,INS_VAL);
+ 				recurence->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL);
+ 			}
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 23365)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 23366)
+@@ -179,7 +179,7 @@
+ 		/*Put +9999 for places where there is no ice!*/
+ 		for(int i=0;i<ngrids_ocean;i++) if(icemask_oceangrid[i]>0.) icebase_oceangrid[i]=+9999.;
+ 		xDelete<IssmDouble>(icemask_oceangrid);
+-			
++
+ 		if(my_rank==0){
+ 			ISSM_MPI_Send(icebase_oceangrid,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001008,tomitgcmcomm);
+ 		}
+@@ -383,6 +383,9 @@
+ 			thermal_core(femmodel);
+ 		}
+ 
++		/*duplicating smb position to have runoff value*/
++		if(issmb) smb_core(femmodel);
++
+ 		if(ishydrology) hydrology_core(femmodel);
+ 
+ 		if(isstressbalance) stressbalance_core(femmodel);
+@@ -392,7 +395,6 @@
+ 		if(ismovingfront)	movingfront_core(femmodel);
+ 
+ 		/* from here on, prepare geometry for next time step*/
+-
+ 		if(issmb) smb_core(femmodel);
+ 
+ 		if(ismasstransport){
+@@ -402,10 +404,10 @@
+ 		}
+ 
+ 		if(isgroundingline){
+-		
++
+ 			/*Start profiler*/
+ 			femmodel->profiler->Start(GROUNDINGLINECORE);
+-		
++
+ 			if(VerboseSolution()) _printf0_("   computing new grounding line position\n");
+ 			GroundinglineMigrationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+ 
+@@ -415,7 +417,7 @@
+ 			extrudefrombase_core(femmodel);
+ 			femmodel->parameters->SetParam(SurfaceEnum,InputToExtrudeEnum);
+ 			extrudefrombase_core(femmodel);
+-			
++
+ 			/*Stop profiler*/
+ 			femmodel->profiler->Stop(GROUNDINGLINECORE);
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23366-23367.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23366-23367.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23366-23367.diff	(revision 23390)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23366)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23367)
+@@ -606,13 +606,13 @@
+ 				/*centered*/
+ 				//thickness[i] = old_thickness[i]*(1.0+opening-closing)/(1.0-opening+closing);
+ 
+-				if(element->nodes[i]->Sid()==2299){
+-					printf("for node %i \n",element->nodes[i]->Sid());
+-					printf(" old thickness is  %g \n",old_thickness[i]);
+-					printf(" new thickness is  %g \n",thickness[i]);
+-					printf(" closing is %g \n",((2.0*A*dt*pow(EPL_N,n))/(pow(n,n))));
+-					printf(" opening is %g \n",((rho_water*gravity*epl_conductivity*EPLgrad2*dt)/(rho_ice*latentheat)));
+-				}
++				/* if(element->nodes[i]->Sid()==2299){ */
++				/* 	printf("for node %i \n",element->nodes[i]->Sid()); */
++				/* 	printf(" old thickness is  %g \n",old_thickness[i]); */
++				/* 	printf(" new thickness is  %g \n",thickness[i]); */
++				/* 	printf(" closing is %g \n",((2.0*A*dt*pow(EPL_N,n))/(pow(n,n)))); */
++				/* 	printf(" opening is %g \n",((rho_water*gravity*epl_conductivity*EPLgrad2*dt)/(rho_ice*latentheat))); */
++				/* } */
+ 				/*Take care of otherthikening*/
+ 				if(thickness[i]>max_thick){
+ 					thickness[i] = max_thick;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23367-23368.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23367-23368.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23367-23368.diff	(revision 23390)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23367)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23368)
+@@ -710,11 +710,11 @@
+ 		if(old_active[i]>0.){
+ 			vec_mask->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL);
+ 			/* If epl thickness gets under colapse thickness, close the layer */
+-				if(element->nodes[i]->Sid()==2299){
+-					printf("thickness for maksing for node %i is %g \n",element->nodes[i]->Sid(),epl_thickness[i]);}
++				/* if(element->nodes[i]->Sid()==2299){ */
++				/* 	printf("thickness for maksing for node %i is %g \n",element->nodes[i]->Sid(),epl_thickness[i]);} */
+ 			if(epl_thickness[i]<colapse_thick){
+-				if(element->nodes[i]->Sid()==2299){
+-					printf("maksing node %i\n",element->nodes[i]->Sid());}
++				/* if(element->nodes[i]->Sid()==2299){ */
++				/* 	printf("maksing node %i\n",element->nodes[i]->Sid());} */
+ 				vec_mask->SetValue(basalelement->nodes[i]->Sid(),0.,INS_VAL);
+ 				recurence->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL);
+ 			}
Index: /issm/oecreview/Archive/23185-23389/ISSM-23368-23369.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23368-23369.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23368-23369.diff	(revision 23390)
@@ -0,0 +1,83 @@
+Index: ../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.py	(revision 23368)
++++ ../trunk-jpl/test/NightlyRun/runme.py	(revision 23369)
+@@ -10,7 +10,7 @@
+ def runme(id=None,exclude=None,benchmark='nightly',procedure='check',output='none',rank=1,numprocs=1):
+ 	"""
+ 	RUNME - test deck for ISSM nightly runs
+- 
++
+ 	    In a test deck directory (tests/Vertification/NightlyRun for example)
+ 	    The following command will launch all the existing tests:
+ 	    >> runme()
+@@ -17,7 +17,7 @@
+ 	    To run the tests 101 and 102:
+ 	    >> runme(id=[101,102])
+ 	    etc...
+- 
++
+ 	    Available options:
+ 	       'id'            followed by the list of ids or (parts of) test names requested
+ 				Note: runs all tests by default
+@@ -36,10 +36,10 @@
+ 
+ 	       'procedure'     'check' : run the test (default)
+ 	                       'update': update the archive
+- 
++
+ 	    Usage:
+ 	       runme(varargin)
+- 
++
+ 	    Examples:
+ 	       runme()
+ 	       runme(101)
+@@ -48,7 +48,6 @@
+ 	       runme(exclude='Dakota',benchmark='all')
+ 	       runme(id=[[101,102],['Dakota','Slr']])
+ 	"""
+-
+ 	from parallelrange import parallelrange
+ 	from IdToName import IdToName
+ 	from arch import archread
+@@ -84,13 +83,13 @@
+ 
+ 	i1,i2=parallelrange(rank,numprocs,len(list_ids))    #Get tests for this cpu only
+ 	list_ids=list_ids[i1:i2+1]
+-	
+-	if np.size(id) > 0:
++
++	if np.size(id) > 0 and not id==None:
+ 		test_ids = set(GetIds(id)).intersection(set(list_ids))
+ 	else:
+ 		# if no tests are specifically provided, do them all
+ 		test_ids = set(list_ids)
+-		
++
+ 	# }}}
+ 	#GET exclude {{{
+ 	exclude_ids = GetIds(exclude)
+@@ -182,7 +181,7 @@
+ 							field = field.T
+ 							if np.shape(field) != np.shape(archive):
+ 								raise RuntimeError("Field '"+archive_name+"' from test is malformed; shape is "+str(np.shape(field.T))+", should be "+str(np.shape(archive))+" (or "+str(np.shape(archive.T))+").")
+-						
++
+ 						error_diff=np.amax(np.abs(archive-field),axis=0)/(np.amax(np.abs(archive),axis=0)+float_info.epsilon)
+ 
+                                                 if not np.isscalar(error_diff): error_diff=error_diff[0]
+Index: ../trunk-jpl/test/NightlyRun/test101.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test101.m	(revision 23368)
++++ ../trunk-jpl/test/NightlyRun/test101.m	(revision 23369)
+@@ -3,7 +3,8 @@
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+ md=setflowequation(md,'SSA','all');
+-md.cluster=generic('name',oshostname(),'np',2);
++md.cluster=stallo('numnodes',1,'cpuspernode',16,'time',60,'queue','devel')
++%md.cluster=generic('name',oshostname(),'np',2);
+ 
+ %output
+ md.stressbalance.requested_outputs={'default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
Index: /issm/oecreview/Archive/23185-23389/ISSM-23369-23370.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23369-23370.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23369-23370.diff	(revision 23390)
@@ -0,0 +1,287 @@
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 23369)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 23370)
+@@ -383,7 +383,7 @@
+ 			thermal_core(femmodel);
+ 		}
+ 
+-		/*duplicating smb position to have runoff value*/
++		/*shifting smb position to have runoff value*/
+ 		if(issmb) smb_core(femmodel);
+ 
+ 		if(ishydrology) hydrology_core(femmodel);
+@@ -395,7 +395,7 @@
+ 		if(ismovingfront)	movingfront_core(femmodel);
+ 
+ 		/* from here on, prepare geometry for next time step*/
+-		if(issmb) smb_core(femmodel);
++		//if(issmb) smb_core(femmodel);
+ 
+ 		if(ismasstransport){
+ 			bmb_core(femmodel);
+Index: ../trunk-jpl/src/c/cores/hydrology_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 23369)
++++ ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 23370)
+@@ -13,7 +13,7 @@
+ 
+ 	/*Start profiler*/
+ 	femmodel->profiler->Start(HYDROLOGYCORE);
+-        
++
+ 	/*intermediary*/
+ 	int          hydrology_model;
+ 	int          solution_type;
+@@ -49,7 +49,6 @@
+ 	else if (hydrology_model==HydrologydcEnum){
+ 		/*intermediary: */
+ 		bool       isefficientlayer;
+-		bool       isthermal;
+ 		int        step,hydroslices;
+ 		IssmDouble time,init_time,hydrotime,yts;
+ 		IssmDouble dt,hydrodt;
+@@ -61,7 +60,6 @@
+ 		femmodel->parameters->FindParam(&hydroslices,HydrologyStepsPerStepEnum);
+ 		femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
+ 
+-		femmodel->parameters->FindParam(&isthermal,TransientIsthermalEnum);
+ 		/*first we exclude frozen nodes of the solved nodes*/
+ 		femmodel->SetCurrentConfiguration(HydrologyDCInefficientAnalysisEnum);
+ 		femmodel->HydrologyIDSupdateDomainx(&ThawedNodes);
+@@ -152,7 +150,7 @@
+ 		}
+ 		xDelete<char*>(requested_outputs);
+ 	}
+-	
++
+ 	/*End profiler*/
+ 	femmodel->profiler->Stop(HYDROLOGYCORE);
+ }
+Index: ../trunk-jpl/src/c/classes/Params/Parameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 23369)
++++ ../trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 23370)
+@@ -91,7 +91,7 @@
+ 	return output;
+ }
+ /*}}}*/
+-void Parameters::DeepEcho(void){/*{{{*/	
++void Parameters::DeepEcho(void){/*{{{*/
+ 	for(int i=0;i<NUMPARAMS;i++) {
+ 		if(this->params[i]) this->params[i]->DeepEcho();
+ 	}
+@@ -98,7 +98,7 @@
+ 	return;
+ }
+ /*}}}*/
+-void Parameters::Echo(void){/*{{{*/	
++void Parameters::Echo(void){/*{{{*/
+ 	for(int i=0;i<NUMPARAMS;i++) {
+ 		if(this->params[i]) this->params[i]->Echo();
+ 	}
+@@ -138,7 +138,7 @@
+ 		for(int i=0;i<num_params;i++){
+ 
+ 			/*Recover enum of object first: */
+-			MARSHALLING(obj_enum); 
++			MARSHALLING(obj_enum);
+ 
+ 			if(obj_enum==DoubleParamEnum){
+ 				DoubleParam* doubleparam=NULL;
+@@ -199,7 +199,7 @@
+ 				fileparam=new FileParam();
+ 				fileparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+ 				delete fileparam;
+-				/* No need to add this object, the pointer is not valid             
++				/* No need to add this object, the pointer is not valid
+ 					The FemModel should reset all FileParams in the restart function */
+ 			}
+ 			else if(obj_enum==StringParamEnum){
+@@ -648,7 +648,7 @@
+ /*Methods relating to parameters: */
+ char* OptionsFromAnalysis(char** pouttoolkit,Parameters* parameters,int analysis_type){ /*{{{*/
+ 
+-	/* figure out ISSM options for current analysis, return a string. */ 
++	/* figure out ISSM options for current analysis, return a string. */
+ 
+ 	/*output: */
+ 	char *outstring  = NULL;
+@@ -666,8 +666,8 @@
+ 	int          i;
+ 
+ 	parameters->FindParam(&strings,&numanalyses,ToolkitsOptionsStringsEnum);
+-	parameters->FindParam(&toolkits,&dummy,ToolkitsTypesEnum); _assert_(dummy==numanalyses); 
+-	parameters->FindParam(&analyses,&dummy,ToolkitsOptionsAnalysesEnum); _assert_(dummy==numanalyses); 
++	parameters->FindParam(&toolkits,&dummy,ToolkitsTypesEnum); _assert_(dummy==numanalyses);
++	parameters->FindParam(&analyses,&dummy,ToolkitsOptionsAnalysesEnum); _assert_(dummy==numanalyses);
+ 
+ 	if(numanalyses==0)return NULL; //we did not find petsc options, don't bother.
+ 
+@@ -709,16 +709,16 @@
+ 	xDelete<char*>(strings);
+ 	xDelete<int>(analyses);
+ 	return outstring;
+-} 
++}
+ /*}}}*/
+ void ToolkitsOptionsFromAnalysis(Parameters* parameters,int analysis_type){ /*{{{*/
+ 
+ 	/*!\file:  ToolkitsOptionsFromAnalysis.cpp
+-	 * \brief: for each analysis, setup the issmoptions string. 
+-	 * This is mainly for the case where we run our toolkits using petsc. In this case, we need to 
+-	 * plug our toolkits options directly into the petsc options database. This is the case for each analysis type 
++	 * \brief: for each analysis, setup the issmoptions string.
++	 * This is mainly for the case where we run our toolkits using petsc. In this case, we need to
++	 * plug our toolkits options directly into the petsc options database. This is the case for each analysis type
+ 	 * and parameters
+-	 */ 
++	 */
+ 
+ 	char* options = NULL;
+ 	char* toolkit = NULL;
+@@ -730,7 +730,7 @@
+ 	ToolkitOptions::Init(toolkit,options);
+ 
+ 	#ifdef _HAVE_PETSC_
+-		/*In case we are using PETSC, we do not rely on issmoptions. Instead, we dump issmoptions into the Petsc 
++		/*In case we are using PETSC, we do not rely on issmoptions. Instead, we dump issmoptions into the Petsc
+ 		 * options database: */
+ 		#if (_PETSC_MINOR_>=7)
+ 		PetscOptionsSetFromOptions(NULL);
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23369)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23370)
+@@ -606,13 +606,11 @@
+ 				/*centered*/
+ 				//thickness[i] = old_thickness[i]*(1.0+opening-closing)/(1.0-opening+closing);
+ 
+-				/* if(element->nodes[i]->Sid()==2299){ */
+-				/* 	printf("for node %i \n",element->nodes[i]->Sid()); */
+-				/* 	printf(" old thickness is  %g \n",old_thickness[i]); */
+-				/* 	printf(" new thickness is  %g \n",thickness[i]); */
+-				/* 	printf(" closing is %g \n",((2.0*A*dt*pow(EPL_N,n))/(pow(n,n)))); */
+-				/* 	printf(" opening is %g \n",((rho_water*gravity*epl_conductivity*EPLgrad2*dt)/(rho_ice*latentheat))); */
+-				/* } */
++				if(element->nodes[i]->Sid()==2299){
++					printf("for node %i \n",element->nodes[i]->Sid());
++					printf(" old thickness is  %g \n",old_thickness[i]);
++					printf(" new thickness is  %g \n",thickness[i]);
++				}
+ 				/*Take care of otherthikening*/
+ 				if(thickness[i]>max_thick){
+ 					thickness[i] = max_thick;
+@@ -710,19 +708,12 @@
+ 		if(old_active[i]>0.){
+ 			vec_mask->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL);
+ 			/* If epl thickness gets under colapse thickness, close the layer */
+-				/* if(element->nodes[i]->Sid()==2299){ */
+-				/* 	printf("thickness for maksing for node %i is %g \n",element->nodes[i]->Sid(),epl_thickness[i]);} */
+ 			if(epl_thickness[i]<colapse_thick){
+-				/* if(element->nodes[i]->Sid()==2299){ */
+-				/* 	printf("maksing node %i\n",element->nodes[i]->Sid());} */
++				if(element->nodes[i]->Sid()==2299){
++					printf("masking node %i with thickness %f\n",element->nodes[i]->Sid(),epl_thickness[i]);}
+ 				vec_mask->SetValue(basalelement->nodes[i]->Sid(),0.,INS_VAL);
+ 				recurence->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL);
+ 			}
+-			/* //If epl head gets under base elevation, close the layer */
+-			/* else if(eplhead[i]<(base[i]-1.0e-8)){ */
+-			/* 	vec_mask->SetValue(basalelement->nodes[i]->Sid(),0.,INS_VAL); */
+-			/* 	recurence->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL); */
+-			/* } */
+ 		}
+ 		/*If node is now closed bring its thickness back to initial*/
+ 		if (old_active[i]==0.){
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23369)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23370)
+@@ -28,6 +28,8 @@
+ 	char**      requestedoutputs = NULL;
+ 
+ 	/*retrieve some parameters: */
++	/* bool   issmb; */
++	/* iomodel->FindConstant(&issmb,"md.transient.issmb"); */
+ 	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
+ 
+ 	/*Now, do we really want DC?*/
+@@ -62,6 +64,10 @@
+ 		iomodel->FetchData(&sedimentlimit,"md.hydrology.sedimentlimit");
+ 		parameters->AddObject(new DoubleParam(HydrologydcSedimentlimitEnum,sedimentlimit));
+ 	}
++	/* if(!issmb){ */
++	/* 	parameters->AddObject(iomodel->CopyConstantObject("md.smb.model",SmbEnum)); */
++	/* } */
++
+   /*Requested outputs*/
+   iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.hydrology.requested_outputs");
+   parameters->AddObject(new IntParam(HydrologyNumRequestedOutputsEnum,numoutputs));
+@@ -76,6 +82,8 @@
+ 
+ 	/*Fetch data needed: */
+ 	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
++	bool   issmb;
++	iomodel->FindConstant(&issmb,"md.transient.issmb");
+ 
+ 	/*Now, do we really want DC?*/
+ 	if(hydrology_model!=HydrologydcEnum) return;
+@@ -108,6 +116,10 @@
+ 		iomodel->FetchDataToInput(elements,"md.hydrology.mask_eplactive_node",HydrologydcMaskEplactiveNodeEnum);
+ 		iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadHydrostepEnum);
+ 	}
++	if(!issmb){
++		iomodel->FetchDataToInput(elements,"md.smb.model",SmbEnum);
++}
++
+ }/*}}}*/
+ 
+ void HydrologyDCInefficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+@@ -637,9 +649,7 @@
+ 	IssmDouble groundedice;
+ 	IssmDouble base_elev,prestep_head,water_sheet;
+ 	IssmDouble sediment_thickness       = element->GetMaterialParameter(HydrologydcSedimentThicknessEnum);
+-	bool isthermal;
+ 
+-	element->FindParam(&isthermal,TransientIsthermalEnum);
+ 	element->FindParam(&unconf_scheme,HydrologydcUnconfinedFlagEnum);
+ 	SedTrans_input->GetInputValue(&FullLayer_transmitivity,gauss);
+ 
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 23369)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 23370)
+@@ -187,7 +187,7 @@
+ 	}
+ 
+ 	if(!issmb){
+-		iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum);
++		iomodel->FetchDataToInput(elements,"md.smb.model",SmbEnum);
+ 	}
+ 	if(stabilization==3){
+ 		iomodel->FetchDataToInput(elements,"md.masstransport.spcthickness",MasstransportSpcthicknessEnum); //for DG, we need the spc in the element
+@@ -628,9 +628,9 @@
+ 	return pe;
+ }/*}}}*/
+ void           MasstransportAnalysis::GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+-	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 
++	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2.
+ 	 * For node i, Bi can be expressed in the actual coordinate system
+-	 * by: 
++	 * by:
+ 	 *       Bi=[ N ]
+ 	 *          [ N ]
+ 	 * where N is the finiteelement function for node i.
+@@ -656,9 +656,9 @@
+ 	xDelete<IssmDouble>(basis);
+ }/*}}}*/
+ void           MasstransportAnalysis::GetBprime(IssmDouble* Bprime,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+-	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 
++	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2.
+ 	 * For node i, Bi' can be expressed in the actual coordinate system
+-	 * by: 
++	 * by:
+ 	 *       Bi_prime=[ dN/dx ]
+ 	 *                [ dN/dy ]
+ 	 * where N is the finiteelement function for node i.
Index: /issm/oecreview/Archive/23185-23389/ISSM-23370-23371.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23370-23371.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23370-23371.diff	(revision 23390)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/test/NightlyRun/test101.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test101.m	(revision 23370)
++++ ../trunk-jpl/test/NightlyRun/test101.m	(revision 23371)
+@@ -3,8 +3,7 @@
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+ md=setflowequation(md,'SSA','all');
+-md.cluster=stallo('numnodes',1,'cpuspernode',16,'time',60,'queue','devel')
+-%md.cluster=generic('name',oshostname(),'np',2);
++md.cluster=generic('name',oshostname(),'np',2);
+ 
+ %output
+ md.stressbalance.requested_outputs={'default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
Index: /issm/oecreview/Archive/23185-23389/ISSM-23371-23372.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23371-23372.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23371-23372.diff	(revision 23390)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 23371)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 23372)
+@@ -187,7 +187,7 @@
+ 	}
+ 
+ 	if(!issmb){
+-		iomodel->FetchDataToInput(elements,"md.smb.model",SmbEnum);
++		iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum);
+ 	}
+ 	if(stabilization==3){
+ 		iomodel->FetchDataToInput(elements,"md.masstransport.spcthickness",MasstransportSpcthicknessEnum); //for DG, we need the spc in the element
Index: /issm/oecreview/Archive/23185-23389/ISSM-23372-23373.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23372-23373.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23372-23373.diff	(revision 23390)
@@ -0,0 +1,243 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23372)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23373)
+@@ -606,11 +606,11 @@
+ 				/*centered*/
+ 				//thickness[i] = old_thickness[i]*(1.0+opening-closing)/(1.0-opening+closing);
+ 
+-				if(element->nodes[i]->Sid()==2299){
+-					printf("for node %i \n",element->nodes[i]->Sid());
+-					printf(" old thickness is  %g \n",old_thickness[i]);
+-					printf(" new thickness is  %g \n",thickness[i]);
+-				}
++				//if(element->nodes[i]->Sid()==2299){
++				//	printf("for node %i \n",element->nodes[i]->Sid());
++				//	printf(" old thickness is  %g \n",old_thickness[i]);
++				//	printf(" new thickness is  %g \n",thickness[i]);
++				//}
+ 				/*Take care of otherthikening*/
+ 				if(thickness[i]>max_thick){
+ 					thickness[i] = max_thick;
+@@ -709,8 +709,8 @@
+ 			vec_mask->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL);
+ 			/* If epl thickness gets under colapse thickness, close the layer */
+ 			if(epl_thickness[i]<colapse_thick){
+-				if(element->nodes[i]->Sid()==2299){
+-					printf("masking node %i with thickness %f\n",element->nodes[i]->Sid(),epl_thickness[i]);}
++				//if(element->nodes[i]->Sid()==2299){
++					//printf("masking node %i with thickness %f\n",element->nodes[i]->Sid(),epl_thickness[i]);}
+ 				vec_mask->SetValue(basalelement->nodes[i]->Sid(),0.,INS_VAL);
+ 				recurence->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL);
+ 			}
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23372)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23373)
+@@ -9,7 +9,6 @@
+ int  HydrologyDCInefficientAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
+ 	return 1;
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+ 	int         hydrology_model;
+@@ -28,8 +27,8 @@
+ 	char**      requestedoutputs = NULL;
+ 
+ 	/*retrieve some parameters: */
+-	/* bool   issmb; */
+-	/* iomodel->FindConstant(&issmb,"md.transient.issmb"); */
++	 bool   issmb;
++	iomodel->FindConstant(&issmb,"md.transient.issmb");
+ 	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
+ 
+ 	/*Now, do we really want DC?*/
+@@ -64,9 +63,9 @@
+ 		iomodel->FetchData(&sedimentlimit,"md.hydrology.sedimentlimit");
+ 		parameters->AddObject(new DoubleParam(HydrologydcSedimentlimitEnum,sedimentlimit));
+ 	}
+-	/* if(!issmb){ */
+-	/* 	parameters->AddObject(iomodel->CopyConstantObject("md.smb.model",SmbEnum)); */
+-	/* } */
++	if(!issmb){
++		parameters->AddObject(iomodel->CopyConstantObject("md.smb.model",SmbEnum));
++	}
+ 
+   /*Requested outputs*/
+   iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.hydrology.requested_outputs");
+@@ -74,7 +73,6 @@
+   if(numoutputs)parameters->AddObject(new StringArrayParam(HydrologyRequestedOutputsEnum,requestedoutputs,numoutputs));
+   iomodel->DeleteData(&requestedoutputs,numoutputs,"md.hydrology.requested_outputs");
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+ 
+ 	bool   isefficientlayer;
+@@ -82,8 +80,6 @@
+ 
+ 	/*Fetch data needed: */
+ 	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
+-	bool   issmb;
+-	iomodel->FindConstant(&issmb,"md.transient.issmb");
+ 
+ 	/*Now, do we really want DC?*/
+ 	if(hydrology_model!=HydrologydcEnum) return;
+@@ -116,12 +112,8 @@
+ 		iomodel->FetchDataToInput(elements,"md.hydrology.mask_eplactive_node",HydrologydcMaskEplactiveNodeEnum);
+ 		iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadHydrostepEnum);
+ 	}
+-	if(!issmb){
+-		iomodel->FetchDataToInput(elements,"md.smb.model",SmbEnum);
+-}
+ 
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+ 
+ 	/*Fetch parameters: */
+@@ -137,7 +129,6 @@
+ 	::CreateNodes(nodes,iomodel,HydrologyDCInefficientAnalysisEnum,P1Enum);
+ 	iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+ 
+ 	/*retrieve some parameters: */
+@@ -147,7 +138,6 @@
+ 
+ 	IoModelToConstraintsx(constraints,iomodel,"md.hydrology.spcsediment_head",HydrologyDCInefficientAnalysisEnum,P1Enum);
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+ 
+ 	/*Fetch parameters: */
+@@ -182,16 +172,13 @@
+ void           HydrologyDCInefficientAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
+-
+ ElementVector* HydrologyDCInefficientAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+ }/*}}}*/
+-
+ ElementMatrix* HydrologyDCInefficientAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
+ _error_("Not implemented");
+ }/*}}}*/
+-
+ ElementMatrix* HydrologyDCInefficientAnalysis::CreateKMatrix(Element* element){/*{{{*/
+ 
+ 	/*Intermediaries*/
+@@ -317,7 +304,6 @@
+ 	}
+ 	return Ke;
+ }/*}}}*/
+-
+ ElementVector* HydrologyDCInefficientAnalysis::CreatePVector(Element* element){/*{{{*/
+ 
+ 	/*Intermediaries*/
+@@ -463,7 +449,6 @@
+ 	}
+ 	return pe;
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2.
+ 	 * For node i, Bi can be expressed in the actual coordinate system
+@@ -491,15 +476,12 @@
+ 	/*Clean-up*/
+ 	xDelete<IssmDouble>(dbasis);
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,SedimentHeadHydrostepEnum);
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	/*Intermediaries*/
+@@ -594,12 +576,10 @@
+ 		delete basalelement;
+ 	}
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	/*Default, do nothing*/
+ 	return;
+ }/*}}}*/
+-
+ IssmDouble HydrologyDCInefficientAnalysis::SedimentStoring(Element* element,Gauss* gauss,Input* sed_head_input, Input* base_input){/*{{{*/
+ 	int unconf_scheme;
+ 	IssmDouble expfac;
+@@ -639,7 +619,6 @@
+ 	}
+ 	return sediment_storing;
+ }/*}}}*/
+-
+ IssmDouble HydrologyDCInefficientAnalysis::SedimentTransmitivity(Element* element,Gauss* gauss,Input* sed_head_input, Input* base_input,Input* SedTrans_input){/*{{{*/
+ 	int unconf_scheme;
+ 	IssmDouble ratio,expfac;
+@@ -674,7 +653,6 @@
+ 	}
+ 	return sediment_transmitivity;
+ }/*}}}*/
+-
+ void  HydrologyDCInefficientAnalysis::GetHydrologyDCInefficientHmax(IssmDouble* ph_max,Element* element, Node* innode){/*{{{*/
+ 
+ 	int        hmax_flag;
+@@ -710,7 +688,6 @@
+ 	*ph_max=h_max;
+ }
+ /*}}}*/
+-
+ IssmDouble HydrologyDCInefficientAnalysis::GetHydrologyKMatrixTransfer(Element* element){/*{{{*/
+ 
+ 	int transfermethod;
+@@ -732,7 +709,6 @@
+ 	}
+ 	return transfer;
+ }/*}}}*/
+-
+ IssmDouble HydrologyDCInefficientAnalysis::GetHydrologyPVectorTransfer(Element* element, Gauss* gauss, Input* epl_head_input){/*{{{*/
+ 
+ 	int transfermethod;
+@@ -757,7 +733,6 @@
+ 	}
+ 	return transfer;
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::ElementizeEplMask(FemModel* femmodel){/*{{{*/
+ 
+ 	bool     element_active;
+@@ -776,8 +751,7 @@
+ 		element->AddInput(new BoolInput(HydrologydcMaskEplactiveEltEnum,element_active));
+ 	}
+ }/*}}}*/
+-
+-void  HydrologyDCInefficientAnalysis::HydrologyIDSGetMask(Vector<IssmDouble>* vec_mask, Element* element){
++void  HydrologyDCInefficientAnalysis::HydrologyIDSGetMask(Vector<IssmDouble>* vec_mask, Element* element){/*{{{*/
+ 	bool        active_element;
+ 	int         domaintype;
+ 	Element*    basalelement=NULL;
+@@ -818,7 +792,7 @@
+ 	}
+ 	xDelete<IssmDouble>(meltingrate);
+ 	xDelete<IssmDouble>(groundedice);
+-}
++}/*}}}*/
+ void HydrologyDCInefficientAnalysis::ElementizeIdsMask(FemModel* femmodel){/*{{{*/
+ 
+ 	bool     element_active;
+@@ -837,7 +811,6 @@
+ 		element->AddInput(new BoolInput(HydrologydcMaskThawedEltEnum,element_active));
+ 	}
+ }/*}}}*/
+-
+ void HydrologyDCInefficientAnalysis::HydrologyIdsGetActive(Vector<IssmDouble>* active_vec, Element* element){/*{{{*/
+ 	/*Constants*/
+ 	int      domaintype;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23373-23374.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23373-23374.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23373-23374.diff	(revision 23390)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23373)
++++ ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 23374)
+@@ -78,12 +78,12 @@
+ 	#define ISSM_MPI_ANY_SOURCE    AMPI_ANY_SOURCE
+ 
+ 	#else
+-	#if defined(_HAVE_AMPI_) && !defined(_WRAPPERS_)
+-			#define ISSM_MPI_DOUBLE    AMPI_ADOUBLE // corresponds to IssmDouble
++		#if defined(_HAVE_AMPI_) && !defined(_WRAPPERS_)
++			#define ISSM_MPI_DOUBLE    AMPI_ADOUBLE
+ 		#else 
+-			#define ISSM_MPI_DOUBLE    MPI_DOUBLE  // corresponds to IssmDouble 
++			#define ISSM_MPI_DOUBLE    MPI_DOUBLE
+ 		#endif
+-		#define ISSM_MPI_PDOUBLE    MPI_DOUBLE  // corresponds to IssmPDouble
++		#define ISSM_MPI_PDOUBLE    MPI_DOUBLE
+ 		#define ISSM_MPI_INT        MPI_INT
+ 		#define ISSM_MPI_CHAR       MPI_CHAR
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23374-23375.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23374-23375.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23374-23375.diff	(revision 23390)
@@ -0,0 +1,19 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 23374)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 23375)
+@@ -323,10 +323,10 @@
+ 
+ #concatenate reports
+ cd $ISSM_DIR/nightlylog/
+-echo 'CHECKING NIGHTLYLOG DIRECTORY'
+-echo '-----------------------------'
+-ls -la
+-echo '-----------------------------'
++#echo 'CHECKING NIGHTLYLOG DIRECTORY'
++#echo '-----------------------------'
++#ls -la
++#echo '-----------------------------'
+ 
+ if [ -f matlab_log.log ]; then
+ 	rm matlab_log.log
Index: /issm/oecreview/Archive/23185-23389/ISSM-23375-23376.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23375-23376.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23375-23376.diff	(revision 23390)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23375)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23376)
+@@ -373,7 +373,7 @@
+ 		old_wh_input = basalelement->GetInput(SedimentHeadOldEnum);                  _assert_(old_wh_input);
+ 	}
+ 	if(smb_model==SMBgradientscomponentsEnum){
+-		surface_runoff_input = basalelement->GetInput(SmbRunoffEnum);
++		surface_runoff_input = basalelement->GetInput(SmbRunoffEnum); _assert_(surface_runoff_input); 
+ 	}
+ 
+ 	/*Transfer related Inputs*/
+@@ -392,7 +392,8 @@
+ 		/*Loading term*/
+ 		if(!isefficientlayer){
+ 			basal_melt_input->GetInputValue(&water_load,gauss);
+-			surface_runoff_input->GetInputValue(&runoff_value,gauss);
++			if(surface_runoff_input) surface_runoff_input->GetInputValue(&runoff_value,gauss);
++			else                     runoff_value = 0.;
+ 			scalar = Jdet*gauss->weight*(water_load+runoff_value);
+ 			//scalar = Jdet*gauss->weight*(water_load)/sediment_transmitivity;
+ 			if(dt!=0.) scalar = scalar*dt;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23376-23377.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23376-23377.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23376-23377.diff	(revision 23390)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23376)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23377)
+@@ -348,7 +348,7 @@
+ 		old_wh_input = basalelement->GetInput(EplHeadOldEnum);            _assert_(old_wh_input);
+ 	}
+ 	if(smb_model==SMBgradientscomponentsEnum){
+-		surface_runoff_input = basalelement->GetInput(SmbRunoffEnum);
++		surface_runoff_input = basalelement->GetInput(SmbRunoffEnum); _assert_(surface_runoff_input);
+ 	}
+ 
+ 	/* Start  looping on the number of gaussian points: */
+@@ -362,7 +362,8 @@
+ 
+ 		/*Loading term*/
+ 		basal_melt_input->GetInputValue(&water_load,gauss);
+-		surface_runoff_input->GetInputValue(&runoff_value,gauss);
++		if(surface_runoff_input) surface_runoff_input->GetInputValue(&runoff_value,gauss);
++		else                     runoff_value = 0.;
+ 		scalar = Jdet*gauss->weight*(water_load+runoff_value);
+ 		//scalar = Jdet*gauss->weight*(water_load)/epl_transmitivity;
+ 		if(dt!=0.) scalar = scalar*dt;
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23376)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23377)
+@@ -406,7 +406,8 @@
+ 			active_element_input->GetInputValue(&active_element);
+ 			if(!active_element){
+ 				basal_melt_input->GetInputValue(&water_load,gauss);
+-				surface_runoff_input->GetInputValue(&runoff_value,gauss);
++				if(surface_runoff_input) surface_runoff_input->GetInputValue(&runoff_value,gauss);
++				else                     runoff_value = 0.;
+ 				scalar = Jdet*gauss->weight*(water_load+runoff_value);
+ 				//scalar = Jdet*gauss->weight*(water_load)/sediment_transmitivity;
+ 				if(dt!=0.) scalar = scalar*dt;
Index: /issm/oecreview/Archive/23185-23389/ISSM-23377-23378.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23377-23378.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23377-23378.diff	(revision 23390)
@@ -0,0 +1,70 @@
+Index: ../trunk-jpl/src/m/classes/clusters/stallo.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/stallo.py	(revision 23377)
++++ ../trunk-jpl/src/m/classes/clusters/stallo.py	(revision 23378)
+@@ -105,23 +105,20 @@
+ 			executable='issm_ocean.exe'
+ 		#write queuing script
+ 		shortname=modelname[0:min(12,len(modelname))]
++		timeobj=datetime.timedelta(minutes=self.time)
++		m,s=divmod(timeobj.total_seconds(), 60)
++		h,m=divmod(m, 60)
++		d,h=divmod(h, 60)
++		timestring="%02d-%02d:%02d:%02d" % (d, h, m, s)
++
+ 		fid=open(modelname+'.queue','w')
+-
+ 		fid.write('#!/bin/bash -l\n')
+ 		fid.write('#SBATCH --job-name=%s \n' % shortname)
+-		if self.queue=='devel':
+-			fid.write('#SBATCH --qos %s \n' % self.queue)
+-		else:
+-			fid.write('#SBATCH --partition %s \n' % self.queue)
++		fid.write('#SBATCH --qos=%s \n' % self.queue)
+ 		fid.write('#SBATCH --nodes=%i \n' % self.numnodes)
+ 		fid.write('#SBATCH --ntasks-per-node=%i \n' % self.cpuspernode)
+-		timeobj=datetime.timedelta(minutes=self.time)
+-		m,s=divmod(timeobj.total_seconds(), 60)
+-		h,m=divmod(m, 60)
+-		d,h=divmod(h, 60)
+-		timestring="%02d-%02d:%02d:%02d" % (d, h, m, s)
+ 		fid.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 (to keep it integral)
++		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)
+Index: ../trunk-jpl/src/m/classes/clusters/stallo.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/stallo.m	(revision 23377)
++++ ../trunk-jpl/src/m/classes/clusters/stallo.m	(revision 23378)
+@@ -97,16 +97,17 @@
+ 				 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 --qos=%s \n',cluster.queue);
+ 			 fprintf(fid,'#SBATCH --nodes=%i \n',cluster.numnodes);
+ 			 fprintf(fid,'#SBATCH --ntasks-per-node=%i \n',cluster.cpuspernode);
+-			 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));
+ 			 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,
+@@ -115,6 +116,7 @@
+ 			 fprintf(fid,'#SBATCH --account=%s\n',cluster.accountname);
+  			 fprintf(fid,'#SBATCH --output %s/%s/%s.outlog \n',cluster.executionpath,dirname,modelname);
+  			 fprintf(fid,'#SBATCH --error %s/%s/%s.errlog \n\n',cluster.executionpath,dirname,modelname);
++
+  			 fprintf(fid,'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');
Index: /issm/oecreview/Archive/23185-23389/ISSM-23378-23379.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23378-23379.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23378-23379.diff	(revision 23390)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test455.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test455.py	(revision 23378)
++++ ../trunk-jpl/test/NightlyRun/test455.py	(revision 23379)
+@@ -23,7 +23,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+[6e-08,6e-08,6e-08,6e-08,3e-13]
++	field_tolerances=field_tolerances+[7e-08,6e-08,6e-08,6e-08,3e-13]
+ 	field_values=field_values+[\
+ 			md.results.StressbalanceSolution.Vx,\
+ 			md.results.StressbalanceSolution.Vy,\
+Index: ../trunk-jpl/test/NightlyRun/test455.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test455.m	(revision 23378)
++++ ../trunk-jpl/test/NightlyRun/test455.m	(revision 23379)
+@@ -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{:},6e-08,6e-08,6e-08,6e-08,3e-13};
++	field_tolerances={field_tolerances{:},7e-08,6e-08,6e-08,6e-08,3e-13};
+ 	field_values={field_values{:},...
+ 	(md.results.StressbalanceSolution.Vx),...
+ 	(md.results.StressbalanceSolution.Vy),...
Index: /issm/oecreview/Archive/23185-23389/ISSM-23379-23380.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23379-23380.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23379-23380.diff	(revision 23390)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 23379)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 23380)
+@@ -130,7 +130,7 @@
+ 	/*activate formulation: */
+ 	femmodel->SetCurrentConfiguration(LevelsetAnalysisEnum);
+ 
+-	if(VerboseSolution()) _printf0_("call computational core:\n");
++	if(VerboseSolution()) _printf0_("   call computational core:\n");
+ 	if(stabilization==4){
+ 		solutionsequence_fct(femmodel);
+ 	}
+Index: ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 23379)
++++ ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 23380)
+@@ -64,7 +64,7 @@
+ 	/*activate formulation: */
+ 	femmodel->SetCurrentConfiguration(ExtrapolationAnalysisEnum);
+ 
+-	if(VerboseSolution()) _printf0_("extrapolation of " << EnumToStringx(extvar_enum) << ": call computational core:\n");
++	if(VerboseSolution()) _printf0_("   extrapolation of " << EnumToStringx(extvar_enum) << ":\n");
+ 	solutionsequence_linear(femmodel);
+ 
+ 	if(save_results){
+Index: ../trunk-jpl/src/c/cores/balancethickness_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/balancethickness_core.cpp	(revision 23379)
++++ ../trunk-jpl/src/c/cores/balancethickness_core.cpp	(revision 23380)
+@@ -20,7 +20,7 @@
+ 	/*recover parameters: */
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+ 
+-	if(VerboseSolution()) _printf0_("call computational core:\n");
++	if(VerboseSolution()) _printf0_("   call computational core:\n");
+ 	solutionsequence_linear(femmodel);
+ 
+ 	if(save_results){
+Index: ../trunk-jpl/src/c/cores/balancevelocity_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/balancevelocity_core.cpp	(revision 23379)
++++ ../trunk-jpl/src/c/cores/balancevelocity_core.cpp	(revision 23380)
+@@ -26,7 +26,7 @@
+ 	femmodel->parameters->SetParam(DrivingStressYEnum,InputToSmoothEnum);
+ 	solutionsequence_linear(femmodel);
+ 
+-	if(VerboseSolution()) _printf0_("call computational core:\n");
++	if(VerboseSolution()) _printf0_("   call computational core:\n");
+ 	femmodel->SetCurrentConfiguration(BalancevelocityAnalysisEnum);
+ 	solutionsequence_linear(femmodel);
+ 
Index: /issm/oecreview/Archive/23185-23389/ISSM-23387-23388.diff
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-23387-23388.diff	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-23387-23388.diff	(revision 23390)
@@ -0,0 +1,494 @@
+Index: ../trunk-jpl/examples/Pig2/Pig.par
+===================================================================
+--- ../trunk-jpl/examples/Pig2/Pig.par	(nonexistent)
++++ ../trunk-jpl/examples/Pig2/Pig.par	(revision 23388)
+@@ -0,0 +1,118 @@
++% Parameters to change/Try
++friction_coefficient = 10; % default [10]
++Temp_change          =  0;  % default [0 K]
++
++%Name and Coordinate system
++md.miscellaneous.name='PIG';
++md.mesh.epsg=3031;
++
++%NetCdf Loading
++disp('   Loading SeaRISE data from NetCDF');
++ncdata='../Data/Antarctica_5km_withshelves_v0.75.nc';
++x1    = ncread(ncdata,'x1');
++y1    = ncread(ncdata,'y1');
++usrf  = ncread(ncdata,'usrf')';
++topg  = ncread(ncdata,'topg')';
++temp  = ncread(ncdata,'presartm')';
++smb   = ncread(ncdata,'presprcp')';
++gflux = ncread(ncdata,'bheatflx_fox')';
++
++%Geometry
++disp('   Interpolating surface and ice base');
++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);
++clear usrf, topg;
++
++disp('   Constructing thickness');
++md.geometry.thickness=md.geometry.surface-md.geometry.base;
++
++%ensure hydrostatic equilibrium on ice shelf: 
++di=md.materials.rho_ice/md.materials.rho_water;
++
++%Get the node numbers of floating nodes
++pos=find(md.mask.groundedice_levelset<0); 
++
++%apply a flotation criterion on the precedingly defined nodes and
++%redefine base and thickness accordingly
++md.geometry.thickness(pos)=1/(1-di)*md.geometry.surface(pos);
++md.geometry.base(pos)=md.geometry.surface(pos)-md.geometry.thickness(pos);
++md.geometry.hydrostatic_ratio=ones(md.mesh.numberofvertices,1); %For Dakota
++
++%Set min thickness to 1 meter
++pos0=find(md.geometry.thickness<=1);
++md.geometry.thickness(pos0)=1;
++md.geometry.surface=md.geometry.thickness+md.geometry.base;
++md.geometry.bed=md.geometry.base;
++md.geometry.bed(pos)=md.geometry.base(pos)-1000;
++
++%Initialization parameters
++disp('   Interpolating temperatures');
++md.initialization.temperature=InterpFromGridToMesh(x1,y1,temp,md.mesh.x,md.mesh.y,0)+273.15+Temp_change;
++clear temp;
++
++disp('   Loading velocities data from NetCDF');
++nsidc_vel='../Data/Antarctica_ice_velocity.nc';
++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'));
++velx    = double(ncread(nsidc_vel,'vx'));
++vely    = 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));  
++spacing = strtrim(spacing);
++spacing = str2num(spacing(1:end-2));  
++% Build the coordinates
++x2=xmin+(0:1:nx)'*spacing;
++y2=(ymax-ny*spacing)+(0:1:ny)'*spacing;
++
++disp('   Set observed velocities')
++md.initialization.vx=InterpFromGridToMesh(x2,y2,flipud(velx'),md.mesh.x,md.mesh.y,0);
++md.initialization.vy=InterpFromGridToMesh(x2,y2,flipud(vely'),md.mesh.x,md.mesh.y,0);
++md.initialization.vz=zeros(md.mesh.numberofvertices,1);
++md.initialization.vel=sqrt(md.initialization.vx.^2+md.initialization.vy.^2);
++clear velx vely;
++
++disp('   Set Pressure');
++md.initialization.pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness;
++
++disp('   Construct ice rheological properties');
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++md.materials.rheology_B=paterson(md.initialization.temperature);
++
++%Forcings
++disp('   Interpolating surface mass balance');
++mass_balance=InterpFromGridToMesh(x1,y1,smb,md.mesh.x,md.mesh.y,0);
++md.smb.mass_balance=mass_balance*md.materials.rho_water/md.materials.rho_ice;
++clear smb;
++
++disp('   Set geothermal heat flux');
++md.basalforcings.geothermalflux=InterpFromGridToMesh(x1,y1,gflux,md.mesh.x,md.mesh.y,0);
++clear gflux;
++
++%Friction and inversion set up
++disp('   Construct basal friction parameters');
++md.friction.coefficient=friction_coefficient*ones(md.mesh.numberofvertices,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++
++%no friction applied on floating ice
++pos=find(md.mask.groundedice_levelset<0);
++md.friction.coefficient(pos)=0;
++md.groundingline.migration='SubelementMigration';
++
++md.inversion=m1qn3inversion();
++md.inversion.vx_obs=md.initialization.vx;
++md.inversion.vy_obs=md.initialization.vy;
++md.inversion.vel_obs=md.initialization.vel;
++
++disp('   Set boundary conditions');
++md=SetMarineIceSheetBC(md);
++md.basalforcings.floatingice_melting_rate = zeros(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices,1);
++md.thermal.spctemperature                 = md.initialization.temperature;
++md.masstransport.spcthickness             = NaN*ones(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/examples/Pig2/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Pig2/runme.m	(nonexistent)
++++ ../trunk-jpl/examples/Pig2/runme.m	(revision 23388)
+@@ -0,0 +1,231 @@
++steps=[1:8];
++
++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
++
++	% 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'));
++
++	% 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);
++	vel_obs=sqrt(vx_obs.^2+vy_obs.^2);
++	clear vx vy x y;
++
++	% Adapt the mesh to minimize error in velocity interpolation
++	md=bamg(md,'hmax',hmax,'hmin',hmin,'gradation',gradation,'field',vel_obs,'err',err);
++
++	% Plot and save model
++	plotmodel(md,'data','mesh')
++	save ./Models/PIG_Mesh_generation md;
++end
++
++if any(steps==2)  %Masks #2
++
++	md = loadmodel('./Models/PIG_Mesh_generation');	
++
++	% Load SeaRISe dataset for Antarctica  http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica
++	searise='../Data/Antarctica_5km_withshelves_v0.75.nc';
++	
++	%read thickness mask from SeaRISE
++	x1=double(ncread(searise,'x1'));
++	y1=double(ncread(searise,'y1'));
++	thkmask=double(ncread(searise,'thkmask'));
++	
++	%interpolate onto our mesh vertices
++	groundedice=double(InterpFromGridToMesh(x1,y1,thkmask',md.mesh.x,md.mesh.y,0));
++	groundedice(groundedice<=0)=-1;
++	clear thkmask;
++
++	%fill in the md.mask structure
++	md.mask.groundedice_levelset=groundedice; %ice is grounded for mask equal one
++	md.mask.ice_levelset=-1*ones(md.mesh.numberofvertices,1);%ice is present when negatvie
++
++	plotmodel(md,'data',md.mask.groundedice_levelset,'title','grounded/floating','data',md.mask.ice_levelset,'title','ice/no-ice')
++	
++	save ./Models/PIG_SetMask md;
++end
++
++if any(steps==3)  %Parameterization #3
++
++	md = loadmodel('./Models/PIG_SetMask');
++	md = setflowequation(md,'SSA','all');
++	md = parameterize(md,'./Pig.par');
++	
++	save ./Models/PIG_Parameterization md;
++end
++
++if any(steps==4)  %Rheology B inversion
++
++	md = loadmodel('./Models/PIG_Parameterization');
++
++	% Control general
++	md.inversion.iscontrol=1;
++	md.inversion.maxsteps=40;
++	md.inversion.maxiter=40;
++	md.inversion.dxmin=0.1;
++	md.inversion.gttol=1.0e-6;
++	md.verbose=verbose('control',true);
++
++	% Cost functions
++	md.inversion.cost_functions=[101 103 502];
++	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,3);
++	md.inversion.cost_functions_coefficients(:,1)=1000;
++	md.inversion.cost_functions_coefficients(:,2)=1;
++	md.inversion.cost_functions_coefficients(:,3)=1.e-16;
++
++	% Controls
++	md.inversion.control_parameters={'MaterialsRheologyBbar'};
++	md.inversion.min_parameters=md.materials.rheology_B;
++	md.inversion.max_parameters=md.materials.rheology_B;
++	pos = find(md.mask.groundedice_levelset<0);
++	md.inversion.min_parameters(pos) = cuffey(273);
++	md.inversion.max_parameters(pos) = cuffey(200);
++
++	% Additional parameters
++	md.stressbalance.restol=0.01;
++	md.stressbalance.reltol=0.1;
++	md.stressbalance.abstol=NaN;
++
++	% Solve
++	md.cluster=generic('name',oshostname,'np',2);
++	mds=extract(md,md.mask.groundedice_levelset<0);
++	mds=solve(mds,'Stressbalance');
++
++	% Update model rheology_B accordingly
++	md.materials.rheology_B(mds.mesh.extractedvertices)=mds.results.StressbalanceSolution.MaterialsRheologyBbar;
++	plotmodel(md,'data',md.materials.rheology_B)
++
++	% Save model
++	save ./Models/PIG_Control_B md;
++end
++
++if any(steps==5)  %drag inversion
++
++	md = loadmodel('./Models/PIG_Control_B');
++
++	% Cost functions
++	md.inversion.cost_functions=[101 103 501];
++	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,3);
++	md.inversion.cost_functions_coefficients(:,1)=2000;
++	md.inversion.cost_functions_coefficients(:,2)=1;
++	md.inversion.cost_functions_coefficients(:,3)=8e-7;
++
++	% Controls
++	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);
++
++	% Solve
++	md=solve(md,'Stressbalance');
++
++	% Update model friction fields accordingly
++	md.friction.coefficient=md.results.StressbalanceSolution.FrictionCoefficient;
++
++	%Plot and save
++	plotmodel(md,...
++		'data',md.initialization.vel,'title','Observed velocity',...
++		'data',md.results.StressbalanceSolution.Vel,'title','Modeled Velocity',...
++		'data',md.geometry.base,'title','Bed elevation',...
++		'data',md.results.StressbalanceSolution.FrictionCoefficient,'title','Friction Coefficient',...
++		'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
++
++if any(steps==6) %Transient Run #1
++
++	md = loadmodel('../Pig/Models/PIG_Control_drag');	
++
++	md.inversion.iscontrol=0;
++	md.transient.ismasstransport=1;
++	md.transient.isstressbalance=1;
++	md.transient.isgroundingline=1;
++	md.transient.ismovingfront=0;
++	md.transient.isthermal=0;
++	md.verbose.solution=1;
++	md.timestepping.time_step=0.1;
++	md.timestepping.final_time=10;
++	md.transient.requested_outputs={'default','IceVolume','IceVolumeAboveFloatation'};
++
++	%Set melt to 25 m/yr under floating ice
++	md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++	md.basalforcings.floatingice_melting_rate=25*ones(md.mesh.numberofvertices,1);
++
++
++	md=solve(md,'Transient');
++	time      = cell2mat({md.results.TransientSolution(:).time});
++	V_control = cell2mat({md.results.TransientSolution(:).IceVolumeAboveFloatation});
++	plot(time,V_control); legend({'Control run'});
++
++	% Save model
++	save ./Models/PIG_Transient md;
++end
++
++if any(steps==7) %High Melt #2
++	md = loadmodel('./Models/PIG_Transient');	
++
++	%Set melt to 60 m/yr under floating ice
++	md.basalforcings.floatingice_melting_rate=60*ones(md.mesh.numberofvertices,1);
++
++	md=solve(md,'Transient');
++	V_melt = cell2mat({md.results.TransientSolution(:).IceVolumeAboveFloatation});
++	plot(time,[V_control',V_melt']); legend({'Control run','High melt'});
++
++	save ./Models/PIG_HighMelt md;
++end
++
++if any(steps==8) %Ice Front retreat
++	md = loadmodel('./Models/PIG_Transient');	
++
++	pos = find(ContourToNodes(md.mesh.x,md.mesh.y,'FrontRetreat.exp',2));
++	md.mask.ice_levelset(pos) = +1; %Deactivate nodes in retreated area
++
++	md=solve(md,'Transient');
++	V_retreat = cell2mat({md.results.TransientSolution(:).IceVolumeAboveFloatation});
++	plot(time,[V_control',V_melt',V_retreat']); legend({'Control run','High melt','Retreat'});
++
++	save ./Models/PIG_FrontRetreat md;
++end
++
++if any(steps==9) %High surface mass balance #3
++	%Load model from PIG_Transient
++	%...
++
++	%Change surface mass balance (x2)
++	%...
++
++	%Solve
++	%...
++
++	%Get volume time series
++	%...
++
++	%plot
++	plot(time,[V_control',V_melt',V_retreat',V_smb']); legend({'Control run','High melt','Retreat','SMB'});
++
++	%Save model
++	save ./Models/PIG_SMB md;
++end
+
+Property changes on: ../trunk-jpl/examples/Pig2/runme.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/Pig2/DomainOutline.exp
+===================================================================
+--- ../trunk-jpl/examples/Pig2/DomainOutline.exp	(nonexistent)
++++ ../trunk-jpl/examples/Pig2/DomainOutline.exp	(revision 23388)
+@@ -0,0 +1,101 @@
++## Name:
++## Icon:0
++# Points Count Value
++95 25000.000000
++# X pos Y pos
++-1712113.0179281300 -349656.0205056490
++-1711509.1917759699 -349354.1074295690
++-1709240.6586108401 -349354.1074295690
++-1707080.1508345299 -348922.0058743060
++-1705459.7700022999 -347193.5996532570
++-1703083.2114483600 -345249.1426545770
++-1701138.7544496800 -344168.8887664210
++-1698438.1197292900 -343952.8379887900
++-1698006.0181740201 -341900.3556012940
++-1693793.0280102200 -340279.9747690600
++-1691092.3932898301 -339631.8224361670
++-1688391.7585694401 -339415.7716585360
++-1686447.3015707601 -340063.9239914290
++-1683530.6160727399 -341036.1524907690
++-1682558.3875734000 -343304.6856558960
++-1682134.7209454600 -344182.1487658350
++-1682126.2860181299 -345681.2442098390
++-1681072.0444963200 -345932.4393879640
++-1680634.4718407800 -346682.5639403050
++-1680571.9614614199 -348557.8753211580
++-1677446.4424933300 -348370.3441830730
++-1675508.6207331200 -349495.5310115840
++-1676616.9911885399 -353567.0975933760
++-1672991.8601872099 -353799.6175753630
++-1668839.1631938200 -353999.1991486380
++-1667132.2298986400 -355121.4651541420
++-1666069.5534494901 -357496.8595698890
++-1662944.0344814099 -358309.4945015920
++-1660756.1712037399 -358747.0671571240
++-1657922.9836098100 -361682.8074238540
++-1656579.2228470000 -364003.8487410000
++-1653004.8841628900 -364748.0635758530
++-1653442.4568184200 -361622.5446077650
++-1651129.5727820301 -355684.0585683980
++-1648929.2928810001 -350845.9692010000
++-1646260.7698359799 -347802.2804785470
++-1644571.8968503401 -341785.6704672340
++-1643503.3064999001 -340869.0986596620
++-1643190.7546030900 -336680.9032424240
++-1642690.6715682000 -335243.1645171040
++-1641913.0916588283 -332341.0814454452
++-1640683.9739821283 -330436.6112348017
++-1637816.0327364956 -328532.1410241582
++-1635241.2508976001 -328652.8685499910
++-1631765.4107996500 -327017.1790921330
++-1625934.5618617306 -322342.6128395668
++-1620608.3852626982 -320438.1426289233
++-1616101.6204481323 -320438.1426289233
++-1611594.8556335662 -320914.2601815842
++-1607907.5026034669 -321866.4952869060
++-1602991.0318966676 -324723.2006028712
++-1599713.3847588014 -327579.9059188365
++-1593977.5022675355 -328532.1410241582
++-1590699.8551296694 -334721.6692087495
++-1589259.8391499999 -338300.0840570000
++-1588627.0898328500 -343572.9950327750
++-1588056.6000060199 -345432.3563530700
++-1586993.9235568701 -347432.6884926460
++-1589259.8391499999 -349315.9832070000
++-1585493.6744521901 -352996.1122558430
++-1585118.6121760199 -354496.3613605250
++-1585861.9157163899 -356240.3342513760
++-1586368.8197632500 -358747.0671571240
++-1587889.0972700799 -360996.6006787950
++-1586681.3716600600 -363935.4286441500
++-1585806.2263489999 -365748.2296456410
++-1586743.8820394201 -368373.6655788350
++-1586056.2678664399 -370123.9562009640
++-1585493.6744521901 -371124.1222707520
++-1586243.7990045301 -373562.0270658610
++-1414257.6683934701 -327460.5482541260
++-1412220.4351378100 -325972.8942023180
++-1404515.9240538401 -296165.1737279960
++-1387984.9332285200 -267002.0106682320
++-1360067.9373810000 -107884.1934940000
++-1423274.3497420000 -81217.9259650000
++-1402446.7987670000 -45916.9921070000
++-1478343.8065599999 60338.8188030000
++-1503760.4789370000 36334.1837800000
++-1528509.5619775900 63667.6809196406
++-1623055.4918765700 62841.1506965373
++-1725734.5897359999 -61372.6193030000
++-1719614.6457630000 -69022.5492690000
++-1759088.2843859999 -114004.1374660000
++-1755416.3180020000 -117064.1094530000
++-1761230.2647760001 -126856.0198080000
++-1758170.2927900001 -130527.9861920000
++-1762148.2563720001 -135423.9413700000
++-1764902.2311590000 -131445.9777880000
++-1769798.1863370000 -134199.9525750000
++-1775000.1387139999 -131445.9777880000
++-1794277.9622269999 -153477.7760890000
++-1712576.7101950001 -225081.1205660000
++-1729939.5891459100 -335652.4567604720
++-1712113.0179281300 -349656.0205056490
++
+Index: ../trunk-jpl/examples/Pig2/FrontRetreat.exp
+===================================================================
+--- ../trunk-jpl/examples/Pig2/FrontRetreat.exp	(nonexistent)
++++ ../trunk-jpl/examples/Pig2/FrontRetreat.exp	(revision 23388)
+@@ -0,0 +1,17 @@
++## Name:FrontRetreat
++## Icon:0
++# Points Count Value
++11 1.000000
++# X pos Y pos
++-1626858.6376043619 -327176.4356578548
++-1605190.4936934854 -325911.1425827671
++-1604716.0087903275 -316263.2828852235
++-1607088.4333061168 -312625.5652943464
++-1612465.9288752396 -311676.5954880306
++-1618476.0709819060 -312467.4036599604
++-1624011.7281854146 -313890.8583694341
++-1626858.6376043619 -315788.7979820656
++-1627807.6074106777 -319268.3539385567
++-1628756.5772169936 -322589.7482606619
++-1626858.6376043619 -327176.4356578548
++
Index: /issm/oecreview/Archive/23185-23389/ISSM-DocReview-23185-23389.tex
===================================================================
--- /issm/oecreview/Archive/23185-23389/ISSM-DocReview-23185-23389.tex	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/ISSM-DocReview-23185-23389.tex	(revision 23390)
@@ -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/23185-23389/LogNumber.tex
===================================================================
--- /issm/oecreview/Archive/23185-23389/LogNumber.tex	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/LogNumber.tex	(revision 23390)
@@ -0,0 +1,1 @@
+23185-23389
Index: /issm/oecreview/Archive/23185-23389/Makefile
===================================================================
--- /issm/oecreview/Archive/23185-23389/Makefile	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/Makefile	(revision 23390)
@@ -0,0 +1,8 @@
+TARGET=ISSM-DocReview-23185-23389
+
+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/23185-23389/log.tex
===================================================================
--- /issm/oecreview/Archive/23185-23389/log.tex	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/log.tex	(revision 23390)
@@ -0,0 +1,1141 @@
+\noindent \textbf{Change \#1} with diff file ISSM-23185-23186.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/exp/exptool.m\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#2} with diff file ISSM-23187-23188.diff: \\
+Function name: \\
+M /issm/trunk-jpl M /issm/trunk-jpl/src M /issm/trunk-jpl/src/m/mesh/triangle.m D /issm/trunk-jpl/src/m/modules/Triangle.m\\
+Export determination: 6. \\
+Rationale: merged trunk and trunk-jpl\\
+\vspace{3em}
+
+\noindent \textbf{Change \#3} with diff file ISSM-23190-23191.diff: \\
+Function name: \\
+M /issm/trunk-jpl M /issm/trunk-jpl/src M /issm/trunk-jpl/test\\
+Export determination: 6. \\
+Rationale: Block revision 23189 from being merged into trunk-jpl\\
+\vspace{3em}
+
+\noindent \textbf{Change \#4} with diff file ISSM-23191-23192.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac\\
+Export determination: 6. \\
+Rationale: CHG: new revision number of ISSM\\
+\vspace{3em}
+
+\noindent \textbf{Change \#5} with diff file ISSM-23192-23193.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mesh/triangle.py M /issm/trunk-jpl/src/m/mesh/triangle2dvertical.m D /issm/trunk-jpl/src/m/modules/Triangle.py\\
+Export determination: 6. \\
+Rationale: CHG: removing Triangle.py as well\\
+\vspace{3em}
+
+\noindent \textbf{Change \#6} with diff file ISSM-23193-23194.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test421.m M /issm/trunk-jpl/test/NightlyRun/test421.py\\
+Export determination: 6. \\
+Rationale: CHG: relaxing tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#7} with diff file ISSM-23194-23195.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mesh/triangle.py\\
+Export determination: 6. \\
+Rationale: BUG: forgot to import Triangle\_python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#8} with diff file ISSM-23197-23198.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_nonlinear.cpp M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_schurcg.cpp\\
+Export determination: 6. \\
+Rationale: NEW: added preconditioned Schur CG solution sequence for FS 3D\\
+\vspace{3em}
+
+\noindent \textbf{Change \#9} with diff file ISSM-23198-23199.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_nonlinear.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Removed personal troubleshooting commands\\
+\vspace{3em}
+
+\noindent \textbf{Change \#10} with diff file ISSM-23199-23200.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h\\
+Export determination: 6. \\
+Rationale: NEW: Added routine to calculate local contribution to the Schur preconditioner\\
+\vspace{3em}
+
+\noindent \textbf{Change \#11} with diff file ISSM-23204-23205.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_schurcg.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Fixed bug in the SchurCG solver for nonzero Dirichlet B.C.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#12} with diff file ISSM-23205-23206.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/convergence.cpp M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_schurcg.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Reduced SchurCG storage req. by storing preconditioner in Kff. Added adjusted routine to check for convergence.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#13} with diff file ISSM-23206-23207.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: PressureMassMatrix and SchurPreconditioner can now also be constructed in 2D\\
+\vspace{3em}
+
+\noindent \textbf{Change \#14} with diff file ISSM-23207-23208.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Combined 2D \& 3D case for MassMatrix \& SchurPrecond into one\\
+\vspace{3em}
+
+\noindent \textbf{Change \#15} with diff file ISSM-23210-23211.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/stallo.py\\
+Export determination: 6. \\
+Rationale: BUG:updating Stallo cluster file\\
+\vspace{3em}
+
+\noindent \textbf{Change \#16} with diff file ISSM-23211-23212.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/export\_netCDF.py M /issm/trunk-jpl/src/m/contrib/defleurian/paraview/enveloppeVTK.py M /issm/trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py\\
+Export determination: 6. \\
+Rationale: CHG:updating export routines\\
+\vspace{3em}
+
+\noindent \textbf{Change \#17} with diff file ISSM-23212-23213.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_schurcg.cpp\\
+Export determination: 6. \\
+Rationale: CHG: make sure code compile with PETSc 3.4\\
+\vspace{3em}
+
+\noindent \textbf{Change \#18} with diff file ISSM-23214-23215.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test290.m M /issm/trunk-jpl/test/NightlyRun/test290.py\\
+Export determination: 6. \\
+Rationale: CHG: Easing tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#19} with diff file ISSM-23215-23216.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/adjointstressbalance\_core.cpp M /issm/trunk-jpl/src/c/cores/stressbalance\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Added SchurCG switch to control method\\
+\vspace{3em}
+
+\noindent \textbf{Change \#20} with diff file ISSM-23216-23217.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: BUG: Minor: extra backslash in m1qn3 lib path.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#21} with diff file ISSM-23217-23218.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/control\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Added SchurCG compatibility to control\_core.cpp\\
+\vspace{3em}
+
+\noindent \textbf{Change \#22} with diff file ISSM-23218-23219.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/control\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: use brackets to protect case\\
+\vspace{3em}
+
+\noindent \textbf{Change \#23} with diff file ISSM-23219-23220.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: libprepend mpich\\
+\vspace{3em}
+
+\noindent \textbf{Change \#24} with diff file ISSM-23220-23221.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_schurcg.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added switch to MatCreateSubMatrix for PETSc 3.5+\\
+\vspace{3em}
+
+\noindent \textbf{Change \#25} with diff file ISSM-23221-23222.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/Profiler.cpp M /issm/trunk-jpl/src/c/classes/Profiler.h M /issm/trunk-jpl/src/c/cores/masstransport\_core.cpp M /issm/trunk-jpl/src/c/cores/stressbalance\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added core solution profiling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#26} with diff file ISSM-23222-23223.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/Profiler.h\\
+Export determination: 6. \\
+Rationale: CHG: moved core profiling to md.debug.profiling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#27} with diff file ISSM-23223-23224.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2084.m\\
+Export determination: 6. \\
+Rationale: CHG: Eased tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#28} with diff file ISSM-23224-23225.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2084.m\\
+Export determination: 6. \\
+Rationale: CHG: Eased tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#29} with diff file ISSM-23227-23228.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/codipack A /issm/trunk-jpl/externalpackages/codipack/install.sh\\
+Export determination: 6. \\
+Rationale: NEW: added codipack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#30} with diff file ISSM-23228-23229.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Profiler.h M /issm/trunk-jpl/src/c/cores/thermal\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added thermal core solution profiling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#31} with diff file ISSM-23229-23230.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added output for thermal core solution profiling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#32} with diff file ISSM-23230-23231.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/clusters/stallo.m M /issm/trunk-jpl/src/m/classes/clusters/stallo.py\\
+Export determination: 6. \\
+Rationale: NEW: adding matlab stallo and updating py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#33} with diff file ISSM-23231-23232.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/modules/Chaco.py M /issm/trunk-jpl/src/m/modules/Scotch.py M /issm/trunk-jpl/src/m/partition/partitioner.py M /issm/trunk-jpl/src/m/qmu/dakota\_in\_write.py M /issm/trunk-jpl/src/m/qmu/dakota\_out\_parse.py M /issm/trunk-jpl/src/m/qmu/process\_qmu\_response\_data.m M /issm/trunk-jpl/src/wrappers/Chaco/Chaco.cpp M /issm/trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp M /issm/trunk-jpl/src/wrappers/python/io/pythonio.h A /issm/trunk-jpl/test/NightlyRun/test234.py A /issm/trunk-jpl/test/NightlyRun/test235.py A /issm/trunk-jpl/test/NightlyRun/test413.py A /issm/trunk-jpl/test/NightlyRun/test414.py A /issm/trunk-jpl/test/NightlyRun/test417.py A /issm/trunk-jpl/test/NightlyRun/test444.py\\
+Export determination: 6. \\
+Rationale: NEW: added Dakota/QMU Chaco tests (234,235,413,414,417,444), minor bug fixes, left out 418 due to unresolved memory issues\\
+\vspace{3em}
+
+\noindent \textbf{Change \#34} with diff file ISSM-23232-23233.diff: \\
+Function name: \\
+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/damage\_core.cpp M /issm/trunk-jpl/src/c/cores/esa\_core.cpp M /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/movingfront\_core.cpp M /issm/trunk-jpl/src/c/cores/sealevelrise\_core.cpp M /issm/trunk-jpl/src/c/cores/smb\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added core solution profiling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#35} with diff file ISSM-23233-23234.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/adjointmpi A /issm/trunk-jpl/externalpackages/adjointmpi/install.sh\\
+Export determination: 6. \\
+Rationale: NEW: added adjointmpi for codipack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#36} with diff file ISSM-23234-23235.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_ross\_dakota\\
+Export determination: 6. \\
+Rationale: CHG: Adding Python tests for Dakota\\
+\vspace{3em}
+
+\noindent \textbf{Change \#37} with diff file ISSM-23235-23236.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2084.m M /issm/trunk-jpl/test/NightlyRun/test2084.py\\
+Export determination: 6. \\
+Rationale: CHG: fixed 2084 so that python and matlab versions test names and tolerances match\\
+\vspace{3em}
+
+\noindent \textbf{Change \#38} with diff file ISSM-23236-23237.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/numberedcostfunction.m\\
+Export determination: 6. \\
+Rationale: CHG: updated numberedcostfunction\\
+\vspace{3em}
+
+\noindent \textbf{Change \#39} with diff file ISSM-23237-23238.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/issm/IssmToolkitUtils.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added check to avoid crash\\
+\vspace{3em}
+
+\noindent \textbf{Change \#40} with diff file ISSM-23238-23239.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mesh/triangle.py\\
+Export determination: 6. \\
+Rationale: BUG: no more Triangle module\\
+\vspace{3em}
+
+\noindent \textbf{Change \#41} with diff file ISSM-23239-23240.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: integrating CoDIPack changes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#42} with diff file ISSM-23240-23241.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Numberedcostfunction.cpp M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h M /issm/trunk-jpl/src/c/shared/MemOps/MemOps.cpp M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h\\
+Export determination: 6. \\
+Rationale: CHG: integrating changes from CoDiPack's branche\\
+\vspace{3em}
+
+\noindent \textbf{Change \#43} with diff file ISSM-23241-23242.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am A /issm/trunk-jpl/src/c/toolkits/codipack A /issm/trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp A /issm/trunk-jpl/src/c/toolkits/codipack/CoDiPackGlobal.h A /issm/trunk-jpl/src/c/toolkits/codipack/ampi\_interface.cpp A /issm/trunk-jpl/src/c/toolkits/codipack/codipackincludes.h M /issm/trunk-jpl/src/c/toolkits/toolkits.h\\
+Export determination: 6. \\
+Rationale: CHG: integrating CoDiPack's changes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#44} with diff file ISSM-23242-23243.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/cores/control\_core.cpp M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.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/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: integrating CoDiPack's changes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#45} with diff file ISSM-23243-23244.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#46} with diff file ISSM-23244-23245.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Numerics/extrema.cpp M /issm/trunk-jpl/src/c/shared/Numerics/isnan.cpp M /issm/trunk-jpl/src/c/shared/Numerics/isnan.h M /issm/trunk-jpl/src/c/shared/Numerics/numerics.h M /issm/trunk-jpl/src/c/shared/Numerics/recast.h M /issm/trunk-jpl/src/c/shared/Numerics/types.h\\
+Export determination: 6. \\
+Rationale: CHG: integrating changes from CoDiPack's branche\\
+\vspace{3em}
+
+\noindent \textbf{Change \#47} with diff file ISSM-23245-23246.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/autodiff.js M /issm/trunk-jpl/src/m/classes/autodiff.m M /issm/trunk-jpl/src/m/classes/autodiff.py\\
+Export determination: 6. \\
+Rationale: CHG: added field for CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#48} with diff file ISSM-23246-23247.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/javascript/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: integrated CoDiPack changes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#49} with diff file ISSM-23247-23248.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_ross\_dakota\\
+Export determination: 6. \\
+Rationale: CHG: Disabling Python tests for Dakota again until Nathan can have a look\\
+\vspace{3em}
+
+\noindent \textbf{Change \#50} with diff file ISSM-23248-23249.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2084.m M /issm/trunk-jpl/test/NightlyRun/test2084.py\\
+Export determination: 6. \\
+Rationale: CHG: Adjusted tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#51} with diff file ISSM-23249-23250.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test215.m M /issm/trunk-jpl/test/NightlyRun/test215.py\\
+Export determination: 6. \\
+Rationale: CHG: Adjusted tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#52} with diff file ISSM-23250-23251.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/ad\_core.cpp M /issm/trunk-jpl/src/c/cores/adgradient\_core.cpp M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: final changes from CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#53} with diff file ISSM-23251-23252.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/toolkits/gsl/DenseGslSolve.cpp M /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.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: final changes from CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#54} with diff file ISSM-23252-23253.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am 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/controlm1qn3\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp\\
+Export determination: 6. \\
+Rationale: CHG: compile the code with CoDiPack in\\
+\vspace{3em}
+
+\noindent \textbf{Change \#55} with diff file ISSM-23253-23254.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/codipack/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: get trunk instead\\
+\vspace{3em}
+
+\noindent \textbf{Change \#56} with diff file ISSM-23254-23255.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/classes/Options/GenericOption.h M /issm/trunk-jpl/src/c/classes/Params/Parameters.cpp M /issm/trunk-jpl/src/c/classes/Params/Parameters.h M /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h\\
+Export determination: 6. \\
+Rationale: CHG: fixing compilation for CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#57} with diff file ISSM-23255-23256.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/cores/controlad\_core.cpp M /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp M /issm/trunk-jpl/src/c/shared/Elements/PrintArrays.cpp M /issm/trunk-jpl/src/c/shared/Elements/elements.h M /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h M /issm/trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp 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/objects/PetscVec.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h\\
+Export determination: 6. \\
+Rationale: CHG: fixing some more errors related to CoDiPack compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#58} with diff file ISSM-23256-23257.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/geometry.py M /issm/trunk-jpl/src/m/qmu/preqmu.py\\
+Export determination: 6. \\
+Rationale: BUG: fixed preqmu.py causing directory error in consecutive Dakota/QMU tests, minor formatting issue in geometry.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#59} with diff file ISSM-23257-23258.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/test420.py\\
+Export determination: 6. \\
+Rationale: NEW: added test420.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#60} with diff file ISSM-23258-23259.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test417.py A /issm/trunk-jpl/test/NightlyRun/test418.py\\
+Export determination: 6. \\
+Rationale: NEW: added test418.py to test on Jenkins, fails on my computer due to a memory issue.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#61} with diff file ISSM-23259-23260.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_ross\_dakota\\
+Export determination: 6. \\
+Rationale: CHG: Added Python tests back to Ubuntu Dakota build. Working on Mac version now.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#62} with diff file ISSM-23260-23261.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_ross\_python\\
+Export determination: 6. \\
+Rationale: CHG: Attempting to bring Python build test suite reporting online\\
+\vspace{3em}
+
+\noindent \textbf{Change \#63} with diff file ISSM-23261-23262.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_ross\_python\\
+Export determination: 6. \\
+Rationale: CHG: Attempting to bring Python build test suite reporting online\\
+\vspace{3em}
+
+\noindent \textbf{Change \#64} with diff file ISSM-23262-23263.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_ross\_python\\
+Export determination: 6. \\
+Rationale: CHG: Attempting to bring Python build test suite reporting online\\
+\vspace{3em}
+
+\noindent \textbf{Change \#65} with diff file ISSM-23263-23264.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_ross\_python\\
+Export determination: 6. \\
+Rationale: CHG: Attempting to bring Python build test suite reporting online (testing to see if something fishy is going on here)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#66} with diff file ISSM-23264-23265.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_ross\_python\\
+Export determination: 6. \\
+Rationale: CHG: Attempting to bring Python build test suite reporting online (apparently something fishy is not going on here)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#67} with diff file ISSM-23265-23266.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/clusters/tetralith.m\\
+Export determination: 6. \\
+Rationale: NEW: new cluster script\\
+\vspace{3em}
+
+\noindent \textbf{Change \#68} with diff file ISSM-23266-23267.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp M /issm/trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing handling of external functions in codipack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#69} with diff file ISSM-23267-23268.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp\\
+Export determination: 6. \\
+Rationale: NEW: integrating CoDiPack in m1qn3, still crashes after first it\\
+\vspace{3em}
+
+\noindent \textbf{Change \#70} with diff file ISSM-23268-23269.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp M /issm/trunk-jpl/src/c/cores/controlm1qn3\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#71} with diff file ISSM-23269-23270.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.py\\
+Export determination: 6. \\
+Rationale: FIX: fixed runme.py bug causing default behavior to run no tests rather than all tests (except those explicitly excluded)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#72} with diff file ISSM-23270-23271.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/partition/AreaAverageOntoPartition.py\\
+Export determination: 6. \\
+Rationale: FIX: forgot to add AreaAverageOntoPartition.py when I uploaded the Dakota/QMU tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#73} with diff file ISSM-23271-23272.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2084.m M /issm/trunk-jpl/test/NightlyRun/test2084.py\\
+Export determination: 6. \\
+Rationale: CHG: Adjusted tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#74} with diff file ISSM-23272-23273.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2084.m M /issm/trunk-jpl/test/NightlyRun/test2084.py\\
+Export determination: 6. \\
+Rationale: CHG: Adjusted tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#75} with diff file ISSM-23273-23274.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/macosx\_pine-island\_dakota\\
+Export determination: 6. \\
+Rationale: CHG: Activating Python Dakota tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#76} with diff file ISSM-23274-23275.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/macosx\_pine-island\_dakota\\
+Export determination: 6. \\
+Rationale: CHG: Deactivating Python Dakota tests until I can get Python stable on Pine Island\\
+\vspace{3em}
+
+\noindent \textbf{Change \#77} with diff file ISSM-23275-23276.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/macosx\_pine-island M /issm/trunk-jpl/jenkins/macosx\_pine-island\_dakota M /issm/trunk-jpl/jenkins/macosx\_pine-island\_dakota\_static M /issm/trunk-jpl/jenkins/macosx\_pine-island\_examples M /issm/trunk-jpl/jenkins/macosx\_pine-island\_static\\
+Export determination: 6. \\
+Rationale: CHG: Activating Python Dakota tests on Pine Island; adjusting all Mac configs to match number of cores available on Pine Island\\
+\vspace{3em}
+
+\noindent \textbf{Change \#78} with diff file ISSM-23276-23277.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/macosx\_pine-island\_dakota\\
+Export determination: 6. \\
+Rationale: CHG: Activating Python Dakota tests on Pine Island; adjusting all Mac configs to match number of cores available on Pine Island\\
+\vspace{3em}
+
+\noindent \textbf{Change \#79} with diff file ISSM-23277-23278.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/macosx\_pine-island\_dakota\\
+Export determination: 6. \\
+Rationale: CHG: Adjusting path to Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#80} with diff file ISSM-23278-23279.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test211.js M /issm/trunk-jpl/test/NightlyRun/test211.m M /issm/trunk-jpl/test/NightlyRun/test211.py\\
+Export determination: 6. \\
+Rationale: CHG: Easing tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#81} with diff file ISSM-23279-23280.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/adjointmpi/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: switching to other branch\\
+\vspace{3em}
+
+\noindent \textbf{Change \#82} with diff file ISSM-23280-23281.diff: \\
+Function name: \\
+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: switching to new branch of AdjointMPI\\
+\vspace{3em}
+
+\noindent \textbf{Change \#83} with diff file ISSM-23281-23282.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp\\
+Export determination: 6. \\
+Rationale: NEW: CoDiPack now works with 1 cpu\\
+\vspace{3em}
+
+\noindent \textbf{Change \#84} with diff file ISSM-23282-23283.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/test702.py\\
+Export determination: 6. \\
+Rationale: NEW: added test702.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#85} with diff file ISSM-23283-23284.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/macosx\_pine-island\_dakota\\
+Export determination: 6. \\
+Rationale: BUG: Correcting path to numpy dir\\
+\vspace{3em}
+
+\noindent \textbf{Change \#86} with diff file ISSM-23284-23285.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/modules/MeshPartition.m M /issm/trunk-jpl/src/m/modules/MeshPartition.py\\
+Export determination: 6. \\
+Rationale: BUG: fixed new implementation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#87} with diff file ISSM-23285-23286.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp M /issm/trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp\\
+Export determination: 6. \\
+Rationale: CHG: enable compilation with proj.4\\
+\vspace{3em}
+
+\noindent \textbf{Change \#88} with diff file ISSM-23286-23287.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlm1qn3\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor error message:\\
+\vspace{3em}
+
+\noindent \textbf{Change \#89} with diff file ISSM-23287-23288.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/DistanceToMaskBoundary/DistanceToMaskBoundary.cpp M /issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added some variables\\
+\vspace{3em}
+
+\noindent \textbf{Change \#90} with diff file ISSM-23288-23289.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/DistanceToMaskBoundary/DistanceToMaskBoundary.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added error message for now\\
+\vspace{3em}
+
+\noindent \textbf{Change \#91} with diff file ISSM-23289-23290.diff: \\
+Function name: \\
+A /issm/trunk-jpl/jenkins/linux64\_ross\_codi\\
+Export determination: 6. \\
+Rationale: CHG: added codi test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#92} with diff file ISSM-23290-23291.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test3015.m\\
+Export determination: 6. \\
+Rationale: CHG: added codi test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#93} with diff file ISSM-23291-23292.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_ross\_codi\\
+Export determination: 6. \\
+Rationale: CHG: fixing codipack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#94} with diff file ISSM-23292-23293.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_ross\_codi M /issm/trunk-jpl/test/NightlyRun/test3480.m M /issm/trunk-jpl/test/NightlyRun/test3481.m\\
+Export determination: 6. \\
+Rationale: CHG: make some test work with CODIPACK\\
+\vspace{3em}
+
+\noindent \textbf{Change \#95} with diff file ISSM-23293-23294.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp M /issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing memory leaks\\
+\vspace{3em}
+
+\noindent \textbf{Change \#96} with diff file ISSM-23294-23295.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h\\
+Export determination: 6. \\
+Rationale: BUG: Daniel's suggestion makes ISSM hang\\
+\vspace{3em}
+
+\noindent \textbf{Change \#97} with diff file ISSM-23305-23306.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Params/Parameters.cpp M /issm/trunk-jpl/src/c/classes/Params/Parameters.h\\
+Export determination: 6. \\
+Rationale: CHG: FindParamAndMakePassive should always be compiled\\
+\vspace{3em}
+
+\noindent \textbf{Change \#98} with diff file ISSM-23306-23307.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlm1qn3\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: extending m1qn3 to AD compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#99} with diff file ISSM-23307-23308.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlm1qn3\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: scaling factor should be double, not active\\
+\vspace{3em}
+
+\noindent \textbf{Change \#100} with diff file ISSM-23308-23309.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added VerboseSolver output for number of PETSc KSP iterations\\
+\vspace{3em}
+
+\noindent \textbf{Change \#101} with diff file ISSM-23309-23310.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlm1qn3\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#102} with diff file ISSM-23310-23311.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Params/Parameters.cpp M /issm/trunk-jpl/src/c/classes/Params/Parameters.h\\
+Export determination: 6. \\
+Rationale: CHG: forgot to commit vector passive\\
+\vspace{3em}
+
+\noindent \textbf{Change \#103} with diff file ISSM-23311-23312.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/control\_core.cpp M /issm/trunk-jpl/src/c/cores/controlm1qn3\_core.cpp M /issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp M /issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h\\
+Export determination: 6. \\
+Rationale: CHG: trying to simplify m1qn3 core to merge with ad\\
+\vspace{3em}
+
+\noindent \textbf{Change \#104} with diff file ISSM-23315-23316.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#105} with diff file ISSM-23316-23317.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#106} with diff file ISSM-23317-23318.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SmbAnalysis.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/Materials/Matpar.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h A /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp M /issm/trunk-jpl/src/c/shared/Elements/elements.h M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp A /issm/trunk-jpl/src/m/classes/SMBpddSicopolis.m A /issm/trunk-jpl/test/Archives/Archive245.arch A /issm/trunk-jpl/test/NightlyRun/test245.m\\
+Export determination: 6. \\
+Rationale: NEW: SICOPOLIS PDD scheme\\
+\vspace{3em}
+
+\noindent \textbf{Change \#107} with diff file ISSM-23318-23319.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: make validation core work for AD (youhou)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#108} with diff file ISSM-23319-23320.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/IoModel.cpp\\
+Export determination: 6. \\
+Rationale: CHG: improved error message\\
+\vspace{3em}
+
+\noindent \textbf{Change \#109} with diff file ISSM-23320-23321.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp\\
+Export determination: 6. \\
+Rationale: CHG: better error message\\
+\vspace{3em}
+
+\noindent \textbf{Change \#110} with diff file ISSM-23321-23322.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed ADOLC compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#111} with diff file ISSM-23322-23323.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed ADOLC compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#112} with diff file ISSM-23323-23324.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: error message IF adolc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#113} with diff file ISSM-23324-23325.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing ADOLC\\
+\vspace{3em}
+
+\noindent \textbf{Change \#114} with diff file ISSM-23325-23326.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/README\\
+Export determination: 6. \\
+Rationale: DEL not needed anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#115} with diff file ISSM-23327-23328.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h\\
+Export determination: 6. \\
+Rationale: BUG: Moved Enums to right locations in EnumDefinitons.h\\
+\vspace{3em}
+
+\noindent \textbf{Change \#116} with diff file ISSM-23328-23329.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp\\
+Export determination: 6. \\
+Rationale: BUG: use correct Enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#117} with diff file ISSM-23329-23330.diff: \\
+Function name: \\
+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: missing files in r23327 (Sychronized)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#118} with diff file ISSM-23330-23331.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_caladan\_ad M /issm/trunk-jpl/jenkins/linux64\_caladan\_ampi M /issm/trunk-jpl/jenkins/linux64\_ross\_ad M /issm/trunk-jpl/jenkins/linux64\_ross\_ampi M /issm/trunk-jpl/jenkins/linux64\_ross\_codi\\
+Export determination: 6. \\
+Rationale: CHG: remove metis from installation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#119} with diff file ISSM-23331-23332.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/cfdragcoeffabsgrad.m\\
+Export determination: 6. \\
+Rationale: Adding matlab file for cost function for drag\\
+\vspace{3em}
+
+\noindent \textbf{Change \#120} with diff file ISSM-23332-23333.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/applyoptions.m M /issm/trunk-jpl/src/m/plot/googlemaps.m\\
+Export determination: 6. \\
+Rationale: CHG: multiple tries for Google maps\\
+\vspace{3em}
+
+\noindent \textbf{Change \#121} with diff file ISSM-23333-23334.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/SMBpddSicopolis.py M /issm/trunk-jpl/src/m/qmu/helpers.py A /issm/trunk-jpl/test/NightlyRun/test245.py\\
+Export determination: 6. \\
+Rationale: NEW: added python version of test 245\\
+\vspace{3em}
+
+\noindent \textbf{Change \#122} with diff file ISSM-23334-23335.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/googlemaps.m\\
+Export determination: 6. \\
+Rationale: CHG: fixed typo\\
+\vspace{3em}
+
+\noindent \textbf{Change \#123} with diff file ISSM-23335-23336.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: specialization for SpatialLinearFloatingMeltRateEnum at the wrong place\\
+\vspace{3em}
+
+\noindent \textbf{Change \#124} with diff file ISSM-23336-23337.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: allow FS with other melt parameterizations\\
+\vspace{3em}
+
+\noindent \textbf{Change \#125} with diff file ISSM-23337-23338.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/stressbalance\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: need melting rates for vz\\
+\vspace{3em}
+
+\noindent \textbf{Change \#126} with diff file ISSM-23338-23339.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: do not load melting rate, it is bmb's job\\
+\vspace{3em}
+
+\noindent \textbf{Change \#127} with diff file ISSM-23339-23340.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test701.m M /issm/trunk-jpl/test/NightlyRun/test701.py M /issm/trunk-jpl/test/NightlyRun/test702.m M /issm/trunk-jpl/test/NightlyRun/test702.py\\
+Export determination: 6. \\
+Rationale: CHG: FS now needs Bmb\\
+\vspace{3em}
+
+\noindent \textbf{Change \#128} with diff file ISSM-23340-23341.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: still need to keep grounded ice melt rate\\
+\vspace{3em}
+
+\noindent \textbf{Change \#129} with diff file ISSM-23341-23342.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: vertanalysis requires melt rates\\
+\vspace{3em}
+
+\noindent \textbf{Change \#130} with diff file ISSM-23342-23343.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: added a check on numthreads, make sure it is an int\\
+\vspace{3em}
+
+\noindent \textbf{Change \#131} with diff file ISSM-23345-23346.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: make friction PISM work for SB\\
+\vspace{3em}
+
+\noindent \textbf{Change \#132} with diff file ISSM-23348-23349.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed solver in parallel with CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#133} with diff file ISSM-23349-23350.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp\\
+Export determination: 6. \\
+Rationale: CHG: integrating MeDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#134} with diff file ISSM-23350-23351.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/cores/controlm1qn3\_core.cpp M /issm/trunk-jpl/src/c/toolkits/codipack/ampi\_interface.cpp\\
+Export determination: 6. \\
+Rationale: CHG: integrating MeDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#135} with diff file ISSM-23351-23352.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test211.js M /issm/trunk-jpl/test/NightlyRun/test211.m M /issm/trunk-jpl/test/NightlyRun/test211.py\\
+Export determination: 6. \\
+Rationale: CHG: relaxing tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#136} with diff file ISSM-23352-23353.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h\\
+Export determination: 6. \\
+Rationale: CHG: integrating MeDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#137} with diff file ISSM-23353-23354.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/medipack A /issm/trunk-jpl/externalpackages/medipack/install.sh\\
+Export determination: 6. \\
+Rationale: NEW: added MeDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#138} with diff file ISSM-23354-23355.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/groundingline.m\\
+Export determination: 6. \\
+Rationale: BUG: checks not needed when we are not in a transient solution with a grounding line migration\\
+\vspace{3em}
+
+\noindent \textbf{Change \#139} with diff file ISSM-23355-23356.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/groundingline.js M /issm/trunk-jpl/src/m/classes/groundingline.py\\
+Export determination: 6. \\
+Rationale: CHG: same change in grounding line for python and js\\
+\vspace{3em}
+
+\noindent \textbf{Change \#140} with diff file ISSM-23357-23358.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/shared/Numerics/types.h M /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp M /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am M /issm/trunk-jpl/src/wrappers/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: integrating MeDiPack but not working yet\\
+\vspace{3em}
+
+\noindent \textbf{Change \#141} with diff file ISSM-23358-23359.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: added check that we don't have both adjointmpi and medipack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#142} with diff file ISSM-23359-23360.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test3480.m M /issm/trunk-jpl/test/NightlyRun/test3481.m\\
+Export determination: 6. \\
+Rationale: CHG: now CoDiPack can run in parallel\\
+\vspace{3em}
+
+\noindent \textbf{Change \#143} with diff file ISSM-23361-23362.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/adjointmpi/install-pleiades.sh\\
+Export determination: 6. \\
+Rationale: CHG: added install-pleiades.sh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#144} with diff file ISSM-23363-23364.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m\\
+Export determination: 6. \\
+Rationale: BUG: Typo in missing gmsh error message\\
+\vspace{3em}
+
+\noindent \textbf{Change \#145} with diff file ISSM-23365-23366.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/SMBgradientscomponents.m A /issm/trunk-jpl/src/m/classes/SMBgradientscomponents.py M /issm/trunk-jpl/src/m/classes/clusters/stallo.m M /issm/trunk-jpl/src/m/classes/clusters/stallo.py M /issm/trunk-jpl/src/m/classes/taoinversion.py M /issm/trunk-jpl/src/m/contrib/defleurian/paraview/enveloppeVTK.py M /issm/trunk-jpl/src/m/solve/WriteData.py\\
+Export determination: 6. \\
+Rationale: NEW: adding a smb scheme that compute runoff separately (also fixing stallo cluster)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#146} with diff file ISSM-23366-23367.diff: \\
+Function name: \\
+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/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/classes/Materials/Matpar.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.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/io/Marshalling/IoCodeConversions.cpp\\
+Export determination: 6. \\
+Rationale: NEW: adding a smb scheme that compute runoff separately (smbcore is called two times in transient to provide runoff to hydro model\\
+\vspace{3em}
+
+\noindent \textbf{Change \#147} with diff file ISSM-23367-23368.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG:commenting debugging message\\
+\vspace{3em}
+
+\noindent \textbf{Change \#148} with diff file ISSM-23368-23369.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG:commenting debugging message\\
+\vspace{3em}
+
+\noindent \textbf{Change \#149} with diff file ISSM-23369-23370.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.py M /issm/trunk-jpl/test/NightlyRun/test101.m\\
+Export determination: 6. \\
+Rationale: BUG:partial fix, issues remain in Hydro\\
+\vspace{3em}
+
+\noindent \textbf{Change \#150} with diff file ISSM-23370-23371.diff: \\
+Function name: \\
+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/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Params/Parameters.cpp M /issm/trunk-jpl/src/c/cores/hydrology\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG:partial fix, issues remain in Hydro\\
+\vspace{3em}
+
+\noindent \textbf{Change \#151} with diff file ISSM-23371-23372.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test101.m\\
+Export determination: 6. \\
+Rationale: BUG:reverting unwanted commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#152} with diff file ISSM-23372-23373.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing user included bug\\
+\vspace{3em}
+
+\noindent \textbf{Change \#153} with diff file ISSM-23373-23374.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing AD compilation and many other tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#154} with diff file ISSM-23374-23375.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#155} with diff file ISSM-23375-23376.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: do not show files everytime\\
+\vspace{3em}
+
+\noindent \textbf{Change \#156} with diff file ISSM-23376-23377.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed crash with input not always provided\\
+\vspace{3em}
+
+\noindent \textbf{Change \#157} with diff file ISSM-23377-23378.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing NR\\
+\vspace{3em}
+
+\noindent \textbf{Change \#158} with diff file ISSM-23378-23379.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/stallo.m M /issm/trunk-jpl/src/m/classes/clusters/stallo.py\\
+Export determination: 6. \\
+Rationale: CHG:uniformisation of stallo cluster\\
+\vspace{3em}
+
+\noindent \textbf{Change \#159} with diff file ISSM-23379-23380.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test455.m M /issm/trunk-jpl/test/NightlyRun/test455.py\\
+Export determination: 6. \\
+Rationale: CHG: Relaxed tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#160} with diff file ISSM-23380-23381.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/cores/balancethickness\_core.cpp M /issm/trunk-jpl/src/c/cores/balancevelocity\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#161} with diff file ISSM-23384-23385.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.9-macosx64.sh\\
+Export determination: 6. \\
+Rationale: CHG: adding installation script for Denis\\
+\vspace{3em}
+
+\noindent \textbf{Change \#162} with diff file ISSM-23387-23388.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_hydro\_nonlinear.cpp\\
+Export determination: 6. \\
+Rationale: CHG: streamlining in EPL activation and dealing with frozen nodes EffectivPressure\\
+\vspace{3em}
+
+\noindent \textbf{Change \#163} with diff file ISSM-23388-23389.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/Pig2 A /issm/trunk-jpl/examples/Pig2/DomainOutline.exp A /issm/trunk-jpl/examples/Pig2/FrontRetreat.exp A /issm/trunk-jpl/examples/Pig2/Models A /issm/trunk-jpl/examples/Pig2/Pig.par A /issm/trunk-jpl/examples/Pig2/runme.m\\
+Export determination: 6. \\
+Rationale: NEW: new tutorial for NIMS\\
+\vspace{3em}
+
Index: /issm/oecreview/Archive/23185-23389/r1.tex
===================================================================
--- /issm/oecreview/Archive/23185-23389/r1.tex	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/r1.tex	(revision 23390)
@@ -0,0 +1,1 @@
+23185
Index: /issm/oecreview/Archive/23185-23389/r2.tex
===================================================================
--- /issm/oecreview/Archive/23185-23389/r2.tex	(revision 23390)
+++ /issm/oecreview/Archive/23185-23389/r2.tex	(revision 23390)
@@ -0,0 +1,1 @@
+23389
