Index: /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 15800)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 15801)
@@ -35,9 +35,20 @@
 	md.stressbalance.spcvy=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
 	md.stressbalance.spcvz=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
-	md.stressbalance.spcvx[pos]=0
-	md.stressbalance.spcvy[pos]=0
-	md.stressbalance.spcvz[pos]=0
 	md.stressbalance.referential=float('nan')*numpy.ones((md.mesh.numberofvertices,6))
 	md.stressbalance.loadingforce=0*numpy.ones((md.mesh.numberofvertices,3))
+
+	#First find segments that are not completely on the front
+	if md.mesh.dimension==2:
+		numbernodesfront=2
+	else:
+		numbernodesfront=4
+	values=md.mask.icelevelset[md.mesh.segments[:,0:-1]]
+	segmentsfront=1-values
+	segments=(numpy.sum(segmentsfront,axis=1)!=numbernodesfront).astype(int)
+	#Find all nodes for these segments and spc them
+	pos=md.mesh.segments[segments,0:-1]
+	md.stressbalance.spcvx[pos[:]]=0
+	md.stressbalance.spcvy[pos[:]]=0
+	md.stressbalance.spcvz[pos[:]]=0
 
 	#Dirichlet Values
Index: /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 15800)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 15801)
@@ -55,6 +55,7 @@
 	else:
 		numbernodesfront=4
-	segmentsfront=numpy.nonzeros(md.mask.icelevelset(md.mesh.segments[:,0:-1]))
-	segments=(numpy.sum(segmentsfront,axis=1)!=numbernodesfront).astype(int) 
+	values=md.mask.icelevelset[md.mesh.segments[:,0:-1]]
+	segmentsfront=1-values
+	segments=(numpy.sum(segmentsfront,axis=1)!=numbernodesfront).astype(int)
 	#Find all nodes for these segments and spc them
 	pos=md.mesh.segments[segments,0:-1]
