Index: issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- issm/trunk-jpl/src/c/Makefile.am	(revision 16528)
+++ issm/trunk-jpl/src/c/Makefile.am	(revision 16529)
@@ -520,12 +520,12 @@
 #}}}
 #Slope sources  {{{
-slope_sources =  ./modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp\
-					  ./modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp \
-					  ./modules/ModelProcessorx/BedSlope/CreateConstraintsBedSlope.cpp\
-					  ./modules/ModelProcessorx/BedSlope/CreateLoadsBedSlope.cpp\
-					  ./modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp\
-					  ./modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp \
-					  ./modules/ModelProcessorx/SurfaceSlope/CreateConstraintsSurfaceSlope.cpp\
-					  ./modules/ModelProcessorx/SurfaceSlope/CreateLoadsSurfaceSlope.cpp\
+slope_sources =  ./modules/ModelProcessorx/L2ProjectionBase/UpdateElementsL2ProjectionBase.cpp\
+					  ./modules/ModelProcessorx/L2ProjectionBase/CreateNodesL2ProjectionBase.cpp \
+					  ./modules/ModelProcessorx/L2ProjectionBase/CreateConstraintsL2ProjectionBase.cpp\
+					  ./modules/ModelProcessorx/L2ProjectionBase/CreateLoadsL2ProjectionBase.cpp\
+					  ./modules/ModelProcessorx/L2ProjectionTop/UpdateElementsL2ProjectionTop.cpp\
+					  ./modules/ModelProcessorx/L2ProjectionTop/CreateNodesL2ProjectionTop.cpp \
+					  ./modules/ModelProcessorx/L2ProjectionTop/CreateConstraintsL2ProjectionTop.cpp\
+					  ./modules/ModelProcessorx/L2ProjectionTop/CreateLoadsL2ProjectionTop.cpp\
 					  ./cores/surfaceslope_core.cpp\
 					  ./cores/bedslope_core.cpp
Index: issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 16529)
@@ -447,5 +447,5 @@
 			break;
 		#endif
-		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
+		case L2ProjectionBaseAnalysisEnum:
 			return CreateBasalMassMatrix();
 			break;
@@ -484,5 +484,5 @@
 		#endif
 		default:
-			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
+			_error_("analysis " << EnumToStringx(analysis_type) << " not supported yet");
 	}
 
@@ -673,6 +673,6 @@
 			break;
 		#endif
-		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
-			return CreatePVectorSlope();
+		case L2ProjectionBaseAnalysisEnum:
+			return CreatePVectorL2ProjectionBase();
 			break;
 		case MasstransportAnalysisEnum:
@@ -756,6 +756,6 @@
 }
 /*}}}*/
-/*FUNCTION Penta::CreatePVectorSlope {{{*/
-ElementVector* Penta::CreatePVectorSlope(void){
+/*FUNCTION Penta::CreatePVectorL2ProjectionBase {{{*/
+ElementVector* Penta::CreatePVectorL2ProjectionBase(void){
 
 	if (!IsOnBed()) return NULL;
@@ -763,5 +763,5 @@
 	/*Call Tria function*/
 	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
-	ElementVector* pe=tria->CreatePVectorSlope();
+	ElementVector* pe=tria->CreatePVectorL2Projection();
 	delete tria->material; delete tria;
 
@@ -2201,5 +2201,5 @@
 void  Penta::InputUpdateFromSolution(IssmDouble* solution){
 
-	int analysis_type;
+	int analysis_type,inputenum;
 
 	/*retreive parameters: */
@@ -2242,15 +2242,7 @@
 		break;
 	#endif
-	case BedSlopeXAnalysisEnum:
-		InputUpdateFromSolutionOneDofCollapsed(solution,BedSlopeXEnum);
-		break;
-	case BedSlopeYAnalysisEnum:
-		InputUpdateFromSolutionOneDofCollapsed(solution,BedSlopeYEnum);
-		break;
-	case SurfaceSlopeXAnalysisEnum:
-		InputUpdateFromSolutionOneDofCollapsed(solution,SurfaceSlopeXEnum);
-		break;
-	case SurfaceSlopeYAnalysisEnum:
-		InputUpdateFromSolutionOneDofCollapsed(solution,SurfaceSlopeYEnum);
+	case L2ProjectionBaseAnalysisEnum:
+		this->parameters->FindParam(&inputenum,InputToL2ProjectEnum);
+		InputUpdateFromSolutionOneDofCollapsed(solution,inputenum);
 		break;
 	case MasstransportAnalysisEnum:
Index: issm/trunk-jpl/src/c/classes/Elements/Penta.h
===================================================================
--- issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 16528)
+++ issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 16529)
@@ -179,5 +179,5 @@
 		ElementVector* CreatePVectorFreeSurfaceTop(void);
 		ElementVector* CreatePVectorFreeSurfaceBase(void);
-		ElementVector* CreatePVectorSlope(void);
+		ElementVector* CreatePVectorL2ProjectionBase(void);
 		void           GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble xyz_zero[3][3],IssmDouble xyz_list[6][3],int numpoints);
 		void	         GetDofList(int** pdoflist,int approximation_enum,int setenum);
Index: issm/trunk-jpl/src/c/classes/Elements/Seg.cpp
===================================================================
--- issm/trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 16529)
@@ -340,12 +340,13 @@
 }
 /*}}}*/
-/*FUNCTION Seg::CreatePVectorSlope {{{*/
-ElementVector* Seg::CreatePVectorSlope(void){
+/*FUNCTION Seg::CreatePVectorL2Projection {{{*/
+ElementVector* Seg::CreatePVectorL2Projection(void){
 
 	/*Intermediaries */
-	int        i,analysis_type;
+	int        i,input_enum;
 	IssmDouble Jdet;
 	IssmDouble xyz_list[NUMVERTICES][3];
-	IssmDouble slope;
+	IssmDouble value;
+	Input*     input2 = NULL;
 
 	/*Fetch number of nodes and dof for this finite element*/
@@ -357,15 +358,13 @@
 
 	/*Retrieve all inputs and parameters*/
-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
-	GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-	Input* slope_input=NULL;
-	if(analysis_type==SurfaceSlopeXAnalysisEnum){
-		slope_input=inputs->GetInput(SurfaceEnum); _assert_(slope_input);
-	}
-	else if(analysis_type==BedSlopeXAnalysisEnum){
-		slope_input=inputs->GetInput(BedEnum);     _assert_(slope_input);
-	}
-	else{
-		_error_("Analysis "<<EnumToStringx(analysis_type)<<" not inplemented yet");
+	GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+	this->parameters->FindParam(&input_enum,InputToL2ProjectEnum);
+	Input* input = inputs->GetInput(input_enum);
+	if(!input){
+		switch(input_enum){
+			case SurfaceSlopeXEnum: input2 = inputs->GetInput(SurfaceEnum); _assert_(input2); break;
+			case BedSlopeXEnum:     input2 = inputs->GetInput(BedEnum);     _assert_(input2); break;
+			default: _error_("input not found in element");
+		}
 	}
 
@@ -379,7 +378,12 @@
 		GetNodalFunctions(basis,gauss);
 
-		slope_input->GetInputDerivativeValue(&slope,&xyz_list[0][0],gauss);
-
-		for(i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*slope*basis[i];
+		if(input){
+			input->GetInputValue(&value,gauss);
+		}
+		else{
+			input2->GetInputDerivativeValue(&value,&xyz_list[0][0],gauss);
+		}
+
+		for(i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*value*basis[i];
 	}
 
Index: issm/trunk-jpl/src/c/classes/Elements/Seg.h
===================================================================
--- issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 16528)
+++ issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 16529)
@@ -75,5 +75,5 @@
 		void        CreateDVector(Vector<IssmDouble>* df){_error_("not implemented yet");};
 		void        CreatePVector(Vector<IssmDouble>* pf){_error_("not implemented yet");};
-		ElementVector* CreatePVectorSlope(void);
+		ElementVector* CreatePVectorL2Projection(void);
 		void        CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("not implemented yet");};
 		void        Delta18oParameterization(void){_error_("not implemented yet");};
Index: issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 16529)
@@ -237,5 +237,5 @@
 			break;
 		#endif
