Index: /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 21897)
+++ /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 21898)
@@ -168,4 +168,34 @@
 	*pxyz_front=xyz_front;
 }/*}}}*/
+IssmDouble Seg::GetGroundedPortion(IssmDouble* xyz_list){/*{{{*/
+	/*Computeportion of the element that is grounded*/ 
+
+	bool              mainlyfloating = true;
+	const IssmPDouble epsilon        = 1.e-15;
+	IssmDouble        phi;
+	IssmDouble        gl[NUMVERTICES];
+
+	/*Recover parameters and values*/
+	parameters->FindParam(&domaintype,DomainTypeEnum);
+	GetInputListOnVertices(&gl[0],MaskGroundediceLevelsetEnum);
+
+	/*Be sure that values are not zero*/
+	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+
+	if(gl[0]>0 && gl[1]>0) phi=1; // All grounded
+	else if(gl[0]<0 && gl[1]<0) phi=0; // All floating
+	else if(gl[0]<0 && gl[1]>0){ //1 grounded
+		phi=1./(1.-gl[0]/gl[1]);
+	}
+	else if(gl[1]<0 && gl[0]>0){ //0 grounded
+		phi=1./(1.-gl[1]/gl[0]);
+	}
+
+	if(phi>1 || phi<0) _error_("Error. Problem with portion of grounded element: value should be between 0 and 1");
+
+	return phi;
+}
+/*}}}*/
 int        Seg::GetNumberOfNodes(void){/*{{{*/
 	return this->NumberofNodes(this->element_type);
Index: /issm/trunk-jpl/src/c/classes/Elements/Seg.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 21897)
+++ /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 21898)
@@ -62,5 +62,5 @@
 		int         GetElementType(void){_error_("not implemented yet");};
 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
-		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list){_error_("not implemented yet");};
+		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list);
 		void		   GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
 		void        GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){_error_("not implemented yet");};
