Index: /issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
===================================================================
--- /issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 10377)
+++ /issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 10378)
@@ -17,4 +17,5 @@
 	double*  vertices_ungrounding             = NULL;
 	double*  old_floatingice                  = NULL;
+	Vec      vec_old_floatingice              = NULL;
 	Element* element                          = NULL;
 	
@@ -36,6 +37,7 @@
 	}
 
-	/*Create vector with vertices initially floating*/
-	old_floatingice=CreateNodesOnIceShelf(nodes,analysis_type);
+	/*Create vector with vertices initially floating and serialize*/
+	vec_old_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type);
+	VecToMPISerial(&old_floatingice,vec_old_floatingice);
 
 	/*Migrate grounding line : */
@@ -46,8 +48,38 @@
 
 	/*free ressouces: */
+	VecFree(&vec_old_floatingice);
 	xfree((void**)&vertices_potentially_ungrounding);
 	xfree((void**)&vertices_ungrounding);
 	xfree((void**)&old_floatingice);
 }
+
+/*FUNCTION CreateNodesOnFloatingIce {{{1*/
+Vec CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){ 
+
+	int     i,numnods;
+	Vec     vec_nodes_on_floatingice = NULL;
+	Node*   node                  = NULL;
+
+	/*First, initialize nodes_on_floatingice, which will track which nodes have changed status: */
+	numnods=nodes->NumberOfNodes(configuration_type);
+	vec_nodes_on_floatingice=NewVec(numnods);
+
+	/*Loop through nodes, and fill vec_nodes_on_floatingice: */
+	for(i=0;i<nodes->Size();i++){
+		node=(Node*)nodes->GetObjectByOffset(i);
+		if(node->InAnalysis(configuration_type)){
+			if(node->IsFloating()){
+				VecSetValue(vec_nodes_on_floatingice,node->Sid(),1.0,INSERT_VALUES);
+			}
+		}
+	}
+
+	/*Assemble vector: */
+	VecAssemblyBegin(vec_nodes_on_floatingice);
+	VecAssemblyEnd(vec_nodes_on_floatingice);
+
+	return vec_nodes_on_floatingice;
+}
+/*%}}}*/
 /*FUNCTION PotentialSheetUngrounding {{{1*/
 double*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){ 
@@ -97,19 +129,5 @@
 
 	/*recover vec_nodes_on_floatingice*/
-	vec_nodes_on_floatingice=NewVec(numberofvertices);
-
-	/*Loop through nodes, and fill nodes_on_floatingice: */
-	for(i=0;i<nodes->Size();i++){
-		node=(Node*)nodes->GetObjectByOffset(i);
-		if(node->InAnalysis(analysis_type)){
-			if(node->IsFloating()){
-				VecSetValue(vec_nodes_on_floatingice,node->Sid(),1.0,INSERT_VALUES);
-			}
-		}
-	}
-
-	/*Assemble vector and serialize: */
-	VecAssemblyBegin(vec_nodes_on_floatingice);
-	VecAssemblyEnd(vec_nodes_on_floatingice);
+	vec_nodes_on_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type);
 	VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice);
 
@@ -161,35 +179,2 @@
 }
 /*}}}*/
-/*FUNCTION CreateNodesOnIceShelf {{{1*/
-double* CreateNodesOnIceShelf(Nodes* nodes,int configuration_type){ 
-
-	int     i,numnods;
-	double* nodes_on_floatingice  = NULL;
-	Vec     vec_nodes_on_iceshelf = NULL;
-	Node*   node                  = NULL;
-
-	/*First, initialize nodes_on_iceshelf, which will track which nodes have changed status: */
-	numnods=nodes->NumberOfNodes(configuration_type);
-	vec_nodes_on_iceshelf=NewVec(numnods);
-
-	/*Loop through nodes, and fill vec_nodes_on_iceshelf: */
-	for(i=0;i<nodes->Size();i++){
-		node=(Node*)nodes->GetObjectByOffset(i);
-		if(node->InAnalysis(configuration_type)){
-			if(node->IsFloating()){
-				VecSetValue(vec_nodes_on_iceshelf,node->Sid(),1.0,INSERT_VALUES);
-			}
-		}
-	}
-
-	/*Assemble vector: */
-	VecAssemblyBegin(vec_nodes_on_iceshelf);
-	VecAssemblyEnd(vec_nodes_on_iceshelf);
-	VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_iceshelf);
-
-	/*Free ressources*/
-	VecFree(&vec_nodes_on_iceshelf);
-
-	return nodes_on_floatingice;
-}
-/*%}}}*/
Index: /issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h
===================================================================
--- /issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h	(revision 10377)
+++ /issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h	(revision 10378)
@@ -13,6 +13,7 @@
 /* local prototypes: */
 void       GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
+
+Vec        CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);
 double*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);
 double*    PropagateFloatingiceToGrounded(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding);
-double*    CreateNodesOnIceShelf(Nodes* nodes,int configuration_type);
 #endif  /* _GROUNDINGLINEMIGRATIONX_H */
