Index: /issm/trunk-jpl/src/c/classes/Elements/Element.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Element.h	(revision 17046)
+++ /issm/trunk-jpl/src/c/classes/Elements/Element.h	(revision 17047)
@@ -237,4 +237,5 @@
 		virtual IssmDouble TotalSmb(void)=0;
 		virtual IssmDouble Misfit(int modelenum,int observationenum,int weightsenum)=0;
+		virtual IssmDouble MisfitArea(int weightsenum)=0;
 		virtual int    VertexConnectivity(int vertexindex)=0;
 		virtual void   VerticalSegmentIndices(int** pindices,int* pnumseg)=0;
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 17046)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 17047)
@@ -184,4 +184,5 @@
 		void   InputControlUpdate(IssmDouble scalar,bool save_parameter);
 		IssmDouble Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
+		IssmDouble MisfitArea(int weightsenum){_error_("not implemented yet");};
 		#endif
 
Index: /issm/trunk-jpl/src/c/classes/Elements/Seg.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 17046)
+++ /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 17047)
@@ -206,4 +206,5 @@
 		void       MaxVz(IssmDouble* pmaxvz){_error_("not implemented yet");};
 		IssmDouble Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
+		IssmDouble MisfitArea(int weightsenum){_error_("not implemented yet");};
 #endif
 
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 17046)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 17047)
@@ -2240,5 +2240,8 @@
 
 	/*If on water, return 0: */
-	if(NoIceInElement())return 0;
+	if(NoIceInElement()){
+		printf("no ice in element!\n");
+		return 0;
+	}
 
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
@@ -2883,4 +2886,42 @@
 }
 /*}}}*/
+/*FUNCTION Tria::MisfitArea{{{*/
+IssmDouble Tria::MisfitArea(int weightsenum){
+
+	/*Intermediaries*/
+	IssmDouble weight;
+	IssmDouble Jdet;
+	IssmDouble Jelem = 0;
+	IssmDouble xyz_list[NUMVERTICES][3];
+	GaussTria *gauss = NULL;
+
+	/*If on water, return 0: */
+	if(NoIceInElement())return 0;
+
+	/*Retrieve all inputs we will be needing: */
+	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+	Input* weights_input     =inputs->GetInput(weightsenum);     _assert_(weights_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: */
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+
+		/*Get parameters at gauss point*/
+		weights_input->GetInputValue(&weight,gauss);
+
+		/*compute misfit between model and observation */
+		Jelem+=Jdet*weight*gauss->weight;
+	}
+
+	/* clean up and Return: */
+	delete gauss;
+	return Jelem;
+}
+/*}}}*/
 /*FUNCTION Tria::Misfit{{{*/
 IssmDouble Tria::Misfit(int modelenum,int observationenum,int weightsenum){
@@ -2917,5 +2958,5 @@
 
 		/*compute misfit between model and observation */
-		Jelem+=0.5*(model-observation)*(model-observation)*weight*Jdet*gauss->weight;
+		Jelem+=0.5*(model-observation)*(model-observation)*Jdet*weight*gauss->weight;
 	}
 
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 17046)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 17047)
@@ -152,4 +152,5 @@
 		void       MaxVz(IssmDouble* pmaxvz);
 		IssmDouble Misfit(int modelenum,int observationenum,int weightsenum);
+		IssmDouble MisfitArea(int weightsenum);
 		#endif
 
