Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 18592)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 18593)
@@ -657,9 +657,6 @@
 issm_sources += ./analyses/ThermalAnalysis.cpp
 endif
-if SMOOTHEDSURFACESLOPEX
-issm_sources += ./analyses/SmoothedSurfaceSlopeXAnalysis.cpp
-endif
-if SMOOTHEDSURFACESLOPEY
-issm_sources += ./analyses/SmoothedSurfaceSlopeYAnalysis.cpp
+if SMOOTH
+issm_sources += ./analyses/SmoothAnalysis.cpp
 endif
 if MESHDEFORMATION
Index: /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 18592)
+++ /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 18593)
@@ -95,6 +95,6 @@
 
 	/*Get vector N for all nodes and build HNx and HNy*/
-	element->GetInputListOnNodes(Nx,SurfaceSlopeXEnum);
-	element->GetInputListOnNodes(Ny,SurfaceSlopeYEnum);
+	element->GetInputListOnNodes(Nx,DrivingStressXEnum);
+	element->GetInputListOnNodes(Ny,DrivingStressYEnum);
 	element->GetInputListOnNodes(H,ThicknessEnum);
 	for(int i=0;i<numnodes;i++){
@@ -190,6 +190,6 @@
 
 	/*Get vector N for all nodes*/
-	basalelement->GetInputListOnNodes(Nx,SurfaceSlopeXEnum);
-	basalelement->GetInputListOnNodes(Ny,SurfaceSlopeYEnum);
+	basalelement->GetInputListOnNodes(Nx,DrivingStressXEnum);
+	basalelement->GetInputListOnNodes(Ny,DrivingStressYEnum);
 	basalelement->GetInputListOnNodes(H,ThicknessEnum);
 	for(int i=0;i<numnodes;i++){
Index: /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 18592)
+++ /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 18593)
@@ -86,9 +86,6 @@
 		case DepthAverageAnalysisEnum : return new DepthAverageAnalysis();
 		#endif
-		#ifdef _HAVE_SMOOTHEDSURFACESLOPEX_
-		case SmoothedSurfaceSlopeXAnalysisEnum : return new SmoothedSurfaceSlopeXAnalysis();
-		#endif
-		#ifdef _HAVE_SMOOTHEDSURFACESLOPEY_
-		case SmoothedSurfaceSlopeYAnalysisEnum : return new SmoothedSurfaceSlopeYAnalysis();
+		#ifdef _HAVE_SMOOTH_
+		case SmoothAnalysisEnum : return new SmoothAnalysis();
 		#endif
 		#ifdef _HAVE_THERMAL_
Index: /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 18592)
+++ /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 18593)
@@ -93,5 +93,5 @@
 
 	/*Initialize Element vector*/
-	ElementMatrix* Ke    = basalelement->NewElementMatrix(NoneApproximationEnum);
+	ElementMatrix* Ke    = basalelement->NewElementMatrix();
 	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
 
