Index: issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 14158)
+++ issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 14159)
@@ -235,4 +235,6 @@
 	BalancethicknessAnalysisEnum,
 	BalancethicknessSolutionEnum,
+	WeakBalancethicknessAnalysisEnum,
+	WeakBalancethicknessSolutionEnum,
 	BedSlopeAnalysisEnum,
 	BedSlopeSolutionEnum,
@@ -355,4 +357,5 @@
 	AdjointyEnum,
 	AdjointzEnum,
+	BalancethicknessMisfitEnum,
 	BedSlopeXEnum,
 	BedSlopeYEnum,
Index: issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- issm/trunk-jpl/src/c/Makefile.am	(revision 14158)
+++ issm/trunk-jpl/src/c/Makefile.am	(revision 14159)
@@ -475,5 +475,6 @@
 					    ./modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp\
 						./modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp\
-						./solutions/balancethickness_core.cpp
+						./solutions/balancethickness_core.cpp \
+						./solutions/dummy_core.cpp
 #}}}
 #Slope sources  {{{
Index: issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 14158)
+++ issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 14159)
@@ -702,4 +702,5 @@
 		case ThicknessAlongGradientEnum: ThicknessAlongGradientx(responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
 		case ThicknessAcrossGradientEnum:ThicknessAcrossGradientx(responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+		case BalancethicknessMisfitEnum:BalancethicknessMisfitx(responses,process_units,weight_index); break;
 		case TotalSmbEnum:					this->TotalSmbx(responses,process_units); break;
 		case RheologyBbarAbsGradientEnum:RheologyBbarAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
@@ -1358,4 +1359,23 @@
 #endif
 #ifdef _HAVE_CONTROL_
+void FemModel::BalancethicknessMisfitx(IssmDouble* presponse,bool process_units,int weight_index){/*{{{*/
+
+	IssmDouble J = 0;
+	IssmDouble J_sum;
+
+	for(int i=0;i<this->elements->Size();i++){
+		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
+		J+=element->BalancethicknessMisfit(process_units,weight_index);
+	}
+	#ifdef _HAVE_MPI_
+	MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,IssmComm::GetComm() );
+	MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,IssmComm::GetComm());
+	J=J_sum;
+	#endif
+
+	/*Assign output pointers: */
+	*presponse=J;
+
+}/*}}}*/
 void FemModel::ThicknessAbsGradientx( IssmDouble* pJ, bool process_units, int weight_index){/*{{{*/
 
Index: issm/trunk-jpl/src/c/classes/FemModel.h
===================================================================
--- issm/trunk-jpl/src/c/classes/FemModel.h	(revision 14158)
+++ issm/trunk-jpl/src/c/classes/FemModel.h	(revision 14159)
@@ -80,4 +80,5 @@
 		void IceVolumex(IssmDouble* pV,bool process_units);
 		void ElementResponsex(IssmDouble* presponse,int response_enum,bool process_units);
+		void BalancethicknessMisfitx(IssmDouble* pV,bool process_units,int weight_index);
 		#endif
 		#ifdef  _HAVE_DAKOTA_
Index: issm/trunk-jpl/src/c/classes/objects/Elements/Element.h
===================================================================
--- issm/trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 14158)
+++ issm/trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 14159)
@@ -110,4 +110,5 @@
 		virtual IssmDouble ThicknessAlongGradient(bool process_units,int weight_index)=0;
 		virtual IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index)=0;
+		virtual IssmDouble BalancethicknessMisfit(bool process_units,int weight_index)=0;
 		virtual IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index)=0;
 		virtual IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index)=0;
Index: issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h
===================================================================
--- issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 14158)
+++ issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 14159)
@@ -166,4 +166,5 @@
 		IssmDouble ThicknessAlongGradient( bool process_units,int weight_index){_error_("not supported");};
 		IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index){_error_("not supported");};
+		IssmDouble BalancethicknessMisfit(bool process_units,int weight_index){_error_("not supported");};
 		void   InputControlUpdate(IssmDouble scalar,bool save_parameter);
 		#endif
Index: issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
===================================================================
--- issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 14158)
+++ issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 14159)
@@ -1550,4 +1550,12 @@
 						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(VyEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+					}