-		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
+		case L2ProjectionBaseAnalysisEnum:
 			parameters->FindParam(&meshtype,MeshTypeEnum);
 			if(meshtype==Mesh2DverticalEnum){
@@ -451,11 +451,11 @@
 			break;
 		#endif
-		case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum:
+		case L2ProjectionBaseAnalysisEnum:
 			parameters->FindParam(&meshtype,MeshTypeEnum);
 			if(meshtype==Mesh2DverticalEnum){
-				return CreateBasalPVectorSlope();
+				return CreatePVectorL2ProjectionBase();
 			}
 			else{
-				return CreatePVectorSlope();
+				return CreatePVectorL2Projection();
 			}
 			break;
@@ -531,6 +531,6 @@
 }
 /*}}}*/
-/*FUNCTION Tria::CreateBasalPVectorSlope{{{*/
-ElementVector* Tria::CreateBasalPVectorSlope(void){
+/*FUNCTION Tria::CreatePVectorL2ProjectionBase{{{*/
+ElementVector* Tria::CreatePVectorL2ProjectionBase(void){
 
 	if(!HasEdgeOnBed()) return NULL;
@@ -540,5 +540,5 @@
 
 	Seg* seg=(Seg*)SpawnSeg(index1,index2); 
-	ElementVector* pe=seg->CreatePVectorSlope();
+	ElementVector* pe=seg->CreatePVectorL2Projection();
 	delete seg->material; delete seg;
 
@@ -547,12 +547,13 @@
 }
 /*}}}*/
-/*FUNCTION Tria::CreatePVectorSlope {{{*/
-ElementVector* Tria::CreatePVectorSlope(void){
+/*FUNCTION Tria::CreatePVectorL2Projection {{{*/
+ElementVector* Tria::CreatePVectorL2Projection(void){
 
 	/*Intermediaries */
-	int        i,analysis_type;
-	IssmDouble Jdet;
+	int        i,input_enum;
+	IssmDouble Jdet,value;
 	IssmDouble xyz_list[NUMVERTICES][3];
-	IssmDouble slope[2];
+	IssmDouble slopes[2];
+	Input*     input2 = NULL;
 
 	/*Fetch number of nodes and dof for this finite element*/
@@ -564,12 +565,15 @@
 
 	/*Retrieve all inputs and parameters*/
-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
 	GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-	Input* slope_input=NULL;
-	if ( (analysis_type==SurfaceSlopeXAnalysisEnum) || (analysis_type==SurfaceSlopeYAnalysisEnum)){
-		slope_input=inputs->GetInput(SurfaceEnum); _assert_(slope_input);
-	}
-	if ( (analysis_type==BedSlopeXAnalysisEnum) || (analysis_type==BedSlopeYAnalysisEnum)){
-		slope_input=inputs->GetInput(BedEnum);     _assert_(slope_input);
+	this->parameters->FindParam(&input_enum,InputToL2ProjectEnum);
+	Input* input = inputs->GetInput(input_enum);
+	if(!input){
+		switch(input_enum){
+			case SurfaceSlopeXEnum: input2 = inputs->GetInput(SurfaceEnum); _assert_(input2); break;
+			case SurfaceSlopeYEnum: input2 = inputs->GetInput(SurfaceEnum); _assert_(input2); break;
+			case BedSlopeXEnum:     input2 = inputs->GetInput(BedEnum);     _assert_(input2); break;
+			case BedSlopeYEnum:     input2 = inputs->GetInput(BedEnum);     _assert_(input2); break;
+			default: _error_("input not found in element");
+		}
 	}
 
@@ -583,12 +587,17 @@
 		GetNodalFunctions(basis,gauss);
 
-		slope_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss);
-
-		if( (analysis_type==SurfaceSlopeXAnalysisEnum) || (analysis_type==BedSlopeXAnalysisEnum)){
-			for(i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*slope[0]*basis[i];
-		}
-		if( (analysis_type==SurfaceSlopeYAnalysisEnum) || (analysis_type==BedSlopeYAnalysisEnum)){
-			for(i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*slope[1]*basis[i];
-		}
+		if(input){
+			input->GetInputValue(&value,gauss);
+		}
+		else{
+			input2->GetInputDerivativeValue(&slopes[0],&xyz_list[0][0],gauss);
+			switch(input_enum){
+				case SurfaceSlopeXEnum: case BedSlopeXEnum: value = slopes[0]; break;
+				case SurfaceSlopeYEnum: case BedSlopeYEnum: value = slopes[1]; break;
+				default: _error_("case not supported");
+			}
+		}
+
+		for(i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*value*basis[i];
 	}
 
@@ -1786,15 +1795,7 @@
 			break;
 		#endif
-		case BedSlopeXAnalysisEnum:
-			InputUpdateFromSolutionOneDof(solution,BedSlopeXEnum);
-			break;
-		case BedSlopeYAnalysisEnum:
-			InputUpdateFromSolutionOneDof(solution,BedSlopeYEnum);
-			break;
-		case SurfaceSlopeXAnalysisEnum:
-			InputUpdateFromSolutionOneDof(solution,SurfaceSlopeXEnum);
-			break;
-		case SurfaceSlopeYAnalysisEnum:
-			InputUpdateFromSolutionOneDof(solution,SurfaceSlopeYEnum);
+		case L2ProjectionBaseAnalysisEnum:
+			this->parameters->FindParam(&extrusioninput,InputToL2ProjectEnum);
+			InputUpdateFromSolutionOneDof(solution,extrusioninput);
 			break;
 		case MasstransportAnalysisEnum:
Index: issm/trunk-jpl/src/c/classes/Elements/Tria.h
===================================================================
--- issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 16528)
+++ issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 16529)
@@ -212,6 +212,6 @@
 		ElementVector* CreatePVectorFreeSurfaceBase(void);
 		ElementVector* CreatePVectorFreeSurfaceBase1D(void);
-		ElementVector* CreatePVectorSlope(void);
-		ElementVector* CreateBasalPVectorSlope(void);
+		ElementVector* CreatePVectorL2Projection(void);
+		ElementVector* CreatePVectorL2ProjectionBase(void);
 		IssmDouble     GetArea(void);
 		void           GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble xyz_zero[3][3],IssmDouble xyz_list[3][3],int numpoints);
Index: issm/trunk-jpl/src/c/classes/Node.cpp
===================================================================
--- issm/trunk-jpl/src/c/classes/Node.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/classes/Node.cpp	(revision 16529)
@@ -88,6 +88,5 @@
 				analysis_type==MasstransportAnalysisEnum || 
 				analysis_type==MeltingAnalysisEnum || 
-				analysis_type==BedSlopeAnalysisEnum || 
-				analysis_type==SurfaceSlopeAnalysisEnum || 
+				analysis_type==L2ProjectionBaseAnalysisEnum || 
 				analysis_type==BalancethicknessAnalysisEnum ||
 				analysis_type==HydrologyDCInefficientAnalysisEnum ||
@@ -103,5 +102,8 @@
 		}
 	}
