Index: /issm/trunk-jpl/src/m/classes/model.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/model.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/classes/model.m	(revision 17559)
@@ -113,5 +113,5 @@
 			%2014 March 26th
 			if isa(md.mesh,'mesh'),
-				if(md.mesh.dimension==2),
+				if(strcmp(meshtype(md.mesh),'2Dhorizontal')),
 					md.mesh=mesh2d(md.mesh);
 				else
Index: /issm/trunk-jpl/src/m/classes/modellist.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/modellist.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/classes/modellist.m	(revision 17559)
@@ -32,5 +32,5 @@
 
 			%2D or 3D?
-			if md.mesh.dimension==3,
+			if strcmp(meshtype(md.mesh),'3D'),
 				numberofelements=md.mesh.numberofelements2d; %this will be forgotten when we get out.
 				flags=project2d(md,flags,1);
@@ -84,5 +84,5 @@
 			for i=1:size(flag_list,1),
 				disp(['   ' num2str(i) '/' num2str(size(flag_list,1))]);
-				if md.mesh.dimension==3,
+				if strcmp(meshtype(md.mesh),'3D'),
 					flags2d=flag_list{i};
 					realflags=project3d(md,flags2d,'element');
Index: /issm/trunk-jpl/src/m/classes/rifts.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/rifts.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/classes/rifts.m	(revision 17559)
@@ -28,5 +28,5 @@
 			end
 			if numrifts,
-				if ~(md.mesh.dimension==2),
+				if ~(strcmp(meshtype(md.mesh),'2Dhorizontal')),
 					md = checkmessage(md,['models with rifts are only supported in 2d for now!']);
 				end
Index: /issm/trunk-jpl/src/m/classes/rifts.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/rifts.py	(revision 17558)
+++ /issm/trunk-jpl/src/m/classes/rifts.py	(revision 17559)
@@ -39,5 +39,5 @@
 
 		if numrifts:
-			if not md.mesh.dimension==2:
+			if not m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
 				md.checkmessage("models with rifts are only supported in 2d for now!")
 			if not isinstance(self.riftstruct,list):
Index: /issm/trunk-jpl/src/m/classes/spheremesh.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/spheremesh.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/classes/spheremesh.m	(revision 17559)
@@ -13,5 +13,4 @@
 		phi                         = NaN
 		elements                    = NaN
-		dimension                   = 0;
 		numberoflayers              = 0;
 		numberofelements            = 0;
@@ -49,36 +48,12 @@
 			md = checkfield(md,'fieldname','spheremesh.phi','NaN',1,'size',[md.spheremesh.numberofvertices 1]);
 			md = checkfield(md,'fieldname','spheremesh.elements','NaN',1,'>',0,'values',1:md.spheremesh.numberofvertices);
-			if(md.spheremesh.dimension==2),
-				md = checkfield(md,'fieldname','spheremesh.elements','size',[md.spheremesh.numberofelements 3]);
-			else
-				md = checkfield(md,'fieldname','spheremesh.elements','size',[md.spheremesh.numberofelements 6]);
-			end
+			md = checkfield(md,'fieldname','spheremesh.elements','size',[md.spheremesh.numberofelements 3]);
 			if any(~ismember(1:md.spheremesh.numberofvertices,sort(unique(md.spheremesh.elements(:)))));
 				md = checkmessage(md,'orphan nodes have been found. Check the spheremesh outline');
 			end
-			md = checkfield(md,'fieldname','spheremesh.dimension','values',[2 3]);
 			md = checkfield(md,'fieldname','spheremesh.numberoflayers','>=',0);
 			md = checkfield(md,'fieldname','spheremesh.numberofelements','>',0);
 			md = checkfield(md,'fieldname','spheremesh.numberofvertices','>',0);