+					break;
+				case ThicknessEnum:
+					if (iomodel->Data(ThicknessEnum)){
+						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(ThicknessEnum)[tria_vertex_ids[j]-1];
+						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
+						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
+						this->inputs->AddInput(new ControlInput(ThicknessEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
@@ -3459,4 +3467,62 @@
 
 #ifdef _HAVE_CONTROL_
+/*FUNCTION Tria::BalancethicknessMisfit{{{*/
+IssmDouble Tria::BalancethicknessMisfit(bool process_units,int weight_index){
+
+	/* Intermediaries */
+	IssmDouble Jelem = 0;
+	IssmDouble weight;
+	IssmDouble Jdet,temp;
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble dH[2];
+	IssmDouble vx,vy,H;
+	IssmDouble dvx[2],dvy[2];
+	IssmDouble dhdt,basal_melting,surface_mass_balance;
+	GaussTria *gauss = NULL;
+
+	/*If on water, return 0: */
+	if(IsOnWater()) return 0;
+
+	/*Retrieve all inputs we will be needing: */
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+	Input* weights_input              = inputs->GetInput(InversionCostFunctionsCoefficientsEnum);   _assert_(weights_input);
+	Input* thickness_input            = inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* vx_input                   = inputs->GetInput(VxEnum);                                 _assert_(vx_input);
+	Input* vy_input                   = inputs->GetInput(VyEnum);                                 _assert_(vy_input);
+	Input* surface_mass_balance_input = inputs->GetInput(SurfaceforcingsMassBalanceEnum);         _assert_(surface_mass_balance_input);
+	Input* basal_melting_input        = inputs->GetInput(BasalforcingsMeltingRateEnum);           _assert_(basal_melting_input);
+	Input* dhdt_input                 = inputs->GetInput(BalancethicknessThickeningRateEnum);     _assert_(dhdt_input);
+
+	/* Start looping on the number of gaussian points: */
+	gauss=new GaussTria(2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+
+		/* Get Jacobian determinant: */
+		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+
+		/*Get all parameters at gaussian point*/
+		weights_input->GetInputValue(&weight,gauss,weight_index);
+		thickness_input->GetInputValue(&H, gauss);
+		thickness_input->GetInputDerivativeValue(&dH[0],&xyz_list[0][0],gauss);
+		surface_mass_balance_input->GetInputValue(&surface_mass_balance,gauss);
+		basal_melting_input->GetInputValue(&basal_melting,gauss);
+		dhdt_input->GetInputValue(&dhdt,gauss);
+		vx_input->GetInputValue(&vx,gauss);
+		vx_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
+		vy_input->GetInputValue(&vy,gauss);
+		vy_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
+
+		/*Weak balance thickness J = 1/2 (div(Hv)-a)^2*/
+		temp  = vx*dH[0]+vy*dH[1]+H*(dvx[0]+dvy[1]) - (surface_mass_balance-basal_melting-dhdt);
+		Jelem+=weight*1/2*temp*temp*Jdet*gauss->weight;
+	}
+
+	/*Clean up and return*/
+	delete gauss;
+	return Jelem;
+}
+/*}}}*/
 /*FUNCTION Tria::InputControlUpdate{{{*/
 void  Tria::InputControlUpdate(IssmDouble scalar,bool save_parameter){
@@ -3580,4 +3646,7 @@
 			GradjVyBalancedthickness(gradient,control_index);
 			break;
+		case ThicknessEnum:
+			GradjThicknessWeakBalancedthickness(gradient,control_index);
+			break;
 		default:
 			_error_("control type not supported yet: " << control_type);
@@ -3597,4 +3666,5 @@
 		case ThicknessAlongGradientEnum:
 		case ThicknessAcrossGradientEnum:
+		case BalancethicknessMisfitEnum:
 		case SurfaceAbsVelMisfitEnum:
 		case SurfaceRelVelMisfitEnum:
@@ -4042,4 +4112,114 @@
 	/*Clean up and return*/
 	delete gauss;
+}
+/*}}}*/
+/*FUNCTION Tria::GradjThicknessWeakBalancedthickness{{{*/
+void  Tria::GradjThicknessWeakBalancedthickness(Vector<IssmDouble>* gradient,int control_index){
+
+	/*Intermediaries */
+	int         i,resp;
+	int         vertexpidlist[NUMVERTICES];
+	IssmDouble  Jdet;
+	IssmDouble  thickness,thicknessobs,weight;
+	int         num_responses;
+	IssmDouble  xyz_list[NUMVERTICES][3];
+	IssmDouble  basis[3];
+	IssmDouble  dbasis[NDOF2][NUMVERTICES];
+	IssmDouble  dH[2];
+	IssmDouble  vx,vy,vel;
+	IssmDouble  dvx[2],dvy[2];
+	IssmDouble dhdt,basal_melting,surface_mass_balance;
+	GaussTria *gauss     = NULL;
+	int       *responses = NULL;
+	IssmDouble grade_g[NUMVERTICES] = {0.0};
+
+	/* Get node coordinates and dof list: */
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+	GradientIndexing(&vertexpidlist[0],control_index);
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
+	Input* thickness_input            = inputs->GetInput(ThicknessEnum);                          _assert_(thickness_input);
+	Input* thicknessobs_input         = inputs->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
+	Input* weights_input              = inputs->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+	Input* vx_input                   = inputs->GetInput(VxEnum);                                 _assert_(vx_input);
+	Input* vy_input                   = inputs->GetInput(VyEnum);                                 _assert_(vy_input);
+	Input* surface_mass_balance_input = inputs->GetInput(SurfaceforcingsMassBalanceEnum);         _assert_(surface_mass_balance_input);
+	Input* basal_melting_input        = inputs->GetInput(BasalforcingsMeltingRateEnum);           _assert_(basal_melting_input);
+	Input* dhdt_input                 = inputs->GetInput(BalancethicknessThickeningRateEnum);     _assert_(dhdt_input);
+
+	/* Start  looping on the number of gaussian points: */
+	gauss=new GaussTria(2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+
+		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+		GetNodalFunctions(basis, gauss);
+		GetNodalFunctionsDerivatives(&dbasis[0][0],&xyz_list[0][0],gauss);
+
+		thickness_input->GetInputValue(&thickness, gauss);
+		thickness_input->GetInputDerivativeValue(&dH[0],&xyz_list[0][0],gauss);
+		thicknessobs_input->GetInputValue(&thicknessobs, gauss);
+
+		/*Loop over all requested responses*/
+		for(resp=0;resp<num_responses;resp++) switch(responses[resp]){
+
+			case ThicknessAbsMisfitEnum:
+				weights_input->GetInputValue(&weight, gauss,resp);
+				for(i=0;i<NUMVERTICES;i++) grade_g[i]+= (thicknessobs-thickness)*weight*Jdet*gauss->weight*basis[i];
+				break;
+			case ThicknessAbsGradientEnum:
+				weights_input->GetInputValue(&weight, gauss,resp);
+				for(i=0;i<NUMVERTICES;i++) grade_g[i]+= - weight*dH[0]*dbasis[0][i]*Jdet*gauss->weight;
+				for(i=0;i<NUMVERTICES;i++) grade_g[i]+= - weight*dH[1]*dbasis[1][i]*Jdet*gauss->weight;
+				break;
+			case ThicknessAlongGradientEnum:
+				weights_input->GetInputValue(&weight, gauss,resp);
+				vx_input->GetInputValue(&vx,gauss);
+				vy_input->GetInputValue(&vy,gauss);
+				vel = sqrt(vx*vx+vy*vy);
+				vx  = vx/(vel+1.e-9);
+				vy  = vy/(vel+1.e-9);
+				for(i=0;i<NUMVERTICES;i++) grade_g[i]+= - weight*(dH[0]*vx+dH[1]*vy)*(dbasis[0][i]*vx+dbasis[1][i]*vy)*Jdet*gauss->weight;
+				break;
+			case ThicknessAcrossGradientEnum:
+				weights_input->GetInputValue(&weight, gauss,resp);
+				vx_input->GetInputValue(&vx,gauss);
+				vy_input->GetInputValue(&vy,gauss);
+				vel = sqrt(vx*vx+vy*vy);
+				vx  = vx/(vel+1.e-9);
+				vy  = vy/(vel+1.e-9);
+				for(i=0;i<NUMVERTICES;i++) grade_g[i]+= - weight*(dH[0]*(-vy)+dH[1]*vx)*(dbasis[0][i]*(-vy)+dbasis[1][i]*vx)*Jdet*gauss->weight;
+				break;
+			case BalancethicknessMisfitEnum:
+				weights_input->GetInputValue(&weight, gauss,resp);
+				surface_mass_balance_input->GetInputValue(&surface_mass_balance,gauss);
+				basal_melting_input->GetInputValue(&basal_melting,gauss);
+				dhdt_input->GetInputValue(&dhdt,gauss);
+				vx_input->GetInputValue(&vx,gauss);
+				vx_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
+				vy_input->GetInputValue(&vy,gauss);
+				vy_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
+				for(i=0;i<NUMVERTICES;i++){
+					grade_g[i]+= - weight*Jdet*gauss->weight*(
+								(vx*dH[0]+vy*dH[1] + thickness*(dvx[0]+dvy[1]))*(vx*dbasis[0][i]+ vy*dbasis[1][i] + basis[i]*(dvx[0]+dvy[1]))
+								-(surface_mass_balance-basal_melting-dhdt)*(vx*dbasis[0][i]+ vy*dbasis[1][i] + basis[i]*(dvx[0]+dvy[1]))
+								);
+				}
+				break;
+			default:
+				_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+		}
+	}
+
+
+	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+
+	/*Clean up and return*/
+	delete gauss;
+	xDelete<int>(responses);
 }
 /*}}}*/
Index: issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h
===================================================================
--- issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 14158)
+++ issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 14159)
@@ -153,4 +153,5 @@
 		void   GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
 		void   GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
+		void   GradjThicknessWeakBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
 		void   GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
 		void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
@@ -164,4 +165,5 @@
 		IssmDouble ThicknessAlongGradient( bool process_units,int weight_index);
 		IssmDouble ThicknessAcrossGradient(bool process_units,int weight_index);
+		IssmDouble BalancethicknessMisfit(     bool process_units,int weight_index);
 		IssmDouble SurfaceRelVelMisfit(    bool process_units,int weight_index);
 		IssmDouble SurfaceLogVelMisfit(    bool process_units,int weight_index);
Index: issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 14158)
+++ issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 14159)
@@ -238,4 +238,6 @@
 		case BalancethicknessAnalysisEnum : return "BalancethicknessAnalysis";
 		case BalancethicknessSolutionEnum : return "BalancethicknessSolution";
