Index: /issm/trunk/src/m/classes/public/BasinConstrain.m
===================================================================
--- /issm/trunk/src/m/classes/public/BasinConstrain.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/BasinConstrain.m	(revision 5024)
@@ -33,5 +33,5 @@
 		end
 		%ok, flag elements and nodes
-		[gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,expread(domain,1),'element and node',2);
+		[gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
 	end
 	if invert,
Index: /issm/trunk/src/m/classes/public/BasinConstrain2.m
===================================================================
--- /issm/trunk/src/m/classes/public/BasinConstrain2.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/BasinConstrain2.m	(revision 5024)
@@ -33,5 +33,5 @@
 		end
 		%ok, flag elements and nodes
-		[gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,expread(domain,1),'element and node',2);
+		[gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
 	end
 	if invert,
Index: /issm/trunk/src/m/classes/public/BasinConstrainShelf.m
===================================================================
--- /issm/trunk/src/m/classes/public/BasinConstrainShelf.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/BasinConstrainShelf.m	(revision 5024)
@@ -33,5 +33,5 @@
 		end
 		%ok, flag elements and nodes
-		[gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,expread(domain,1),'element and node',2);
+		[gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
 	end
 	if invert,
Index: /issm/trunk/src/m/classes/public/contourenvelope.m
===================================================================
--- /issm/trunk/src/m/classes/public/contourenvelope.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/contourenvelope.m	(revision 5024)
@@ -34,5 +34,5 @@
 if nargin==2,
 	%get flag list of elements and nodes inside the contour
-	nodein=ContourToMesh(md.elements,md.x,md.y,expread(file,1),'node',1);
+	nodein=ContourToMesh(md.elements,md.x,md.y,file,'node',1);
 	elemin=(sum(nodein(md.elements),2)==size(md.elements,2));
 	%modify element connectivity
Index: /issm/trunk/src/m/classes/public/contourmassbalance.m
===================================================================
--- /issm/trunk/src/m/classes/public/contourmassbalance.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/contourmassbalance.m	(revision 5024)
@@ -22,5 +22,5 @@
 
 %get flag list of elements and nodes inside the contour
-nodein=ContourToMesh(md.elements,md.x,md.y,expread(file,1),'node',1);
+nodein=ContourToMesh(md.elements,md.x,md.y,file,'node',1);
 elemin=(sum(nodein(md.elements),2)==size(md.elements,2));
 
Index: /issm/trunk/src/m/classes/public/geography2.m
===================================================================
--- /issm/trunk/src/m/classes/public/geography2.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/geography2.m	(revision 5024)
@@ -15,5 +15,5 @@
 %recover elements and grids on land.
 if ischar(landname),
-	[gridonland,elementonland]=ContourToMesh(elements,x,y,expread(landname,1),'element and node',2);
+	[gridonland,elementonland]=ContourToMesh(elements,x,y,landname,'element and node',2);
 elseif isfloat(landname),
 	if size(landname,1)~=md.numberofelements,
@@ -48,5 +48,5 @@
 		yelem=y(md.elements)*weights{i}/sum(weights{i});
 	end
-	baryonland=ContourToNodes(xelem,yelem,expread(landname,1),1);
+	baryonland=ContourToNodes(xelem,yelem,landname,1);
 	pos=find(~baryonland); elementonland(pos)=0;
 	pos=find(baryonland); elementonland(pos)=1;
Index: /issm/trunk/src/m/classes/public/mesh/meshbamg.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/meshbamg.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/mesh/meshbamg.m	(revision 5024)
@@ -97,5 +97,5 @@
 	%set gridonwater field
 	if ~strcmp(groundeddomain,'N/A'),
-		gridground=ContourToMesh(md.elements,md.x,md.y,expread(groundeddomain,1),'node',2);
+		gridground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
 		md.gridonwater=ones(md.numberofgrids,1);
 		md.gridonwater(find(gridground))=0;
Index: /issm/trunk/src/m/classes/public/mesh/meshexprefine.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/meshexprefine.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/mesh/meshexprefine.m	(revision 5024)
@@ -39,5 +39,5 @@
 
 %Read domainame file into a matlab array (x,y):
-refinearea=ContourToMesh(md.elements,md.x,md.y,expread(domainname,1),'element',1);
+refinearea=ContourToMesh(md.elements,md.x,md.y,domainname,'element',1);
 aires=GetAreas(md.elements,md.x,md.y);
 
Index: /issm/trunk/src/m/classes/public/mesh/meshyams.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/meshyams.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/mesh/meshyams.m	(revision 5024)
@@ -81,5 +81,5 @@
 	%set gridonwater field
 	if ~strcmp(groundeddomain,'N/A'),
-		gridground=ContourToMesh(md.elements,md.x,md.y,expread(groundeddomain,1),'node',2);
+		gridground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
 		md.gridonwater=ones(md.numberofgrids,1);
 		md.gridonwater(find(gridground))=0;
@@ -120,5 +120,5 @@
 md.elementonsurface=ones(md.numberofelements,1);
 if ~strcmp(groundeddomain,'N/A'),
-	gridground=ContourToMesh(md.elements,md.x,md.y,expread(groundeddomain,1),'node',2);
+	gridground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
 	md.gridonwater=ones(md.numberofgrids,1);
 	md.gridonwater(find(gridground))=0;
Index: /issm/trunk/src/m/classes/public/mesh/rifts/meshprocessoutsiderifts.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/rifts/meshprocessoutsiderifts.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/mesh/rifts/meshprocessoutsiderifts.m	(revision 5024)
@@ -12,5 +12,5 @@
 	
 	%first, flag nodes that belong to the domain outline
-	flags=ContourToMesh(md.elements,md.x,md.y,expread(domainoutline,1),'node',0);
+	flags=ContourToMesh(md.elements,md.x,md.y,domainoutline,'node',0);
 
 	rift=md.rifts(i);
Index: /issm/trunk/src/m/classes/public/mesh/rifts/meshprocessrifts.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/rifts/meshprocessrifts.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/mesh/rifts/meshprocessrifts.m	(revision 5024)
@@ -45,5 +45,5 @@
 
 %In case we have rifts that open up the domain outline, we need to open them: 
-flags=ContourToMesh(md.elements,md.x,md.y,expread(domainoutline,1),'node',0);
+flags=ContourToMesh(md.elements,md.x,md.y,domainoutline,'node',0);
 found=0;
 for i=1:md.numrifts,
Index: /issm/trunk/src/m/classes/public/modeldefault/defaultparams.m
===================================================================
--- /issm/trunk/src/m/classes/public/modeldefault/defaultparams.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/modeldefault/defaultparams.m	(revision 5024)
@@ -52,5 +52,5 @@
 		
 	%zones of high md.drag
-	%[rhighmd.drag_coefficient]=ArgusContourToMesh(md.elements,md.x,md.y,expread('HighDrag.exp',1),'node');
+	%[rhighmd.drag_coefficient]=ArgusContourToMesh(md.elements,md.x,md.y,'HighDrag.exp','node');
 	%pos=find(highmd.drag);md.drag_coefficient(pos)=10^3;
 
@@ -79,5 +79,5 @@
 
 	%zones of shear margin softening
-	%[rweakb]=ArgusContourToMesh(md.elements,md.x,md.y,expread('Weakmd.BPIG.exp',1),'node');
+	%[rweakb]=ArgusContourToMesh(md.elements,md.x,md.y,'Weakmd.BPIG.exp','node');
 	%pos=find(weakb);md.rheology_B(pos)=.3*md.rheology_B(pos);
 		
Index: /issm/trunk/src/m/classes/public/plot/processmesh.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/processmesh.m	(revision 5023)
+++ /issm/trunk/src/m/classes/public/plot/processmesh.m	(revision 5024)
@@ -27,5 +27,5 @@
 	if (md.dim==2);
 		is2d=1;
-	else
+	elseif (md.dim==3),
 		if getfieldvalue(options,'layer',0)>=1,
 			is2d=1;
@@ -33,4 +33,6 @@
 			is2d=0;
 		end
+	else
+		error(['dim = ' num2str(md.dim) ' not supported yet']);
 	end
 
Index: /issm/trunk/src/m/utils/BC/SetIceShelfBC.m
===================================================================
--- /issm/trunk/src/m/utils/BC/SetIceShelfBC.m	(revision 5023)
+++ /issm/trunk/src/m/utils/BC/SetIceShelfBC.m	(revision 5024)
@@ -19,5 +19,5 @@
 	icefrontfile=varargin{1};
 	if ~exist(icefrontfile), error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']); end
-	gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,expread(icefrontfile,1),'node',2);
+	gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2);
 	gridonicefront=double(md.gridonboundary & gridinsideicefront);
 elseif nargin==1,
Index: /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m
===================================================================
--- /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 5023)
+++ /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 5024)
@@ -23,5 +23,5 @@
 		error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']);
 	end