Index: /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.cpp	(revision 18593)
+++ /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.cpp	(revision 18593)
@@ -0,0 +1,227 @@
+#include "./SmoothAnalysis.h"
+#include "../toolkits/toolkits.h"
+#include "../classes/classes.h"
+#include "../shared/shared.h"
+#include "../modules/modules.h"
+
+/*Model processing*/
+int  SmoothAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
+	return 1;
+}/*}}}*/
+void SmoothAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+}/*}}}*/
+void SmoothAnalysis::UpdateElements(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++;
+		}
+	}
+}/*}}}*/
+void SmoothAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+
+	::CreateNodes(nodes,iomodel,SmoothAnalysisEnum,P1Enum);
+
+}/*}}}*/
+void SmoothAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+}/*}}}*/
+void SmoothAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+}/*}}}*/
+
+/*Finite Element Analysis*/
+void           SmoothAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+ElementVector* SmoothAnalysis::CreateDVector(Element* element){/*{{{*/
+	/*Default, return NULL*/
+	return NULL;
+}/*}}}*/
+ElementMatrix* SmoothAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
+_error_("Not implemented");
+}/*}}}*/
+ElementMatrix* SmoothAnalysis::CreateKMatrix(Element* element){/*{{{*/
+
+	/* Intermediaries */
+	int         domaintype;
+	IssmDouble  Jdet,thickness,l=8.;
+	IssmDouble *xyz_list = NULL;
+
+	/*Check dimension*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DhorizontalEnum:
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+
+	/*Initialize Element matrix and vectors*/
+	ElementMatrix* Ke     = element->NewElementMatrix();
+	IssmDouble*    dbasis = xNew<IssmDouble>(2*numnodes);
+	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
+
+	/*Retrieve all inputs and parameters*/
+	element->GetVerticesCoordinates(&xyz_list);
+	Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input);
+
+	/* Start looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss(2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+		gauss->GaussPoint(ig);
+
+		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		thickness_input->GetInputValue(&thickness,gauss);
+		if(thickness<50.) thickness=50.;
+
+		element->NodalFunctions(basis,gauss);
+		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+
+		for(int i=0;i<numnodes;i++){
+			for(int j=0;j<numnodes;j++){
+				Ke->values[i*numnodes+j] += gauss->weight*Jdet*(
+							basis[i]*basis[j]
+							+(l*thickness)*(l*thickness)*(dbasis[0*numnodes+i]*dbasis[0*numnodes+j] + dbasis[1*numnodes+i]*dbasis[1*numnodes+j])
+							);
+			}
+		}
+	}
+
+	/*Clean up and return*/
+	delete gauss;
+	xDelete<IssmDouble>(dbasis);
+	xDelete<IssmDouble>(basis);
+	xDelete<IssmDouble>(xyz_list);
+	return Ke;
+}/*}}}*/
+ElementVector* SmoothAnalysis::CreatePVector(Element* element){/*{{{*/
+
+	/*Get basal element*/
+	int domaintype;
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DhorizontalEnum:
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+
+	/*Intermediaries */
+	int         input_enum;
+	IssmDouble  Jdet,value;
+	IssmDouble *xyz_list  = NULL;
+	Input      *input = NULL;
+
+	/*SPECIFICS: Driving stress for balance velocities*/
+	Input*      H_input = NULL, *surface_input = NULL, *vx_input = NULL, *vy_input = NULL;
+	IssmDouble  taud_x,norms,normv,vx,vy;
+	IssmDouble  rho_ice,gravity,slope[2],thickness;
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+
+	/*Initialize Element vector*/
+	ElementVector* pe    = element->NewElementVector();
+	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
+
+	/*Retrieve all inputs and parameters*/
+	element->GetVerticesCoordinates(&xyz_list);
+	element->FindParam(&input_enum,InputToSmoothEnum);
+
+	switch(input_enum){
+		case DrivingStressXEnum:
+		case DrivingStressYEnum:{
+			rho_ice       = element->GetMaterialParameter(MaterialsRhoIceEnum);
+			gravity       = element->GetMaterialParameter(ConstantsGEnum);
+			H_input       = element->GetInput(ThicknessEnum); _assert_(H_input);
+			surface_input = element->GetInput(SurfaceEnum);   _assert_(surface_input);
+			vx_input      = element->GetInput(VxEnum);
+			vy_input      = element->GetInput(VyEnum);
+			}
+			break;
+		case SurfaceSlopeXEnum:
+		case SurfaceSlopeYEnum:{
+			surface_input = element->GetInput(SurfaceEnum);   _assert_(surface_input);
+			}
+			break;
+		default: input = element->GetInput(input_enum);
+	}
+
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss(2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+		gauss->GaussPoint(ig);
+
+		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		element->NodalFunctions(basis,gauss);
+
+
+		switch(input_enum){
+			case DrivingStressXEnum: 
+			case DrivingStressYEnum:{
+				H_input->GetInputValue(&thickness,gauss);
+				surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
+				if(vx_input && vy_input){
+					vx_input->GetInputValue(&vx,gauss);
+					vy_input->GetInputValue(&vy,gauss);
+					norms = sqrt(slope[0]*slope[0]+slope[1]*slope[1]+1.e-10);
+					normv = sqrt(vx*vx + vy*vy);
+					if(normv>15./(365.*24.*3600.)){
+						slope[0] = -vx/normv*norms;
+						slope[1] = -vy/normv*norms;
+					}
+				}
+				if(input_enum==DrivingStressXEnum)
+				 value = rho_ice*gravity*thickness*slope[0];
+				else
+				 value = rho_ice*gravity*thickness*slope[1];
+			}
+			break;
+			case SurfaceSlopeXEnum: 
+				surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
+				value = slope[0];
+				break;
+			case SurfaceSlopeYEnum:
+				surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
+				value = slope[1];
+				break;
+			default:
+				input->GetInputValue(&value,gauss);
+		}
+
+		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*value*basis[i];
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+	delete gauss;
+	return pe;
+}/*}}}*/
+void SmoothAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+	   _error_("not implemented yet");
+}/*}}}*/
+void SmoothAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+	_error_("Not implemented yet");
+}/*}}}*/
+void SmoothAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+	int inputenum,domaintype,elementtype;
+
+	element->FindParam(&inputenum,InputToSmoothEnum);
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DhorizontalEnum:
+			element->InputUpdateFromSolutionOneDof(solution,inputenum);
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+}/*}}}*/
+void SmoothAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+	/*Default, do nothing*/
+	return;
+}/*}}}*/
Index: /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.h
===================================================================
--- /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.h	(revision 18593)
+++ /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.h	(revision 18593)
@@ -0,0 +1,33 @@
+/*! \file SmoothAnalysis.h 
+ *  \brief: header file for generic external result object
+ */
+
+#ifndef _SmoothAnalysis_
+#define _SmoothAnalysis_
+
+/*Headers*/
+#include "./Analysis.h"
+
+class SmoothAnalysis: public Analysis{
+
+	public:
+		/*Model processing*/
+		int  DofsPerNode(int** doflist,int domaintype,int approximation);
+		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
+		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
+		void CreateLoads(Loads* loads, IoModel* iomodel);
+
+		/*Finite element Analysis*/
+		void           Core(FemModel* femmodel);
+		ElementVector* CreateDVector(Element* element);
+		ElementMatrix* CreateJacobianMatrix(Element* element);
+		ElementMatrix* CreateKMatrix(Element* element);
+		ElementVector* CreatePVector(Element* element);
+		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+		void UpdateConstraints(FemModel* femmodel);
+};
+#endif
Index: sm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.cpp	(revision 18592)
+++ 	(revision )
@@ -1,183 +1,0 @@
-#include "./SmoothedSurfaceSlopeXAnalysis.h"
-#include "../toolkits/toolkits.h"
-#include "../classes/classes.h"
-#include "../shared/shared.h"
-#include "../modules/modules.h"
-
-/*Model processing*/
-int  SmoothedSurfaceSlopeXAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
-	return 1;
-}/*}}}*/
-void SmoothedSurfaceSlopeXAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
-}/*}}}*/
-void SmoothedSurfaceSlopeXAnalysis::UpdateElements(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,BaseEnum);
-	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
-	if(iomodel->domaintype!=Domain2DhorizontalEnum){
-		iomodel->FetchDataToInput(elements,MeshVertexonbaseEnum);
-		iomodel->FetchDataToInput(elements,MeshVertexonsurfaceEnum);
-	}
-}/*}}}*/
-void SmoothedSurfaceSlopeXAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
-	if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(1,MeshVertexonbaseEnum);
-	::CreateNodes(nodes,iomodel,SmoothedSurfaceSlopeXAnalysisEnum,P1Enum);
-	if(iomodel->domaintype==Domain3DEnum) iomodel->DeleteData(1,MeshVertexonbaseEnum);
-}/*}}}*/
-void SmoothedSurfaceSlopeXAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
-}/*}}}*/
-void SmoothedSurfaceSlopeXAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
-}/*}}}*/
-
-/*Finite Element Analysis*/
-void           SmoothedSurfaceSlopeXAnalysis::Core(FemModel* femmodel){/*{{{*/
-	_error_("not implemented");
-}/*}}}*/
-ElementVector* SmoothedSurfaceSlopeXAnalysis::CreateDVector(Element* element){/*{{{*/
-	/*Default, return NULL*/
-	return NULL;
-}/*}}}*/
-ElementMatrix* SmoothedSurfaceSlopeXAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
-_error_("Not implemented");
-}/*}}}*/
-ElementMatrix* SmoothedSurfaceSlopeXAnalysis::CreateKMatrix(Element* element){/*{{{*/
-
-	/* Intermediaries */
-	IssmDouble  Jdet,thickness,l=8.;
-	IssmDouble *xyz_list = NULL;
-
-	/*Fetch number of nodes and dof for this finite element*/
-	int numnodes = element->GetNumberOfNodes();
-
-	/*Initialize Element matrix and vectors*/
-	ElementMatrix* Ke     = element->NewElementMatrix();
-	IssmDouble*    dbasis = xNew<IssmDouble>(2*numnodes);
-	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
-
-	/*Retrieve all inputs and parameters*/
-	element->GetVerticesCoordinates(&xyz_list);
-	Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input);
-
-	/* Start looping on the number of gaussian points: */
-	Gauss* gauss=element->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
-
-		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
-		thickness_input->GetInputValue(&thickness,gauss);
-		if(thickness<50.) thickness=50.;
-
-		element->NodalFunctions(basis,gauss);
-		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-
-		for(int i=0;i<numnodes;i++){
-			for(int j=0;j<numnodes;j++){
-				Ke->values[i*numnodes+j] += gauss->weight*Jdet*(
-							basis[i]*basis[j]
-							+(l*thickness)*(l*thickness)*(dbasis[0*numnodes+i]*dbasis[0*numnodes+j] + dbasis[1*numnodes+i]*dbasis[1*numnodes+j])
-							);
-			}
-		}
-	}
-
-	/*Clean up and return*/
-	delete gauss;
-	xDelete<IssmDouble>(dbasis);
-	xDelete<IssmDouble>(basis);
-	xDelete<IssmDouble>(xyz_list);
-	return Ke;
-}/*}}}*/
-ElementVector* SmoothedSurfaceSlopeXAnalysis::CreatePVector(Element* element){/*{{{*/
-
-	/*Intermediaries*/
-	int      domaintype;
-	Element* basalelement;
-
-	/*Get basal element*/
-	element->FindParam(&domaintype,DomainTypeEnum);
-	switch(domaintype){
-		case Domain2DhorizontalEnum:
-			basalelement = element;
-			break;
-		case Domain3DEnum:
-			if(!element->IsOnBase()) return NULL;
-			basalelement = element->SpawnBasalElement();
-			break;
-		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
-	}
-
-	/*Intermediaries */
-	int         input_enum;
-	IssmDouble  Jdet,thickness,slope[2];
-	IssmDouble  taud_x,norms,normv,vx,vy;
-	IssmDouble *xyz_list  = NULL;
-
-	/*Fetch number of nodes and dof for this finite element*/
-	int numnodes = basalelement->GetNumberOfNodes();
-
-	/*Initialize Element vector*/
-	ElementVector* pe    = basalelement->NewElementVector();
-	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
-
-	/*Retrieve all inputs and parameters*/
-	basalelement->GetVerticesCoordinates(&xyz_list);
-	IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
-	Input* H_input       = basalelement->GetInput(ThicknessEnum); _assert_(H_input);
-	Input* surface_input = basalelement->GetInput(SurfaceEnum);   _assert_(surface_input);
-	Input* vx_input      = basalelement->GetInput(VxEnum);
-	Input* vy_input      = basalelement->GetInput(VyEnum);
-
-	/* Start  looping on the number of gaussian points: */
-	Gauss* gauss=basalelement->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
-
-		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
-		basalelement->NodalFunctions(basis,gauss);
-
-		H_input->GetInputValue(&thickness,gauss);
-		surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
-		if(vx_input && vy_input){
-			vx_input->GetInputValue(&vx,gauss);
-			vy_input->GetInputValue(&vy,gauss);
-			norms = sqrt(slope[0]*slope[0]+slope[1]*slope[1]+1.e-10);
-			normv = sqrt(vx*vx + vy*vy);
-			if(normv>15./(365.*24.*3600.)) slope[0] = -vx/normv*norms;
-		}
-		taud_x = rho_ice*gravity*thickness*slope[0];
-
-		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*taud_x*basis[i];
-	}
-
-	/*Clean up and return*/
-	xDelete<IssmDouble>(xyz_list);
-	xDelete<IssmDouble>(basis);
-	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
-	return pe;
-}/*}}}*/
-void SmoothedSurfaceSlopeXAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
-	   _error_("not implemented yet");
-}/*}}}*/
-void SmoothedSurfaceSlopeXAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
-	_error_("Not implemented yet");
-}/*}}}*/
-void SmoothedSurfaceSlopeXAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
-	element->InputUpdateFromSolutionOneDof(solution,SurfaceSlopeXEnum);
-}/*}}}*/
-void SmoothedSurfaceSlopeXAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
-	/*Default, do nothing*/
-	return;
-}/*}}}*/
Index: sm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.h
===================================================================
--- /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.h	(revision 18592)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*! \file SmoothedSurfaceSlopeXAnalysis.h 
- *  \brief: header file for generic external result object
- */
-
-#ifndef _SmoothedSurfaceSlopeXAnalysis_
-#define _SmoothedSurfaceSlopeXAnalysis_
-
-/*Headers*/
-#include "./Analysis.h"
-
-class SmoothedSurfaceSlopeXAnalysis: public Analysis{
-
-	public:
-		/*Model processing*/
-		int  DofsPerNode(int** doflist,int domaintype,int approximation);
-		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
-		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
-		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
-		void CreateLoads(Loads* loads, IoModel* iomodel);
-
-		/*Finite element Analysis*/
-		void           Core(FemModel* femmodel);
-		ElementVector* CreateDVector(Element* element);
-		ElementMatrix* CreateJacobianMatrix(Element* element);
-		ElementMatrix* CreateKMatrix(Element* element);
-		ElementVector* CreatePVector(Element* element);
-		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
-		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
-		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
-		void UpdateConstraints(FemModel* femmodel);
-};
-#endif
Index: sm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp	(revision 18592)
+++ 	(revision )
@@ -1,182 +1,0 @@
-#include "./SmoothedSurfaceSlopeYAnalysis.h"
-#include "../toolkits/toolkits.h"
-#include "../classes/classes.h"
-#include "../shared/shared.h"
-#include "../modules/modules.h"
-
-/*Model processing*/
-int  SmoothedSurfaceSlopeYAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
-	return 1;
-}/*}}}*/
-void SmoothedSurfaceSlopeYAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
-}/*}}}*/
-void SmoothedSurfaceSlopeYAnalysis::UpdateElements(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,BaseEnum);
-	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
-	if(iomodel->domaintype!=Domain2DhorizontalEnum){
-		iomodel->FetchDataToInput(elements,MeshVertexonbaseEnum);
-		iomodel->FetchDataToInput(elements,MeshVertexonsurfaceEnum);
-	}
-}/*}}}*/
-void SmoothedSurfaceSlopeYAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
-	if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(1,MeshVertexonbaseEnum);
-	::CreateNodes(nodes,iomodel,SmoothedSurfaceSlopeYAnalysisEnum,P1Enum);
-	if(iomodel->domaintype==Domain3DEnum) iomodel->DeleteData(1,MeshVertexonbaseEnum);
-}/*}}}*/
-void SmoothedSurfaceSlopeYAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
-}/*}}}*/
-void SmoothedSurfaceSlopeYAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
-}/*}}}*/
-
-/*Finite Element Analysis*/
-void           SmoothedSurfaceSlopeYAnalysis::Core(FemModel* femmodel){/*{{{*/
-	_error_("not implemented");
-}/*}}}*/
-ElementVector* SmoothedSurfaceSlopeYAnalysis::CreateDVector(Element* element){/*{{{*/
-	/*Default, return NULL*/
-	return NULL;
-}/*}}}*/
-ElementMatrix* SmoothedSurfaceSlopeYAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
-_error_("Not implemented");
-}/*}}}*/
-ElementMatrix* SmoothedSurfaceSlopeYAnalysis::CreateKMatrix(Element* element){/*{{{*/
-
-	/* Intermediaries */
-	IssmDouble  Jdet,thickness,l=8.;
-	IssmDouble *xyz_list = NULL;
-
-	/*Fetch number of nodes and dof for this finite element*/
-	int numnodes = element->GetNumberOfNodes();
-
-	/*Initialize Element matrix and vectors*/
-	ElementMatrix* Ke     = element->NewElementMatrix();
-	IssmDouble*    dbasis = xNew<IssmDouble>(2*numnodes);
-	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
-
-	/*Retrieve all inputs and parameters*/
-	element->GetVerticesCoordinates(&xyz_list);
-	Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input);
-
-	/* Start looping on the number of gaussian points: */
-	Gauss* gauss=element->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
-
-		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
-		thickness_input->GetInputValue(&thickness,gauss);
-		if(thickness<50.) thickness=50.;
-
-		element->NodalFunctions(basis,gauss);
-		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-
-		for(int i=0;i<numnodes;i++){
-			for(int j=0;j<numnodes;j++){
-				Ke->values[i*numnodes+j] += gauss->weight*Jdet*(
-							basis[i]*basis[j]
-							+(l*thickness)*(l*thickness)*(dbasis[0*numnodes+i]*dbasis[0*numnodes+j] + dbasis[1*numnodes+i]*dbasis[1*numnodes+j])
-							);
-			}
-		}
-	}
-
-	/*Clean up and return*/
-	delete gauss;
-	xDelete<IssmDouble>(dbasis);
-	xDelete<IssmDouble>(basis);
-	xDelete<IssmDouble>(xyz_list);
-	return Ke;
-}/*}}}*/
-ElementVector* SmoothedSurfaceSlopeYAnalysis::CreatePVector(Element* element){/*{{{*/
-
-	/*Intermediaries*/
-	int      domaintype;
-	Element* basalelement;
-
-	/*Get basal element*/
-	element->FindParam(&domaintype,DomainTypeEnum);
-	switch(domaintype){
-		case Domain2DhorizontalEnum:
-			basalelement = element;
-			break;
-		case Domain3DEnum:
-			if(!element->IsOnBase()) return NULL;
-			basalelement = element->SpawnBasalElement();
-			break;
-		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
-	}
-
-	/*Intermediaries */
-	IssmDouble  Jdet,thickness,slope[2];
-	IssmDouble  taud_y,norms,normv,vx,vy;
-	IssmDouble *xyz_list  = NULL;
-
-	/*Fetch number of nodes and dof for this finite element*/
-	int numnodes = basalelement->GetNumberOfNodes();
-
-	/*Initialize Element vector*/
-	ElementVector* pe    = basalelement->NewElementVector();
-	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
-
-	/*Retrieve all inputs and parameters*/
-	basalelement->GetVerticesCoordinates(&xyz_list);
-	IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
-	Input* H_input       = basalelement->GetInput(ThicknessEnum); _assert_(H_input);
-	Input* surface_input = basalelement->GetInput(SurfaceEnum);   _assert_(surface_input);
-	Input* vx_input      = basalelement->GetInput(VxEnum);
-	Input* vy_input      = basalelement->GetInput(VyEnum);
-
-	/* Start  looping on the number of gaussian points: */
-	Gauss* gauss=basalelement->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
-
-		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
-		basalelement->NodalFunctions(basis,gauss);
-
-		H_input->GetInputValue(&thickness,gauss);
-		surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
-		if(vx_input && vy_input){
-			vx_input->GetInputValue(&vx,gauss);
-			vy_input->GetInputValue(&vy,gauss);
-			norms = sqrt(slope[0]*slope[0]+slope[1]*slope[1]+1.e-10);
-			normv = sqrt(vx*vx + vy*vy);
-			if(normv>15./(365.*24.*3600.)) slope[1] = -vy/normv*norms;
-		}
-		taud_y = rho_ice*gravity*thickness*slope[1];
-
-		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*taud_y*basis[i];
-	}
-
-	/*Clean up and return*/
-	xDelete<IssmDouble>(xyz_list);
-	xDelete<IssmDouble>(basis);
-	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
-	return pe;
-}/*}}}*/
-void SmoothedSurfaceSlopeYAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
-	   _error_("not implemented yet");
-}/*}}}*/
-void SmoothedSurfaceSlopeYAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
-	_error_("Not implemented yet");
-}/*}}}*/
-void SmoothedSurfaceSlopeYAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
-	element->InputUpdateFromSolutionOneDof(solution,SurfaceSlopeYEnum);
-}/*}}}*/
-void SmoothedSurfaceSlopeYAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
-	/*Default, do nothing*/
-	return;
-}/*}}}*/
Index: sm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.h
===================================================================
--- /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.h	(revision 18592)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*! \file SmoothedSurfaceSlopeYAnalysis.h 
- *  \brief: header file for generic external result object
- */
-
-#ifndef _SmoothedSurfaceSlopeYAnalysis_
-#define _SmoothedSurfaceSlopeYAnalysis_
-
-/*Headers*/
-#include "./Analysis.h"
-
-class SmoothedSurfaceSlopeYAnalysis: public Analysis{
-
-	public:
-		/*Model processing*/
-		int  DofsPerNode(int** doflist,int domaintype,int approximation);
-		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
-		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
-		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
-		void CreateLoads(Loads* loads, IoModel* iomodel);
-
-		/*Finite element Analysis*/
-		void           Core(FemModel* femmodel);
-		ElementVector* CreateDVector(Element* element);
-		ElementMatrix* CreateJacobianMatrix(Element* element);
-		ElementMatrix* CreateKMatrix(Element* element);
-		ElementVector* CreatePVector(Element* element);
-		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
-		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
-		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
-		void UpdateConstraints(FemModel* femmodel);
-};
-#endif
Index: /issm/trunk-jpl/src/c/analyses/analyses.h
===================================================================
--- /issm/trunk-jpl/src/c/analyses/analyses.h	(revision 18592)
+++ /issm/trunk-jpl/src/c/analyses/analyses.h	(revision 18593)
@@ -32,6 +32,5 @@
 #include "./MeltingAnalysis.h"
 #include "./MeshdeformationAnalysis.h"
