Index: /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m	(revision 15795)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.m	(revision 15796)
@@ -46,5 +46,5 @@
 segments=find(sum(segmentsfront,2)~=numbernodesfront);
 %Find all nodes for these segments and spc them
-pos=[md.mesh.segments(segments,1:numbernodesfront)];
+pos=md.mesh.segments(segments,1:numbernodesfront);
 md.stressbalance.spcvx(pos(:))=0;
 md.stressbalance.spcvy(pos(:))=0;
Index: /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 15795)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 15796)
@@ -41,5 +41,4 @@
 md.stressbalance.loadingforce=0*ones(md.mesh.numberofvertices,3);
 
-
 %Position of ice front
 md.mask.icelevelset(find(vertexonicefront))=0;
@@ -54,5 +53,5 @@
 segments=find(sum(segmentsfront,2)~=numbernodesfront);
 %Find all nodes for these segments and spc them
-pos=[md.mesh.segments(segments,1:numbernodesfront)];
+pos=md.mesh.segments(segments,1:numbernodesfront);
 md.stressbalance.spcvx(pos(:))=0;
 md.stressbalance.spcvy(pos(:))=0;
Index: /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 15795)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 15796)
@@ -43,9 +43,23 @@
 	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))
+
+	#Position of ice front
+	pos=numpy.nonzero(vertexonicefront)[0]
+	md.mask.icelevelset[pos]=0
+
+	#First find segments that are not completely on the front
+	if md.mesh.dimension==2:
+		numbernodesfront=2
+	else:
+		numbernodesfront=4
+	segmentsfront=numpy.nonzeros(md.mask.icelevelset(md.mesh.segments(:,0:-1)))
+	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
@@ -60,8 +74,4 @@
 	pos=numpy.nonzero(md.mesh.vertexonboundary)[0]
 	md.hydrology.spcwatercolumn[pos,0]=1
-
-	#Position of ice front
-	pos=numpy.nonzero(vertexonicefront)[0]
-	md.mask.icelevelset[pos]=0
 
 	#Create zeros basalforcings and surfaceforcings