-			if (md.spheremesh.dimension==2),
-				md = checkfield(md,'fieldname','spheremesh.average_vertex_connectivity','>=',9,'message','''spheremesh.average_vertex_connectivity'' should be at least 9 in 2d');
-			else
-				md = checkfield(md,'fieldname','spheremesh.average_vertex_connectivity','>=',24,'message','''spheremesh.average_vertex_connectivity'' should be at least 24 in 3d');
-			end
 			md = checkfield(md,'fieldname','spheremesh.elementconnectivity','size',[md.spheremesh.numberofelements 3],'NaN',1);
-
-			%Solution specific checks
-			switch(solution),
-				case MasstransportSolutionEnum(),
-					if md.masstransport.stabilization==3,
-						md = checkfield(md,'fieldname','spheremesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d spheremeshes');
-					end
-				case TransientSolutionEnum(),
-					if md.transient.ismasstransport & md.masstransport.stabilization==3,
-						md = checkfield(md,'fieldname','spheremesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d spheremeshes');
-					end
-				case ThermalSolutionEnum(),
-					md = checkfield(md,'fieldname','spheremesh.dimension','values',3,'message','thermal solution only supported on 3d spheremeshes');
-			end
 		end % }}}
 		function disp(obj) % {{{
@@ -97,5 +72,4 @@
 
 			disp(sprintf('\n      Properties:'));
-			fielddisplay(obj,'dimension','spheremesh dimension (2d or 3d)');
 			fielddisplay(obj,'numberoflayers','number of extrusion layers');
 
@@ -113,5 +87,4 @@
 			WriteData(fid,'object',obj,'fieldname','phi','format','DoubleMat','mattype',1);
 			WriteData(fid,'object',obj,'fieldname','elements','format','DoubleMat','mattype',2);
-			WriteData(fid,'object',obj,'fieldname','dimension','format','Integer');
 			WriteData(fid,'object',obj,'fieldname','numberoflayers','format','Integer');
 			WriteData(fid,'object',obj,'fieldname','numberofelements','format','Integer');
Index: /issm/trunk-jpl/src/m/classes/thermal.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/thermal.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/classes/thermal.m	(revision 17559)
@@ -64,5 +64,5 @@
 			md = checkfield(md,'fieldname','thermal.stabilization','numel',[1],'values',[0 1 2]);
 			md = checkfield(md,'fieldname','thermal.spctemperature','forcing',1);
-			if (ismember(EnthalpyAnalysisEnum(),analyses) & md.thermal.isenthalpy & md.mesh.dimension==3),
+			if (ismember(EnthalpyAnalysisEnum(),analyses) & md.thermal.isenthalpy & strcmp(meshtype(md.mesh),'3D')),
 				pos=find(md.thermal.spctemperature(1:md.mesh.numberofvertices,:)~=NaN);
 				replicate=repmat(md.geometry.surface-md.mesh.z,1,size(md.thermal.spctemperature,2));
Index: /issm/trunk-jpl/src/m/classes/thermal.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/thermal.py	(revision 17558)
+++ /issm/trunk-jpl/src/m/classes/thermal.py	(revision 17559)
@@ -81,5 +81,5 @@
 		md = checkfield(md,'fieldname','thermal.stabilization','numel',[1],'values',[0,1,2])
 		md = checkfield(md,'fieldname','thermal.spctemperature','forcing',1)
-		if EnthalpyAnalysisEnum() in analyses and md.thermal.isenthalpy and md.mesh.dimension==3:
+		if EnthalpyAnalysisEnum() in analyses and md.thermal.isenthalpy and m.strcmp(md.mesh.meshtype(),'3D'):
 			pos=numpy.nonzero(numpy.logical_not(numpy.isnan(md.thermal.spctemperature[0:md.mesh.numberofvertices])))
 			replicate=numpy.tile(md.geometry.surface-md.mesh.z,(1,numpy.size(md.thermal.spctemperature,axis=1)))
Index: /issm/trunk-jpl/src/m/contrib/ecco/PropagateFlagsUntilDistance.m
===================================================================
--- /issm/trunk-jpl/src/m/contrib/ecco/PropagateFlagsUntilDistance.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/contrib/ecco/PropagateFlagsUntilDistance.m	(revision 17559)
@@ -10,5 +10,5 @@
 
 %make 3d work in 2d: 
-if md.mesh.dimension==3,
+if strcmp(meshtype(md.mesh),'3D'),
 	md.mesh.x=md.mesh.x2d;
 	md.mesh.y=md.mesh.y2d;
Index: /issm/trunk-jpl/src/m/contrib/hack/tres.m
===================================================================
--- /issm/trunk-jpl/src/m/contrib/hack/tres.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/contrib/hack/tres.m	(revision 17559)
@@ -9,5 +9,5 @@
 
 if strcmpi(string,'stressbalance'),
-	if md.mesh.dimension==2,
+	if strcmp(meshtype(md.mesh),'2Dhorizontal'),
 		md.initialization.vx=md.results.StressbalanceSolution.Vx;
 		md.initialization.vy=md.results.StressbalanceSolution.Vy;
Index: /issm/trunk-jpl/src/m/contrib/massbalance/divergence.m
===================================================================
--- /issm/trunk-jpl/src/m/contrib/massbalance/divergence.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/contrib/massbalance/divergence.m	(revision 17559)
@@ -5,5 +5,5 @@
 %      div=divergence(md,a,b)
 
-if (md.mesh.dimension==2),
+if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
 	numberofelements=md.mesh.numberofelements;
 	numberofnodes=md.mesh.numberofvertices;
Index: /issm/trunk-jpl/src/m/contrib/massbalance/outflux.m
===================================================================
--- /issm/trunk-jpl/src/m/contrib/massbalance/outflux.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/contrib/massbalance/outflux.m	(revision 17559)
@@ -16,5 +16,5 @@
 
 if nargin==1,
-	if md.mesh.dimension==3,
+	if strcmp(meshtype(md.mesh),'3D'),
 		vxa=DepthAverage(md,md.initialization.vx);
 		vya=DepthAverage(md,md.initialization.vy);
@@ -28,5 +28,5 @@
 else
 	step=varargin{1};
-	if md.mesh.dimension==3,
+	if strcmp(meshtype(md.mesh),'3D'),
 		vxa=DepthAverage(md,md.results.TransientSolution(step).Vx);
 		vya=DepthAverage(md,md.results.TransientSolution(step).Vy);
Index: /issm/trunk-jpl/src/m/exp/contourlevelzero.m
===================================================================
--- /issm/trunk-jpl/src/m/exp/contourlevelzero.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/exp/contourlevelzero.m	(revision 17559)
@@ -10,5 +10,5 @@
 
 %process data 
-if md.mesh.dimension==3,
+if strcmp(meshtype(md.mesh),'3D'),
 	error('contourlevelzero error message: routine not supported for 3d meshes, project on a layer');
 end
Index: /issm/trunk-jpl/src/m/geometry/slope.m
===================================================================
--- /issm/trunk-jpl/src/m/geometry/slope.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/geometry/slope.m	(revision 17559)
@@ -7,5 +7,5 @@
 
 %load some variables (it is much faster if the variab;es are loaded from md once for all) 
-if (md.mesh.dimension==2),
+if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
 	numberofelements=md.mesh.numberofelements;
 	numberofnodes=md.mesh.numberofvertices;
@@ -30,5 +30,5 @@
 s=sqrt(sx.^2+sy.^2);
 
-if md.mesh.dimension==3,
+if strcmp(meshtype(md.mesh),'3D'),
 	sx=project3d(md,'vector',sx,'type','element');
 	sy=project3d(md,'vector',sy,'type','element');
Index: /issm/trunk-jpl/src/m/geometry/slope.py
===================================================================
--- /issm/trunk-jpl/src/m/geometry/slope.py	(revision 17558)
+++ /issm/trunk-jpl/src/m/geometry/slope.py	(revision 17559)
@@ -12,5 +12,5 @@
 
 	#load some variables (it is much faster if the variables are loaded from md once for all) 
-	if md.mesh.dimension==2:
+	if m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
 		numberofelements=md.mesh.numberofelements
 		numberofnodes=md.mesh.numberofvertices
@@ -39,5 +39,5 @@
 	s=npy.sqrt(sx**2+sy**2)
 
-	if md.mesh.dimension==3:
+	if m.strcmp(md.mesh.meshtype(),'3D'):
 		sx=project3d(md,'vector',sx,'type','element')
 		sy=project3d(md,'vector',sy,'type','element')
Index: /issm/trunk-jpl/src/m/interp/SectionValues.m
===================================================================
--- /issm/trunk-jpl/src/m/interp/SectionValues.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/interp/SectionValues.m	(revision 17559)
@@ -29,5 +29,5 @@
 	error('SectionValues error message: wrong resolution type. Resolution must be an array [horizontal_resolution vertical_resolution]')
 end
-if md.mesh.dimension==3
+if strcmp(meshtype(md.mesh),'3D')
 	if (length(resolution)==2 & isnumeric(resolution(2)))
 		res_v=resolution(2);
@@ -78,5 +78,5 @@
 
 %New mesh and Data interpolation
-if (md.mesh.dimension==2)
+if (strcmp(meshtype(md.mesh),'2Dhorizontal'))
 
 	%Interpolation of data on specified points
Index: /issm/trunk-jpl/src/m/interp/averaging.m
===================================================================
--- /issm/trunk-jpl/src/m/interp/averaging.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/interp/averaging.m	(revision 17559)
@@ -25,5 +25,5 @@
 	error('averaging error message: data not supported yet');
 end
-if md.mesh.dimension==3 & nargin==4,
+if strcmp(meshtype(md.mesh),'3D') & nargin==4,
 	if varargin{1}<=0 | varargin{1}>md.mesh.numberoflayers,
 		error('layer should be between 1 and md.mesh.numberoflayers');
@@ -56,8 +56,8 @@
 %build some variables
 line=index(:);
-if md.mesh.dimension==3 & layer==0,
+if strcmp(meshtype(md.mesh),'3D') & layer==0,
 	rep=6;
 	areas=GetAreas(index,md.mesh.x,md.mesh.y,md.mesh.z);
-elseif md.mesh.dimension==2,
+elseif strcmp(meshtype(md.mesh),'2Dhorizontal'),
 	rep=3;
 	areas=GetAreas(index,md.mesh.x,md.mesh.y);
Index: /issm/trunk-jpl/src/m/interp/averaging.py
===================================================================
--- /issm/trunk-jpl/src/m/interp/averaging.py	(revision 17558)
+++ /issm/trunk-jpl/src/m/interp/averaging.py	(revision 17559)
@@ -27,5 +27,5 @@
 	if len(data)!=md.mesh.numberofelements and len(data)!=md.mesh.numberofvertices:
 		raise StandardError('averaging error message: data not supported yet')
-	if md.mesh.dimension==3 and layer!=0:
+	if m.strcmp(md.mesh.meshtype(),'3D') and layer!=0:
 		if layer<=0 or layer>md.mesh.numberoflayers:
 			raise ValueError('layer should be between 1 and md.mesh.numberoflayers')
@@ -53,8 +53,8 @@
 	
 	#build some variables
-	if md.mesh.dimension==3 and layer==0:
+	if m.strcmp(md.mesh.meshtype(),'3D') and layer==0:
 		rep=6
 		areas=GetAreas(index,md.mesh.x,md.mesh.y,md.mesh.z)
-	elif md.mesh.dimension==2:
+	elif m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
 		rep=3
 		areas=GetAreas(index,md.mesh.x,md.mesh.y)
Index: /issm/trunk-jpl/src/m/inversions/velocitymisfit.m
===================================================================
--- /issm/trunk-jpl/src/m/inversions/velocitymisfit.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/inversions/velocitymisfit.m	(revision 17559)
@@ -9,5 +9,5 @@
 %
 
-if md.mesh.dimension==2,
+if strcmp(meshtype(md.mesh),'2Dhorizontal'),
 	elements=md.mesh.elements;
 	x=md.mesh.x;
Index: /issm/trunk-jpl/src/m/mech/analyticaldamage.m
===================================================================
--- /issm/trunk-jpl/src/m/mech/analyticaldamage.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/mech/analyticaldamage.m	(revision 17559)
@@ -48,5 +48,5 @@
 	error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)']);
 end
-if ~(md.mesh.dimension==2),
+if ~(strcmp(meshtype(md.mesh),'2Dhorizontal')),
 	error('only 2d model supported currently');
 end
Index: /issm/trunk-jpl/src/m/mech/backstressfrominversion.m
===================================================================
--- /issm/trunk-jpl/src/m/mech/backstressfrominversion.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/mech/backstressfrominversion.m	(revision 17559)
@@ -41,5 +41,5 @@
 	error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)']);
 end
-if ~(md.mesh.dimension==2),
+if ~(strcmp(meshtype(md.mesh),'2Dhorizontal')),
 	error('only 2d model supported currently');
 end
Index: /issm/trunk-jpl/src/m/mech/damagefrominversion.m
===================================================================
--- /issm/trunk-jpl/src/m/mech/damagefrominversion.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/mech/damagefrominversion.m	(revision 17559)
@@ -21,5 +21,5 @@
 	error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)']);
 end
