Index: /issm/trunk-jpl/src/py3/classes/plotoptions.py
===================================================================
--- /issm/trunk-jpl/src/py3/classes/plotoptions.py	(revision 23690)
+++ /issm/trunk-jpl/src/py3/classes/plotoptions.py	(revision 23691)
@@ -42,5 +42,5 @@
 		#go through args and build list (like pairoptions)
 		rawoptions=pairoptions.pairoptions(*arg)
-		numoptions=len(arg)/2
+		numoptions=int(len(arg)/2)
 		rawlist=[] # cannot be a dict since they do not support duplicate keys
 
Index: /issm/trunk-jpl/src/py3/plot/plotmodel.py
===================================================================
--- /issm/trunk-jpl/src/py3/plot/plotmodel.py	(revision 23690)
+++ /issm/trunk-jpl/src/py3/plot/plotmodel.py	(revision 23691)
@@ -52,5 +52,5 @@
 	#Go through plots
 	if numberofplots:
-		#if plt.fignum_exists(figurenumber): 
+		#if plt.fignum_exists(figurenumber):
 		#	plt.cla()
 
@@ -72,4 +72,6 @@
 		# options needed to define plot grid
 		plotnum=options.numberofplots
+		if plotnum==1:
+			plotnum=None
 		direction=options.list[0].getfieldvalue('direction','row') # row,column
 		axes_pad=options.list[0].getfieldvalue('axes_pad',0.25)
@@ -81,5 +83,5 @@
 		cbar_location=options.list[0].getfieldvalue('colorbarpos','right') # right,top
 		cbar_size=options.list[0].getfieldvalue('colorbarsize','5%')
