Index: /issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 12097)
+++ /issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 12098)
@@ -61,5 +61,5 @@
 /*  read exp file  */
 
-	if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp,true))
+	if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp))
 		_error_("Error reading exp file.");
 	_printf_(true,"Exp2Kmlx -- Reading %d exp profiles from file \"%s\".\n",nprof,filexp);
Index: /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 12097)
+++ /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 12098)
@@ -46,5 +46,5 @@
 	for (i=0;i<domain->Size();i++){
 		contour=(Contour*)domain->GetObjectByOffset(i);
-		in.numberofpoints+=contour->nods;
+		in.numberofpoints+=contour->nods-1;
 	}
 	for (i=0;i<rifts->Size();i++){
@@ -62,4 +62,12 @@
 	for (i=0;i<domain->Size();i++){
 		contour=(Contour*)domain->GetObjectByOffset(i);
+		for (j=0;j<contour->nods-1;j++){
+			in.pointlist[2*counter+0]=contour->x[j];
+			in.pointlist[2*counter+1]=contour->y[j];
+			counter++;
+		}
+	}
+	for (i=0;i<rifts->Size();i++){
+		contour=(Contour*)rifts->GetObjectByOffset(i);
 		for (j=0;j<contour->nods;j++){
 			in.pointlist[2*counter+0]=contour->x[j];
@@ -68,12 +76,4 @@
 		}
 	}
-	for (i=0;i<rifts->Size();i++){
-		contour=(Contour*)rifts->GetObjectByOffset(i);
-		for (j=0;j<contour->nods;j++){
-			in.pointlist[2*counter+0]=contour->x[j];
-			in.pointlist[2*counter+1]=contour->y[j];
-			counter++;
-		}
-	}
 	
 	/*fill in the point attribute list: */
@@ -89,5 +89,5 @@
 	for (i=0;i<domain->Size();i++){
 		contour=(Contour*)domain->GetObjectByOffset(i);
-		in.numberofsegments+=contour->nods;
+		in.numberofsegments+=contour->nods-1;
 	}
 	for(i=0;i<rifts->Size();i++){
@@ -103,5 +103,5 @@
 	for (i=0;i<domain->Size();i++){
 		contour=(Contour*)domain->GetObjectByOffset(i);
-		for (j=0;j<contour->nods-1;j++){
+		for (j=0;j<contour->nods-2;j++){
 			in.segmentlist[2*counter+0]=counter;
 			in.segmentlist[2*counter+1]=counter+1;
@@ -138,5 +138,5 @@
 		for (i=0;i<domain->Size()-1;i++){
 			contour=(Contour*)domain->GetObjectByOffset(i+1);
-			GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],contour->nods,contour->x,contour->y);
+			GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],contour->nods-1,contour->x,contour->y);
 		}
 	}
Index: /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 12097)
+++ /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 12098)
@@ -13,5 +13,5 @@
 #include "../../Container/DataSet.h"
 
-int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole=true){
+int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname){
 	
 	/*indexing: */
@@ -101,7 +101,4 @@
 		if((x[0]==x[n-1]) && (y[0]==y[n-1])){
 			cl=true;
-			if (!whole) {
-				n=n-1;
-			}
 		}
 
@@ -125,5 +122,5 @@
 }
 
-DataSet* DomainOutlineRead(char* domainname,bool whole=true){
+DataSet* DomainOutlineRead(char* domainname){
 
 	/*intermediary: */
@@ -142,5 +139,5 @@
 	}
 	else{
-		DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname,whole);
+		DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname);
 	}
 
Index: /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 12097)
+++ /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 12098)
@@ -11,5 +11,5 @@
 #include "../Exceptions/exceptions.h"
 
-int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname,bool whole=true){
+int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname){
 
 	
@@ -20,11 +20,4 @@
 	/*I/O: */
 	FILE* fid=NULL;
-
-	/*input: */
-//	int nprof; //number of profiles in the domainname file
-//	int* profnvertices=NULL; //array holding the number of vertices for the nprof profiles
-//	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
 
 	/*open domain outline file for writing: */
@@ -43,8 +36,5 @@
 		
 		/*Write number of profile vertices: */
-		if(closed[counter] && !whole)
-			fprintf(fid,"%u %s\n",profnvertices[counter]+1,"1.");
-		else
-			fprintf(fid,"%u %s\n",profnvertices[counter]  ,"1.");
+		fprintf(fid,"%u %s\n",profnvertices[counter]  ,"1.");
 	
 		/*Write next line: */
@@ -55,8 +45,4 @@
 			fprintf(fid,"%lf\t%lf\n",pprofx[counter][i],pprofy[counter][i]);
 		}
-
-		/*Now check that we are dealing with open contours: */
-		if(closed[counter] && !whole)
-			fprintf(fid,"%lf\t%lf\n",pprofx[counter][0],pprofy[counter][0]);
 
 		/*Write blank line: */
Index: /issm/trunk-jpl/src/c/shared/Exp/exp.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exp/exp.h	(revision 12097)
+++ /issm/trunk-jpl/src/c/shared/Exp/exp.h	(revision 12098)
@@ -13,9 +13,9 @@
 int IsOutsidePoly(Vector* 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 DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname,bool whole);
+int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname);
 int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
 
-int      DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole);
-DataSet* DomainOutlineRead(char* domainname,bool whole);
+int      DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname);
+DataSet* DomainOutlineRead(char* domainname);
 
 
Index: /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 12097)
+++ /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 12098)
@@ -35,6 +35,6 @@
 
 	/*Read domain outline: */
-	domain = DomainOutlineRead(domainname,false);
-	rifts  = DomainOutlineRead(riftsname,false);
+	domain = DomainOutlineRead(domainname);
+	rifts  = DomainOutlineRead(riftsname);
 
 	/*call x core: */
