Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 8607)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 8608)
@@ -459,5 +459,7 @@
 	NumResponsesEnum,
 	StepResponsesEnum,
-	IntMatParamEnum
+	IntMatParamEnum,
+	RheologyBbarAbsGradientEnum,
+	DragCoefficientAbsGradientEnum
 };
 
Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 8607)
+++ /issm/trunk/src/c/Makefile.am	(revision 8608)
@@ -683,5 +683,12 @@
 					./modules/Bamgx/Bamgx.h\
 					./modules/BamgConvertMeshx/BamgConvertMeshx.cpp\
-					./modules/BamgConvertMeshx/BamgConvertMeshx.h
+					./modules/BamgConvertMeshx/BamgConvertMeshx.h\
+					./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp\
+					./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h\
+					./modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp\
+					./modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h\
+					./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp\
+					./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h
+
 
 libISSM_a_CXXFLAGS = -fPIC -DMATLAB -D_SERIAL_ -ansi -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_  $(CXXOPTFLAGS)
@@ -1340,4 +1347,10 @@
 					./modules/OutputRiftsx/OutputRiftsx.h\
 					./modules/OutputRiftsx/OutputRiftsx.cpp\
+					./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp\
+					./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h\
+					./modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp\
+					./modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h\
+					./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp\
+					./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h\
 					./solutions/diagnostic_core.cpp\
 					./solutions/convergence.cpp\
Index: /issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp
===================================================================
--- /issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp	(revision 8608)
+++ /issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp	(revision 8608)
@@ -0,0 +1,35 @@
+/*!\file DragCoefficientAbsGradientx
+ * \brief: compute misfit between observations and model
+ */
+
+#include "./DragCoefficientAbsGradientx.h"
+
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void DragCoefficientAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*output: */
+	double J=0;
+	double J_sum;
+
+	/*Compute Misfit: */
+	for (i=0;i<elements->Size();i++){
+		element=(Element*)elements->GetObjectByOffset(i);
+		J+=element->DragCoefficientAbsGradient(process_units,weight_index);
+	}
+
+	/*Sum all J from all cpus of the cluster:*/
+	MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
+	MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
+	J=J_sum;
+
+	/*Assign output pointers: */
+	*pJ=J;
+}
Index: /issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h
===================================================================
--- /issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h	(revision 8608)
+++ /issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h	(revision 8608)
@@ -0,0 +1,14 @@
+/*!\file:  DragCoefficientAbsGradientx.h
+ * \brief header file for inverse methods misfit computation
+ */ 
+
+#ifndef _DRAGCOEFFABSGRADX_H
+#define _DRAGCOEFFABSGRADX_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+void DragCoefficientAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+
+#endif
Index: /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 8607)
+++ /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 8608)
@@ -403,4 +403,6 @@
 		case StepResponsesEnum : return "StepResponses";
 		case IntMatParamEnum : return "IntMatParam";
+		case RheologyBbarAbsGradientEnum : return "RheologyBbarAbsGradient";
+		case DragCoefficientAbsGradientEnum : return "DragCoefficientAbsGradient";
 		default : return "unknown";
 
Index: /issm/trunk/src/c/modules/Responsex/Responsex.cpp
===================================================================
--- /issm/trunk/src/c/modules/Responsex/Responsex.cpp	(revision 8607)
+++ /issm/trunk/src/c/modules/Responsex/Responsex.cpp	(revision 8608)
@@ -38,4 +38,7 @@
 		case SurfaceAverageVelMisfitEnum:SurfaceAverageVelMisfitx( responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
 		case ThicknessAbsMisfitEnum:     ThicknessAbsMisfitx(      responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+		case ThicknessAbsGradientEnum:   ThicknessAbsGradientx(    responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+		case RheologyBbarAbsGradientEnum:RheologyBbarAbsGradientx( responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
+		case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
 		default: _error_(" response descriptor \"%s\" not supported yet!",response_descriptor); break;
 	}
Index: /issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp
===================================================================
--- /issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp	(revision 8608)
+++ /issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp	(revision 8608)
@@ -0,0 +1,35 @@
+/*!\file RheologyBbarAbsGradientx
+ * \brief: compute misfit between observations and model
+ */
+
+#include "./RheologyBbarAbsGradientx.h"
+
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void RheologyBbarAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*output: */
+	double J=0;
+	double J_sum;
+
+	/*Compute Misfit: */
+	for (i=0;i<elements->Size();i++){
+		element=(Element*)elements->GetObjectByOffset(i);
+		J+=element->RheologyBbarAbsGradient(process_units,weight_index);
+	}
+
+	/*Sum all J from all cpus of the cluster:*/
+	MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
+	MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
+	J=J_sum;
+
+	/*Assign output pointers: */
+	*pJ=J;
+}
Index: /issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h
===================================================================
--- /issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h	(revision 8608)
+++ /issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h	(revision 8608)
@@ -0,0 +1,14 @@
+/*!\file:  RheologyBbarAbsGradientx.h
+ * \brief header file for inverse methods misfit computation
+ */ 
+
+#ifndef _RHEOLOGYBBARGRADIENTX_H
+#define _RHEOLOGYBBARGRADIENTX_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+void RheologyBbarAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+
+#endif
Index: /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 8607)
+++ /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 8608)
@@ -401,4 +401,6 @@
 	else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
 	else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+	else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
