Index: /issm/trunk-jpl/src/m/exp/contourlevelzero.m
===================================================================
--- /issm/trunk-jpl/src/m/exp/contourlevelzero.m	(revision 24028)
+++ /issm/trunk-jpl/src/m/exp/contourlevelzero.m	(revision 24029)
@@ -11,9 +11,14 @@
 %process data 
 if dimension(md.mesh)==3,
-	error('contourlevelzero error message: routine not supported for 3d meshes, project on a layer');
-end
-
-x=md.mesh.x;
-y=md.mesh.y;
+% 	error('contourlevelzero error message: routine not supported for 3d meshes, project on a layer');
+	x = md.mesh.x2d;
+	y = md.mesh.y2d;
+	index=md.mesh.elements2d;
+else
+	x=md.mesh.x;
+	y=md.mesh.y;
+	index=md.mesh.elements;
+end
+
 if isfield(md.mesh,'z'),
 	z=md.mesh.z;
@@ -21,8 +26,11 @@
 	z=zeros(md.mesh.numberofvertices,1);
 end
-index=md.mesh.elements;
 
 if isempty(mask), error('mask provided is empty'); end
-if length(mask)~=md.mesh.numberofvertices, error('mask provided should be specified at the vertices of the mesh'); end
+if dimension(md.mesh)==3,
+	if length(mask)~=md.mesh.numberofvertices2d, error('mask provided should be specified at the vertices of the mesh'); end
+else
+	if length(mask)~=md.mesh.numberofvertices, error('mask provided should be specified at the vertices of the mesh'); end
+end
 
 %initialization of some variables