+		case WeakBalancethicknessAnalysisEnum : return "WeakBalancethicknessAnalysis";
+		case WeakBalancethicknessSolutionEnum : return "WeakBalancethicknessSolution";
 		case BedSlopeAnalysisEnum : return "BedSlopeAnalysis";
 		case BedSlopeSolutionEnum : return "BedSlopeSolution";
@@ -346,4 +348,5 @@
 		case AdjointyEnum : return "Adjointy";
 		case AdjointzEnum : return "Adjointz";
+		case BalancethicknessMisfitEnum : return "BalancethicknessMisfit";
 		case BedSlopeXEnum : return "BedSlopeX";
 		case BedSlopeYEnum : return "BedSlopeY";
Index: issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 14158)
+++ issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 14159)
@@ -45,7 +45,8 @@
 			case VxEnum:   iomodel->FetchData(1,VxEnum); break;
 			case VyEnum:   iomodel->FetchData(1,VyEnum); break;
-			case FrictionCoefficientEnum: iomodel->FetchData(1,FrictionCoefficientEnum); break;
-			case MaterialsRheologyBbarEnum:    iomodel->FetchData(1,MaterialsRheologyBEnum); break;
-			case MaterialsRheologyZbarEnum:    iomodel->FetchData(1,MaterialsRheologyZEnum); break;
+			case ThicknessEnum:             iomodel->FetchData(1,ThicknessEnum); break;
+			case FrictionCoefficientEnum:   iomodel->FetchData(1,FrictionCoefficientEnum); break;
+			case MaterialsRheologyBbarEnum: iomodel->FetchData(1,MaterialsRheologyBEnum); break;
+			case MaterialsRheologyZbarEnum: iomodel->FetchData(1,MaterialsRheologyZEnum); break;
 			default: _error_("Control " << EnumToStringx(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])) << " not implemented yet");
 		}