-if ~(md.mesh.dimension==2),
+if ~(strcmp(meshtype(md.mesh),'2Dhorizontal')),
 	error('only 2d model supported currently');
 end
Index: /issm/trunk-jpl/src/m/mech/mechanicalproperties.m
===================================================================
--- /issm/trunk-jpl/src/m/mech/mechanicalproperties.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/mech/mechanicalproperties.m	(revision 17559)
@@ -17,5 +17,5 @@
 	%error(['the input velocity should be of size ' num2str(md.mesh.numberofvertices) '!'])
 end
-if ~(md.mesh.dimension==2)
+if ~(strcmp(meshtype(md.mesh),'2Dhorizontal'))
 	error('only 2d model supported yet');
 end
Index: /issm/trunk-jpl/src/m/mech/strainrateuncert.m
===================================================================
--- /issm/trunk-jpl/src/m/mech/strainrateuncert.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/mech/strainrateuncert.m	(revision 17559)
@@ -32,5 +32,5 @@
 	error(['the velocity error dvy should be of size ' num2str(md.mesh.numberofelements) ' or 1!'])
 end
-if ~(md.mesh.dimension==2)
+if ~(strcmp(meshtype(md.mesh),'2Dhorizontal'))
 	error('only 2d model supported yet');
 end
Index: /issm/trunk-jpl/src/m/mech/thomasparams.m
===================================================================
--- /issm/trunk-jpl/src/m/mech/thomasparams.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/mech/thomasparams.m	(revision 17559)
@@ -51,5 +51,5 @@
 	error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)'])
 end