+	else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
 	else _error_("Enum %s not found",name);
 
Index: /issm/trunk/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp	(revision 8608)
+++ /issm/trunk/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp	(revision 8608)
@@ -0,0 +1,35 @@
+/*!\file ThicknessAbsGradientx
+ * \brief: compute misfit between observations and model
+ */
+
+#include "./ThicknessAbsGradientx.h"
+
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void ThicknessAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units, int weight_index){
+
+	/*Intermediary*/
+	int i;
+	Element* element=NULL;
+
+	/*output: */
+	double J=0;
+	double J_sum;
+
+	/*Compute Misfit: */
+	for (i=0;i<elements->Size();i++){
+		element=(Element*)elements->GetObjectByOffset(i);
+		J+=element->ThicknessAbsGradient(process_units,weight_index);
+	}
+
+	/*Sum all J from all cpus of the cluster:*/
+	MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
+	MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
+	J=J_sum;
+
+	/*Assign output pointers: */
+	*pJ=J;
+}
Index: /issm/trunk/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h
===================================================================
--- /issm/trunk/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h	(revision 8608)
+++ /issm/trunk/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.h	(revision 8608)
@@ -0,0 +1,14 @@
+/*!\file:  ThicknessAbsGradientx.h
+ * \brief header file for inverse methods misfit computation
+ */ 
+
+#ifndef _THICKNESSABSGRADIENT_H
+#define _THICKNESSABSGRADIENT_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+void ThicknessAbsGradientx( double* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,bool process_units,int weight_index);
+
+#endif
Index: /issm/trunk/src/c/modules/modules.h
===================================================================
--- /issm/trunk/src/c/modules/modules.h	(revision 8607)
+++ /issm/trunk/src/c/modules/modules.h	(revision 8608)
@@ -25,4 +25,5 @@
 #include "./CreateNodalConstraintsx/CreateNodalConstraintsx.h"
 #include "./DakotaResponsesx/DakotaResponsesx.h"
+#include "./DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h"
 #include "./ElementConnectivityx/ElementConnectivityx.h"
 #include "./EnumToStringx/EnumToStringx.h"
@@ -89,4 +90,5 @@
 #include "./Reducevectorgtofx/Reducevectorgtofx.h"
 #include "./Responsex/Responsex.h"
+#include "./RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h"
 #include "./Scotchx/Scotchx.h"
 #include "./Solverx/Solverx.h"
@@ -97,4 +99,5 @@
 #include "./TriaSearchx/TriaSearchx.h"
 #include "./ThicknessAbsMisfitx/ThicknessAbsMisfitx.h"
+#include "./ThicknessAbsGradientx/ThicknessAbsGradientx.h"
 #include "./UpdateVertexPositionsx/UpdateVertexPositionsx.h"
 #include "./VerticesDofx/VerticesDofx.h"
Index: /issm/trunk/src/c/objects/Elements/Element.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Element.h	(revision 8607)
+++ /issm/trunk/src/c/objects/Elements/Element.h	(revision 8608)
@@ -49,4 +49,7 @@
 		virtual double SurfaceLogVxVyMisfit(bool process_units,int weight_index)=0;
 		virtual double SurfaceAverageVelMisfit(bool process_units,int weight_index)=0;
