Index: /issm/trunk/cron/cronfiles/linux_cronfile
===================================================================
--- /issm/trunk/cron/cronfiles/linux_cronfile	(revision 10443)
+++ /issm/trunk/cron/cronfiles/linux_cronfile	(revision 10444)
@@ -9,5 +9,5 @@
 30 12 * * 1-5 cd /u/astrid-r1b/seroussi/svn/issm/trunk/cron/ && ./nightlyrun.sh configs/linux64_seroussi_daily
 00 15 * * 1-5 cd /u/astrid-r1b/seroussi/svn/issm/trunk/cron/ && ./nightlyrun.sh configs/linux64_seroussi_daily
-00 18 * * 1-5 cd /u/astrid-r1b/seroussi/svn/issm/trunk/cron/ && ./nightlyrun.sh configs/linux64_seroussi_daily
+00 18 * * 1-5 cd /u/astrid-r1b/seroussi/svn/issm/trunk/cron/ && ./nightlyrun.sh configs/linux64_seroussi_nightly
 00 23 * * 1-5 cd /u/astrid-r1b/seroussi/svn/issm/trunk/cron/ && ./nightlyrun.sh configs/linux64_seroussi_nightly
 00 23 * * 6   cd /u/astrid-r1b/seroussi/svn/issm/trunk/cron/ && ./nightlyrun.sh configs/linux64_seroussi_validation
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 10443)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 10444)
@@ -1991,5 +1991,5 @@
 }
 /*}}}*/
-/*FUNCTION Penta::IsNodeOnShelf {{{1*/
+/*FUNCTION Penta::IsNodeOnShelfFromFlags {{{1*/
 bool   Penta::IsNodeOnShelfFromFlags(double* flags){
 
@@ -1997,5 +1997,5 @@
 	bool shelf=false;
 
-	for(i=0;i<6;i++){
+	for(i=0;i<NUMVERTICES;i++){
 		if (flags[nodes[i]->Sid()]){
 			shelf=true;
@@ -2220,5 +2220,29 @@
 /*FUNCTION Penta::PotentialSheetUngrounding{{{1*/
 void  Penta::PotentialSheetUngrounding(Vec potential_sheet_ungrounding){
-	_error_("not supported yet!");
+
+	int     i;
+	double  h[NUMVERTICES],ba[NUMVERTICES];
+	double  bed_hydro;
+	double  rho_water,rho_ice,density;
+	bool    elementonshelf = false;
+
+	/*material parameters: */
+	rho_water=matpar->GetRhoWater();
+	rho_ice=matpar->GetRhoIce();
+	density=rho_ice/rho_water;
+	GetInputListOnVertices(&h[0],ThicknessEnum);
+	GetInputListOnVertices(&ba[0],BathymetryEnum);
+
+	/*go through vertices, and figure out which ones are on the ice sheet, and want to unground: */
+	for(i=0;i<NUMVERTICES;i++){
+		/*Find if grounded vertices want to start floating*/
+		if (!nodes[i]->IsFloating()){
+			bed_hydro=-density*h[i];
+			if (bed_hydro>ba[i]){
+				/*Vertex that could potentially unground, flag it*/
+				VecSetValue(potential_sheet_ungrounding,nodes[i]->Sid(),1,INSERT_VALUES);
+			}
+		}
+	}
 }
 /*}}}*/
@@ -2716,6 +2740,21 @@
 /*}}}*/
 /*FUNCTION Penta::UpdatePotentialSheetUngrounding{{{1*/
-int Penta::UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf){
-	_error_("Not implemented yet");
+int Penta::UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf){
+
+	int i;
+	int nflipped=0;
+
+	/*Go through nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */
+	for(i=0;i<NUMVERTICES;i++){
+		if (vertices_potentially_ungrounding[nodes[i]->Sid()]){
+			VecSetValue(vec_nodes_on_iceshelf,nodes[i]->Sid(),1,INSERT_VALUES);
+		
+			/*If node was not on ice shelf, we flipped*/
+			if(nodes_on_iceshelf[nodes[i]->Sid()]==0){
+				nflipped++;
+			}
+		}
+	}
+	return nflipped;
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 10443)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 10444)
@@ -1871,5 +1871,5 @@
 	bool shelf=false;
 
-	for(i=0;i<3;i++){
+	for(i=0;i<NUMVERTICES;i++){
 		if (flags[nodes[i]->Sid()]){
 			shelf=true;
@@ -2346,5 +2346,5 @@
 	int nflipped=0;
 
-	/*Ok, go through our 3 nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */
+	/*Go through nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */
 	for(i=0;i<3;i++){
 		if (vertices_potentially_ungrounding[nodes[i]->Sid()]){
Index: /issm/trunk/src/m/classes/groundingline.m
===================================================================
--- /issm/trunk/src/m/classes/groundingline.m	(revision 10443)
+++ /issm/trunk/src/m/classes/groundingline.m	(revision 10444)
@@ -47,7 +47,7 @@
 
 			if ~strcmp(obj.migration,'None'),
-				if (md.mesh.dimension==3 & strcmpi(md.groundingline.migration,'SoftMigration')),
-					checkmessage(['requesting grounding line migration with SoftMigration, but only AgressiveMigration is implemented in 3d models !']);
-				end
+	%			if (md.mesh.dimension==3 & strcmpi(md.groundingline.migration,'SoftMigration')),
+	%				checkmessage(['requesting grounding line migration with SoftMigration, but only AgressiveMigration is implemented in 3d models !']);
+	%			end
 				if isnan(md.geometry.bathymetry),
 					checkmessage(['requesting grounding line migration, but bathymetry is absent!']);
Index: /issm/trunk/src/m/model/plot/plot_gridded.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_gridded.m	(revision 10443)
+++ /issm/trunk/src/m/model/plot/plot_gridded.m	(revision 10444)
@@ -7,5 +7,5 @@
 %   See also: PLOTMODEL
 
-whitepos=2; %1: up, 2: down, else: none
+whitepos=1; %1: up, 2: down, else: none
 
 %process mesh and data
Index: /issm/trunk/src/m/solutions/transient_core.m
===================================================================
--- /issm/trunk/src/m/solutions/transient_core.m	(revision 10443)
+++ /issm/trunk/src/m/solutions/transient_core.m	(revision 10444)
@@ -58,5 +58,5 @@
 
 		if (isgroundingline)
-			if (dim==3 & groundinglinemigration==SoftMigrationEnum), error('grounding line migration not implemented in 3d'); end
+		%	if (dim==3 & groundinglinemigration==SoftMigrationEnum), error('grounding line migration not implemented in 3d'); end
 			issmprintf(VerboseSolution,'\n%s',['   computing new grounding line']);
 			[femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters]=...