-if ~(md.mesh.dimension==2)
+if ~(strcmp(meshtype(md.mesh),'2Dhorizontal'))
 	error('only 2d model supported currently');
 end
Index: /issm/trunk-jpl/src/m/mesh/bamg.m
===================================================================
--- /issm/trunk-jpl/src/m/mesh/bamg.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/mesh/bamg.m	(revision 17559)
@@ -284,5 +284,5 @@
 %}}}
 % Bamg Mesh parameters {{{
-if (~exist(options,'domain') & md.mesh.numberofvertices~=0 & md.mesh.dimension==2),
+if (~exist(options,'domain') & md.mesh.numberofvertices~=0 & strcmp(meshtype(md.mesh),'2Dhorizontal')),
 
 	if isstruct(md.private.bamg) & isfield(md.private.bamg,'mesh'),
Index: /issm/trunk-jpl/src/m/mesh/bamg.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/bamg.py	(revision 17558)
+++ /issm/trunk-jpl/src/m/mesh/bamg.py	(revision 17559)
@@ -272,5 +272,5 @@
 	#}}}
 	# Bamg Mesh parameters {{{
-	if not options.exist('domain') and md.mesh.numberofvertices and md.mesh.dimension==2:
+	if not options.exist('domain') and md.mesh.numberofvertices and m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
 
 		if isinstance(md.private.bamg,dict) and 'mesh' in md.private.bamg:
Index: /issm/trunk-jpl/src/m/partition/AreaAverageOntoPartition.m
===================================================================
--- /issm/trunk-jpl/src/m/partition/AreaAverageOntoPartition.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/partition/AreaAverageOntoPartition.m	(revision 17559)
@@ -9,5 +9,5 @@
 
 %some checks
-if md.mesh.dimension==3,
+if strcmp(meshtype(md.mesh),'3D'),
 	if nargin~=3,
 		error('layer should be provided onto which Area Averaging occurs');
@@ -51,5 +51,5 @@
 
 %in 3D, restore 3D model:
-if md.mesh.dimension==3,
+if strcmp(meshtype(md.mesh),'3D'),
 	md=md3d;
 end
Index: /issm/trunk-jpl/src/m/partition/partitioner.m
===================================================================
--- /issm/trunk-jpl/src/m/partition/partitioner.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/partition/partitioner.m	(revision 17559)
@@ -30,5 +30,5 @@
 recomputeadjacency=getfieldvalue(options,'recomputeadjacency');
 
-if(md.mesh.dimension==3),
+if(strcmp(meshtype(md.mesh),'3D')),
 	%partitioning essentially happens in 2D. So partition in 2D, then 
 	%extrude the partition vector vertically. 
@@ -69,5 +69,9 @@
 
 	%  partition into nparts
-	part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y ,md.mesh.z,method,npart,[])'+1; %index partitions from 1 up. like metis.
+	if isa(md.mesh,'mesh2d'),
+		part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,zeros(md.mesh.numberofvertices,1),method,npart,[])'+1; %index partitions from 1 up. like metis.
+	else
+		part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,md.mesh.z,method,npart,[])'+1; %index partitions from 1 up. like metis.
+	end
 
 elseif strcmpi(package,'scotch'),
