Index: /issm/trunk-jpl/src/c/classes/Vertices.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Vertices.cpp	(revision 23501)
+++ /issm/trunk-jpl/src/c/classes/Vertices.cpp	(revision 23502)
@@ -101,21 +101,20 @@
 void  Vertices::FlagClones(int numberofobjects){/*{{{*/
 
-	int i;
-	int num_procs;
+	/*Some checks in debug mode*/
+	_assert_(numberofobjects>0);
 
-	int* ranks=NULL;
-	int* minranks=NULL;
-
-	/*recover num_procs:*/
-	num_procs=IssmComm::GetSize();
+	/*recover num_procs and rank*/
+	int num_procs = IssmComm::GetSize();
+	int my_rank   = IssmComm::GetRank();
 
 	/*Allocate ranks: */
-	ranks=xNew<int>(numberofobjects);
-	minranks=xNew<int>(numberofobjects);
+	int *ranks    = xNew<int>(numberofobjects);
+	for(int i=0;i<numberofobjects;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit.
 
-	for(i=0;i<numberofobjects;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit.
-
-	/*Now go through all our objects and ask them to report to who they belong (which rank): */
-	Ranks(ranks);
+	/*Go through a dataset, and for each object, report it cpu: */
+	for(int i=0;i<this->Size();i++){
+		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
+		ranks[vertex->Sid()]=my_rank; 
+	}
 
 	/*We need to take the minimum rank for each vertex, and every cpu needs to get that result. That way, 
@@ -123,8 +122,10 @@
 	 * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing 
 	 * order of cpu rank. This is also why we initialized this array to num_procs.*/
-	ISSM_MPI_Allreduce ( (void*)ranks,(void*)minranks,numberofobjects,ISSM_MPI_INT,ISSM_MPI_MIN,IssmComm::GetComm());
+	int *minranks = xNew<int>(numberofobjects);
+	ISSM_MPI_Allreduce((void*)ranks,(void*)minranks,numberofobjects,ISSM_MPI_INT,ISSM_MPI_MIN,IssmComm::GetComm());
+	xDelete<int>(ranks); 
 
 	/*Now go through all objects, and use minranks to flag which objects are cloned: */
-	for(i=0;i<this->Size();i++){
+	for(int i=0;i<this->Size();i++){
 		/*For this object, decide whether it is a clone: */
 		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
@@ -133,9 +134,6 @@
 
 	/*Free ressources: */
-	xDelete<int>(ranks); 
 	xDelete<int>(minranks);
-
-}
-/*}}}*/
+}/*}}}*/
 int Vertices::NumberOfVertices(void){/*{{{*/
 
@@ -161,21 +159,4 @@
 	/*return:*/
 	return max_sid;
-}
-/*}}}*/
-void   Vertices::Ranks(int* ranks){/*{{{*/
-
-	int my_rank;
-	int        sid;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-
-	/*Go through a dataset, and for each object, report it cpu: */
-	for(int i=0;i<this->Size();i++){
-		/*Plug rank into ranks, according to id: */
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		sid=vertex->Sid();
-		ranks[sid]=my_rank; 
-	}
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Vertices.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Vertices.h	(revision 23501)
+++ /issm/trunk-jpl/src/c/classes/Vertices.h	(revision 23502)
@@ -24,6 +24,5 @@
 		void  FlagClones(int numberofnodes);
 		int   NumberOfVertices(void);
-		void  Ranks(int* ranks);
-		void LatLonList(IssmDouble** lat,IssmDouble** lon);
+		void  LatLonList(IssmDouble** lat,IssmDouble** lon);
 };
 