-#include "./SmoothedSurfaceSlopeXAnalysis.h"
-#include "./SmoothedSurfaceSlopeYAnalysis.h"
+#include "./SmoothAnalysis.h"
 #include "./SeaiceAnalysis.h"
 #include "./StressbalanceAnalysis.h"
Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 18592)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 18593)
@@ -475,6 +475,5 @@
 		case BalancevelocitySolutionEnum:
 			analyses_temp[numanalyses++]=BalancevelocityAnalysisEnum;
-			analyses_temp[numanalyses++]=SmoothedSurfaceSlopeXAnalysisEnum;
-			analyses_temp[numanalyses++]=SmoothedSurfaceSlopeYAnalysisEnum;
+			analyses_temp[numanalyses++]=SmoothAnalysisEnum;
 			break;
 
Index: /issm/trunk-jpl/src/c/cores/balancevelocity_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/cores/balancevelocity_core.cpp	(revision 18592)
+++ /issm/trunk-jpl/src/c/cores/balancevelocity_core.cpp	(revision 18593)
@@ -19,9 +19,9 @@
 
 	if(VerboseSolution()) _printf0_("computing smoothed slopes:\n");
-	femmodel->SetCurrentConfiguration(SmoothedSurfaceSlopeXAnalysisEnum);
+	femmodel->SetCurrentConfiguration(SmoothAnalysisEnum);
+	femmodel->parameters->SetParam(DrivingStressXEnum,InputToSmoothEnum);
 	solutionsequence_linear(femmodel);