Index: issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 14158)
+++ issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 14159)
@@ -242,4 +242,6 @@
 	      else if (strcmp(name,"BalancethicknessAnalysis")==0) return BalancethicknessAnalysisEnum;
 	      else if (strcmp(name,"BalancethicknessSolution")==0) return BalancethicknessSolutionEnum;
+	      else if (strcmp(name,"WeakBalancethicknessAnalysis")==0) return WeakBalancethicknessAnalysisEnum;
+	      else if (strcmp(name,"WeakBalancethicknessSolution")==0) return WeakBalancethicknessSolutionEnum;
 	      else if (strcmp(name,"BedSlopeAnalysis")==0) return BedSlopeAnalysisEnum;
 	      else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
@@ -259,10 +261,10 @@
 	      else if (strcmp(name,"NoneAnalysis")==0) return NoneAnalysisEnum;
 	      else if (strcmp(name,"PrognosticAnalysis")==0) return PrognosticAnalysisEnum;
-	      else if (strcmp(name,"PrognosticSolution")==0) return PrognosticSolutionEnum;
-	      else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
          else stage=3;
    }
    if(stage==3){
-	      if (strcmp(name,"SurfaceSlopeAnalysis")==0) return SurfaceSlopeAnalysisEnum;
+	      if (strcmp(name,"PrognosticSolution")==0) return PrognosticSolutionEnum;
+	      else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
+	      else if (strcmp(name,"SurfaceSlopeAnalysis")==0) return SurfaceSlopeAnalysisEnum;
 	      else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
 	      else if (strcmp(name,"SurfaceSlopeXAnalysis")==0) return SurfaceSlopeXAnalysisEnum;
@@ -353,4 +355,5 @@
 	      else if (strcmp(name,"Adjointy")==0) return AdjointyEnum;
 	      else if (strcmp(name,"Adjointz")==0) return AdjointzEnum;
+	      else if (strcmp(name,"BalancethicknessMisfit")==0) return BalancethicknessMisfitEnum;
 	      else if (strcmp(name,"BedSlopeX")==0) return BedSlopeXEnum;
 	      else if (strcmp(name,"BedSlopeY")==0) return BedSlopeYEnum;
@@ -381,11 +384,11 @@
 	      else if (strcmp(name,"QmuMelting")==0) return QmuMeltingEnum;
 	      else if (strcmp(name,"ResetPenalties")==0) return ResetPenaltiesEnum;
-	      else if (strcmp(name,"SegmentOnIceShelf")==0) return SegmentOnIceShelfEnum;
-	      else if (strcmp(name,"SurfaceAbsVelMisfit")==0) return SurfaceAbsVelMisfitEnum;
-	      else if (strcmp(name,"SurfaceArea")==0) return SurfaceAreaEnum;
          else stage=4;
    }
    if(stage==4){
-	      if (strcmp(name,"SurfaceAverageVelMisfit")==0) return SurfaceAverageVelMisfitEnum;
+	      if (strcmp(name,"SegmentOnIceShelf")==0) return SegmentOnIceShelfEnum;
+	      else if (strcmp(name,"SurfaceAbsVelMisfit")==0) return SurfaceAbsVelMisfitEnum;
+	      else if (strcmp(name,"SurfaceArea")==0) return SurfaceAreaEnum;
+	      else if (strcmp(name,"SurfaceAverageVelMisfit")==0) return SurfaceAverageVelMisfitEnum;
 	      else if (strcmp(name,"SurfaceLogVelMisfit")==0) return SurfaceLogVelMisfitEnum;
 	      else if (strcmp(name,"SurfaceLogVxVyMisfit")==0) return SurfaceLogVxVyMisfitEnum;
@@ -504,11 +507,11 @@
 	      else if (strcmp(name,"PetscOptionsStrings")==0) return PetscOptionsStringsEnum;
 	      else if (strcmp(name,"QmuErrName")==0) return QmuErrNameEnum;
-	      else if (strcmp(name,"QmuInName")==0) return QmuInNameEnum;
-	      else if (strcmp(name,"QmuOutName")==0) return QmuOutNameEnum;
-	      else if (strcmp(name,"Regular")==0) return RegularEnum;
          else stage=5;
    }
    if(stage==5){
-	      if (strcmp(name,"Scaled")==0) return ScaledEnum;
+	      if (strcmp(name,"QmuInName")==0) return QmuInNameEnum;
+	      else if (strcmp(name,"QmuOutName")==0) return QmuOutNameEnum;
+	      else if (strcmp(name,"Regular")==0) return RegularEnum;
+	      else if (strcmp(name,"Scaled")==0) return ScaledEnum;
 	      else if (strcmp(name,"Separate")==0) return SeparateEnum;
 	      else if (strcmp(name,"Sset")==0) return SsetEnum;
Index: issm/trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp
===================================================================
--- issm/trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 14158)
+++ issm/trunk-jpl/src/c/solutions/AdjointCorePointerFromSolutionEnum.cpp	(revision 14159)
@@ -33,4 +33,6 @@
 		case BalancethicknessSolutionEnum:
 			adjointcore=&adjointbalancethickness_core;