@@ -96,5 +100,5 @@
 
 %extrude if we are in 3D:
-if md.mesh.dimension==3,
+if strcmp(meshtype(md.mesh),'3D'),
 	md3d.qmu.vertex_weight=md.qmu.vertex_weight;
 	md3d.qmu.adjacency=md.qmu.adjacency;
Index: /issm/trunk-jpl/src/m/plot/plot_basaldrag.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_basaldrag.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_basaldrag.m	(revision 17559)
@@ -9,5 +9,5 @@
 
 %check layer
-if md.mesh.dimension==3,
+if strcmp(meshtype(md.mesh),'3D'),
 	if getfieldvalue(options,'layer',1)~=1;
 		disp('plot_basaldrag warning: basal drag is displayed in the lower layer')
Index: /issm/trunk-jpl/src/m/plot/plot_edges.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_edges.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_edges.m	(revision 17559)
@@ -17,5 +17,5 @@
 end
 
-if (md.mesh.dimension==2),
+if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
 	%plot mesh
 	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
Index: /issm/trunk-jpl/src/m/plot/plot_icefront.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_icefront.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_icefront.m	(revision 17559)
@@ -19,5 +19,5 @@
 elementzeroice=sum(zeroice(md.mesh.elements),2);
 
-if (md.mesh.dimension==2),
+if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
 	icefront=(elementice & elementnoice) & ~(elementice==2 & elementzeroice);
 