-	gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,expread(icefrontfile,1),'node',2);
+	gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2);
 	gridonicefront=double(md.gridonboundary & gridinsideicefront);
 else
Index: /issm/trunk/src/m/utils/Geometry/FlagElements.m
===================================================================
--- /issm/trunk/src/m/utils/Geometry/FlagElements.m	(revision 5023)
+++ /issm/trunk/src/m/utils/Geometry/FlagElements.m	(revision 5024)
@@ -1,9 +1,9 @@
-function flag=FlagElements(md,area),
-%FLAGELEMENTS - flag the elements in an area
+function flag=FlagElements(md,region),
+%FLAGELEMENTS - flag the elements in an region
 %
-%   The area can be given with an exp file, a list of elements.
+%   The region can be given with an exp file, a list of elements.
 %
 %   Usage: 
-%      flag=FlagElements(md,area);
+%      flag=FlagElements(md,region);
 %
 %   Example:
@@ -14,15 +14,15 @@
 %      flag=FlagElements(md,md.elementonicesheet);
 
-	if ischar(area),
-		if isempty(area),
+	if ischar(region),
+		if isempty(region),
 			flag=zeros(md.numberofelements,1);
 			invert=0;
-		elseif strcmpi(area,'all')
+		elseif strcmpi(region,'all')
 			flag=ones(md.numberofelements,1);
 			invert=0;
 		else
 			%make sure that we actually don't want the elements outside the domain outline!