-		cbar_pad=options.list[0].getfieldvalue('colorbarpad','2.5%') # None or %
+		cbar_pad=options.list[0].getfieldvalue('colorbarpad',0.025) # None or %
 
 		axgrid=ImageGrid(fig,111,
@@ -97,5 +99,5 @@
 
 		if cbar_mode=='None':
-			for ax in axgrid.cbar_axes: 
+			for ax in axgrid.cbar_axes:
 				fig._axstack.remove(ax)
 
Index: /issm/trunk-jpl/src/py3/solve/WriteData.py
===================================================================
--- /issm/trunk-jpl/src/py3/solve/WriteData.py	(revision 23690)
+++ /issm/trunk-jpl/src/py3/solve/WriteData.py	(revision 23691)
@@ -1,5 +1,5 @@
 import numpy as np
 from struct import pack,unpack
-from pairoptions import pairoptions
+import pairoptions
 
 def WriteData(fid,prefix,*args):
@@ -12,5 +12,5 @@
 
 	#process options
-	options=pairoptions(*args)
+	options=pairoptions.pairoptions(*args)
 
 	#Get data properties
@@ -55,22 +55,21 @@
 
 	#Step 1: write the enum to identify this record uniquely
-	fid.write(pack('>i',len(name)))
-	fid.write(pack('>{}s'.format(len(name)),name.encode()))
-	# print(name)
-	# print(pack('>{}s'.format(len(name)),name)
+	fid.write(pack('i',len(name)))
+	fid.write(pack('{}s'.format(len(name)),name.encode()))
+
 
 	#Step 2: write the data itself.
 	if datatype=='Boolean':    # {{{
 #		if len(data) !=1:
-#			raise ValueError('field %s cannot be marshalled as it has more than one element!' % name[0])
-
-		#first write length of record
-		fid.write(pack('>i',4+4))  #1 bool (disguised as an int)+code
-
-		#write data code:
-		fid.write(pack('>i',FormatToCode(datatype)))
+#			raise ValueError('fi eld %s cannot be marshalled as it has more than one element!' % name[0])
+
+		#first write length of record
+		fid.write(pack('i',4+4))  #1 bool (disguised as an int)+code
+
+		#write data code:
+		fid.write(pack('i',FormatToCode(datatype)))
 
 		#now write integer
-		fid.write(pack('>i',int(data)))  #send an int, not easy to send a bool
+		fid.write(pack('i',int(data)))  #send an int, not easy to send a bool
 		# }}}
 
@@ -80,11 +79,11 @@
 
 		#first write length of record
-		fid.write(pack('>i',4+4))  #1 integer + code
-
-		#write data code:
-		fid.write(pack('>i',FormatToCode(datatype)))
+		fid.write(pack('i',4+4))  #1 integer + code
+
+		#write data code:
+		fid.write(pack('i',FormatToCode(datatype)))
 
 		#now write integer
-		fid.write(pack('>i',int(data))) #force an int,
+		fid.write(pack('i',int(data))) #force an int,
 		# }}}
 
@@ -94,28 +93,28 @@
 
 		#first write length of record
-		fid.write(pack('>i',8+4))  #1 double+code
-
-		#write data code:
-		fid.write(pack('>i',FormatToCode(datatype)))
+		fid.write(pack('i',8+4))  #1 double+code
+
+		#write data code:
+		fid.write(pack('i',FormatToCode(datatype)))
 
 		#now write double
-		fid.write(pack('>d',data))
+		fid.write(pack('d',data))
 		# }}}
 
 	elif datatype=='String':    # {{{
 		#first write length of record
-		fid.write(pack('>i',len(data)+4+4))  #string + string size + code
-
-		#write data code:
-		fid.write(pack('>i',FormatToCode(datatype)))
+		fid.write(pack('i',len(data)+4+4))  #string + string size + code
+
+		#write data code:
+		fid.write(pack('i',FormatToCode(datatype)))
 
 		#now write string
-		fid.write(pack('>i',len(data)))
-		fid.write(pack('>{}s'.format(len(data)),data.encode()))
+		fid.write(pack('i',len(data)))
+		fid.write(pack('{}s'.format(len(data)),data.encode()))
 		# }}}
 
 	elif datatype in ['IntMat','BooleanMat']:    # {{{
 
-		if   isinstance(data,(int,bool)):
+		if isinstance(data,(int,bool)):
 			data=np.array([data])
 		elif isinstance(data,(list,tuple)):
@@ -134,22 +133,22 @@
 
 		#first write length of record
-		fid.write(pack('>i',4+4+8*np.product(s)+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
+		fid.write(pack('i',4+4+8*np.product(s)+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
 
 		#write data code and matrix type:
-		fid.write(pack('>i',FormatToCode(datatype)))
-		fid.write(pack('>i',mattype))
+		fid.write(pack('i',FormatToCode(datatype)))
+		fid.write(pack('i',mattype))
 
 		#now write matrix
 		if np.ndim(data) == 1:
-			fid.write(pack('>i',s[0]))
-			fid.write(pack('>i',1))
+			fid.write(pack('i',s[0]))
+			fid.write(pack('i',1))
 			for i in range(s[0]):
-				fid.write(pack('>d',float(data[i])))    #get to the "c" convention, hence the transpose
-		else:
-			fid.write(pack('>i',s[0]))
-			fid.write(pack('>i',s[1]))
+				fid.write(pack('d',float(data[i])))    #get to the "c" convention, hence the transpose
+		else:
+			fid.write(pack('i',s[0]))
+			fid.write(pack('i',s[1]))
 			for i in range(s[0]):
 				for j in range(s[1]):
-					fid.write(pack('>d',float(data[i][j])))    #get to the "c" convention, hence the transpose
+					fid.write(pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
 		# }}}
 
@@ -175,24 +174,24 @@
 		recordlength=4+4+8*np.product(s)+4+4; #2 integers (32 bits) + the double matrix + code + matrix type
 		if recordlength > 4**31 :
-			raise ValueError('field %s cannot be marshalled because it is larger than 4^31 bytes!' % enum)
-
-		fid.write(pack('>i',recordlength))  #2 integers (32 bits) + the double matrix + code + matrix type
+			raise ValueError('field {} cannot be marshalled because it is larger than 4^31 bytes!'.format(enum))
+
+		fid.write(pack('i',recordlength))  #2 integers (32 bits) + the double matrix + code + matrix type
 
 		#write data code and matrix type:
-		fid.write(pack('>i',FormatToCode(datatype)))
-		fid.write(pack('>i',mattype))
+		fid.write(pack('i',FormatToCode(datatype)))
+		fid.write(pack('i',mattype))
 
 		#now write matrix
 		if np.ndim(data) == 1:
-			fid.write(pack('>i',s[0]))
-			fid.write(pack('>i',1))
+			fid.write(pack('i',s[0]))
+			fid.write(pack('i',1))
 			for i in range(s[0]):
-				fid.write(pack('>d',float(data[i])))    #get to the "c" convention, hence the transpose
-		else:
-			fid.write(pack('>i',s[0]))
-			fid.write(pack('>i',s[1]))
+				fid.write(pack('d',float(data[i])))    #get to the "c" convention, hence the transpose
+		else:
+			fid.write(pack('i',s[0]))
+			fid.write(pack('i',s[1]))
 			for i in range(s[0]):
 				for j in range(s[1]):
-					fid.write(pack('>d',float(data[i][j])))    #get to the "c" convention, hence the transpose
+					fid.write(pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
 		# }}}
 
@@ -226,9 +225,9 @@
 			raise ValueError('field %s cannot be marshalled because it is larger than 4^31 bytes!' % enum)
 
-		fid.write(pack('>i',recordlength))  #2 integers (32 bits) + the matrix + code + matrix type
+		fid.write(pack('i',recordlength))  #2 integers (32 bits) + the matrix + code + matrix type
 
 		#write data code and matrix type:
-		fid.write(pack('>i',FormatToCode(datatype)))
-		fid.write(pack('>i',mattype))
+		fid.write(pack('i',FormatToCode(datatype)))
+		fid.write(pack('i',mattype))
 
 		#Write offset and range
@@ -244,24 +243,24 @@
 		#now write matrix
 		if np.ndim(data) == 1:
-			fid.write(pack('>i',s[0]))
-			fid.write(pack('>i',1))
-			fid.write(pack('>d',float(offsetA)))
-			fid.write(pack('>d',float(rangeA)))
+			fid.write(pack('i',s[0]))
+			fid.write(pack('i',1))
+			fid.write(pack('d',float(offsetA)))
+			fid.write(pack('d',float(rangeA)))
 			for i in range(s[0]-1):
-				fid.write(pack('>B',int(A[i])))
-
-			fid.write(pack('>d',float(data[s[0]-1])))    #get to the "c" convention, hence the transpose
+				fid.write(pack('B',int(A[i])))
+
+			fid.write(pack('d',float(data[s[0]-1])))    #get to the "c" convention, hence the transpose
 
 		elif np.product(s) > 0:
-			fid.write(pack('>i',s[0]))
-			fid.write(pack('>i',s[1]))
-			fid.write(pack('>d',float(offsetA)))
-			fid.write(pack('>d',float(rangeA)))
+			fid.write(pack('i',s[0]))
+			fid.write(pack('i',s[1]))
+			fid.write(pack('d',float(offsetA)))
+			fid.write(pack('d',float(rangeA)))
 			for i in range(s[0]-1):
 				for j in range(s[1]):
-					fid.write(pack('>B',int(A[i][j])))    #get to the "c" convention, hence the transpose
+					fid.write(pack('B',int(A[i][j])))    #get to the "c" convention, hence the transpose
 
 			for j in range(s[1]):
-				fid.write(pack('>d',float(data[s[0]-1][j])))
+				fid.write(pack('d',float(data[s[0]-1][j])))
 
 		# }}}
@@ -286,11 +285,11 @@
 
 		#write length of record
-		fid.write(pack('>i',recordlength))
-
-		#write data code:
-		fid.write(pack('>i',FormatToCode(datatype)))
+		fid.write(pack('i',recordlength))
+
+		#write data code:
+		fid.write(pack('i',FormatToCode(datatype)))
 
 		#write data, first number of records
-		fid.write(pack('>i',len(data)))
+		fid.write(pack('i',len(data)))
 
 		for matrix in data:
@@ -305,14 +304,14 @@
 
 			if np.ndim(matrix) == 1:
-				fid.write(pack('>i',s[0]))
-				fid.write(pack('>i',1))
+				fid.write(pack('i',s[0]))
+				fid.write(pack('i',1))
 				for i in range(s[0]):
-					fid.write(pack('>d',float(matrix[i])))    #get to the "c" convention, hence the transpose
+					fid.write(pack('d',float(matrix[i])))    #get to the "c" convention, hence the transpose
 			else:
-				fid.write(pack('>i',s[0]))
-				fid.write(pack('>i',s[1]))
+				fid.write(pack('i',s[0]))
+				fid.write(pack('i',s[1]))
 				for i in range(s[0]):
 					for j in range(s[1]):
-						fid.write(pack('>d',float(matrix[i][j])))
+						fid.write(pack('d',float(matrix[i][j])))
 		# }}}
 
@@ -325,16 +324,16 @@
 
 		#write length of record
-		fid.write(pack('>i',recordlength))
-
-		#write data code:
-		fid.write(pack('>i',FormatToCode(datatype)))
+		fid.write(pack('i',recordlength))
+
+		#write data code:
+		fid.write(pack('i',FormatToCode(datatype)))
 
 		#now write length of string array
-		fid.write(pack('>i',len(data)))
+		fid.write(pack('i',len(data)))
 
 		#now write the strings
 		for string in data:
-			fid.write(pack('>i',len(string)))
-			fid.write(pack('>{}s'.format(len(string)),string.encode()))
+			fid.write(pack('i',len(string)))
+			fid.write(pack('{}s'.format(len(string)),string.encode()))
 		# }}}
 
Index: /issm/trunk-jpl/src/py3/solve/loadresultsfromdisk.py
===================================================================
--- /issm/trunk-jpl/src/py3/solve/loadresultsfromdisk.py	(revision 23690)
+++ /issm/trunk-jpl/src/py3/solve/loadresultsfromdisk.py	(revision 23691)
@@ -2,11 +2,10 @@
 from results import results
 from parseresultsfromdisk import parseresultsfromdisk
-import MatlabFuncs as m
 from postqmu import postqmu
 
 def loadresultsfromdisk(md,filename):
 	"""
-	LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
- 
+	LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"
+
 	   Usage:
 	      md=loadresultsfromdisk(md=False,filename=False);
@@ -21,5 +20,5 @@
 		#Check that file exists
 		if not os.path.exists(filename):
-			raise OSError("binary file '%s' not found." % filename)
+			raise OSError("binary file '{}' not found.".format(filename))
 
 		#initialize md.results if not a structure yet
@@ -30,5 +29,6 @@
 		structure=parseresultsfromdisk(md,filename,not md.settings.io_gather)
 		if not len(structure):
-			raise RuntimeError("No result found in binary file '%s'. Check for solution crash." % filename)
+			raise RuntimeError("No result found in binary file '{}'. Check for solution crash.".format(filename))
+
 		setattr(md.results,structure[0].SolutionType,structure)
 
@@ -53,5 +53,5 @@
 
 		#if only one solution, extract it from list for user friendliness
-		if len(structure) == 1 and not m.strcmp(structure[0].SolutionType,'TransientSolution'):
+		if len(structure) == 1 and not structure[0].SolutionType=='TransientSolution':
 			setattr(md.results,structure[0].SolutionType,structure[0])
 
Index: /issm/trunk-jpl/src/py3/solve/parseresultsfromdisk.py
===================================================================
--- /issm/trunk-jpl/src/py3/solve/parseresultsfromdisk.py	(revision 23690)
+++ /issm/trunk-jpl/src/py3/solve/parseresultsfromdisk.py	(revision 23691)
@@ -9,5 +9,4 @@
 	else:
 		saveres=parseresultsfromdiskioserial(md,filename)
-
 	return saveres
 
@@ -17,5 +16,5 @@
 		fid=open(filename,'rb')
 	except IOError as e:
-		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
+		raise IOError("loadresultsfromdisk error message: could not open '{}' for binary reading.".format(filename))
 
 	#initialize results:
@@ -79,5 +78,5 @@
 		fid=open(filename,'rb')
 	except IOError as e:
-		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
+		raise IOError("loadresultsfromdisk error message: could not open '{}' for binary reading.".format(filename))
 
 	saveres=[]
@@ -146,29 +145,32 @@
 	try:
 		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-
-		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
+		fieldname=struct.unpack('{}s'.format(length),fid.read(length))[0][:-1]
 		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
 		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-
-		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+		datatype=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
 		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-		if   type==1:
-			field=np.array(struct.unpack('%dd' % M,fid.read(M*struct.calcsize('d'))),dtype=float)
-		elif type==2:
-			field=struct.unpack('%ds' % M,fid.read(M))[0][:-1]
-		elif type==3:
+		if   datatype==1:
+			field=np.array(struct.unpack('{}d'.format(M),fid.read(M*struct.calcsize('d'))),dtype=float)
+
+		elif datatype==2:
+			field=struct.unpack('{}s'.format(M),fid.read(M))[0][:-1]
+			field=field.decode()
+
+		elif datatype==3:
 			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
 #			field=transpose(fread(fid,[N M],'double'));
 			field=np.zeros(shape=(M,N),dtype=float)
 			for i in range(M):
-				field[i,:]=struct.unpack('%dd' % N,fid.read(N*struct.calcsize('d')))
-		elif type==4:
+				field[i,:]=struct.unpack('{}d'.format(N),fid.read(N*struct.calcsize('d')))
+
+		elif datatype==4:
 			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
 #			field=transpose(fread(fid,[N M],'int'));
 			field=np.zeros(shape=(M,N),dtype=int)
 			for i in range(M):
-				field[i,:]=struct.unpack('%ii' % N,fid.read(N*struct.calcsize('i')))
+				field[i,:]=struct.unpack('{}i'.format(N),fid.read(N*struct.calcsize('i')))
+
 		else:
-			raise TypeError("cannot read data of type %d" % type)
+			raise TypeError("cannot read data of datatype {}".format(datatype))
 
 		#Process units here FIXME: this should not be done here!
@@ -244,5 +246,5 @@
 
 		saveres=OrderedDict()
-		saveres['fieldname']=fieldname
+		saveres['fieldname']=fieldname.decode()
 		saveres['time']=time
 		saveres['step']=step
@@ -265,19 +267,19 @@
 	try:
 		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
+		fieldname=struct.unpack('{}s'.format(length),fid.read(length))[0][:-1]
 		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
 		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
+		dtattype=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
 		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
 		N=1    #default
-		if   type==1:
+		if   datatype==1:
 			fid.seek(M*8,1)
-		elif type==2:
+		elif datatype==2:
 			fid.seek(M,1)
-		elif type==3:
+		elif datatype==3:
 			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
 			fid.seek(N*M*8,1)
 		else:
-			raise TypeError("cannot read data of type %d" % type)
+			raise TypeError("cannot read data of datatype {}".format(datatype))
 
 		saveres=OrderedDict()
