Index: /issm/trunk-jpl/src/m/coordsystems/gmtmask.m
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 19980)
+++ /issm/trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 19981)
@@ -6,5 +6,16 @@
 %
 
-
+	%Check lat and long size is not more than 50,000; If so, recursively call gmtmask: 
+	if length(lat)>50000,
+		for i=1:50000:length(lat),
+			j=i+50000-1;
+			if j>length(lat),
+				j=length(lat);
+			end
+			mask(i:j)=gmtmask(lat(i:j),long(i:j));
+		end
+		return
+	end
+	
 	%First, write our lat,long file for gmt:
 	nv=length(lat);