-	femmodel->SetCurrentConfiguration(SmoothedSurfaceSlopeYAnalysisEnum);
+	femmodel->parameters->SetParam(DrivingStressYEnum,InputToSmoothEnum);
 	solutionsequence_linear(femmodel);
-	//surfaceslope_core(femmodel);
 
 	if(VerboseSolution()) _printf0_("call computational core:\n");
@@ -31,5 +31,5 @@
 	if(save_results){
 		if(VerboseSolution()) _printf0_("   saving results\n");
-		int outputs[3] = {SurfaceSlopeXEnum,SurfaceSlopeYEnum,VelEnum};
+		int outputs[3] = {DrivingStressXEnum,DrivingStressYEnum,VelEnum};
 		femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],3);
 	}
Index: /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18592)
+++ /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18593)
@@ -388,6 +388,5 @@
 	SteadystateSolutionEnum,
 	SurfaceSlopeSolutionEnum,
-	SmoothedSurfaceSlopeXAnalysisEnum,
-	SmoothedSurfaceSlopeYAnalysisEnum,
+	SmoothAnalysisEnum,
 	ThermalAnalysisEnum,
 	ThermalSolutionEnum,
@@ -450,4 +449,5 @@
 	InputToL2ProjectEnum,
 	InputToDepthaverageEnum,
