Index: /issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp
===================================================================
--- /issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp	(revision 7332)
+++ /issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp	(revision 7333)
@@ -48,8 +48,8 @@
 	/*First, figure out which nodes that are on the ice sheet want to unground. Build a flags vector for this (size number of nodes: */
 	potential_sheet_ungrounding=PotentialSheetUngrounding(elements,nodes,parameters);
-
+	
 	/*Now, propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */
 	sheet_ungrounding=PropagateShelfIntoConnexIceSheet(elements,nodes,parameters,potential_sheet_ungrounding);
-
+	
 	/*Now, use the sheet_ungrounding flags to unground the ice sheet (at the same time, take care of grounding elements of the ice shelf 
 	 * that want to: */
@@ -136,18 +136,21 @@
 		 * nodes have flipped from grounded to ungrounded: */
 		VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf);
-		
+
 		for(i=0;i<elements->Size();i++){
 			element=(Element*)elements->GetObjectByOffset(i);
 			if(elements_touching_iceshelf[element->Sid()]){
-				nflipped+=element->UpdatePotentialSheetUngrounding(potential_sheet_ungrounding,vec_nodes_on_iceshelf,nodes_on_iceshelf);
+				local_nflipped+=element->UpdatePotentialSheetUngrounding(potential_sheet_ungrounding,vec_nodes_on_iceshelf,nodes_on_iceshelf);
 			}
 		}
 		
 		MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
-		//_printf_(VerboseConvergence(),"   number of grounded vertices  connected to grounding line: %i\n",nflipped);
-		_printf_(1,"   number of grounded vertices  connected to grounding line: %i\n",nflipped);
+		_printf_(VerboseConvergence(),"   number of grounded vertices  connected to grounding line: %i\n",nflipped);
 
 		/*Avoid leaks: */
 		xfree((void**)&nodes_on_iceshelf);
+
+		/*Assemble:*/
+		VecAssemblyBegin(vec_nodes_on_iceshelf);
+		VecAssemblyEnd(vec_nodes_on_iceshelf);
 	}
 
@@ -162,6 +165,4 @@
 }
 /*}}}*/
-
-
 bool*      CreateElementOnGroundingLine(Elements* elements,double* element_on_iceshelf){ //{{{1
 
@@ -212,5 +213,4 @@
 	for(i=0;i<elements->Size();i++){
 		element=(Element*)elements->GetObjectByOffset(i);
-		printf("%i\n",i);
 		VecSetValue(vec_element_on_iceshelf,element->Sid(),(int)element->IsOnShelf(),INSERT_VALUES);
 	}
@@ -328,5 +328,9 @@
 	for(i=0;i<nodes->Size();i++){
 		node=(Node*)nodes->GetObjectByOffset(i);
-		if(node->IsOnShelf())VecSetValue(nodes_on_iceshelf,node->Sid()+1,1,INSERT_VALUES);
+		if(node->InAnalysis(analysis_type)){
+			if(node->IsOnShelf()){
+				VecSetValue(nodes_on_iceshelf,node->Sid(),1.0,INSERT_VALUES);
+			}
+		}
 	}
 
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 7332)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 7333)
@@ -4297,5 +4297,5 @@
 }
 /*}}}*/
-/*FUNCTION Tria::IsNodeOnShelf {{{1*/
+/*FUNCTION Tria::IsNodeOnShelfFromFlags {{{1*/
 bool   Tria::IsNodeOnShelfFromFlags(double* flags){
 
@@ -5679,7 +5679,8 @@
 		if (potential_sheet_ungrounding[nodes[i]->Sid()]){
 			VecSetValue(vec_nodes_on_iceshelf,nodes[i]->Sid(),1,INSERT_VALUES);
+		
+			/*Figure out if we flipped: */
+			if (potential_sheet_ungrounding[nodes[i]->Sid()] != nodes_on_iceshelf[nodes[i]->Sid()])nflipped++;
 		}
-		/*Figure out if we flipped: */
-		if (potential_sheet_ungrounding[nodes[i]->Sid()] != nodes_on_iceshelf[nodes[i]->Sid()])nflipped++;
 	}
 	return nflipped;
Index: /issm/trunk/src/c/solutions/groundinglinemigration2d_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/groundinglinemigration2d_core.cpp	(revision 7332)
+++ /issm/trunk/src/c/solutions/groundinglinemigration2d_core.cpp	(revision 7333)
@@ -21,4 +21,7 @@
 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
 
+	/*activate formulation: */
+	femmodel->SetCurrentConfiguration(PrognosticAnalysisEnum);
+
 	_printf_(VerboseSolution(),"%s\n","   computing new grounding line position");
 	GroundingLineMigrationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