-			if strcmpi(area(1),'~'),
-				area=area(2:length(area));
+			if strcmpi(region(1),'~'),
+				region=region(2:length(region));
 				invert=1;
 			else
@@ -30,12 +30,12 @@
 			end
 
-			%does the area domain outline exist or do we have to look for xlim,ylim in basinzoom?
-			if ~exist(area,'file'),
-				[xlim,ylim]=basinzoom(area);
+			%does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
+			if ~exist(region,'file'),
+				[xlim,ylim]=basinzoom(region);
 				flag_nodes=double(md.x<xlim(2) & md.x>xlim(1) &  md.y<ylim(2) & md.y>ylim(1));
 				flag=prod(flag_nodes(md.elements),2);
 			else
 				%ok, flag elements
-				flag=ContourToMesh(md.elements(:,1:3),md.x,md.y,expread(area,1),'element',1);
+				flag=ContourToMesh(md.elements(:,1:3),md.x,md.y,region,'element',1);
 			end
 		end
@@ -43,12 +43,12 @@
 			flag=~flag;
 		end
-	elseif isfloat(area),
-		if size(area,1)~=md.numberofelements,
+	elseif isfloat(region),
+		if size(region,1)~=md.numberofelements,
 			help FlagElements
-			error('Flaglist for area must be of same size as number of elements in model');
+			error('Flaglist for region must be of same size as number of elements in model');
 		end
-		flag=area;
+		flag=region;
 	else
-		error('Invalid area option option');
+		error('Invalid region option option');
 	end
 end