+	InputToSmoothEnum,
 	IntParamEnum,
 	IntVecParamEnum,
@@ -563,4 +563,6 @@
 	HydrologyWaterVxEnum,
 	HydrologyWaterVyEnum,
+	DrivingStressXEnum,
+	DrivingStressYEnum,
 	SigmaNNEnum,
 	StressTensorEnum,
Index: /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18592)
+++ /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18593)
@@ -391,6 +391,5 @@
 		case SteadystateSolutionEnum : return "SteadystateSolution";
 		case SurfaceSlopeSolutionEnum : return "SurfaceSlopeSolution";
-		case SmoothedSurfaceSlopeXAnalysisEnum : return "SmoothedSurfaceSlopeXAnalysis";
-		case SmoothedSurfaceSlopeYAnalysisEnum : return "SmoothedSurfaceSlopeYAnalysis";
+		case SmoothAnalysisEnum : return "SmoothAnalysis";
 		case ThermalAnalysisEnum : return "ThermalAnalysis";
 		case ThermalSolutionEnum : return "ThermalSolution";
@@ -447,4 +446,5 @@
 		case InputToL2ProjectEnum : return "InputToL2Project";
 		case InputToDepthaverageEnum : return "InputToDepthaverage";
+		case InputToSmoothEnum : return "InputToSmooth";
 		case IntParamEnum : return "IntParam";
 		case IntVecParamEnum : return "IntVecParam";
