Index: /issm/trunk-jpl/src/m/mesh/bamg.m
===================================================================
--- /issm/trunk-jpl/src/m/mesh/bamg.m	(revision 16257)
+++ /issm/trunk-jpl/src/m/mesh/bamg.m	(revision 16258)
@@ -64,5 +64,14 @@
 	domainfile=getfieldvalue(options,'domain');
 	if ~exist(domainfile,'file') error(['bamg error message: file ' domainfile ' not found']); end
-	domain=expread(domainfile);
+	
+	%read domain according to its extension: 
+	[path,name,ext]=fileparts(domainfile);
+	if strcmp(ext,'.exp'),
+		domain=expread(domainfile);
+	elseif strcmp(ext,'.shp'),
+		domain=shpread(domainfile);
+	else
+		error(['bamg error message: file ' domainfile ' format not supported (.shp or .exp)']);
+	end
 
 	%Build geometry 
Index: /issm/trunk-jpl/src/m/shp/shpread.m
===================================================================
--- /issm/trunk-jpl/src/m/shp/shpread.m	(revision 16257)
+++ /issm/trunk-jpl/src/m/shp/shpread.m	(revision 16258)
@@ -31,5 +31,5 @@
 for i=1:length(shp),
 	if strcmpi(shp(i).Geometry,'Polygon'),
-		x=shp(i).X; y=shp(i).Y;
+		x=shp(i).X'; y=shp(i).Y';
 		ids=find(isnan(x));
 		x(ids)=[]; y(ids)=[];
