Index: /issm/trunk-jpl/src/c/toolkits/objects/Vector.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/objects/Vector.h	(revision 17508)
+++ /issm/trunk-jpl/src/c/toolkits/objects/Vector.h	(revision 17509)
@@ -305,4 +305,18 @@
 		}
 		/*}}}*/
+		/*FUNCTION Max{{{*/
+		doubletype Max(void){_assert_(this);
+
+			doubletype max=0;
+
+			if(type==PetscVecType){
+				#ifdef _HAVE_PETSC_
+				max=this->pvector->Max();
+				#endif
+			}
+			else _error_("operation not supported yet");
+			return max;
+		}
+		/*}}}*/
 		/*FUNCTION Norm{{{*/
 		doubletype Norm(NormMode norm_type){_assert_(this);
Index: /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 17508)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 17509)
@@ -188,4 +188,15 @@
 }
 /*}}}*/
+/*FUNCTION PetscVec::Max{{{*/
+IssmDouble PetscVec::Max(void){
+
+	_assert_(this->vector);
+
+	IssmDouble max;
+	VecMax(this->vector,NULL,&max);
+	return max;
+
+}
+/*}}}*/
 /*FUNCTION PetscVec::Norm{{{*/
 IssmDouble PetscVec::Norm(NormMode mode){
Index: /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h	(revision 17508)
+++ /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h	(revision 17509)
@@ -38,21 +38,22 @@
 
 		/*PetscVec specific routines*/
-		void Echo(void);
-		void Assemble(void);
-		void SetValues(int ssize, int* list, IssmDouble* values, InsMode mode);
-		void SetValue(int dof, IssmDouble value, InsMode  mode);
-		void GetValue(IssmDouble* pvalue, int dof);
-		void GetSize(int* pM);
-		void GetLocalSize(int* pM);
-		PetscVec* Duplicate(void);
-		void Set(IssmDouble value);
-		void AXPY(PetscVec* X, IssmDouble a);
-		void AYPX(PetscVec* X, IssmDouble a);
+		void        Echo(void);
+		void        Assemble(void);
+		void        SetValues(int ssize, int* list, IssmDouble* values, InsMode mode);
+		void        SetValue(int dof, IssmDouble value, InsMode  mode);
+		void        GetValue(IssmDouble* pvalue, int dof);
+		void        GetSize(int* pM);
+		void        GetLocalSize(int* pM);
+		PetscVec*   Duplicate(void);
+		void        Set(IssmDouble value);
+		void        AXPY(PetscVec* X, IssmDouble a);
+		void        AYPX(PetscVec* X, IssmDouble a);
 		IssmDouble* ToMPISerial(void);
-		void Copy(PetscVec* to);
-		IssmDouble Norm(NormMode norm_type);
-		void Scale(IssmDouble scale_factor);
-		void PointwiseDivide(PetscVec* x,PetscVec* y);
-		IssmDouble Dot(PetscVec* vector);
+		void        Copy(PetscVec* to);
+		IssmDouble  Norm(NormMode norm_type);
+		IssmDouble  Max(void);
+		void        Scale(IssmDouble scale_factor);
+		void        PointwiseDivide(PetscVec* x,PetscVec* y);
+		IssmDouble  Dot(PetscVec* vector);
 };
 