@@ -554,4 +554,6 @@
 		case HydrologyWaterVxEnum : return "HydrologyWaterVx";
 		case HydrologyWaterVyEnum : return "HydrologyWaterVy";
+		case DrivingStressXEnum : return "DrivingStressX";
+		case DrivingStressYEnum : return "DrivingStressY";
 		case SigmaNNEnum : return "SigmaNN";
 		case StressTensorEnum : return "StressTensor";
Index: /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18592)
+++ /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18593)
@@ -400,6 +400,5 @@
 	      else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
 	      else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
-	      else if (strcmp(name,"SmoothedSurfaceSlopeXAnalysis")==0) return SmoothedSurfaceSlopeXAnalysisEnum;
-	      else if (strcmp(name,"SmoothedSurfaceSlopeYAnalysis")==0) return SmoothedSurfaceSlopeYAnalysisEnum;
+	      else if (strcmp(name,"SmoothAnalysis")==0) return SmoothAnalysisEnum;
 	      else if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum;
 	      else if (strcmp(name,"ThermalSolution")==0) return ThermalSolutionEnum;
@@ -456,4 +455,5 @@
 	      else if (strcmp(name,"InputToL2Project")==0) return InputToL2ProjectEnum;
 	      else if (strcmp(name,"InputToDepthaverage")==0) return InputToDepthaverageEnum;
+	      else if (strcmp(name,"InputToSmooth")==0) return InputToSmoothEnum;
 	      else if (strcmp(name,"IntParam")==0) return IntParamEnum;
 	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
@@ -566,4 +566,6 @@
 	      else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
 	      else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
+	      else if (strcmp(name,"DrivingStressX")==0) return DrivingStressXEnum;
+	      else if (strcmp(name,"DrivingStressY")==0) return DrivingStressYEnum;
 	      else if (strcmp(name,"SigmaNN")==0) return SigmaNNEnum;
 	      else if (strcmp(name,"StressTensor")==0) return StressTensorEnum;
@@ -627,10 +629,10 @@
 	      else if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum;
 	      else if (strcmp(name,"Outputdefinition")==0) return OutputdefinitionEnum;
