Index: /issm/trunk-jpl/src/m/exp/contourlevelzero.m
===================================================================
--- /issm/trunk-jpl/src/m/exp/contourlevelzero.m	(revision 26791)
+++ /issm/trunk-jpl/src/m/exp/contourlevelzero.m	(revision 26792)
@@ -1,3 +1,3 @@
-function contours=contourlevelzero(md,mask,level)
+function contours=contourlevelzero(md,mask,level,varargin)
 %CONTOURLEVELZERO - figure out the zero level (or offset thereof, specified by the level value) 
 %                   of a vectorial mask, and vectorialize it into an exp or shp compatible 
@@ -7,5 +7,15 @@
 %      contours=contourlevelzero(md,mask,level)
 %
+%   Example:
+%      contours=contourlevelzero(md, md.results.TransientSolution(end).MaskOceanLevelset,0);
+%      contours=contourlevelzero(md, md.results.TransientSolution(end).MaskOceanLevelset,0,'output','vector');
+%
+%   Supported options:
+%      'output': either 'matrix' (with NaN delimiters) or 'struct' (default)
+%
 %   See also: PLOT_CONTOUR
+
+%Process options
+options = pairoptions(varargin{:});
 
 %process data 
@@ -228,2 +238,10 @@
 
 end
+
+%process output
+if strcmp(getfieldvalue(options,'output',1),'matrix')
+	x = cell2mat(cellfun(@(x) [x;NaN],{contours(:).x},'UniformOutput',0)');
+	y = cell2mat(cellfun(@(x) [x;NaN],{contours(:).y},'UniformOutput',0)');
+
+	contours = [x y];
+end