Index: /issm/trunk-jpl/src/m/plot/plot_penalties.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_penalties.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_penalties.m	(revision 17559)
@@ -21,5 +21,5 @@
 end
 
-if ~md.mesh.dimension==3,
+if ~strcmp(meshtype(md.mesh),'3D'),
 	error('no penalties to plot for ''2d'' model');
 elseif isempty(md.penalties),
Index: /issm/trunk-jpl/src/m/plot/plot_qmu_mass_flux_segments.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_qmu_mass_flux_segments.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_qmu_mass_flux_segments.m	(revision 17559)
@@ -13,5 +13,5 @@
 allsegments=md.qmu.mass_flux_segments;
 
-if (md.mesh.dimension==2),
+if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
 
 	%recover segments
Index: /issm/trunk-jpl/src/m/plot/plot_referential.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_referential.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_referential.m	(revision 17559)
@@ -28,5 +28,5 @@
 Yhat=cross(Zhat,Xhat);
 
-if (md.mesh.dimension==2),
+if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
 
 	%plot mesh
Index: /issm/trunk-jpl/src/m/plot/plot_section.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_section.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_section.m	(revision 17559)
@@ -203,12 +203,12 @@
 %apply options
 options=addfielddefault(options,'title','Section value');
-if (md.mesh.dimension==2)
+if (strcmp(meshtype(md.mesh),'2Dhorizontal'))
 	options=addfielddefault(options,'colorbar',0);
 end