-	      else if (strcmp(name,"OutputdefinitionList")==0) return OutputdefinitionListEnum;
-	      else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
          else stage=6;
    }
    if(stage==6){
-	      if (strcmp(name,"MassfluxatgateName")==0) return MassfluxatgateNameEnum;
+	      if (strcmp(name,"OutputdefinitionList")==0) return OutputdefinitionListEnum;
+	      else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
+	      else if (strcmp(name,"MassfluxatgateName")==0) return MassfluxatgateNameEnum;
 	      else if (strcmp(name,"MassfluxatgateSegments")==0) return MassfluxatgateSegmentsEnum;
 	      else if (strcmp(name,"MisfitName")==0) return MisfitNameEnum;
@@ -750,10 +752,10 @@
 	      else if (strcmp(name,"SurfaceforcingsRhoAir")==0) return SurfaceforcingsRhoAirEnum;
 	      else if (strcmp(name,"SurfaceforcingsAirCoef")==0) return SurfaceforcingsAirCoefEnum;
-	      else if (strcmp(name,"SurfaceforcingsAirLinDragCoef")==0) return SurfaceforcingsAirLinDragCoefEnum;
-	      else if (strcmp(name,"SurfaceforcingsAirQuadDragCoef")==0) return SurfaceforcingsAirQuadDragCoefEnum;
          else stage=7;
    }
    if(stage==7){
-	      if (strcmp(name,"SurfaceforcingsWindVx")==0) return SurfaceforcingsWindVxEnum;
+	      if (strcmp(name,"SurfaceforcingsAirLinDragCoef")==0) return SurfaceforcingsAirLinDragCoefEnum;
+	      else if (strcmp(name,"SurfaceforcingsAirQuadDragCoef")==0) return SurfaceforcingsAirQuadDragCoefEnum;
+	      else if (strcmp(name,"SurfaceforcingsWindVx")==0) return SurfaceforcingsWindVxEnum;
 	      else if (strcmp(name,"SurfaceforcingsWindVy")==0) return SurfaceforcingsWindVyEnum;
 	      else if (strcmp(name,"Matseaice")==0) return MatseaiceEnum;
Index: /issm/trunk-jpl/src/m/classes/inversionvalidation.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/inversionvalidation.m	(revision 18592)
+++ /issm/trunk-jpl/src/m/classes/inversionvalidation.m	(revision 18593)
@@ -18,4 +18,5 @@
 		vel_obs                     = NaN
 		thickness_obs               = NaN
+		surface_obs               = NaN
 	end
 	methods
@@ -54,5 +55,5 @@
 			md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',...
 				{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'DamageDbar' 'Vx' 'Vy' 'Thickness',...
-				'BalancethicknessNu' 'BalancethicknessApparentMassbalance'});
+				'BalancethicknessOmega' 'BalancethicknessApparentMassbalance'});
 			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',[101:105 201 501:506 601:604]);
 			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
@@ -84,4 +85,5 @@
 			fielddisplay(obj,'vel_obs','observed velocity magnitude [m/yr]');
 			fielddisplay(obj,'thickness_obs','observed thickness [m]');
+			fielddisplay(obj,'surface_obs','observed surface elevation [m]');
 			disp('Available cost functions:');
 			disp('   101: SurfaceAbsVelMisfit');
@@ -115,4 +117,5 @@
 			end
 			WriteData(fid,'object',obj,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
+			WriteData(fid,'object',obj,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
 
 			%process control parameters
@@ -140,4 +143,5 @@
 			pos=find(obj.cost_functions==505); data(pos)=ThicknessAcrossGradientEnum();
 			pos=find(obj.cost_functions==506); data(pos)=BalancethicknessMisfitEnum();
+			pos=find(obj.cost_functions==601); data(pos)=SurfaceAbsMisfitEnum();
 			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);
 			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');
Index: /issm/trunk-jpl/src/m/enum/DrivingStressXEnum.m
===================================================================
--- /issm/trunk-jpl/src/m/enum/DrivingStressXEnum.m	(revision 18593)
+++ /issm/trunk-jpl/src/m/enum/DrivingStressXEnum.m	(revision 18593)
@@ -0,0 +1,11 @@
+function macro=DrivingStressXEnum()
+%DRIVINGSTRESSXENUM - Enum of DrivingStressX
+%
+%   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=DrivingStressXEnum()
+
+macro=StringToEnum('DrivingStressX');
Index: /issm/trunk-jpl/src/m/enum/DrivingStressYEnum.m
===================================================================
--- /issm/trunk-jpl/src/m/enum/DrivingStressYEnum.m	(revision 18593)
+++ /issm/trunk-jpl/src/m/enum/DrivingStressYEnum.m	(revision 18593)
@@ -0,0 +1,11 @@
+function macro=DrivingStressYEnum()
+%DRIVINGSTRESSYENUM - Enum of DrivingStressY
+%
+%   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=DrivingStressYEnum()
+
+macro=StringToEnum('DrivingStressY');
Index: /issm/trunk-jpl/src/m/enum/EnumDefinitions.py
===================================================================
--- /issm/trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18592)
+++ /issm/trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18593)
@@ -383,6 +383,5 @@
 def SteadystateSolutionEnum(): return StringToEnum("SteadystateSolution")[0]
 def SurfaceSlopeSolutionEnum(): return StringToEnum("SurfaceSlopeSolution")[0]
-def SmoothedSurfaceSlopeXAnalysisEnum(): return StringToEnum("SmoothedSurfaceSlopeXAnalysis")[0]
-def SmoothedSurfaceSlopeYAnalysisEnum(): return StringToEnum("SmoothedSurfaceSlopeYAnalysis")[0]
+def SmoothAnalysisEnum(): return StringToEnum("SmoothAnalysis")[0]
 def ThermalAnalysisEnum(): return StringToEnum("ThermalAnalysis")[0]
 def ThermalSolutionEnum(): return StringToEnum("ThermalSolution")[0]
@@ -439,4 +438,5 @@
 def InputToL2ProjectEnum(): return StringToEnum("InputToL2Project")[0]
 def InputToDepthaverageEnum(): return StringToEnum("InputToDepthaverage")[0]
