Index: /issm/trunk-jpl/src/m/coordsystems/gmtmask.m
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 20012)
+++ /issm/trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 20013)
@@ -1,3 +1,3 @@
-function mask = gmtmask(lat,long)
+function mask = gmtmask(lat,long,varargin)
 %GMTMASK - figure out which lat,long points are on the ocean
 %
@@ -6,5 +6,14 @@
 %
 
-	disp(sprintf('gmtmask: num vertices %i',length(lat)));
+	%are we doing a recursive call? 
+	if nargin==3,
+		recursive=1;
+	else 
+		recursive=0;
+	end
+	
+	if(recursive)disp(sprintf('             recursing: num vertices %i',length(lat)));
+	else disp(sprintf('gmtmask: num vertices %i',length(lat)));
+	end
 	
 	%Check lat and long size is not more than 50,000; If so, recursively call gmtmask: 
@@ -15,5 +24,5 @@
 				j=length(lat);
 			end
-			mask(i:j)=gmtmask(lat(i:j),long(i:j));
+			mask(i:j)=gmtmask(lat(i:j),long(i:j),1);
 		end
 		return
@@ -31,5 +40,5 @@
 
 	%figure out which vertices are on the ocean, which one on the continent:
-	system('gmt gmtselect ./all_vertices.txt -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/k/s/k > ./oce_vertices.txt');
+	system('gmt gmtselect ./all_vertices.txt -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt');
 
 	%reset DYLD_LIBRARY_PATH to what it was: 
@@ -53,3 +62,3 @@
 	
 	system('rm -rf ./all_vertices.txt ./oce_vertices.txt ./gmt.history');
-	disp(sprintf('gmtmask: done'));
+	if ~recursive, disp(sprintf('gmtmask: done')); end;