-if ((md.mesh.dimension==2) | getfieldvalue(options,'view')==2 )
+if ((strcmp(meshtype(md.mesh),'2Dhorizontal')) | getfieldvalue(options,'view')==2 )
 	options=addfielddefault(options,'xlabel','Curvilinear coordinate');
 	options=addfielddefault(options,'axis','auto');
 end
-if (md.mesh.dimension==3 & getfieldvalue(options,'view')==2 )
+if (strcmp(meshtype(md.mesh),'3D') & getfieldvalue(options,'view')==2 )
 	options=addfielddefault(options,'ylabel','z');
 end
Index: /issm/trunk-jpl/src/m/plot/plot_segments.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_segments.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_segments.m	(revision 17559)
@@ -14,5 +14,5 @@
 segments=md.mesh.segments;
 
-if (md.mesh.dimension==2),
+if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
 	%plot mesh
 	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
Index: /issm/trunk-jpl/src/m/plot/plot_tensor_components.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_tensor_components.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_tensor_components.m	(revision 17559)
@@ -10,9 +10,9 @@
 upperplots=fix((i-1)/width);
 if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
-if (md.mesh.dimension==2)%3 components -> 3 indexes
+if (strcmp(meshtype(md.mesh),'2Dhorizontal'))%3 components -> 3 indexes
 	index1=4*width*upperplots+2*leftplots+1;
 	index2=index1+1;
 	index3=index1+width*2;
-elseif md.mesh.dimension==3%6 components -> 6 indexes
+elseif strcmp(meshtype(md.mesh),'3D')%6 components -> 6 indexes
 	index1=3*3*width*upperplots+3*leftplots+1;
 	index2=index1+1;
@@ -28,5 +28,5 @@
 [tensor.yy datatype]=processdata(md,tensor.yy,options);
 [tensor.xy datatype]=processdata(md,tensor.xy,options);
-if  md.mesh.dimension==3
+if  strcmp(meshtype(md.mesh),'3D')
 	[tensor.xz datatype]=processdata(md,tensor.xz,options);
 	[tensor.yz datatype]=processdata(md,tensor.yz,options);
@@ -34,5 +34,5 @@
 end
 
-if ((md.mesh.dimension==2)),
+if ((strcmp(meshtype(md.mesh),'2Dhorizontal'))),
 	subplot(2*width,2*width,index1),
 	plot_unit(x,y,z,elements,tensor.xx,is2d,isplanet,datatype,options)