+def InputToSmoothEnum(): return StringToEnum("InputToSmooth")[0]
 def IntParamEnum(): return StringToEnum("IntParam")[0]
 def IntVecParamEnum(): return StringToEnum("IntVecParam")[0]
@@ -546,4 +546,6 @@
 def HydrologyWaterVxEnum(): return StringToEnum("HydrologyWaterVx")[0]
 def HydrologyWaterVyEnum(): return StringToEnum("HydrologyWaterVy")[0]
+def DrivingStressXEnum(): return StringToEnum("DrivingStressX")[0]
+def DrivingStressYEnum(): return StringToEnum("DrivingStressY")[0]
 def SigmaNNEnum(): return StringToEnum("SigmaNN")[0]
 def StressTensorEnum(): return StringToEnum("StressTensor")[0]
Index: /issm/trunk-jpl/src/m/enum/InputToSmoothEnum.m
===================================================================
--- /issm/trunk-jpl/src/m/enum/InputToSmoothEnum.m	(revision 18593)
+++ /issm/trunk-jpl/src/m/enum/InputToSmoothEnum.m	(revision 18593)
@@ -0,0 +1,11 @@
+function macro=InputToSmoothEnum()
+%INPUTTOSMOOTHENUM - Enum of InputToSmooth
+%
+%   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=InputToSmoothEnum()
+
+macro=StringToEnum('InputToSmooth');
Index: /issm/trunk-jpl/src/m/enum/SmoothAnalysisEnum.m
===================================================================
--- /issm/trunk-jpl/src/m/enum/SmoothAnalysisEnum.m	(revision 18593)
+++ /issm/trunk-jpl/src/m/enum/SmoothAnalysisEnum.m	(revision 18593)
@@ -0,0 +1,11 @@
+function macro=SmoothAnalysisEnum()
+%SMOOTHANALYSISENUM - Enum of SmoothAnalysis
+%
+%   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=SmoothAnalysisEnum()
+
+macro=StringToEnum('SmoothAnalysis');
Index: /issm/trunk-jpl/test/NightlyRun/test530.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test530.m	(revision 18592)
+++ /issm/trunk-jpl/test/NightlyRun/test530.m	(revision 18593)
@@ -7,9 +7,9 @@
 
 %Fields and tolerances to track changes
-field_names     ={'SurfaceSlopeX','SurfaceSlopeX','Vel'};
+field_names     ={'DrivingStressX','DrivingStressX','Vel'};
 field_tolerances={1e-13,1e-13,1e-13};
 field_values={...
-	(md.results.BalancevelocitySolution.SurfaceSlopeX),...
-	(md.results.BalancevelocitySolution.SurfaceSlopeY),...
+	(md.results.BalancevelocitySolution.DrivingStressX),...
+	(md.results.BalancevelocitySolution.DrivingStressY),...
 	(md.results.BalancevelocitySolution.Vel),...
 	};
Index: /issm/trunk-jpl/test/NightlyRun/test530.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test530.py	(revision 18592)
+++ /issm/trunk-jpl/test/NightlyRun/test530.py	(revision 18593)
@@ -16,9 +16,9 @@
 
 # Fields and tolerances to track changes
-field_names     =['SurfaceSlopeX','SurfaceSlopeY','Vel']
+field_names     =['DrivingStressX','DrivingStressY','Vel']
 field_tolerances=[1e-13,1e-13,1e-13]
 field_values=[\
-		md.results.BalancevelocitySolution.SurfaceSlopeX,\
-		md.results.BalancevelocitySolution.SurfaceSlopeY,\
+		md.results.BalancevelocitySolution.DrivingStressX,\
+		md.results.BalancevelocitySolution.DrivingStressY,\
 		md.results.BalancevelocitySolution.Vel,\
 		]
Index: /issm/trunk-jpl/test/NightlyRun/test531.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test531.m	(revision 18592)
+++ /issm/trunk-jpl/test/NightlyRun/test531.m	(revision 18593)
@@ -9,9 +9,9 @@
 
 %Fields and tolerances to track changes
-field_names     ={'SurfaceSlopeX','SurfaceSlopeX','Vel'};
+field_names     ={'DrivingStressX','DrivingStressX','Vel'};
 field_tolerances={1e-13,1e-13,1e-13};
 field_values={...
-	(md.results.BalancevelocitySolution.SurfaceSlopeX),...
-	(md.results.BalancevelocitySolution.SurfaceSlopeY),...
+	(md.results.BalancevelocitySolution.DrivingStressX),...
+	(md.results.BalancevelocitySolution.DrivingStressY),...
 	(md.results.BalancevelocitySolution.Vel),...
 	};
Index: /issm/trunk-jpl/test/NightlyRun/test531.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test531.py	(revision 18592)
+++ /issm/trunk-jpl/test/NightlyRun/test531.py	(revision 18593)
@@ -18,9 +18,9 @@
 
 # Fields and tolerances to track changes
-field_names     =['SurfaceSlopeX','SurfaceSlopeY','Vel']
+field_names     =['DrivingStressX','DrivingStressY','Vel']
 field_tolerances=[1e-13,1e-13,1e-13]
 field_values=[\
-		md.results.BalancevelocitySolution.SurfaceSlopeX,\
-		md.results.BalancevelocitySolution.SurfaceSlopeY,\
+		md.results.BalancevelocitySolution.DrivingStressX,\
+		md.results.BalancevelocitySolution.DrivingStressY,\
 		md.results.BalancevelocitySolution.Vel,\
 		]