+		case WeakBalancethicknessSolutionEnum:
+			adjointcore=&dummy_core;
 			break;
 		default:
Index: issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp
===================================================================
--- issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 14158)
+++ issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp	(revision 14159)
@@ -83,4 +83,10 @@
 			break;
 
+		case WeakBalancethicknessSolutionEnum:
+			numanalyses=1;
+			analyses=xNew<int>(numanalyses);
+			analyses[0]=BalancethicknessAnalysisEnum;
+			break;
+
 		case SurfaceSlopeSolutionEnum:
 			numanalyses=1;
Index: issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp
===================================================================
--- issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 14158)
+++ issm/trunk-jpl/src/c/solutions/CorePointerFromSolutionEnum.cpp	(revision 14159)
@@ -60,4 +60,11 @@
 			#endif
 			break;
+		case WeakBalancethicknessSolutionEnum:
+			#ifdef _HAVE_BALANCED_
+			solutioncore=&dummy_core;
+			#else
+			_error_("ISSM was not compiled with balanced capabilities. Exiting");
+			#endif
+			break;
 		case HydrologySolutionEnum:
 			#ifdef _HAVE_HYDROLOGY_
Index: issm/trunk-jpl/src/c/solutions/dummy_core.cpp
===================================================================
--- issm/trunk-jpl/src/c/solutions/dummy_core.cpp	(revision 14159)
+++ issm/trunk-jpl/src/c/solutions/dummy_core.cpp	(revision 14159)
@@ -0,0 +1,19 @@
+/*!\file: dummy_core.cpp
+ * \brief: dummy core (nothing done)
+ */ 
+
+#include "../toolkits/toolkits.h"
+#include "../classes/objects/objects.h"
+#include "../shared/shared.h"
+#include "../io/io.h"
+#include "../include/include.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "./solutions.h"
+#include "../modules/modules.h"
+#include "../solvers/solvers.h"
+
+void dummy_core(FemModel* femmodel){
+
+	/*We do not do anything*/
+
+}
Index: issm/trunk-jpl/src/c/solutions/objectivefunction.cpp
===================================================================
--- issm/trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 14158)
+++ issm/trunk-jpl/src/c/solutions/objectivefunction.cpp	(revision 14159)
@@ -46,4 +46,7 @@
 		femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
 	}
+	else if (solution_type==WeakBalancethicknessSolutionEnum){
+		femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
+	}
 	else{
 		_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
@@ -63,4 +66,7 @@
 		solver_linear(femmodel); 
 	}
+	else if (solution_type==WeakBalancethicknessSolutionEnum){
+		/*Don't do anything*/
+	}
 	else{
 		_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
Index: issm/trunk-jpl/src/c/solutions/solutions.h
===================================================================
--- issm/trunk-jpl/src/c/solutions/solutions.h	(revision 14158)
+++ issm/trunk-jpl/src/c/solutions/solutions.h	(revision 14159)
@@ -33,4 +33,5 @@
 void dakota_core(FemModel* femmodel);
 void ad_core(FemModel* femmodel);
+void dummy_core(FemModel* femmodel);
 IssmDouble objectivefunction(IssmDouble search_scalar,OptArgs* optargs);
 
