Index: /issm/trunk/src/m/utils/Exp/readwrite/expread.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/readwrite/expread.m	(revision 8743)
+++ /issm/trunk/src/m/utils/Exp/readwrite/expread.m	(revision 8744)
@@ -57,9 +57,5 @@
 	%Get number of nods and density
    A=fscanf(fid,'%f %f',[1 2]);
-   if whole==1,
-       Struct(count).nods=A(1);
-   else
-       Struct(count).nods=A(1)-1;
-   end
+   Struct(count).nods=A(1);
    Struct(count).density=A(2);
 
@@ -75,6 +71,18 @@
 	if(Struct(count).nods~=length(Struct(count).x))error(['Profile ' num2str(count) ' reports incorrect length']); end;
 
-	%skip last coordinate if whole=0,
-   if whole==0, fscanf(fid,'%f %f',[1 2]); end
+	%Check if closed
+	if (Struct(count).nods > 1) && ...
+	   (Struct(count).x(end) == Struct(count).x(1)) && ...
+	   (Struct(count).y(end) == Struct(count).y(1))
+		Struct(count).closed=true;
+		%skip last coordinate if whole=0,
+		if whole==0
+			Struct(count).nods=Struct(count).nods-1;
+			Struct(count).x   =Struct(count).x(1:end-1,1);
+			Struct(count).y   =Struct(count).y(1:end-1,1);
+		end
+	else
+		Struct(count).closed=false;
+	end
 
 end
