Index: /issm/trunk-jpl/src/m/modules/ExpToLevelSet.m
===================================================================
--- /issm/trunk-jpl/src/m/modules/ExpToLevelSet.m	(revision 26539)
+++ /issm/trunk-jpl/src/m/modules/ExpToLevelSet.m	(revision 26540)
@@ -14,16 +14,36 @@
 % Check usage
 if nargin~=3
-	help ExpToLevelSet
-	error('Wrong usage (see above)');
+    help ExpToLevelSet
+    error('Wrong usage (see above)');
 end
 
+multipleShp = 0;
+
 if ischar(contourname),
-	[path,name,ext]=fileparts(contourname); 
-	if strcmpi(ext,'.shp'),
-		%read contour from shapefile
-		contourname=shpread(contourname); 
-	end
+    [path,name,ext]=fileparts(contourname);
+    if strcmpi(ext,'.shp'),
+        %read contour from shapefile
+        contourname=shpread(contourname);
+        if isstruct(contourname)
+            multipleShp = size(contourname, 2);
+        end
+    end
 end
 
 % Call mex module
-distance = ExpToLevelSet_matlab(x,y,contourname);
+if multipleShp>0 
+    % shp file contains multiple contours
+    distance = zeros(length(x)+1, multipleShp);
+    for i = 1:multipleShp
+        distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i));
+        % append the NAME information at the end of the distance
+        if isfield(contourname(i),'NAME')
+            distance(end, i) = contourname(i).NAME;
+        else
+			distance(end, i) = i;
+        end        
+    end
+else
+    % single shape or exp file
+    distance = ExpToLevelSet_matlab(x,y,contourname);
+end