Index: /issm/trunk-jpl/src/m/plot/plot_tensor_principal.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_tensor_principal.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_tensor_principal.m	(revision 17559)
@@ -10,5 +10,5 @@
 upperplots=fix((i-1)/width);
 if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
-if (md.mesh.dimension==2)%3 components -> 3 indexes
+if (strcmp(meshtype(md.mesh),'2Dhorizontal'))%3 components -> 3 indexes
 	index1=4*width*upperplots+2*leftplots+1;
 	index2=index1+1;
@@ -16,5 +16,5 @@
 	index4=index3+1;
 	newwidth=2*width;
-elseif md.mesh.dimension==3%6 components -> 6 indexes
+elseif strcmp(meshtype(md.mesh),'3D')%6 components -> 6 indexes
 	index1=3*3*width*upperplots+3*leftplots+1;
 	index2=index1+1;
@@ -31,5 +31,5 @@
 type2=[type 'axis2'];
 plot_tensor_principalaxis(md,options,newwidth,index2,tensor,type2,plot_options);
-if  md.mesh.dimension==3
+if  strcmp(meshtype(md.mesh),'3D')
 	type3=[type 'axis3'];
 	plot_tensor_principalaxis(md,options,newwidth,index3,tensor,type3,plot_options);
@@ -40,9 +40,9 @@
 [tensor.principalvalue1 datatype]=processdata(md,tensor.principalvalue1,options);
 [tensor.principalvalue2 datatype]=processdata(md,tensor.principalvalue2,options);
-if  md.mesh.dimension==3
+if  strcmp(meshtype(md.mesh),'3D')
 	[tensor.principalvalue3 datatype]=processdata(md,tensor.principalvalue3,options);
 end
 
-if ((md.mesh.dimension==2)),
+if ((strcmp(meshtype(md.mesh),'2Dhorizontal'))),
 	subplot(2*width,2*width,index3)
 	plot_unit(x,y,z,elements,tensor.principalvalue1,is2d,isplanet,datatype,options)
Index: /issm/trunk-jpl/src/m/plot/plot_tensor_principalaxis.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_tensor_principalaxis.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_tensor_principalaxis.m	(revision 17559)
@@ -13,5 +13,5 @@
 [x y z elements is2d isplanet]=processmesh(md,[],options);
 
-if ((md.mesh.dimension==2)),
+if ((strcmp(meshtype(md.mesh),'2Dhorizontal'))),
 	eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2);'])
 	eval(['value=tensor.principalvalue' type(end) ';']);
@@ -33,5 +33,5 @@
 
 %plot quivers
-if (md.mesh.dimension==2),
+if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
 
 	%density
Index: /issm/trunk-jpl/src/m/plot/plot_transient_results.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_transient_results.m	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/plot_transient_results.m	(revision 17559)
@@ -41,5 +41,5 @@
 clear string;
 
-if md.mesh.dimension==3,
+if strcmp(meshtype(md.mesh),'3D'),
 	string='plotmodel(md';
 	for i=1:length(md.results.transient),
@@ -67,5 +67,5 @@
 clear string;
 
-if md.mesh.dimension==3,
+if strcmp(meshtype(md.mesh),'3D'),
 	string='plotmodel(md';
 	for i=2:length(md.results.transient),
Index: /issm/trunk-jpl/src/m/plot/processmesh.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/processmesh.py	(revision 17558)
+++ /issm/trunk-jpl/src/m/plot/processmesh.py	(revision 17559)
@@ -44,7 +44,7 @@
 
 		#is it a 2D plot?
-		if md.mesh.dimension==2:
+		if m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
 			is2d=1
-		elif md.mesh.dimension==3:
+		elif m.strcmp(md.mesh.meshtype(),'3D'):
 			if options.getfieldvalue('layer',0)>=1:
 				is2d=1
@@ -66,5 +66,5 @@
 	else:
 		#Process mesh for plotting 
-		if md.mesh.dimension==2:
+		if m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
 			is2d=1
 		else:
