Index: /issm/trunk/src/c/shared/Exp/DomainOutlineWrite.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 9258)
+++ /issm/trunk/src/c/shared/Exp/DomainOutlineWrite.cpp	(revision 9258)
@@ -0,0 +1,75 @@
+/*!\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,bool whole=true){
+
+	
+	/*Error management: */
+	int noerr=1;
+	int i,j,counter;
+
+	/*I/O: */
+	FILE* fid=NULL;
+	char chardummy[256];
+	int  idummy;
+	double  ddummy;
+
+	/*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: */
+	if ((fid=fopen(domainname,"w"))==NULL){
+		_error_("%s%s","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: */
+		if(closed[counter] && !whole)
+			fprintf(fid,"%u %s\n",profnvertices[counter]+1,"1.");
+		else
+			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]);
+		}
+
+		/*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: */
+		if(counter < nprof-1) fprintf(fid,"\n");
+	}
+
+	/*close domain outline file: */
+	fclose(fid);
+
+	cleanupandreturn: 
+	return noerr;
+}
+
Index: /issm/trunk/src/c/shared/Exp/exp.h
===================================================================
--- /issm/trunk/src/c/shared/Exp/exp.h	(revision 9257)
+++ /issm/trunk/src/c/shared/Exp/exp.h	(revision 9258)
@@ -13,4 +13,5 @@
 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,bool** pclosed,char* domainname,bool whole);
+int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname,bool whole);
 int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
 