-	if(analysis_type==FreeSurfaceTopAnalysisEnum){
+	if(
+				analysis_type==FreeSurfaceTopAnalysisEnum ||
+				analysis_type==L2ProjectionTopAnalysisEnum
+				){
 		if(iomodel->meshtype==Mesh3DEnum || iomodel->meshtype==Mesh2DverticalEnum){
 			/*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
Index: issm/trunk-jpl/src/c/cores/AnalysisConfiguration.cpp
===================================================================
--- issm/trunk-jpl/src/c/cores/AnalysisConfiguration.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/cores/AnalysisConfiguration.cpp	(revision 16529)
@@ -26,24 +26,22 @@
 
 		case StressbalanceSolutionEnum:
-			numanalyses=5;
+			numanalyses=4;
 			analyses=xNew<int>(numanalyses);
 			analyses[0]=StressbalanceAnalysisEnum;
 			analyses[1]=StressbalanceVerticalAnalysisEnum;
 			analyses[2]=StressbalanceSIAAnalysisEnum;
-			analyses[3]=SurfaceSlopeAnalysisEnum;
-			analyses[4]=BedSlopeAnalysisEnum;
+			analyses[3]=L2ProjectionBaseAnalysisEnum;
 			break;
 
 		case SteadystateSolutionEnum:
-			numanalyses=8;
+			numanalyses=7;
 			analyses=xNew<int>(numanalyses);
 			analyses[0]=StressbalanceAnalysisEnum;
 			analyses[1]=StressbalanceVerticalAnalysisEnum;
 			analyses[2]=StressbalanceSIAAnalysisEnum;
-			analyses[3]=SurfaceSlopeAnalysisEnum;
-			analyses[4]=BedSlopeAnalysisEnum;
-			analyses[5]=EnthalpyAnalysisEnum;
-			analyses[6]=ThermalAnalysisEnum;
-			analyses[7]=MeltingAnalysisEnum;
+			analyses[3]=L2ProjectionBaseAnalysisEnum;
+			analyses[4]=EnthalpyAnalysisEnum;
+			analyses[5]=ThermalAnalysisEnum;
+			analyses[6]=MeltingAnalysisEnum;
 			break;
 
@@ -57,11 +55,10 @@
 
 		case HydrologySolutionEnum:
-			numanalyses=5;
+			numanalyses=4;
 			analyses=xNew<int>(numanalyses);
 			analyses[0]=HydrologyShreveAnalysisEnum;
 			analyses[1]=HydrologyDCInefficientAnalysisEnum;
 			analyses[2]=HydrologyDCEfficientAnalysisEnum;
-			analyses[3]=SurfaceSlopeAnalysisEnum;
-			analyses[4]=BedSlopeAnalysisEnum;
+			analyses[3]=L2ProjectionBaseAnalysisEnum;
 			break;
 
@@ -88,5 +85,5 @@
 			analyses=xNew<int>(numanalyses);
 			analyses[0]=BalancevelocityAnalysisEnum;
-			analyses[1]=SurfaceSlopeAnalysisEnum;
+			analyses[1]=L2ProjectionBaseAnalysisEnum;
 			break;
 
@@ -94,5 +91,5 @@
 			numanalyses=1;
 			analyses=xNew<int>(numanalyses);
-			analyses[0]=SurfaceSlopeAnalysisEnum;
+			analyses[0]=L2ProjectionBaseAnalysisEnum;
 			break;
 
@@ -100,5 +97,5 @@
 			numanalyses=1;
 			analyses=xNew<int>(numanalyses);
-			analyses[0]=BedSlopeAnalysisEnum;
+			analyses[0]=L2ProjectionBaseAnalysisEnum;
 			break;
 
@@ -116,19 +113,18 @@
 
 		case TransientSolutionEnum:
-			numanalyses=13;
+			numanalyses=12;
 			analyses=xNew<int>(numanalyses);
 			analyses[ 0]=StressbalanceAnalysisEnum;
 			analyses[ 1]=StressbalanceVerticalAnalysisEnum;
 			analyses[ 2]=StressbalanceSIAAnalysisEnum;
-			analyses[ 3]=SurfaceSlopeAnalysisEnum;
-			analyses[ 4]=BedSlopeAnalysisEnum;
-			analyses[ 5]=ThermalAnalysisEnum;
-			analyses[ 6]=MeltingAnalysisEnum;
-			analyses[ 7]=EnthalpyAnalysisEnum;
-			analyses[ 8]=MasstransportAnalysisEnum;
-			analyses[ 9]=FreeSurfaceBaseAnalysisEnum;
-			analyses[10]=FreeSurfaceTopAnalysisEnum;
-			analyses[11]=ExtrudeFromBaseAnalysisEnum;
-			analyses[12]=ExtrudeFromTopAnalysisEnum;
+			analyses[ 3]=L2ProjectionBaseAnalysisEnum;
+			analyses[ 4]=ThermalAnalysisEnum;
+			analyses[ 5]=MeltingAnalysisEnum;
+			analyses[ 6]=EnthalpyAnalysisEnum;
+			analyses[ 7]=MasstransportAnalysisEnum;
+			analyses[ 8]=FreeSurfaceBaseAnalysisEnum;
+			analyses[ 9]=FreeSurfaceTopAnalysisEnum;
+			analyses[10]=ExtrudeFromBaseAnalysisEnum;
+			analyses[11]=ExtrudeFromTopAnalysisEnum;
 			break;
 
Index: issm/trunk-jpl/src/c/cores/balancevelocity_core.cpp
===================================================================
--- issm/trunk-jpl/src/c/cores/balancevelocity_core.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/cores/balancevelocity_core.cpp	(revision 16529)
@@ -19,7 +19,7 @@
 
 	if(VerboseSolution()) _printf0_("computing smoothed slopes:\n");
-	femmodel->SetCurrentConfiguration(SurfaceSlopeAnalysisEnum,SmoothedSurfaceSlopeXAnalysisEnum);
+	femmodel->SetCurrentConfiguration(SmoothedSurfaceSlopeXAnalysisEnum);
 	solutionsequence_linear(femmodel);
-	femmodel->SetCurrentConfiguration(SurfaceSlopeAnalysisEnum,SmoothedSurfaceSlopeYAnalysisEnum);
+	femmodel->SetCurrentConfiguration(SmoothedSurfaceSlopeYAnalysisEnum);
 	solutionsequence_linear(femmodel);
 	//surfaceslope_core(femmodel);
Index: issm/trunk-jpl/src/c/cores/bedslope_core.cpp
===================================================================
--- issm/trunk-jpl/src/c/cores/bedslope_core.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/cores/bedslope_core.cpp	(revision 16529)
@@ -23,8 +23,11 @@
 
 	/*Call on core computations: */
-	femmodel->SetCurrentConfiguration(BedSlopeAnalysisEnum,BedSlopeXAnalysisEnum);
+	femmodel->SetCurrentConfiguration(L2ProjectionBaseAnalysisEnum);
+
+	femmodel->parameters->SetParam(BedSlopeXEnum,InputToL2ProjectEnum);
 	solutionsequence_linear(femmodel);
+
 	if(meshtype!=Mesh2DverticalEnum){
-		femmodel->SetCurrentConfiguration(BedSlopeAnalysisEnum,BedSlopeYAnalysisEnum);
+		femmodel->parameters->SetParam(BedSlopeYEnum,InputToL2ProjectEnum);
 		solutionsequence_linear(femmodel);
 	}
Index: issm/trunk-jpl/src/c/cores/surfaceslope_core.cpp
===================================================================
--- issm/trunk-jpl/src/c/cores/surfaceslope_core.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/cores/surfaceslope_core.cpp	(revision 16529)
@@ -23,8 +23,13 @@
 
 	/*Call on core computations: */
-	femmodel->SetCurrentConfiguration(SurfaceSlopeAnalysisEnum,SurfaceSlopeXAnalysisEnum);
+	femmodel->SetCurrentConfiguration(L2ProjectionBaseAnalysisEnum);
+
+	femmodel->parameters->SetParam(SurfaceSlopeXEnum,InputToL2ProjectEnum);
 	solutionsequence_linear(femmodel);
-	femmodel->SetCurrentConfiguration(SurfaceSlopeAnalysisEnum,SurfaceSlopeYAnalysisEnum);
-	solutionsequence_linear(femmodel);
+
+	if(meshtype!=Mesh2DverticalEnum){
+		femmodel->parameters->SetParam(SurfaceSlopeYEnum,InputToL2ProjectEnum);
+		solutionsequence_linear(femmodel);
+	}
 
 	if(save_results){
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp	(revision 16529)
@@ -142,16 +142,16 @@
 
 		#ifdef _HAVE_SLOPE_
-		case BedSlopeAnalysisEnum:
-			CreateNodesBedSlope(pnodes, iomodel);
-			CreateConstraintsBedSlope(pconstraints,iomodel);
-			CreateLoadsBedSlope(ploads,iomodel);
-			UpdateElementsBedSlope(elements,iomodel,analysis_counter,analysis_type);
-			break;
-
-		case SurfaceSlopeAnalysisEnum:
-			CreateNodesSurfaceSlope(pnodes, iomodel);
-			CreateConstraintsSurfaceSlope(pconstraints,iomodel);
-			CreateLoadsSurfaceSlope(ploads,iomodel);
-			UpdateElementsSurfaceSlope(elements,iomodel,analysis_counter,analysis_type);
+		case L2ProjectionBaseAnalysisEnum:
+			CreateNodesL2ProjectionBase(pnodes, iomodel);
+			CreateConstraintsL2ProjectionBase(pconstraints,iomodel);
+			CreateLoadsL2ProjectionBase(ploads,iomodel);
+			UpdateElementsL2ProjectionBase(elements,iomodel,analysis_counter,analysis_type);
+			break;
+
+		case L2ProjectionTopAnalysisEnum:
+			CreateNodesL2ProjectionTop(pnodes, iomodel);
+			CreateConstraintsL2ProjectionTop(pconstraints,iomodel);
+			CreateLoadsL2ProjectionTop(ploads,iomodel);
+			UpdateElementsL2ProjectionTop(elements,iomodel,analysis_counter,analysis_type);
 			break;
 		#endif
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp	(revision 16529)
@@ -92,8 +92,8 @@
 			numdofs=2;
 			break;
-		case BedSlopeAnalysisEnum:
+		case L2ProjectionBaseAnalysisEnum:
 			numdofs=1;
 			break;
-		case SurfaceSlopeAnalysisEnum:
+		case L2ProjectionTopAnalysisEnum:
 			numdofs=1;
 			break;
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/CreateConstraintsL2ProjectionBase.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/CreateConstraintsL2ProjectionBase.cpp	(revision 16529)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/CreateConstraintsL2ProjectionBase.cpp	(revision 16529)
@@ -0,0 +1,14 @@
+/*
+ * CreateConstraintsL2ProjectionBase.c:
+ */
+
+#include "../../../toolkits/toolkits.h"
+#include "../../../classes/classes.h"
+#include "../../../shared/shared.h"
+#include "../ModelProcessorx.h"
+
+void	CreateConstraintsL2ProjectionBase(Constraints** pconstraints, IoModel* iomodel){
+
+	/*No constraints*/
+
+}
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/CreateLoadsL2ProjectionBase.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/CreateLoadsL2ProjectionBase.cpp	(revision 16529)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/CreateLoadsL2ProjectionBase.cpp	(revision 16529)
@@ -0,0 +1,13 @@
+/*! \file CreateLoadsL2ProjectionBase.c:
+ */
+
+#include "../../../toolkits/toolkits.h"
+#include "../../../classes/classes.h"
+#include "../../../shared/shared.h"
+#include "../ModelProcessorx.h"
+
+void	CreateLoadsL2ProjectionBase(Loads** ploads, IoModel* iomodel){
+
+	/*No loads*/
+
+}
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/CreateNodesL2ProjectionBase.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/CreateNodesL2ProjectionBase.cpp	(revision 16529)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/CreateNodesL2ProjectionBase.cpp	(revision 16529)
@@ -0,0 +1,21 @@
+/*
+ * CreateNodesL2ProjectionBase.c:
+ */
+
+#include "../../../toolkits/toolkits.h"
+#include "../../../classes/classes.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../ModelProcessorx.h"
+
+void	CreateNodesL2ProjectionBase(Nodes** pnodes, IoModel* iomodel){
+
+	if(iomodel->meshtype==Mesh3DEnum){
+		iomodel->FetchData(2,MeshVertexonbedEnum,MeshVertexonsurfaceEnum);
+	}
+	else if(iomodel->meshtype==Mesh2DverticalEnum){
+		iomodel->FetchData(1,MeshVertexonbedEnum);
+	}
+	CreateNodes(pnodes,iomodel,L2ProjectionBaseAnalysisEnum,P1Enum);
+	iomodel->DeleteData(2,MeshVertexonbedEnum,MeshVertexonsurfaceEnum);
+}
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/UpdateElementsL2ProjectionBase.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/UpdateElementsL2ProjectionBase.cpp	(revision 16529)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionBase/UpdateElementsL2ProjectionBase.cpp	(revision 16529)
@@ -0,0 +1,33 @@
+/*
+ * UpdateElementsL2ProjectionBase:
+ */
+
+#include "../../../toolkits/toolkits.h"
+#include "../../../classes/classes.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsL2ProjectionBase(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
+
+	/*Update elements: */
+	int counter=0;
+	for(int i=0;i<iomodel->numberofelements;i++){
+		if(iomodel->my_elements[i]){
+			Element* element=(Element*)elements->GetObjectByOffset(counter);
+			element->Update(i,iomodel,analysis_counter,analysis_type,P1Enum);
+			counter++;
+		}
+	}
+
+	iomodel->FetchDataToInput(elements,SurfaceEnum);
+	iomodel->FetchDataToInput(elements,BedEnum);
+	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
+	if(iomodel->meshtype==Mesh3DEnum){
+		iomodel->FetchDataToInput(elements,MeshElementonbedEnum);
+		iomodel->FetchDataToInput(elements,MeshElementonsurfaceEnum);
+	}
+	if(iomodel->meshtype==Mesh2DverticalEnum){
+		iomodel->FetchDataToInput(elements,MeshVertexonbedEnum);
+	}
+}
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/CreateConstraintsL2ProjectionTop.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/CreateConstraintsL2ProjectionTop.cpp	(revision 16529)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/CreateConstraintsL2ProjectionTop.cpp	(revision 16529)
@@ -0,0 +1,13 @@
+/*
+ * CreateConstraintsL2ProjectionTop.c:
+ */
+
+#include "../../../toolkits/toolkits.h"
+#include "../../../classes/classes.h"
+#include "../../../shared/shared.h"
+#include "../ModelProcessorx.h"
+
+void	CreateConstraintsL2ProjectionTop(Constraints** pconstraints, IoModel* iomodel){
+
+	/*No constraints*/
+}
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/CreateLoadsL2ProjectionTop.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/CreateLoadsL2ProjectionTop.cpp	(revision 16529)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/CreateLoadsL2ProjectionTop.cpp	(revision 16529)
@@ -0,0 +1,13 @@
+/*! \file CreateLoadsL2ProjectionTop.c:
+ */
+
+#include "../../../toolkits/toolkits.h"
+#include "../../../classes/classes.h"
+#include "../../../shared/shared.h"
+#include "../ModelProcessorx.h"
+
+void	CreateLoadsL2ProjectionTop(Loads** ploads, IoModel* iomodel){
+
+	/*No loads*/
+
+}
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/CreateNodesL2ProjectionTop.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/CreateNodesL2ProjectionTop.cpp	(revision 16529)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/CreateNodesL2ProjectionTop.cpp	(revision 16529)
@@ -0,0 +1,21 @@
+/*
+ * CreateNodesL2ProjectionTop.c:
+ */
+
+#include "../../../toolkits/toolkits.h"
+#include "../../../classes/classes.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../ModelProcessorx.h"
+
+void	CreateNodesL2ProjectionTop(Nodes** pnodes, IoModel* iomodel){
+
+	if(iomodel->meshtype==Mesh3DEnum){
+		iomodel->FetchData(2,MeshVertexonbedEnum,MeshVertexonsurfaceEnum);
+	}
+	else if(iomodel->meshtype==Mesh2DverticalEnum){
+		iomodel->FetchData(1,MeshVertexonbedEnum);
+	}
+	CreateNodes(pnodes,iomodel,L2ProjectionTopAnalysisEnum,P1Enum);
+	iomodel->DeleteData(2,MeshVertexonbedEnum,MeshVertexonsurfaceEnum);
+}
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/UpdateElementsL2ProjectionTop.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/UpdateElementsL2ProjectionTop.cpp	(revision 16529)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/L2ProjectionTop/UpdateElementsL2ProjectionTop.cpp	(revision 16529)
@@ -0,0 +1,30 @@
+/*
+ * UpdateElementsL2ProjectionTop:
+ */
+
+#include "../../../toolkits/toolkits.h"
+#include "../../../classes/classes.h"
+#include "../../../shared/shared.h"
+#include "../../MeshPartitionx/MeshPartitionx.h"
+#include "../ModelProcessorx.h"
+
+void	UpdateElementsL2ProjectionTop(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
+
+	/*Update elements: */
+	int counter=0;
+	for(int i=0;i<iomodel->numberofelements;i++){
+		if(iomodel->my_elements[i]){
+			Element* element=(Element*)elements->GetObjectByOffset(counter);
+			element->Update(i,iomodel,analysis_counter,analysis_type,P1Enum);
+			counter++;
+		}
+	}
+
+	iomodel->FetchDataToInput(elements,SurfaceEnum);
+	iomodel->FetchDataToInput(elements,BedEnum);
+	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
+	if(iomodel->meshtype==Mesh3DEnum){
+		iomodel->FetchDataToInput(elements,MeshElementonbedEnum);
+		iomodel->FetchDataToInput(elements,MeshElementonsurfaceEnum);
+	}
+}
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 16528)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 16529)
@@ -77,15 +77,15 @@
 void UpdateElementsExtrudeFromTop(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
 
-/*bed slope*/
-void CreateNodesBedSlope(Nodes** pnodes,IoModel* iomodel);
-void CreateConstraintsBedSlope(Constraints** pconstraints,IoModel* iomodel);
-void CreateLoadsBedSlope(Loads** ploads, IoModel* iomodel);
-void UpdateElementsBedSlope(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
+/*L2 projection base*/
+void CreateNodesL2ProjectionBase(Nodes** pnodes,IoModel* iomodel);
+void CreateConstraintsL2ProjectionBase(Constraints** pconstraints,IoModel* iomodel);
+void CreateLoadsL2ProjectionBase(Loads** ploads, IoModel* iomodel);
+void UpdateElementsL2ProjectionBase(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
 
-/*surface slope*/
-void CreateNodesSurfaceSlope(Nodes** pnodes,IoModel* iomodel);
-void CreateConstraintsSurfaceSlope(Constraints** pconstraints,IoModel* iomodel);
-void CreateLoadsSurfaceSlope(Loads** ploads, IoModel* iomodel);
-void UpdateElementsSurfaceSlope(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
+/*L2 projection top*/
+void CreateNodesL2ProjectionTop(Nodes** pnodes,IoModel* iomodel);
+void CreateConstraintsL2ProjectionTop(Constraints** pconstraints,IoModel* iomodel);
+void CreateLoadsL2ProjectionTop(Loads** ploads, IoModel* iomodel);
+void UpdateElementsL2ProjectionTop(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
 
 /*thermal:*/
Index: issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
===================================================================
--- issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 16528)
+++ issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 16529)
@@ -297,8 +297,6 @@
 	BalancevelocityAnalysisEnum,
 	BalancevelocitySolutionEnum,
-	BedSlopeAnalysisEnum,
+	L2ProjectionBaseAnalysisEnum,
 	BedSlopeSolutionEnum,
-	BedSlopeXAnalysisEnum,
-	BedSlopeYAnalysisEnum,
 	DamageEvolutionSolutionEnum,
 	DamageEvolutionAnalysisEnum,
@@ -322,8 +320,6 @@
 	ExtrudeFromTopAnalysisEnum,
 	SteadystateSolutionEnum,
-	SurfaceSlopeAnalysisEnum,
+	L2ProjectionTopAnalysisEnum,
 	SurfaceSlopeSolutionEnum,
-	SurfaceSlopeXAnalysisEnum,
-	SurfaceSlopeYAnalysisEnum,
 	SmoothedSurfaceSlopeXAnalysisEnum,
 	SmoothedSurfaceSlopeYAnalysisEnum,
@@ -380,4 +376,5 @@
 	IntInputEnum,
 	InputToExtrudeEnum,
+	InputToL2ProjectEnum,
 	IntParamEnum,
 	IntVecParamEnum,
Index: issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
===================================================================
--- issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 16529)
@@ -303,8 +303,6 @@
 		case BalancevelocityAnalysisEnum : return "BalancevelocityAnalysis";
 		case BalancevelocitySolutionEnum : return "BalancevelocitySolution";
-		case BedSlopeAnalysisEnum : return "BedSlopeAnalysis";
+		case L2ProjectionBaseAnalysisEnum : return "L2ProjectionBaseAnalysis";
 		case BedSlopeSolutionEnum : return "BedSlopeSolution";
-		case BedSlopeXAnalysisEnum : return "BedSlopeXAnalysis";
-		case BedSlopeYAnalysisEnum : return "BedSlopeYAnalysis";
 		case DamageEvolutionSolutionEnum : return "DamageEvolutionSolution";
 		case DamageEvolutionAnalysisEnum : return "DamageEvolutionAnalysis";
@@ -328,8 +326,6 @@
 		case ExtrudeFromTopAnalysisEnum : return "ExtrudeFromTopAnalysis";
 		case SteadystateSolutionEnum : return "SteadystateSolution";
-		case SurfaceSlopeAnalysisEnum : return "SurfaceSlopeAnalysis";
+		case L2ProjectionTopAnalysisEnum : return "L2ProjectionTopAnalysis";
 		case SurfaceSlopeSolutionEnum : return "SurfaceSlopeSolution";
-		case SurfaceSlopeXAnalysisEnum : return "SurfaceSlopeXAnalysis";
-		case SurfaceSlopeYAnalysisEnum : return "SurfaceSlopeYAnalysis";
 		case SmoothedSurfaceSlopeXAnalysisEnum : return "SmoothedSurfaceSlopeXAnalysis";
 		case SmoothedSurfaceSlopeYAnalysisEnum : return "SmoothedSurfaceSlopeYAnalysis";
@@ -380,4 +376,5 @@
 		case IntInputEnum : return "IntInput";
 		case InputToExtrudeEnum : return "InputToExtrude";
+		case InputToL2ProjectEnum : return "InputToL2Project";
 		case IntParamEnum : return "IntParam";
 		case IntVecParamEnum : return "IntVecParam";
Index: issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
===================================================================
--- issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 16528)
+++ issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 16529)
@@ -309,8 +309,6 @@
 	      else if (strcmp(name,"BalancevelocityAnalysis")==0) return BalancevelocityAnalysisEnum;
 	      else if (strcmp(name,"BalancevelocitySolution")==0) return BalancevelocitySolutionEnum;
-	      else if (strcmp(name,"BedSlopeAnalysis")==0) return BedSlopeAnalysisEnum;
+	      else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum;
 	      else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
-	      else if (strcmp(name,"BedSlopeXAnalysis")==0) return BedSlopeXAnalysisEnum;
-	      else if (strcmp(name,"BedSlopeYAnalysis")==0) return BedSlopeYAnalysisEnum;
 	      else if (strcmp(name,"DamageEvolutionSolution")==0) return DamageEvolutionSolutionEnum;
 	      else if (strcmp(name,"DamageEvolutionAnalysis")==0) return DamageEvolutionAnalysisEnum;
@@ -334,8 +332,6 @@
 	      else if (strcmp(name,"ExtrudeFromTopAnalysis")==0) return ExtrudeFromTopAnalysisEnum;
 	      else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
-	      else if (strcmp(name,"SurfaceSlopeAnalysis")==0) return SurfaceSlopeAnalysisEnum;
+	      else if (strcmp(name,"L2ProjectionTopAnalysis")==0) return L2ProjectionTopAnalysisEnum;
 	      else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
-	      else if (strcmp(name,"SurfaceSlopeXAnalysis")==0) return SurfaceSlopeXAnalysisEnum;
-	      else if (strcmp(name,"SurfaceSlopeYAnalysis")==0) return SurfaceSlopeYAnalysisEnum;
 	      else if (strcmp(name,"SmoothedSurfaceSlopeXAnalysis")==0) return SmoothedSurfaceSlopeXAnalysisEnum;
 	      else if (strcmp(name,"SmoothedSurfaceSlopeYAnalysis")==0) return SmoothedSurfaceSlopeYAnalysisEnum;
@@ -383,11 +379,12 @@
 	      else if (strcmp(name,"ExternalResult")==0) return ExternalResultEnum;
 	      else if (strcmp(name,"FileParam")==0) return FileParamEnum;
+	      else if (strcmp(name,"Input")==0) return InputEnum;
+	      else if (strcmp(name,"IntInput")==0) return IntInputEnum;
+	      else if (strcmp(name,"InputToExtrude")==0) return InputToExtrudeEnum;
+	      else if (strcmp(name,"InputToL2Project")==0) return InputToL2ProjectEnum;
          else stage=4;
    }
    if(stage==4){
-	      if (strcmp(name,"Input")==0) return InputEnum;
-	      else if (strcmp(name,"IntInput")==0) return IntInputEnum;
-	      else if (strcmp(name,"InputToExtrude")==0) return InputToExtrudeEnum;
-	      else if (strcmp(name,"IntParam")==0) return IntParamEnum;
+	      if (strcmp(name,"IntParam")==0) return IntParamEnum;
 	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
 	      else if (strcmp(name,"TransientParam")==0) return TransientParamEnum;
@@ -506,11 +503,11 @@
 	      else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
 	      else if (strcmp(name,"StressTensor")==0) return StressTensorEnum;
+	      else if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum;
+	      else if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
+	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
          else stage=5;
    }
    if(stage==5){
-	      if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum;
-	      else if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
-	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
-	      else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
+	      if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
 	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
 	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
Index: issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m
===================================================================
--- issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 16528)
+++ issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 16529)
@@ -10,5 +10,5 @@
 %Get solution and associated analyses
 solution=md.private.solution;
