Index: /issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 8736)
+++ /issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 8737)
@@ -31,4 +31,5 @@
 	int     *pnvert=NULL;
 	double  **pprofx=NULL,**pprofy=NULL;
+	bool    *closed=NULL;
 	double  *lat=NULL,*lon=NULL;
 
@@ -52,5 +53,5 @@
 /*  read exp file  */
 
-	if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,filexp))
+	if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp))
 		_error_("Error reading exp file.");
 
Index: /issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 8736)
+++ /issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 8737)
@@ -11,5 +11,5 @@
 #include "../Exceptions/exceptions.h"
 
-int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,char* domainname){
+int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname){
 
 	
@@ -29,4 +29,5 @@
 	double** pprofx=NULL; //array of profiles x coordinates
 	double** pprofy=NULL; //array of profiles y coordinates
+	bool* closed=NULL; //array holding closed flags for the nprof profiles
 
 	/*For each profile: */
@@ -34,4 +35,5 @@
 	double* x=NULL;
 	double* y=NULL;
+	bool cl;
 
 	/*open domain outline file for reading: */
@@ -68,4 +70,5 @@
 		pprofy[i]=NULL;
 	}
+	closed=(bool*)xmalloc(nprof*sizeof(bool));
 
 	/*Reaset file pointer to beginning of file: */
@@ -97,6 +100,8 @@
 
 		/*Now check that we are dealing with open contours: */
+		cl=false;
 		if((x[0]==x[n-1]) && (y[0]==y[n-1])){
 			n=n-1;
+			cl=true;
 		}
 
@@ -105,4 +110,5 @@
 		pprofx[counter]=x;
 		pprofy[counter]=y;
+		closed[counter]=cl;
 	}
 
@@ -123,4 +129,6 @@
 	*ppprofx=pprofx;
 	*ppprofy=pprofy;
+	if(pclosed)*pclosed=closed;
+	else       xfree((void**)&closed);
 	return noerr;
 }
Index: /issm/trunk/src/c/shared/Exp/exp.h
===================================================================
--- /issm/trunk/src/c/shared/Exp/exp.h	(revision 8736)
+++ /issm/trunk/src/c/shared/Exp/exp.h	(revision 8737)
@@ -12,5 +12,5 @@
 int IsOutsidePoly(Vec in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
 int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
-int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,char* domainname);
+int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname);
 int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
 
Index: /issm/trunk/src/mex/TriMesh/TriMesh.cpp
===================================================================
--- /issm/trunk/src/mex/TriMesh/TriMesh.cpp	(revision 8736)
+++ /issm/trunk/src/mex/TriMesh/TriMesh.cpp	(revision 8737)
@@ -96,5 +96,5 @@
 	
 	/*Start reading the domain outline file: */
-	if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,domainname)){
+	if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,NULL,domainname)){
 		printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname);
 		mexErrMsgTxt(" ");
@@ -103,5 +103,5 @@
 	/*Read rifts file if present: */
 	if(riftname){
-		if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,riftname)){
+		if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,NULL,riftname)){
 			printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname);
 			mexErrMsgTxt(" ");
Index: /issm/trunk/src/mex/TriMeshNoDensity/TriMeshNoDensity.cpp
===================================================================
--- /issm/trunk/src/mex/TriMeshNoDensity/TriMeshNoDensity.cpp	(revision 8736)
+++ /issm/trunk/src/mex/TriMeshNoDensity/TriMeshNoDensity.cpp	(revision 8737)
@@ -86,5 +86,5 @@
 	
 	/*Start reading the domain outline file: */
-	if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,domainname)){
+	if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,NULL,domainname)){
 		printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname);
 		mexErrMsgTxt(" ");
@@ -93,5 +93,5 @@
 	/*Read rifts file if present: */
 	if(riftname){
-		if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,riftname)){
+		if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,NULL,riftname)){
 			printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname);
 			mexErrMsgTxt(" ");
