Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 14292)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 14293)
@@ -741,5 +741,5 @@
 			./shared/Exp/IsInPoly.cpp\
 			./shared/Exp/IsInPolySerial.cpp\
-			./shared/Exp/DomainOutlineWrite.cpp\
+			./shared/Exp/ExpWrite.cpp\
 			./shared/TriMesh/trimesh.h\
 			./shared/TriMesh/AssociateSegmentToElement.cpp\
Index: /issm/trunk-jpl/src/c/shared/Elements/PrintArrays.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/PrintArrays.cpp	(revision 14292)
+++ /issm/trunk-jpl/src/c/shared/Elements/PrintArrays.cpp	(revision 14293)
@@ -39,4 +39,13 @@
 	_printLine_("");
 }
+void printarray(bool* array,int lines,int cols){
+	_printLine_("");
+	for(int i=0;i<lines;i++){  
+		_printString_("   [ ");
+		for(int j=0;j<cols;j++) _printString_( " " << array[i*cols+j]?1:0);
+		_printLine_(" ]");
+	}  
+	_printLine_("");
+}
 void printbinary(int n){
 	unsigned int i=1L<<(sizeof(n)*8-1);
Index: /issm/trunk-jpl/src/c/shared/Elements/elements.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/elements.h	(revision 14292)
+++ /issm/trunk-jpl/src/c/shared/Elements/elements.h	(revision 14293)
@@ -40,4 +40,5 @@
 void printarray(IssmPDouble* array,int lines,int cols=1);
 void printarray(int* array,int lines,int cols=1);
+void printarray(bool* array,int lines,int cols=1);
 void printsparsity(IssmPDouble* array,int lines,int cols=1);
 void printbinary(int n);
Index: sm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 14292)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/*!\file:  DomainOutlineWrite.cpp
- * \brief DomainOutlineWrite.c: write the vertex coordinates defined in a domain 
- * outline from Argus (.exp file). The first contour in the file is for 
- * the outside domain outline. The following contours represent holes in
- * the domain.
- */
-
-#include <stdio.h>
-#include "../Alloc/alloc.h"
-#include "../../include/include.h"
-#include "../Exceptions/exceptions.h"
-
-int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname){
-
-	/*Error management: */
-	int noerr=1;
-	int i,counter;
-
-	/*I/O: */
-	FILE* fid=NULL;
-
-	/*open domain outline file for writing: */
-	if ((fid=fopen(domainname,"w"))==NULL){
-		_error_("could not open domain file " << domainname); 
-		noerr=0; goto cleanupandreturn;
-	}
-
-	/*Start writing profiles: */
-	for(counter=0;counter<nprof;counter++){
-
-		/*Write header: */
-		fprintf(fid,"%s %s\n","##","Name:");
-		fprintf(fid,"%s %s\n","##","Icon:0");
-		fprintf(fid,"%s %s %s %s\n","#","Points","Count","Value");
-
-		/*Write number of profile vertices: */
-		fprintf(fid,"%u %s\n",profnvertices[counter]  ,"1.");
-
-		/*Write next line: */
-		fprintf(fid,"%s %s %s %s %s\n","#","X","pos","Y","pos");
-
-		/*Write vertices: */
-		for (i=0;i<profnvertices[counter];i++){
-			fprintf(fid,"%lf\t%lf\n",pprofx[counter][i],pprofy[counter][i]);
-		}
-
-		/*Write blank line: */
-		if(counter < nprof-1) fprintf(fid,"\n");
-	}
-
-	/*close domain outline file: */
-	fclose(fid);
-
-	cleanupandreturn: 
-	return noerr;
-}
Index: /issm/trunk-jpl/src/c/shared/Exp/ExpWrite.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exp/ExpWrite.cpp	(revision 14293)
+++ /issm/trunk-jpl/src/c/shared/Exp/ExpWrite.cpp	(revision 14293)
@@ -0,0 +1,77 @@
+/*!\file:  Exp.cpp
+ * \brief Exp.cpp: write the vertex coordinates defined in a domain 
+ * outline from Argus (.exp file). The first contour in the file is for 
+ * the outside domain outline. 
+ */
+#include <stdio.h>
+#include "../Alloc/alloc.h"
+#include "../../include/include.h"
+#include "../Exceptions/exceptions.h"
+#include "../../Container/DataSet.h"
+#include "../../classes/objects/Contour.h"
+
+int ExpWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,char* domainname){/*{{{*/
+
+	/*I/O: */
+	FILE* fid=NULL;
+
+	/*open domain outline file for writing: */
+	if((fid=fopen(domainname,"w"))==NULL) _error_("could not open domain file " << domainname); 
+
+	/*Start writing profiles: */
+	for(int counter=0;counter<nprof;counter++){
+
+		/*Write header: */
+		fprintf(fid,"## Name:%s\n",domainname);
+		fprintf(fid,"## Icon:0\n");
+		fprintf(fid,"# Points Count	Value\n");
+		fprintf(fid,"%u %s\n",profnvertices[counter]  ,"1.");
+		fprintf(fid,"# X pos	Y pos\n");
+
+		/*Write vertices: */
+		for(int i=0;i<profnvertices[counter];i++){
+			fprintf(fid,"%lf\t%lf\n",pprofx[counter][i],pprofy[counter][i]);
+		}
+
+		/*Write blank line: */
+		if(counter<nprof-1) fprintf(fid,"\n");
+	}
+
+	/*close Exp file: */
+	fclose(fid);
+
+	return 1;
+}/*}}}*/
+int ExpWrite(DataSet* contours,char* domainname){/*{{{*/
+
+	/*I/O: */
+	FILE* fid=NULL;
+	Contour<double>* contour = NULL;
+
+	/*open domain outline file for writing: */
+	if((fid=fopen(domainname,"w"))==NULL) _error_("could not open domain file " << domainname); 
+
+	for(int counter=0;counter<contours->Size();counter++){
+		contour=(Contour<double>*)contours->GetObjectByOffset(counter);
+
+		/*Write header: */
+		fprintf(fid,"## Name:%s\n",domainname);
+		fprintf(fid,"## Icon:0\n");
+		fprintf(fid,"# Points Count	Value\n");
+		fprintf(fid,"%u %s\n",contour->nods  ,"1.");
+		fprintf(fid,"# X pos	Y pos\n");
+
+		/*Write vertices: */
+		for(int i=0;i<contour->nods;i++){
+			fprintf(fid,"%lf\t%lf\n",contour->x[i],contour->y[i]);
+		}
+
+		/*Write blank line: */
+		if(counter<contours->Size()-1) fprintf(fid,"\n");
+	}
+
+	/*close Exp file: */
+	fclose(fid);
+
+	return 1;
+}/*}}}*/
Index: /issm/trunk-jpl/src/c/shared/Exp/exp.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exp/exp.h	(revision 14292)
+++ /issm/trunk-jpl/src/c/shared/Exp/exp.h	(revision 14293)
@@ -12,5 +12,6 @@
 
 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);
+int ExpWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,char* domainname);
+int ExpWrite(DataSet* contours,char* domainname);
 int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
 
