Index: /issm/trunk-jpl/src/m/mesh/meshintersect.m
===================================================================
--- /issm/trunk-jpl/src/m/mesh/meshintersect.m	(revision 22934)
+++ /issm/trunk-jpl/src/m/mesh/meshintersect.m	(revision 22935)
@@ -12,5 +12,5 @@
 
 	%retrieve tolerance: 
-	tolerance=getfieldvalue(options,'tolerance',1e-10);
+	tolerance=getfieldvalue(options,'tolerance',1e-5);
 
 	%go through lats,longs and find within tolerance, the index of the corresponding value in lat,long: 
@@ -19,4 +19,19 @@
 	for i=1:length(lats),
 		distance=sqrt((lat-lats(i)).^2+(long-longs(i)).^2);
-		indices(i)=find(distance<tolerance);
+		s=find(distance<tolerance);
+		if length(s)>1,
+			indices(i)=s(1);
+			format long
+			[lats(i) longs(i)]
+			for j=1:length(s),
+				[lat(s(j)) long(s(j))]
+			end
+			error('one or more vertices on the global mesh were duplicated!');
+		elseif isempty(s),
+			plot(distance)
+			min(distance)
+			error('could not find vertices in common, relax tolerance?');
+		else
+			indices(i)=s;
+		end
 	end
