Index: /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 15992)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 15993)
@@ -23,9 +23,11 @@
 		error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']);
 	end
-	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2);
-	vertexonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
+	incontour=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2);
+	vertexonicefront=double(md.mesh.vertexonboundary & incontour);
 else
 	%Guess where the ice front is
-	vertexonfloatingice=(md.mask.groundedice_levelset<0.);
+	pos=find(sum(md.mask.groundedice_levelset(md.mesh.elements)<0.,2) >0.);
+	vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
+	vertexonfloatingice(md.mesh.elements(pos,:))=1.;
 	vertexonicefront=double(md.mesh.vertexonboundary & vertexonfloatingice);
 end