-[analyses,numanalyses]=AnalysisConfiguration(solution);
+[analyses]=AnalysisConfiguration(solution);
 
 %Go through a model field, check that it is a class, and call checkconsistency
@@ -37,66 +37,52 @@
 end
 
-function [analyses,numanalyses]=AnalysisConfiguration(solutiontype), % {{{
+function [analyses]=AnalysisConfiguration(solutiontype), % {{{
 %ANALYSISCONFIGURATION - return type of analyses, number of analyses 
 %
 %   Usage:
-%      [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
+%      [analyses]=AnalysisConfiguration(solutiontype);
 
 switch solutiontype,
 
 	case StressbalanceSolutionEnum(),
-		numanalyses=5;
-		analyses=[StressbalanceAnalysisEnum();StressbalanceVerticalAnalysisEnum();StressbalanceSIAAnalysisEnum();SurfaceSlopeAnalysisEnum();BedSlopeAnalysisEnum()];
+		analyses=[StressbalanceAnalysisEnum();StressbalanceVerticalAnalysisEnum();StressbalanceSIAAnalysisEnum();L2ProjectionBaseAnalysisEnum()];
 
 	case SteadystateSolutionEnum(),
-		numanalyses=7; 
-		analyses=[StressbalanceAnalysisEnum();StressbalanceVerticalAnalysisEnum();StressbalanceSIAAnalysisEnum();SurfaceSlopeAnalysisEnum();BedSlopeAnalysisEnum();ThermalAnalysisEnum();MeltingAnalysisEnum()];
+		analyses=[StressbalanceAnalysisEnum();StressbalanceVerticalAnalysisEnum();StressbalanceSIAAnalysisEnum();L2ProjectionBaseAnalysisEnum();ThermalAnalysisEnum();MeltingAnalysisEnum()];
 
 	case ThermalSolutionEnum(),
-		numanalyses=2; 
 		analyses=[EnthalpyAnalysisEnum;ThermalAnalysisEnum();MeltingAnalysisEnum()];
 
 	case MasstransportSolutionEnum(),
-		numanalyses=1; 
 		analyses=[MasstransportAnalysisEnum()];
 
 	case BalancethicknessSolutionEnum(),
-		numanalyses=1; 
 		analyses=[BalancethicknessAnalysisEnum()];
 
 	case BalancethicknessSoftSolutionEnum(),
-		numanalyses=1; 
 		analyses=[BalancethicknessAnalysisEnum()];
 
 	case BalancevelocitySolutionEnum(),
-		numanalyses=1; 
 		analyses=[BalancevelocityAnalysisEnum()];
 
 	case SurfaceSlopeSolutionEnum(),
-		numanalyses=1; 
-		analyses=[SurfaceSlopeAnalysisEnum()];
+		analyses=[L2ProjectionBaseAnalysisEnum()];
 
 	case BedSlopeSolutionEnum(),
-		numanalyses=1; 
-		analyses=[BedSlopeAnalysisEnum()];
+		analyses=[L2ProjectionBaseAnalysisEnum()];
 
 	case GiaSolutionEnum(),
-		numanalyses=1; 
 		analyses=[GiaAnalysisEnum()];
 
 	case TransientSolutionEnum(),
-		numanalyses=9; 
-		analyses=[StressbalanceAnalysisEnum();StressbalanceVerticalAnalysisEnum();StressbalanceSIAAnalysisEnum();SurfaceSlopeAnalysisEnum();BedSlopeAnalysisEnum();ThermalAnalysisEnum();MeltingAnalysisEnum();EnthalpyAnalysisEnum();MasstransportAnalysisEnum()];
+		analyses=[StressbalanceAnalysisEnum();StressbalanceVerticalAnalysisEnum();StressbalanceSIAAnalysisEnum();L2ProjectionBaseAnalysisEnum();ThermalAnalysisEnum();MeltingAnalysisEnum();EnthalpyAnalysisEnum();MasstransportAnalysisEnum()];
 
 	case FlaimSolutionEnum(),
-		numanalyses=1; 
 		analyses=[FlaimAnalysisEnum()];
 
 	case HydrologySolutionEnum(),
-		numanalyses=3; 
-		analyses=[BedSlopeAnalysisEnum();SurfaceSlopeAnalysisEnum();HydrologyShreveAnalysisEnum();HydrologyDCInefficientAnalysisEnum();HydrologyDCEfficientAnalysisEnum()];
+		analyses=[L2ProjectionBaseAnalysisEnum();HydrologyShreveAnalysisEnum();HydrologyDCInefficientAnalysisEnum();HydrologyDCEfficientAnalysisEnum()];
 	
 	case DamageEvolutionSolutionEnum(),
-		numanalyses=1; 
 		analyses=[DamageEvolutionAnalysisEnum()];
 
Index: issm/trunk-jpl/src/m/enum/BedSlopeAnalysisEnum.m
===================================================================
--- issm/trunk-jpl/src/m/enum/BedSlopeAnalysisEnum.m	(revision 16528)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=BedSlopeAnalysisEnum()
-%BEDSLOPEANALYSISENUM - Enum of BedSlopeAnalysis
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
-%            Please read src/c/shared/Enum/README for more information
-%
-%   Usage:
-%      macro=BedSlopeAnalysisEnum()
-
-macro=StringToEnum('BedSlopeAnalysis');
Index: issm/trunk-jpl/src/m/enum/BedSlopeXAnalysisEnum.m
===================================================================
--- issm/trunk-jpl/src/m/enum/BedSlopeXAnalysisEnum.m	(revision 16528)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=BedSlopeXAnalysisEnum()
-%BEDSLOPEXANALYSISENUM - Enum of BedSlopeXAnalysis
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
-%            Please read src/c/shared/Enum/README for more information
-%
-%   Usage:
-%      macro=BedSlopeXAnalysisEnum()
-
-macro=StringToEnum('BedSlopeXAnalysis');
Index: issm/trunk-jpl/src/m/enum/BedSlopeYAnalysisEnum.m
===================================================================
--- issm/trunk-jpl/src/m/enum/BedSlopeYAnalysisEnum.m	(revision 16528)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=BedSlopeYAnalysisEnum()
-%BEDSLOPEYANALYSISENUM - Enum of BedSlopeYAnalysis
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
-%            Please read src/c/shared/Enum/README for more information
-%
-%   Usage:
-%      macro=BedSlopeYAnalysisEnum()
-
-macro=StringToEnum('BedSlopeYAnalysis');
Index: issm/trunk-jpl/src/m/enum/EnumDefinitions.py
===================================================================
--- issm/trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 16528)
+++ issm/trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 16529)
@@ -295,8 +295,6 @@
 def BalancevelocityAnalysisEnum(): return StringToEnum("BalancevelocityAnalysis")[0]
 def BalancevelocitySolutionEnum(): return StringToEnum("BalancevelocitySolution")[0]
-def BedSlopeAnalysisEnum(): return StringToEnum("BedSlopeAnalysis")[0]
+def L2ProjectionBaseAnalysisEnum(): return StringToEnum("L2ProjectionBaseAnalysis")[0]
 def BedSlopeSolutionEnum(): return StringToEnum("BedSlopeSolution")[0]
-def BedSlopeXAnalysisEnum(): return StringToEnum("BedSlopeXAnalysis")[0]
-def BedSlopeYAnalysisEnum(): return StringToEnum("BedSlopeYAnalysis")[0]
 def DamageEvolutionSolutionEnum(): return StringToEnum("DamageEvolutionSolution")[0]
 def DamageEvolutionAnalysisEnum(): return StringToEnum("DamageEvolutionAnalysis")[0]
@@ -320,8 +318,6 @@
 def ExtrudeFromTopAnalysisEnum(): return StringToEnum("ExtrudeFromTopAnalysis")[0]
 def SteadystateSolutionEnum(): return StringToEnum("SteadystateSolution")[0]
-def SurfaceSlopeAnalysisEnum(): return StringToEnum("SurfaceSlopeAnalysis")[0]
+def L2ProjectionTopAnalysisEnum(): return StringToEnum("L2ProjectionTopAnalysis")[0]
 def SurfaceSlopeSolutionEnum(): return StringToEnum("SurfaceSlopeSolution")[0]
-def SurfaceSlopeXAnalysisEnum(): return StringToEnum("SurfaceSlopeXAnalysis")[0]
-def SurfaceSlopeYAnalysisEnum(): return StringToEnum("SurfaceSlopeYAnalysis")[0]
 def SmoothedSurfaceSlopeXAnalysisEnum(): return StringToEnum("SmoothedSurfaceSlopeXAnalysis")[0]
 def SmoothedSurfaceSlopeYAnalysisEnum(): return StringToEnum("SmoothedSurfaceSlopeYAnalysis")[0]
@@ -372,4 +368,5 @@
 def IntInputEnum(): return StringToEnum("IntInput")[0]
 def InputToExtrudeEnum(): return StringToEnum("InputToExtrude")[0]
+def InputToL2ProjectEnum(): return StringToEnum("InputToL2Project")[0]
 def IntParamEnum(): return StringToEnum("IntParam")[0]
 def IntVecParamEnum(): return StringToEnum("IntVecParam")[0]
Index: issm/trunk-jpl/src/m/enum/InputToL2ProjectEnum.m
===================================================================
--- issm/trunk-jpl/src/m/enum/InputToL2ProjectEnum.m	(revision 16529)
+++ issm/trunk-jpl/src/m/enum/InputToL2ProjectEnum.m	(revision 16529)
@@ -0,0 +1,11 @@
+function macro=InputToL2ProjectEnum()
+%INPUTTOL2PROJECTENUM - Enum of InputToL2Project
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
+%            Please read src/c/shared/Enum/README for more information
+%
+%   Usage:
+%      macro=InputToL2ProjectEnum()
+
+macro=StringToEnum('InputToL2Project');
Index: issm/trunk-jpl/src/m/enum/L2ProjectionBaseAnalysisEnum.m
===================================================================
--- issm/trunk-jpl/src/m/enum/L2ProjectionBaseAnalysisEnum.m	(revision 16529)
+++ issm/trunk-jpl/src/m/enum/L2ProjectionBaseAnalysisEnum.m	(revision 16529)
@@ -0,0 +1,11 @@
+function macro=L2ProjectionBaseAnalysisEnum()
+%L2PROJECTIONBASEANALYSISENUM - Enum of L2ProjectionBaseAnalysis
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
+%            Please read src/c/shared/Enum/README for more information
+%
+%   Usage:
+%      macro=L2ProjectionBaseAnalysisEnum()
+
+macro=StringToEnum('L2ProjectionBaseAnalysis');
Index: issm/trunk-jpl/src/m/enum/L2ProjectionTopAnalysisEnum.m
===================================================================
--- issm/trunk-jpl/src/m/enum/L2ProjectionTopAnalysisEnum.m	(revision 16529)
+++ issm/trunk-jpl/src/m/enum/L2ProjectionTopAnalysisEnum.m	(revision 16529)
@@ -0,0 +1,11 @@
+function macro=L2ProjectionTopAnalysisEnum()
+%L2PROJECTIONTOPANALYSISENUM - Enum of L2ProjectionTopAnalysis
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
+%            Please read src/c/shared/Enum/README for more information
+%
+%   Usage:
+%      macro=L2ProjectionTopAnalysisEnum()
+
+macro=StringToEnum('L2ProjectionTopAnalysis');
Index: issm/trunk-jpl/src/m/enum/SurfaceSlopeAnalysisEnum.m
===================================================================
--- issm/trunk-jpl/src/m/enum/SurfaceSlopeAnalysisEnum.m	(revision 16528)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=SurfaceSlopeAnalysisEnum()
-%SURFACESLOPEANALYSISENUM - Enum of SurfaceSlopeAnalysis
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
-%            Please read src/c/shared/Enum/README for more information
-%
-%   Usage:
-%      macro=SurfaceSlopeAnalysisEnum()
-
-macro=StringToEnum('SurfaceSlopeAnalysis');
Index: issm/trunk-jpl/src/m/enum/SurfaceSlopeXAnalysisEnum.m
===================================================================
--- issm/trunk-jpl/src/m/enum/SurfaceSlopeXAnalysisEnum.m	(revision 16528)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=SurfaceSlopeXAnalysisEnum()
-%SURFACESLOPEXANALYSISENUM - Enum of SurfaceSlopeXAnalysis
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
-%            Please read src/c/shared/Enum/README for more information
-%
-%   Usage:
-%      macro=SurfaceSlopeXAnalysisEnum()
-
-macro=StringToEnum('SurfaceSlopeXAnalysis');
Index: issm/trunk-jpl/src/m/enum/SurfaceSlopeYAnalysisEnum.m
===================================================================
--- issm/trunk-jpl/src/m/enum/SurfaceSlopeYAnalysisEnum.m	(revision 16528)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=SurfaceSlopeYAnalysisEnum()
-%SURFACESLOPEYANALYSISENUM - Enum of SurfaceSlopeYAnalysis
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
-%            Please read src/c/shared/Enum/README for more information
-%
-%   Usage:
-%      macro=SurfaceSlopeYAnalysisEnum()
-
-macro=StringToEnum('SurfaceSlopeYAnalysis');