+		virtual double ThicknessAbsGradient(bool process_units,int weight_index)=0;
+		virtual double RheologyBbarAbsGradient(bool process_units,int weight_index)=0;
+		virtual double DragCoefficientAbsGradient(bool process_units,int weight_index)=0;
 		virtual double RegularizeInversion(void)=0;
 		virtual double SurfaceArea(void)=0;
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 8607)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 8608)
@@ -3844,4 +3844,10 @@
 	this->results=new Results();
 
+}
+/*}}}*/
+/*FUNCTION Penta::DragCoefficientAbsGradient{{{1*/
+double Penta::DragCoefficientAbsGradient(bool process_units,int weight_index){
+
+	_error_("Not implemented yet");
 }
 /*}}}*/
@@ -6742,4 +6748,10 @@
 }
 /*}}}*/
+/*FUNCTION Penta::RheologyBbarAbsGradient{{{1*/
+double Penta::RheologyBbarAbsGradient(bool process_units,int weight_index){
+
+	_error_("Not implemented yet");
+}
+/*}}}*/
 /*FUNCTION Penta::SetClone {{{1*/
 void  Penta::SetClone(int* minranks){
@@ -7053,4 +7065,10 @@
 		return J;
 	}
+}
+/*}}}*/
+/*FUNCTION Penta::ThicknessAbsGradient{{{1*/
+double Penta::ThicknessAbsGradient(bool process_units,int weight_index){
+
+	_error_("Not implemented yet");
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.h	(revision 8607)
+++ /issm/trunk/src/c/objects/Elements/Penta.h	(revision 8608)
@@ -83,4 +83,5 @@
 		void   CreatePVector(Vec pg, Vec pf);
 		void   DeleteResults(void);
+		double DragCoefficientAbsGradient(bool process_units,int weight_index);
 		int    GetNodeIndex(Node* node);
 		void   GetSolutionFromInputs(Vec solution);
@@ -113,4 +114,6 @@
 		void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding);
 		void   ShelfSync();
+		double RheologyBbarAbsGradient(bool process_units,int weight_index);
+		double ThicknessAbsGradient(bool process_units,int weight_index);
 		void   MigrateGroundingLine();
 		void   MinVel(double* pminvel, bool process_units);
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 8607)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 8608)
@@ -2393,4 +2393,10 @@
 }
 /*}}}*/
+/*FUNCTION Tria::DragCoefficientAbsGradient{{{1*/
+double Tria::DragCoefficientAbsGradient(bool process_units,int weight_index){
+
+	_error_("Not implemented yet");
+}
+/*}}}*/
 /*FUNCTION Tria::Echo{{{1*/
 void Tria::Echo(void){
@@ -4670,4 +4676,10 @@
 }
 /*}}}*/
+/*FUNCTION Tria::RheologyBbarAbsGradient{{{1*/
+double Tria::RheologyBbarAbsGradient(bool process_units,int weight_index){
+
+	_error_("Not implemented yet");
+}
+/*}}}*/
 /*FUNCTION Tria::SetClone {{{1*/
 void  Tria::SetClone(int* minranks){
@@ -5194,4 +5206,10 @@
 	delete gauss;
 	return Jelem;
+}
+/*}}}*/
+/*FUNCTION Tria::ThicknessAbsGradient{{{1*/
+double Tria::ThicknessAbsGradient(bool process_units,int weight_index){
+
+	_error_("Not implemented yet");
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.h	(revision 8607)
+++ /issm/trunk/src/c/objects/Elements/Tria.h	(revision 8608)
@@ -79,4 +79,5 @@
 		void   CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs,Vec dg,Vec df);
 		void   CreatePVector(Vec pg, Vec pf);
+		double DragCoefficientAbsGradient(bool process_units,int weight_index);
 		int    GetNodeIndex(Node* node);
 		int    Sid();
@@ -123,6 +124,8 @@
 		void   MinVy(double* pminvy, bool process_units);
 		void   MinVz(double* pminvz, bool process_units);
+		double RheologyBbarAbsGradient(bool process_units,int weight_index);
 		double ThicknessAbsMisfit(     bool process_units,int weight_index);
 		double SurfaceAbsVelMisfit(    bool process_units,int weight_index);
+		double ThicknessAbsGradient(bool process_units,int weight_index);
 		double SurfaceRelVelMisfit(    bool process_units,int weight_index);
 		double SurfaceLogVelMisfit(    bool process_units,int weight_index);
