Index: /issm/trunk-jpl/src/m/exp/expread.py
===================================================================
--- /issm/trunk-jpl/src/m/exp/expread.py	(revision 13340)
+++ /issm/trunk-jpl/src/m/exp/expread.py	(revision 13341)
@@ -16,9 +16,9 @@
 
 	   Usage:
-	      Struct=expread(filename)
+	      contours=expread(filename)
 
 	   Example:
-	      Struct=expread('domainoutline.exp')
-	      Struct=expread('domainoutline.exp')
+	      contours=expread('domainoutline.exp')
+	      contours=expread('domainoutline.exp')
 
 	   See also EXPDOC, EXPWRITEASVERTICES
@@ -30,5 +30,5 @@
 
 	#initialize number of profile
-	Structs=[]
+	contours=[]
 
 	#open file
@@ -39,5 +39,5 @@
 
 		#update number of profiles
-		Struct=OrderedDict()
+		contour=OrderedDict()
 
 		#Get file name
@@ -51,7 +51,7 @@
 			break
 		if len(A[1])>5: 
-			Struct['name']=A[1][5:-1]
+			contour['name']=A[1][5:-1]
 		else:
-			Struct['name']=''
+			contour['name']=''
 
 		#Get Icon
@@ -67,6 +67,6 @@
 		#Get number of nodes and density
 		A=fid.readline().split()
-		Struct['nods']   =float(A[0])
-		Struct['density']=float(A[1])
+		contour['nods']   =float(A[0])
+		contour['density']=float(A[1])
 
 		#Get Info
@@ -77,26 +77,24 @@
 
 		#Get Coordinates
-		Struct['x']=numpy.empty(Struct['nods'])
-		Struct['y']=numpy.empty(Struct['nods'])
-		for i in xrange(int(Struct['nods'])):
+		contour['x']=numpy.empty(contour['nods'])
+		contour['y']=numpy.empty(contour['nods'])
+		for i in xrange(int(contour['nods'])):
 			A=fid.readline().split()
-			Struct['x'][i]=float(A[0])
-			Struct['y'][i]=float(A[1])
-
-#		if(Struct['nods']~=length(Struct['x']))error(['Profile ' num2str ' reports incorrect length']); end;
+			contour['x'][i]=float(A[0])
+			contour['y'][i]=float(A[1])
 
 		#Check if closed
-		if (Struct['nods'] > 1) and \
-		   (Struct['x'][-1] == Struct['x'][0]) and \
-		   (Struct['y'][-1] == Struct['y'][0]):
-			Struct['closed']=True
+		if (contour['nods'] > 1) and \
+		   (contour['x'][-1] == contour['x'][0]) and \
+		   (contour['y'][-1] == contour['y'][0]):
+			contour['closed']=True
 		else:
-			Struct['closed']=False
+			contour['closed']=False
 
-		Structs.append(Struct)
+		contours.append(contour)
 
 	#close file
 	fid.close()
 
-	return Structs
+	return contours
 
Index: /issm/trunk-jpl/src/m/exp/expwrite.m
===================================================================
--- /issm/trunk-jpl/src/m/exp/expwrite.m	(revision 13340)
+++ /issm/trunk-jpl/src/m/exp/expwrite.m	(revision 13341)
@@ -21,21 +21,21 @@
 	end
    
-   if isfield(a,'name'),
-	   if ~isempty(a(n).name),
-		   fprintf(fid,'%s%s\n','## Name:',a(n).name);
-	   else
-		   fprintf(fid,'%s\n','## Name:');
-	   end
-   else
-	   fprintf(fid,'%s\n','## Name:');
-   end
+	if isfield(a,'name'),
+		if ~isempty(a(n).name),
+			fprintf(fid,'%s%s\n','## Name:',a(n).name);
+		else
+			fprintf(fid,'%s\n','## Name:');
+		end
+	else
+		fprintf(fid,'%s\n','## Name:');
+	end
    
-   fprintf(fid,'%s\n','## Icon:0');
-   fprintf(fid,'%s\n','# Points Count Value');
-   fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
-   fprintf(fid,'%s\n','# X pos Y pos');
+	fprintf(fid,'%s\n','## Icon:0');
+	fprintf(fid,'%s\n','# Points Count Value');
+	fprintf(fid,'%i %f\n',[length(a(n).x) a(n).density]);
+	fprintf(fid,'%s\n','# X pos Y pos');
 	fprintf(fid,'%10.10f %10.10f\n',[a(n).x a(n).y]');
-	fprintf(fid,'\n','');
-   
+	fprintf(fid,'\n');
+
 end
 fclose(fid);
Index: /issm/trunk-jpl/src/m/exp/expwrite.py
===================================================================
--- /issm/trunk-jpl/src/m/exp/expwrite.py	(revision 13341)
+++ /issm/trunk-jpl/src/m/exp/expwrite.py	(revision 13341)
@@ -0,0 +1,43 @@
+import numpy
+
+def expwrite(contours,filename):
+	"""
+	EXPWRITE - write an Argus file from a structure given in input
+
+	   This routine write an Argus file form a structure containing the fields:
+	   x and y of the coordinates of the points.
+	   The first argument is the structure containing the points coordinates 
+	   and the second one the file to be write.
+
+	   Usage:
+	      expwrite(contours,filename)
+
+	   Example:
+	      expwrite(coordstruct,'domainoutline.exp')
+
+	   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
+	"""
+
+	fid=open(filename,'w')
+	for contour in contours:
+		if numpy.size(contour['x'])!=numpy.size(contour['y']):
+			raise RuntimeError("contours x and y coordinates must be of identical size")
+   
+		if 'name' in contour:
+			if contour['name']:
+				fid.write("%s%s\n" % ('## Name:',contour['name']))
+			else:
+				fid.write("%s\n" % '## Name:')
+		else:
+			fid.write("%s\n" % '## Name:')
+   
+		fid.write("%s\n" % '## Icon:0')
+		fid.write("%s\n" % '# Points Count Value')
+		fid.write("%i %f\n" % (numpy.size(contour['x']),contour['density']))
+		fid.write("%s\n" % '# X pos Y pos')
+		for x,y in zip(contour['x'],contour['y']):
+			fid.write("%10.10f %10.10f\n" % (x,y))
+		fid.write("\n")
+
+	fid.close()
+
