Index: /issm/trunk-jpl/src/m/archive/arch.py
===================================================================
--- /issm/trunk-jpl/src/m/archive/arch.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/archive/arch.py	(revision 23716)
@@ -1,7 +1,5 @@
 import numpy as np
-import math
 import struct
-import sys
-import os
+from os import path
 from collections import OrderedDict
 
@@ -18,5 +16,5 @@
 	# open file
 	try:
-		if not os.path.isfile(filename):
+		if not path.isfile(filename):
 			fid=open(filename,'wb')
 		else:
@@ -31,5 +29,5 @@
 		name=args[2*i]
 		write_field_name(fid,name)
-		
+
 		# write data associated with field name
 		data=args[2*i+1]
@@ -43,5 +41,5 @@
 		else:
 			raise ValueError("archwrite : error writing data, invalid code entered '%d'" % code)
-	
+
 	fid.close()
 
@@ -55,5 +53,5 @@
 	"""
 	try:
-		if os.path.isfile(filename):
+		if path.isfile(filename):
 			fid=open(filename,'rb')
 		else:
@@ -61,9 +59,10 @@
 	except IOError as e:
 		raise IOError("archread error : could not open file '%s' to read from" % filename)
-	
+
 	archive_results=[]
 
 	# read first result
 	result=read_field(fid)
+
 	while result:
 		if fieldname == result['field_name']:
@@ -71,11 +70,11 @@
 			archive_results=result['data']; # we only want the data
 			break
-		
+
 		# read next result
 		result=read_field(fid)
-	
+
 	# close file
 	fid.close()
-	
+
 	return archive_results
 # }}}
@@ -88,5 +87,5 @@
 	"""
 	try:
-		if os.path.isfile(filename):
+		if path.isfile(filename):
 			fid=open(filename,'rb')
 		else:
@@ -94,17 +93,17 @@
 	except IOError as e:
 		raise IOError("archread error : could not open file '%s' to read from" % filename)
-	
-	print 'Source file: '
-	print '\t{0}'.format(filename)
-	print 'Variables: '
+
+	print('Source file: ')
+	print(('\t{0}'.format(filename)))
+	print('Variables: ')
 
 	result=read_field(fid)
 	while result:
-		print '\t{0}'.format(result['field_name'])
-		print '\t\tSize:\t\t{0}'.format(result['size'])
-		print '\t\tDatatype:\t{0}'.format(result['data_type'])
+		print(('\t{0}'.format(result['field_name'])))
+		print(('\t\tSize:\t\t{0}'.format(result['size'])))
+		print(('\t\tDatatype:\t{0}'.format(result['data_type'])))
 		# go to next result
 		result=read_field(fid)
-	
+
 	# close file
 	fid.close()
@@ -112,5 +111,5 @@
 # }}}
 
-# Helper functions 
+# Helper functions
 def write_field_name(fid,data): # {{{
 	"""
@@ -121,5 +120,5 @@
 	reclen=len(data)+4+4
 	fid.write(struct.pack('>i',reclen))
-	
+
 	# write format code
 	code=format_archive_code(data);
@@ -130,5 +129,5 @@
 	# write string length, and then the string
 	fid.write(struct.pack('>i',len(data)))
-	fid.write(struct.pack('>%ds' % len(data),data))
+	fid.write(struct.pack('>{}s'.format(len(data)),data.encode('utf8')))
 # }}}
 def write_scalar(fid,data): # {{{
@@ -143,5 +142,5 @@
 	# write the format code (2 for scalar)
 	fid.write(struct.pack('>i',2))
-	
+
 	# write the double
 	fid.write(struct.pack('>d',data))
@@ -154,9 +153,9 @@
 	# Make sure our vector is the correct shape.
 	# Reshape it into a row vector if it is not correct.
-	if isinstance(data,(bool,int,long,float)):
+	if isinstance(data,(bool,int,float)):
 		data=np.array([data])
 	elif isinstance(data,(list,tuple)):
 		data=np.array(data).reshape(-1,)
-	
+
 	if np.ndim(data) == 1:
 		if np.size(data):
@@ -164,5 +163,5 @@
 		else:
 			data=data.reshape(0,0)
-	
+
 	# get size of data
 	sz=data.shape
@@ -175,5 +174,5 @@
 		raise ValueError("archwrite error : can not write vector to binary file because it is too large")
 	fid.write(struct.pack('>i',reclen))
-	
+
 	# write format code
 	fid.write(struct.pack('>i',3))
@@ -182,6 +181,6 @@
 	fid.write(struct.pack('>i',sz[0]))
 	fid.write(struct.pack('>i',sz[1]))
-	for i in xrange(sz[0]):
-		for j in xrange(sz[1]):
+	for i in range(sz[0]):
+		for j in range(sz[1]):
 			fid.write(struct.pack('>d',float(data[i][j])))
 
@@ -204,6 +203,6 @@
 			raise ValueError('archread error : a string was not present at the start of the arch file')
 		namelen=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0]
-		fieldname=struct.unpack('>%ds' % namelen,fid.read(namelen))[0]
-		
+		fieldname=struct.unpack('>{}s'.format(namelen),fid.read(namelen))[0]
+
 		# then, read the data
 		datalen=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0]
@@ -211,5 +210,5 @@
 
 		if data_type==2:
-			# unpack scalar
+			# struct.upack scalar
 			data=struct.unpack('>d',fid.read(struct.calcsize('>d')))[0]
 		elif data_type==3:
@@ -217,12 +216,12 @@
 			cols=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0]
 			raw_data=np.zeros(shape=(rows,cols),dtype=float)
-			for i in xrange(rows):
-				raw_data[i,:]=struct.unpack('>%dd' % cols,fid.read(cols*struct.calcsize('>d')))
-			# The matrix will be unpacked in order and will be filled left -> right by column
+			for i in range(rows):
+				raw_data[i,:]=struct.unpack('>{}d'.format(cols),fid.read(cols*struct.calcsize('>d')))
+			# The matrix will be struct.upacked in order and will be filled left -> right by column
 			# We need to reshape and transpose the matrix so it can be read correctly
 			data=raw_data.reshape(raw_data.shape[::-1]).T
 		else:
 			raise TypeError("Cannot read data type %d" % data_type)
-			
+
 		# give additional data to user
 		if data_type==2:
@@ -234,5 +233,5 @@
 
 		result=OrderedDict()
-		result['field_name']=fieldname
+		result['field_name']=fieldname.decode('utf8')
 		result['size']=data_size
 		result['data_type']=data_type_str
@@ -255,5 +254,5 @@
 
 	"""
-	if isinstance(format,basestring):
+	if isinstance(format,str):
 		code=1
 	elif format.shape[0] == 1 and format.shape[1] == 1:
Index: /issm/trunk-jpl/src/m/array/MatlabArray.py
===================================================================
--- /issm/trunk-jpl/src/m/array/MatlabArray.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/array/MatlabArray.py	(revision 23716)
@@ -5,4 +5,5 @@
 #move this later
 from helpers import *
+from functools import reduce
 
 def allempty(cin):
@@ -28,5 +29,5 @@
 '''
 	if type(ain) != type(aval):
-		print allequal.__doc__
+		print((allequal.__doc__))
 		raise RuntimeError("ain and aval must be of the same type")
 	
@@ -247,5 +248,5 @@
 	try:
 		# I tried other methods, but this is, unfortunately, the best behaving by far
-		exec 'from '+cstr+' import *'
+		exec('from '+cstr+' import *')
 	except:
 		raise RuntimeError('MatlabArray.struc_class Class Error: class "'+cstr+'" does not exist')
Index: /issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py	(revision 23716)
@@ -26,9 +26,9 @@
 	#Dirichlet Values
 	if isinstance(md.inversion.vx_obs,np.ndarray) and np.size(md.inversion.vx_obs,axis=0)==md.mesh.numberofvertices and isinstance(md.inversion.vy_obs,np.ndarray) and np.size(md.inversion.vy_obs,axis=0)==md.mesh.numberofvertices:
-		print "      boundary conditions for stressbalance model: spc set as observed velocities"
+		print("      boundary conditions for stressbalance model: spc set as observed velocities")
 		md.stressbalance.spcvx[pos]=md.inversion.vx_obs[pos]
 		md.stressbalance.spcvy[pos]=md.inversion.vy_obs[pos]
 	else:
-		print "      boundary conditions for stressbalance model: spc set as zero"
+		print("      boundary conditions for stressbalance model: spc set as zero")
 
 	#No ice front -> do nothing
@@ -41,5 +41,5 @@
 	if np.all(np.isnan(md.balancethickness.thickening_rate)):
 		md.balancethickness.thickening_rate=np.zeros((md.mesh.numberofvertices))
-		print "      no balancethickness.thickening_rate specified: values set as zero"
+		print("      no balancethickness.thickening_rate specified: values set as zero")
 	md.masstransport.spcthickness=float('nan')*np.ones((md.mesh.numberofvertices))
 	md.balancethickness.spcthickness=float('nan')*np.ones((md.mesh.numberofvertices))
@@ -54,5 +54,5 @@
 			md.basalforcings.geothermalflux=50.*10**-3*np.ones((md.mesh.numberofvertices))    #50 mW/m^2
 	else:
-		print "      no thermal boundary conditions created: no observed temperature found"
+		print("      no thermal boundary conditions created: no observed temperature found")
 
 	return md
Index: /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py	(revision 23716)
@@ -70,9 +70,9 @@
 		if np.ndim(md.inversion.vy_obs)==1:
 			md.inversion.vy_obs=md.inversion.vy_obs.reshape(-1,)
-		print "      boundary conditions for stressbalance model: spc set as observed velocities"
+		print("      boundary conditions for stressbalance model: spc set as observed velocities")
 		md.stressbalance.spcvx[pos]=md.inversion.vx_obs[pos]
 		md.stressbalance.spcvy[pos]=md.inversion.vy_obs[pos]
 	else:
-		print "      boundary conditions for stressbalance model: spc set as zero"
+		print("      boundary conditions for stressbalance model: spc set as zero")
 
 	#Create zeros basalforcings and smb
@@ -83,5 +83,5 @@
 	if np.all(np.isnan(md.balancethickness.thickening_rate)):
 		md.balancethickness.thickening_rate=np.zeros((md.mesh.numberofvertices))
-		print "      no balancethickness.thickening_rate specified: values set as zero"
+		print("      no balancethickness.thickening_rate specified: values set as zero")
 	md.masstransport.spcthickness=float('nan')*np.ones((md.mesh.numberofvertices))
 	md.balancethickness.spcthickness=float('nan')*np.ones((md.mesh.numberofvertices))
@@ -96,5 +96,5 @@
 			md.basalforcings.geothermalflux=np.zeros((md.mesh.numberofvertices))
 	else:
-		print "      no thermal boundary conditions created: no observed temperature found"
+		print("      no thermal boundary conditions created: no observed temperature found")
 
 	return md
Index: /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 23716)
@@ -40,5 +40,5 @@
 	pos=np.nonzero(np.logical_and(md.mesh.vertexonboundary,np.logical_not(vertexonicefront)))[0]
 	if not np.size(pos):
-		print "SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually."
+		print("SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually.")
 
 	md.stressbalance.spcvx=float('nan')*np.ones(md.mesh.numberofvertices)
@@ -58,5 +58,5 @@
 		numbernodesfront=2
 	else:
-			raise StandardError("Mesh type not supported")
+			raise Exception("Mesh type not supported")
 	if any(md.mask.ice_levelset<=0):
 		values=md.mask.ice_levelset[md.mesh.segments[:,0:-1]-1]
@@ -74,9 +74,9 @@
 	#Dirichlet Values
 	if isinstance(md.inversion.vx_obs,np.ndarray) and np.size(md.inversion.vx_obs,axis=0)==md.mesh.numberofvertices and isinstance(md.inversion.vy_obs,np.ndarray) and np.size(md.inversion.vy_obs,axis=0)==md.mesh.numberofvertices:
-		print "      boundary conditions for stressbalance model: spc set as observed velocities"
+		print("      boundary conditions for stressbalance model: spc set as observed velocities")
 		md.stressbalance.spcvx[pos]=md.inversion.vx_obs[pos]
 		md.stressbalance.spcvy[pos]=md.inversion.vy_obs[pos]
 	else:
-		print "      boundary conditions for stressbalance model: spc set as zero"
+		print("      boundary conditions for stressbalance model: spc set as zero")
 
 	md.hydrology.spcwatercolumn=np.zeros((md.mesh.numberofvertices,2))
@@ -91,5 +91,5 @@
 	if np.all(np.isnan(md.balancethickness.thickening_rate)):
 		md.balancethickness.thickening_rate=np.zeros((md.mesh.numberofvertices))
-		print "      no balancethickness.thickening_rate specified: values set as zero"
+		print("      no balancethickness.thickening_rate specified: values set as zero")
 
 	md.masstransport.spcthickness=float('nan')*np.ones((md.mesh.numberofvertices))
@@ -106,5 +106,5 @@
 			md.basalforcings.geothermalflux[np.nonzero(md.mask.groundedice_levelset>0.)]=50.*10.**-3    #50mW/m2
 	else:
-		print "      no thermal boundary conditions created: no observed temperature found"
+		print("      no thermal boundary conditions created: no observed temperature found")
 
 	return md
Index: /issm/trunk-jpl/src/m/boundaryconditions/love_numbers.py
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/love_numbers.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/boundaryconditions/love_numbers.py	(revision 23716)
@@ -20,5 +20,5 @@
         if len(varargin)==0:
         	frame='CM';
-		print 'Info: computation is done in Center of Mass (CM) reference frame by default'
+		print('Info: computation is done in Center of Mass (CM) reference frame by default')
         elif len(varargin)==1: 
 		reference_frame = varargin[0]
Index: /issm/trunk-jpl/src/m/classes/SMBcomponents.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBcomponents.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/SMBcomponents.py	(revision 23716)
@@ -40,13 +40,13 @@
 		if np.all(np.isnan(self.accumulation)):
 			self.accumulation=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.accumulation specified: values set as zero"
+			print("      no SMB.accumulation specified: values set as zero")
 
 		if np.all(np.isnan(self.runoff)):
 			self.runoff=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.runoff specified: values set as zero"
+			print("      no SMB.runoff specified: values set as zero")
 
 		if np.all(np.isnan(self.evaporation)):
 			self.evaporation=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.evaporation specified: values set as zero"
+			print("      no SMB.evaporation specified: values set as zero")
 
 		return self
Index: /issm/trunk-jpl/src/m/classes/SMBd18opdd.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBd18opdd.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/SMBd18opdd.py	(revision 23716)
@@ -94,9 +94,9 @@
 		if np.all(np.isnan(self.s0p)):
 			self.s0p=np.zeros((md.mesh.numberofvertices))
-			print "      no SMBd18opdd.s0p specified: values set as zero"
+			print("      no SMBd18opdd.s0p specified: values set as zero")
 
 		if np.all(np.isnan(self.s0t)):
 			self.s0t=np.zeros((md.mesh.numberofvertices))
-			print "      no SMBd18opdd.s0t specified: values set as zero"
+			print("      no SMBd18opdd.s0t specified: values set as zero")
 			
 		return self
Index: /issm/trunk-jpl/src/m/classes/SMBforcing.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBforcing.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/SMBforcing.py	(revision 23716)
@@ -35,5 +35,5 @@
 		if np.all(np.isnan(self.mass_balance)):
 			self.mass_balance=np.zeros((md.mesh.numberofvertices))
-			print "      no SMBforcing.mass_balance specified: values set as zero"
+			print("      no SMBforcing.mass_balance specified: values set as zero")
 
 		return self
Index: /issm/trunk-jpl/src/m/classes/SMBgemb.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBgemb.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/SMBgemb.py	(revision 23716)
@@ -14,6 +14,6 @@
 
 	def __init__(self): # {{{
-		#each one of these properties is a transient forcing to the GEMB model, loaded from meteorological data derived 
-		#from an automatic weather stations (AWS). Each property is therefore a matrix, of size (numberofvertices x number 
+		#each one of these properties is a transient forcing to the GEMB model, loaded from meteorological data derived
+		#from an automatic weather stations (AWS). Each property is therefore a matrix, of size (numberofvertices x number
 		#of time steps. )
 
@@ -27,7 +27,7 @@
 		#ismelt
 		#isdensification
-		#isturbulentflux    
-
-		#inputs: 
+		#isturbulentflux
+
+		#inputs:
 		Ta    = float('NaN')	#2 m air temperature, in Kelvin
 		V     = float('NaN')	#wind speed (m/s-1)
@@ -37,7 +37,6 @@
 		eAir  = float('NaN')	#screen level vapor pressure [Pa]
 		pAir  = float('NaN')	#surface pressure [Pa]
-		
 		Tmean = float('NaN')	#mean annual temperature [K]
-                Vmean = float('NaN')    #mean annual wind velocity [m s-1]
+		Vmean = float('NaN')    #mean annual wind velocity [m s-1]
 		C     = float('NaN')	#mean annual snow accumulation [kg m-2 yr-1]
 		Tz    = float('NaN')	#height above ground at which temperature (T) was sampled [m]
@@ -47,5 +46,5 @@
 		aValue  = float('NaN') #Albedo forcing at every element.  Used only if aIdx == 0.
 		teValue = float('NaN') #Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
-        
+
 		# Initialization of snow properties
 		Dzini = float('NaN')	#cell depth (m)
@@ -60,34 +59,30 @@
 		Sizeini = float('NaN')	#Number of layers
 
-		#settings: 
+		#settings:
 		aIdx   = float('NaN')	#method for calculating albedo and subsurface absorption (default is 1)
-		           # 0: direct input from aValue parameter
-					  # 1: effective grain radius [Gardner & Sharp, 2009]
-					  # 2: effective grain radius [Brun et al., 2009]
-					  # 3: density and cloud amount [Greuell & Konzelmann, 1994]
-					  # 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
-					  # 5: ingest MODIS mode, direct input from aValue parameter applied to surface ice only
-
+		# 0: direct input from aValue parameter
+		# 1: effective grain radius [Gardner & Sharp, 2009]
+		# 2: effective grain radius [Brun et al., 2009]
+		# 3: density and cloud amount [Greuell & Konzelmann, 1994]
+		# 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
+		# 5: ingest MODIS mode, direct input from aValue parameter applied to surface ice only
 		swIdx  = float('NaN')	# apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1)
-
 		denIdx = float('NaN')	#densification model to use (default is 2):
-					# 1 = emperical model of Herron and Langway (1980)
-					# 2 = semi-emperical model of Anthern et al. (2010)
-					# 3 = DO NOT USE: physical model from Appix B of Anthern et al. (2010)
-					# 4 = DO NOT USE: emperical model of Li and Zwally (2004)
-					# 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
-                                        # 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
-                                        # 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
-                                        
-                dsnowIdx = float('NaN') #model for fresh snow accumulation density (default is 1):
-                                        # 0 = Original GEMB value, 150 kg/m^3
-                                        # 1 = Antarctica value of fresh snow density, 350 kg/m^3
-                                        # 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)
-                                        # 3 = Antarctica model of Kaspers et al. (2004)
-                                        # 4 = Greenland model of Kuipers Munneke et al. (2015)
-
+		# 1 = emperical model of Herron and Langway (1980)
+		# 2 = semi-emperical model of Anthern et al. (2010)
+		# 3 = DO NOT USE: physical model from Appix B of Anthern et al. (2010)
+		# 4 = DO NOT USE: emperical model of Li and Zwally (2004)
+		# 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
+		# 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
+		# 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
+		dsnowIdx = float('NaN') #model for fresh snow accumulation density (default is 1):
+		# 0 = Original GEMB value, 150 kg/m^3
+		# 1 = Antarctica value of fresh snow density, 350 kg/m^3
+		# 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)
+		# 3 = Antarctica model of Kaspers et al. (2004)
+		# 4 = Greenland model of Kuipers Munneke et al. (2015)
 		zTop  = float('NaN')	# depth over which grid length is constant at the top of the snopack (default 10) [m]
-		dzTop = float('NaN')	# initial top vertical grid spacing (default .05) [m] 
-		dzMin = float('NaN')	# initial min vertical allowable grid spacing (default dzMin/2) [m] 
+		dzTop = float('NaN')	# initial top vertical grid spacing (default .05) [m]
+		dzMin = float('NaN')	# initial min vertical allowable grid spacing (default dzMin/2) [m]
 		zY    = float('NaN')	# strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]
 		zMax = float('NaN')	#initial max model depth (default is min(thickness,500)) [m]
@@ -95,17 +90,17 @@
 		outputFreq = float('NaN')	#output frequency in days (default is monthly, 30)
 
-		#specific albedo parameters: 
-		#Method 1 and 2: 
+		#specific albedo parameters:
+		#Method 1 and 2:
 		aSnow = float('NaN')	# new snow albedo (0.64 - 0.89)
 		aIce  = float('NaN')	# range 0.27-0.58 for old snow
-			#Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
+		#Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
 		cldFrac = float('NaN')	# average cloud amount
-			#Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
-		t0wet = float('NaN')	# time scale for wet snow (15-21.9) 
-		t0dry = float('NaN')	# warm snow timescale (30) 
-		K     = float('NaN')	# time scale temperature coef. (7) 
+		#Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
+		t0wet = float('NaN')	# time scale for wet snow (15-21.9)
+		t0dry = float('NaN')	# warm snow timescale (30)
+		K     = float('NaN')	# time scale temperature coef. (7)
 		adThresh = float('NaN') # Apply aIdx method to all areas with densities below this value,
-		                        # or else apply direct input value from aValue, allowing albedo to be altered.
-										# Default value is rho water (1023 kg m-3).
+		# or else apply direct input value from aValue, allowing albedo to be altered.
+		# Default value is rho water (1023 kg m-3).
 
 		#densities:
@@ -114,10 +109,10 @@
 		#thermo:
 		ThermoDeltaTScaling = float('NaN') #scaling factor to multiply the thermal diffusion timestep (delta t)
-		
+
 		requested_outputs      = []
 
-		#Several fields are missing from the standard GEMB model, which are capture intrinsically by ISSM. 
-		#dateN: that's the last row of the above fields. 
-		#dt:    included in dateN. Not an input.  
+		#Several fields are missing from the standard GEMB model, which are capture intrinsically by ISSM.
+		#dateN: that's the last row of the above fields.
+		#dt:    included in dateN. Not an input.
 		#elev:  this is taken from the ISSM surface itself.
 
@@ -128,6 +123,5 @@
 		#string = "#s\n#s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
 		string = '   surface forcings for SMB GEMB model :'
-			
-		string="%s\n%s"%(string,fielddisplay(self,'issmbgradients','is smb gradients method activated (0 or 1, default is 0)'))
+		string = "%s\n%s"%(string,fielddisplay(self,'issmbgradients','is smb gradients method activated (0 or 1, default is 0)'))
 		string = "%s\n%s"%(string,fielddisplay(self,'isgraingrowth','run grain growth module (default true)'))
 		string = "%s\n%s"%(string,fielddisplay(self,'isalbedo','run albedo module (default true)'))
@@ -147,5 +141,5 @@
 		string = "%s\n%s"%(string,fielddisplay(self,'Tmean','mean annual temperature [K]'))
 		string = "%s\n%s"%(string,fielddisplay(self,'C','mean annual snow accumulation [kg m-2 yr-1]'))
-                string = "%s\n%s"%(string,fielddisplay(self,'Vmean','mean annual temperature [m s-1] (default 10 m/s)'))
+		string = "%s\n%s"%(string,fielddisplay(self,'Vmean','mean annual temperature [m s-1] (default 10 m/s)'))
 		string = "%s\n%s"%(string,fielddisplay(self,'Tz','height above ground at which temperature (T) was sampled [m]'))
 		string = "%s\n%s"%(string,fielddisplay(self,'Vz','height above ground at which wind (V) eas sampled [m]'))
@@ -161,12 +155,10 @@
 		string = "%s\n%s"%(string,fielddisplay(self,'adThresh','Apply aIdx method to all areas with densities below this value,','or else apply direct input value from aValue, allowing albedo to be altered.'))
 		string = "%s\n%s"%(string,fielddisplay(self,'aIdx',['method for calculating albedo and subsurface absorption (default is 1)',
-			         '0: direct input from aValue parameter',
-						'1: effective grain radius [Gardner & Sharp, 2009]',
-						'2: effective grain radius [Brun et al., 2009]',
-						'3: density and cloud amount [Greuell & Konzelmann, 1994]',
-						'4: exponential time decay & wetness [Bougamont & Bamber, 2005]']))
-
+																												'0: direct input from aValue parameter',
+																												'1: effective grain radius [Gardner & Sharp, 2009]',
+																												'2: effective grain radius [Brun et al., 2009]',
+																												'3: density and cloud amount [Greuell & Konzelmann, 1994]',
+																												'4: exponential time decay & wetness [Bougamont & Bamber, 2005]']))
 		string = "%s\n%s"%(string,fielddisplay(self,'teValue','Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'))
-                               
 		#snow properties init
 		string = "%s\n%s"%(string,fielddisplay(self,'Dzini','Initial cell depth when restart [m]'))
@@ -180,6 +172,6 @@
 		string = "%s\n%s"%(string,fielddisplay(self,'Tini','Initial snow temperature when restart [K]'))
 		string = "%s\n%s"%(string,fielddisplay(self,'Sizeini','Initial number of layers when restart [K]'))
-                        
-		#additional albedo parameters: 
+
+		#additional albedo parameters:
 		if type(self.aIdx) == list or type(self.aIdx) == type(np.array([1,2])) and (self.aIdx == [1,2] or (1 in self.aIdx and 2 in self.aIdx)):
 			string = "%s\n%s"%(string,fielddisplay(self,'aSnow','new snow albedo (0.64 - 0.89)'))
@@ -195,22 +187,20 @@
 			string = "%s\n%s"%(string,fielddisplay(self,'t0dry','warm snow timescale (30) [d]'))
 			string = "%s\n%s"%(string,fielddisplay(self,'K','time scale temperature coef. (7) [d]'))
-		
+
 		string = "%s\n%s"%(string,fielddisplay(self,'swIdx','apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1]'))
 		string = "%s\n%s"%(string,fielddisplay(self,'denIdx',['densification model to use (default is 2):',
-						'1 = emperical model of Herron and Langway (1980)',
-						'2 = semi-emperical model of Anthern et al. (2010)',
-						'3 = DO NOT USE: physical model from Appix B of Anthern et al. (2010)',
-						'4 = DO NOT USE: emperical model of Li and Zwally (2004)',
-                                                '5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',
-                                                '6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',
-                                                '7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)']))
-
-                string = "%s\n%s"%(string,fielddisplay(self,'dsnowIdx',['model for fresh snow accumulation density (default is 1):',
-                                                '0 = Original GEMB value, 150 kg/m^3',
-                                                '1 = Antarctica value of fresh snow density, 350 kg/m^3',
-                                                '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)',
-                                                '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',
-                                                '4 = Greenland model of Kuipers Munneke et al. (2015)']));
-
+																													'1 = emperical model of Herron and Langway (1980)',
+																													'2 = semi-emperical model of Anthern et al. (2010)',
+																													'3 = DO NOT USE: physical model from Appix B of Anthern et al. (2010)',
+																													'4 = DO NOT USE: emperical model of Li and Zwally (2004)',
+																													'5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',
+																													'6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',
+																													'7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)']))
+		string = "%s\n%s"%(string,fielddisplay(self,'dsnowIdx',['model for fresh snow accumulation density (default is 1):',
+																														'0 = Original GEMB value, 150 kg/m^3',
+																														'1 = Antarctica value of fresh snow density, 350 kg/m^3',
+																														'2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)',
+																														'3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',
+																														'4 = Greenland model of Kuipers Munneke et al. (2015)']));
 		string = "%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
 		return string
@@ -247,9 +237,9 @@
 		self.isdensification = 1
 		self.isturbulentflux = 1
-	
+
 		self.aIdx = 1
 		self.swIdx = 1
 		self.denIdx = 2
-                self.dsnowIdx = 1
+		self.dsnowIdx = 1
 		self.zTop = 10*np.ones((mesh.numberofelements,))
 		self.dzTop = .05* np.ones((mesh.numberofelements,))
@@ -258,6 +248,6 @@
 		self.ThermoDeltaTScaling = 1/11.0
 
-                self.Vmean = 10*np.ones((mesh.numberofelements,))
-		
+		self.Vmean = 10*np.ones((mesh.numberofelements,))
+
 		self.zMax = 250*np.ones((mesh.numberofelements,))
 		self.zMin = 130*np.ones((mesh.numberofelements,))
@@ -268,5 +258,5 @@
 		self.aSnow = 0.85
 		self.aIce = 0.48
-		self.cldFrac = 0.1 
+		self.cldFrac = 0.1
 		self.t0wet = 15
 		self.t0dry = 30
@@ -276,7 +266,7 @@
 		self.teValue = np.ones((mesh.numberofelements,));
 		self.aValue = self.aSnow*np.ones(mesh.numberofelements,);
-        
+
 		self.Dzini = 0.05*np.ones((mesh.numberofelements,2))
-		self.Dini = 910.0*np.ones((mesh.numberofelements,2)) 
+		self.Dini = 910.0*np.ones((mesh.numberofelements,2))
 		self.Reini = 2.5*np.ones((mesh.numberofelements,2))
 		self.Gdnini = 0.0*np.ones((mesh.numberofelements,2))
@@ -286,6 +276,6 @@
 		self.Aini = self.aSnow*np.ones((mesh.numberofelements,2))
 		self.Tini = 273.15*np.ones((mesh.numberofelements,2))
-# 		/!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh). 
-# 		If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp 
+# 		/!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh).
+# 		If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp
 		self.Sizeini = 2*np.ones((mesh.numberofelements,))
 	#}}}
@@ -310,8 +300,8 @@
 
 		md = checkfield(md,'fieldname','smb.Tmean','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'>',273-100,'<',273+100) #-100/100 celsius min/max value
-		md = checkfield(md,'fieldname','smb.C','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'> = ',0) 
-                md = checkfield(md,'fieldname','smb.Vmean','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'> = ',0)
-		md = checkfield(md,'fieldname','smb.Tz','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'> = ',0,'< = ',5000) 
-		md = checkfield(md,'fieldname','smb.Vz','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'> = ',0,'< = ',5000) 
+		md = checkfield(md,'fieldname','smb.C','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'> = ',0)
+		md = checkfield(md,'fieldname','smb.Vmean','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'> = ',0)
+		md = checkfield(md,'fieldname','smb.Tz','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'> = ',0,'< = ',5000)
+		md = checkfield(md,'fieldname','smb.Vz','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'> = ',0,'< = ',5000)
 
 		md = checkfield(md,'fieldname','smb.teValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
@@ -320,5 +310,5 @@
 		md = checkfield(md,'fieldname','smb.swIdx','NaN',1,'Inf',1,'values',[0,1])
 		md = checkfield(md,'fieldname','smb.denIdx','NaN',1,'Inf',1,'values',[1,2,3,4,5,6,7])
-                md = checkfield(md,'fieldname','smb.dsnowIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4])
+		md = checkfield(md,'fieldname','smb.dsnowIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4])
 
 		md = checkfield(md,'fieldname','smb.zTop','NaN',1,'Inf',1,'> = ',0)
@@ -326,5 +316,5 @@
 		md = checkfield(md,'fieldname','smb.dzMin','NaN',1,'Inf',1,'>',0)
 		md = checkfield(md,'fieldname','smb.zY','NaN',1,'Inf',1,'> = ',1)
-		md = checkfield(md,'fieldname','smb.outputFreq','NaN',1,'Inf',1,'>',0,'<',10*365) #10 years max 
+		md = checkfield(md,'fieldname','smb.outputFreq','NaN',1,'Inf',1,'>',0,'<',10*365) #10 years max
 		md = checkfield(md,'fieldname','smb.InitDensityScaling','NaN',1,'Inf',1,'> = ',0,'< = ',1)
 		md = checkfield(md,'fieldname','smb.ThermoDeltaTScaling','NaN',1,'Inf',1,'> = ',0,'< = ',1)
@@ -342,5 +332,5 @@
 			md = checkfield(md,'fieldname','smb.t0dry','NaN',1,'Inf',1,'> = ',30,'< = ',30)
 			md = checkfield(md,'fieldname','smb.K','NaN',1,'Inf',1,'> = ',7,'< = ',7)
-			
+
 
 		#check zTop is < local thickness:
@@ -348,5 +338,5 @@
 		if np.any(he<self.zTop):
 			error('SMBgemb consistency check error: zTop should be smaller than local ice thickness')
-		
+
 		md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1)
 		return md
@@ -358,5 +348,5 @@
 
 		WriteData(fid,prefix,'name','md.smb.model','data',8,'format','Integer')
-			
+
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isgraingrowth','format','Boolean')
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isalbedo','format','Boolean')
@@ -367,5 +357,5 @@
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdensification','format','Boolean')
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isturbulentflux','format','Boolean')
-            
+
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','V','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
@@ -374,9 +364,9 @@
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','P','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','eAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','pAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)         
+		WriteData(fid,prefix,'object',self,'class','smb','fieldname','pAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
 
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tmean','format','DoubleMat','mattype',2)
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','C','format','DoubleMat','mattype',2)
-                WriteData(fid,prefix,'object',self,'class','smb','fieldname','Vmean','format','DoubleMat','mattype',2)
+		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Vmean','format','DoubleMat','mattype',2)
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tz','format','DoubleMat','mattype',2)
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Vz','format','DoubleMat','mattype',2)
@@ -387,9 +377,9 @@
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','zMax','format','DoubleMat','mattype',2)
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','zMin','format','DoubleMat','mattype',2)
-		
+
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','aIdx','format','Integer')
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','swIdx','format','Integer')
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','denIdx','format','Integer')
-                WriteData(fid,prefix,'object',self,'class','smb','fieldname','dsnowIdx','format','Integer')
+		WriteData(fid,prefix,'object',self,'class','smb','fieldname','dsnowIdx','format','Integer')
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','InitDensityScaling','format','Double')
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','ThermoDeltaTScaling','format','Double')
@@ -405,5 +395,5 @@
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','aValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','teValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-            
+
 		#snow properties init
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Dzini','format','DoubleMat','mattype',3)
@@ -418,15 +408,15 @@
 		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Sizeini','format','IntMat','mattype',2)
 
-		#figure out dt from forcings: 
+		#figure out dt from forcings:
 		time = self.Ta[-1] #assume all forcings are on the same time step
 		dtime = np.diff(time,n=1,axis=0)
 		dt = min(dtime) / yts
-            
+
 		WriteData(fid,prefix,'data',dt,'name','md.smb.dt','format','Double','scale',yts)
 
 		# Check if smb_dt goes evenly into transient core time step
 		if (md.timestepping.time_step % dt >=  1e-10):
-	                error('smb_dt/dt = #f. The number of SMB time steps in one transient core time step has to be an an integer',md.timestepping.time_step/dt)
-			
+			error('smb_dt/dt = #f. The number of SMB time steps in one transient core time step has to be an an integer',md.timestepping.time_step/dt)
+
 		#process requested outputs
 		outputs = self.requested_outputs
@@ -435,6 +425,5 @@
 			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
 			outputs    =outputscopy
-		
+
 		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
 	# }}}
-
Index: /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 23716)
@@ -42,17 +42,17 @@
 		if np.all(np.isnan(self.accumulation)):
 			self.accumulation=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.accumulation specified: values set as zero"
+			print("      no SMB.accumulation specified: values set as zero")
 
 		if np.all(np.isnan(self.evaporation)):
 			self.evaporation=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.evaporation specified: values set as zero"
+			print("      no SMB.evaporation specified: values set as zero")
 
 		if np.all(np.isnan(self.melt)):
 			self.melt=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.melt specified: values set as zero"
+			print("      no SMB.melt specified: values set as zero")
 
 		if np.all(np.isnan(self.refreeze)):
 			self.refreeze=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.refreeze specified: values set as zero"
+			print("      no SMB.refreeze specified: values set as zero")
 
 		return self
Index: /issm/trunk-jpl/src/m/classes/SMBpdd.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBpdd.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/SMBpdd.py	(revision 23716)
@@ -97,9 +97,9 @@
 		if np.all(np.isnan(self.s0p)):
 			self.s0p=np.zeros((md.mesh.numberofvertices))
-			print "      no SMBpdd.s0p specified: values set as zero"
+			print("      no SMBpdd.s0p specified: values set as zero")
 
 		if np.all(np.isnan(self.s0t)):
 			self.s0t=np.zeros((md.mesh.numberofvertices))
-			print "      no SMBpdd.s0t specified: values set as zero"
+			print("      no SMBpdd.s0t specified: values set as zero")
 
 		return self
Index: /issm/trunk-jpl/src/m/classes/SMBpddSicopolis.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBpddSicopolis.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/SMBpddSicopolis.py	(revision 23716)
@@ -60,21 +60,21 @@
 		if np.isnan(self.s0p):
 			self.s0p = np.zeros((md.mesh.numberofvertices,))
-			print '      no SMBpddSicopolis.s0p specified: values set as zero'
+			print('      no SMBpddSicopolis.s0p specified: values set as zero')
 		
 		if np.isnan(self.s0t):
 			self.s0t = np.zeros((md.mesh.numberofvertices,))
-			print '      no SMBpddSicopolis.s0t specified: values set as zero'
+			print('      no SMBpddSicopolis.s0t specified: values set as zero')
 		
 		if np.isnan(self.temperature_anomaly):
 			self.temperature_anomaly = np.zeros((md.mesh.numberofvertices,))
-			print '      no SMBpddSicopolis.temperature_anomaly specified: values set as zero'
+			print('      no SMBpddSicopolis.temperature_anomaly specified: values set as zero')
 		
 		if np.isnan(self.precipitation_anomaly):
 			self.precipitation_anomaly = np.ones((md.mesh.numberofvertices,))
-			print '      no SMBpddSicopolis.precipitation_anomaly specified: values set as ones'
+			print('      no SMBpddSicopolis.precipitation_anomaly specified: values set as ones')
 		
 		if np.isnan(self.smb_corr):
 			self.smb_corr = np.zeros((md.mesh.numberofvertices,))
-			print '      no SMBpddSicopolis.smb_corr specified: values set as zero'
+			print('      no SMBpddSicopolis.smb_corr specified: values set as zero')
 	# }}}
 
Index: /issm/trunk-jpl/src/m/classes/autodiff.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/autodiff.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/autodiff.py	(revision 23716)
@@ -5,5 +5,4 @@
 from checkfield import checkfield
 from WriteData import WriteData
-from MatlabFuncs import *
 
 class autodiff(object):
@@ -15,15 +14,15 @@
 	"""
 	def __init__(self,*args):    # {{{
-		self.isautodiff   = False
-		self.dependents   = []
-		self.independents = []
-		self.driver       = 'fos_forward'
-		self.obufsize     = float('NaN')
-		self.lbufsize     = float('NaN')
-		self.cbufsize     = float('NaN')
-		self.tbufsize     = float('NaN')
-		self.gcTriggerMaxSize     = float('NaN')
-		self.gcTriggerRatio     = float('NaN')
-                self.tapeAlloc = float('NaN')
+		self.isautodiff				= False
+		self.dependents				= []
+		self.independents			= []
+		self.driver						= 'fos_forward'
+		self.obufsize					= float('NaN')
+		self.lbufsize					= float('NaN')
+		self.cbufsize					= float('NaN')
+		self.tbufsize					= float('NaN')
+		self.gcTriggerMaxSize = float('NaN')
+		self.gcTriggerRatio   = float('NaN')
+		self.tapeAlloc				= float('NaN')
 		if not len(args):
 			self.setdefaultparameters()
@@ -31,7 +30,7 @@
 			raise RuntimeError("constructor not supported")
 	# }}}
+
 	def __repr__(self):    # {{{
 		s ="      automatic differentiation parameters:\n"
-
 		s+="%s\n" % fielddisplay(self,'isautodiff',"indicates if the automatic differentiation is activated")
 		s+="%s\n" % fielddisplay(self,'dependents',"list of dependent variables")
@@ -44,25 +43,25 @@
 		s+="%s\n" % fielddisplay(self,'gcTriggerRatio',"free location block sorting/consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio")
 		s+="%s\n" % fielddisplay(self,'gcTriggerMaxSize',"free location block sorting/consolidation triggered if the allocated locations exceed gcTriggerMaxSize)")
-                s+="%s\n" % fielddisplay(self,'tapeAlloc','Iteration count of a priori memory allocation of the AD tape');
+		s+="%s\n" % fielddisplay(self,'tapeAlloc','Iteration count of a priori memory allocation of the AD tape');
 
 		return s
 	# }}}
+
 	def setdefaultparameters(self):    # {{{
-		
-		self.obufsize     = 524288
-		self.lbufsize     = 524288
-		self.cbufsize     = 524288
-		self.tbufsize     = 524288
-		self.gcTriggerRatio=2.0
-		self.gcTriggerMaxSize=65536
-                self.tapeAlloc    = 15000000;
+		self.obufsize					= 524288
+		self.lbufsize					= 524288
+		self.cbufsize					= 524288
+		self.tbufsize					= 524288
+		self.gcTriggerRatio		=	2.0
+		self.gcTriggerMaxSize	=	65536
+		self.tapeAlloc				= 15000000;
 		return self
 	# }}}
+
 	def checkconsistency(self,md,solution,analyses):    # {{{
-
-		#Early return 
+		#Early return
 		if not self.isautodiff:
-			return md 
-		
+			return md
+
 		md = checkfield(md,'fieldname','autodiff.obufsize','>=',524288)
 		md = checkfield(md,'fieldname','autodiff.lbufsize','>=',524288)
@@ -71,10 +70,10 @@
 		md = checkfield(md,'fieldname','autodiff.gcTriggerRatio','>=',2.0)
 		md = checkfield(md,'fieldname','autodiff.gcTriggerMaxSize','>=',65536)
-                md = checkfield(md,'fieldname','autodiff.tapeAlloc','>=',0);
+		md = checkfield(md,'fieldname','autodiff.tapeAlloc','>=',0);
 
 		#Driver value:
 		md = checkfield(md,'fieldname','autodiff.driver','values',['fos_forward','fov_forward','fov_forward_all','fos_reverse','fov_reverse','fov_reverse_all'])
 
-		#go through our dependents and independents and check consistency: 
+		#go through our dependents and independents and check consistency:
 		for dep in self.dependents:
 			dep.checkconsistency(md,solution,analyses)
@@ -84,4 +83,5 @@
 		return md
 	# }}}
+
 	def marshall(self,prefix,md,fid):    # {{{
 		WriteData(fid,prefix,'object',self,'fieldname','isautodiff','format','Boolean')
@@ -93,5 +93,5 @@
 			WriteData(fid,prefix,'data',False,'name','md.autodiff.keep','format','Boolean')
 			return
-			
+
 		#buffer sizes {{{
 		WriteData(fid,prefix,'object',self,'fieldname','obufsize','format','Double');
@@ -101,6 +101,6 @@
 		WriteData(fid,prefix,'object',self,'fieldname','gcTriggerRatio','format','Double');
 		WriteData(fid,prefix,'object',self,'fieldname','gcTriggerMaxSize','format','Double');
-                WriteData(fid,prefix,'object',self,'fieldname','tapeAlloc','format','Integer');
-                #}}}
+		WriteData(fid,prefix,'object',self,'fieldname','tapeAlloc','format','Integer');
+		#}}}
 		#process dependent variables {{{
 		num_dependent_objects=len(self.dependents)
@@ -200,13 +200,13 @@
 		keep=False
 
-		#From ADOLC userdoc: 
-		# The optional integer argument keep of trace on determines whether the numerical values of all active variables are 
-		# recorded in a buffered temporary array or file called the taylor stack. This option takes effect if keep = 1 and 
-		# prepares the scene for an immediately following gradient evaluation by a call to a routine implementing the reverse 
-		# mode as described in the Section 4 and Section 5. 
+		#From ADOLC userdoc:
+		# The optional integer argument keep of trace on determines whether the numerical values of all active variables are
+		# recorded in a buffered temporary array or file called the taylor stack. This option takes effect if keep = 1 and
+		# prepares the scene for an immediately following gradient evaluation by a call to a routine implementing the reverse
+		# mode as described in the Section 4 and Section 5.
 		#
 
 		if len(self.driver)<=3:
-			keep=False    #there is no "_reverse" string within the driver string: 
+			keep=False    #there is no "_reverse" string within the driver string:
 		else:
 			if strncmpi(self.driver[3:],'_reverse',8):
Index: /issm/trunk-jpl/src/m/classes/bamggeom.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/bamggeom.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/bamggeom.py	(revision 23716)
@@ -25,5 +25,5 @@
 		elif len(args) == 1:
 			object=args[0]
-			for field in object.iterkeys():
+			for field in list(object.keys()):
 				if field in vars(self):
 					setattr(self,field,object[field])
Index: /issm/trunk-jpl/src/m/classes/bamgmesh.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/bamgmesh.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/bamgmesh.py	(revision 23716)
@@ -32,5 +32,5 @@
 		elif len(args) == 1:
 			object=args[0]
-			for field in object.iterkeys():
+			for field in list(object.keys()):
 				if field in vars(self):
 					setattr(self,field,object[field])
Index: /issm/trunk-jpl/src/m/classes/basalforcings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/basalforcings.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/basalforcings.py	(revision 23716)
@@ -40,9 +40,9 @@
 		if np.all(np.isnan(self.groundedice_melting_rate)):
 			self.groundedice_melting_rate=np.zeros((md.mesh.numberofvertices))
-			print "      no basalforcings.groundedice_melting_rate specified: values set as zero"
+			print("      no basalforcings.groundedice_melting_rate specified: values set as zero")
 
 		if np.all(np.isnan(self.floatingice_melting_rate)):
 			self.floatingice_melting_rate=np.zeros((md.mesh.numberofvertices))
-			print "      no basalforcings.floatingice_melting_rate specified: values set as zero"
+			print("      no basalforcings.floatingice_melting_rate specified: values set as zero")
 		#if np.all(np.isnan(self.geothermalflux)):
 			#self.geothermalflux=np.zeros((md.mesh.numberofvertices))
Index: /issm/trunk-jpl/src/m/classes/clusters/cyclone.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/cyclone.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/clusters/cyclone.py	(revision 23716)
@@ -10,5 +10,5 @@
 	from cyclone_settings import cyclone_settings
 except ImportError:
-	print 'You need cyclone_settings.py to proceed, check presence and sys.path'
+	print('You need cyclone_settings.py to proceed, check presence and sys.path')
 	
 class cyclone(object):
@@ -101,5 +101,5 @@
 		subprocess.call(compressstring,shell=True)
 
-		print 'uploading input file and queueing script'
+		print('uploading input file and queueing script')
 		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
 
@@ -108,5 +108,5 @@
                 # {{{
 
-		print 'launching solution sequence on remote cluster'
+		print('launching solution sequence on remote cluster')
 		if restart:
 			launchcommand='cd %s && cd %s && qsub %s.queue' % (self.executionpath,dirname,modelname)
Index: /issm/trunk-jpl/src/m/classes/clusters/fram.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/fram.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/clusters/fram.py	(revision 23716)
@@ -11,5 +11,5 @@
 	from fram_settings import fram_settings
 except ImportError:
-	print 'You need fram_settings.py to proceed, check presence and sys.path'
+	print('You need fram_settings.py to proceed, check presence and sys.path')
 	
 class fram(object):
@@ -143,5 +143,5 @@
 		subprocess.call(compressstring,shell=True)
 
-		print 'uploading input file and queueing script'
+		print('uploading input file and queueing script')
 		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
 
@@ -150,5 +150,5 @@
 		# {{{
 
-		print 'launching solution sequence on remote cluster'
+		print('launching solution sequence on remote cluster')
 		if restart:
 			launchcommand='cd %s && cd %s && sbatch %s.queue' % (self.executionpath,dirname,modelname)
Index: /issm/trunk-jpl/src/m/classes/clusters/generic.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/generic.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/clusters/generic.py	(revision 23716)
@@ -41,5 +41,5 @@
 		#initialize cluster using user settings if provided
 		if os.path.exists(self.name+'_settings.py'):
-			execfile(self.name+'_settings.py',globals())
+			exec(compile(open(self.name+'_settings.py').read(), self.name+'_settings.py', 'exec'),globals())
 
 		#OK get other fields
@@ -180,5 +180,5 @@
 		subprocess.call(compressstring,shell=True)
 
-		print 'uploading input file and queueing script'
+		print('uploading input file and queueing script')
 		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
 
@@ -186,5 +186,5 @@
 	def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch):    # {{{
 
-		print 'launching solution sequence on remote cluster'
+		print('launching solution sequence on remote cluster')
 		if restart:
 			launchcommand='cd %s && cd %s chmod 777 %s.queue && ./%s.queue' % (self.executionpath,dirname,modelname,modelname)
Index: /issm/trunk-jpl/src/m/classes/clusters/hexagon.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/hexagon.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/clusters/hexagon.py	(revision 23716)
@@ -10,10 +10,10 @@
 	from hexagon_settings import hexagon_settings
 except ImportError:
-	print 'You need hexagon_settings.py to proceed, check presence and sys.path'
-	
+	print('You need hexagon_settings.py to proceed, check presence and sys.path')
+
 class hexagon(object):
 	"""
 	Hexagon cluster class definition
-	Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. 
+	Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway.
 	You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
 	   Usage:
@@ -46,4 +46,5 @@
 		self.np=self.numnodes*self.procspernodes
 		# }}}
+
 	def __repr__(self):
 		# {{{
@@ -62,10 +63,11 @@
 		s = "%s\n%s"%(s,fielddisplay(self,'accountname','your cluster account'))
 		return s
-                # }}}
+	# }}}
+
 	def checkconsistency(self,md,solution,analyses):
 		# {{{
 		#mem should not be over 32000mb
 		#numprocs should not be over 4096
-		#we have cpupernodes*numberofcpus=mppwidth and mppnppn=cpupernodes, 
+		#we have cpupernodes*numberofcpus=mppwidth and mppnppn=cpupernodes,
 		#Miscelaneous
 		if not self.login:
@@ -80,8 +82,8 @@
 			md = md.checkmessage('asking too much memory max is 32000 per node')
 		return self
-                # }}}
+	# }}}
+
 	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling):
 		# {{{
-
 		executable='issm.exe'
 		if isdakota:
@@ -93,5 +95,5 @@
 			executable='issm_ocean.exe'
 
-		#write queuing script 
+		#write queuing script
 		shortname=modelname[0:min(12,len(modelname))]
 		fid=open(modelname+'.queue','w')
@@ -99,11 +101,11 @@
 		fid.write('#PBS -N %s \n' % shortname)
 		fid.write('#PBS -l mppwidth=%i,mppnppn=%i\n' % (self.np,self.procspernodes))
-                timeobj=datetime.timedelta(minutes=self.time)
-                m,s=divmod(timeobj.total_seconds(), 60)
-                h,m=divmod(m, 60)
-                timestring="%02d:%02d:%02d" % (h, m, s)
+		timeobj=datetime.timedelta(minutes=self.time)
+		m,s=divmod(timeobj.total_seconds(), 60)
+		h,m=divmod(m, 60)
+		timestring="%02d:%02d:%02d" % (h, m, s)
 		fid.write('#PBS -l walltime=%s\n' % timestring) #walltime is hh:mm:ss
 		fid.write('#PBS -l mppmem=%imb\n' % int(self.mem/self.procspernodes))
-		fid.write('#PBS -A %s\n' % self.accountname) 
+		fid.write('#PBS -A %s\n' % self.accountname)
 		fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath,dirname,modelname))
 		fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath,dirname,modelname))
@@ -118,9 +120,8 @@
 		fid.write('aprun -B %s/%s %s %s/%s %s\n' % (self.codepath,executable,str(solution),self.executionpath,dirname,modelname))
 		fid.close()
+		# }}}
 
-		# }}}
 	def UploadQueueJob(self,modelname,dirname,filelist):
 		# {{{
-
 		#compress the files into one zip.
 		compressstring='tar -zcf %s.tar.gz ' % dirname
@@ -129,12 +130,11 @@
 		subprocess.call(compressstring,shell=True)
 
-		print 'uploading input file and queueing script'
+		print('uploading input file and queueing script')
 		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
+		# }}}
 
-		# }}}
 	def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch):
 		# {{{
-
-		print 'launching solution sequence on remote cluster'
+		print('launching solution sequence on remote cluster')
 		if restart:
 			launchcommand='cd %s && cd %s && qsub %s.queue' % (self.executionpath,dirname,modelname)
@@ -142,6 +142,6 @@
 			launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname)
 		issmssh(self.name,self.login,self.port,launchcommand)
+		# }}}
 
-		# }}}
 	def Download(self,dirname,filelist):
 		# {{{
Index: /issm/trunk-jpl/src/m/classes/clusters/pfe.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/pfe.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/clusters/pfe.py	(revision 23716)
@@ -12,5 +12,5 @@
 	from pfe_settings import pfe_settings
 except ImportError:
-	print 'You need pfe_settings.py to proceed, check presence and sys.path'
+	print('You need pfe_settings.py to proceed, check presence and sys.path')
 	
 class pfe(object):
@@ -177,5 +177,5 @@
 		subprocess.call(compressstring,shell=True)
 
-		print 'uploading input file and queueing script'
+		print('uploading input file and queueing script')
 		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
 
@@ -184,5 +184,5 @@
 			# {{{
 
-		print 'launching solution sequence on remote cluster'
+		print('launching solution sequence on remote cluster')
 		if restart:
 			launchcommand='cd %s && cd %s && qsub %s.queue' % (self.executionpath,dirname,modelname)
Index: /issm/trunk-jpl/src/m/classes/clusters/stallo.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/stallo.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/clusters/stallo.py	(revision 23716)
@@ -11,5 +11,5 @@
 	from stallo_settings import stallo_settings
 except ImportError:
-	print 'You need stallo_settings.py to proceed, check presence and sys.path'
+	print('You need stallo_settings.py to proceed, check presence and sys.path')
 
 class stallo(object):
@@ -151,5 +151,5 @@
 		subprocess.call(compressstring,shell=True)
 
-		print 'uploading input file and queueing script'
+		print('uploading input file and queueing script')
 		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
 
@@ -158,5 +158,5 @@
 		# {{{
 
-		print 'launching solution sequence on remote cluster'
+		print('launching solution sequence on remote cluster')
 		if restart:
 			launchcommand='cd %s && cd %s && sbatch %s.queue' % (self.executionpath,dirname,modelname)
Index: /issm/trunk-jpl/src/m/classes/clusters/vilje.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/vilje.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/clusters/vilje.py	(revision 23716)
@@ -10,10 +10,10 @@
 	from vilje_settings import vilje_settings
 except ImportError:
-	print 'You need vilje_settings.py to proceed, check presence and sys.path'
-	
+	print('You need vilje_settings.py to proceed, check presence and sys.path')
+
 class vilje(object):
 	"""
 	Vilje cluster class definition
- 
+
 	   Usage:
 	      cluster=vilje();
@@ -43,6 +43,7 @@
 		#OK get other fields
 		self=options.AssignObjectFields(self)
-		self.np=self.numnodes*self.procspernodes		
-		# }}}
+		self.np=self.numnodes*self.procspernodes
+	# }}}
+
 	def __repr__(self):
 		# {{{
@@ -62,8 +63,9 @@
 		s = "%s\n%s"%(s,fielddisplay(self,'accountname','your cluster account'))
 		return s
-                # }}}
+	# }}}
+
 	def checkconsistency(self,md,solution,analyses):
 		# {{{
-                #Queue dictionarry  gives queu name as key and max walltime and cpus as var
+		#Queue dictionarry  gives queu name as key and max walltime and cpus as var
 		queuedict = {'workq':[5*24*60, 30],
 								 'test':[30,4]}
@@ -80,8 +82,8 @@
 			md = md.checkmessage('interactive mode not implemented')
 		return self
-                # }}}
+	# }}}
+
 	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling):
 		# {{{
-
 		executable='issm.exe'
 		if isdakota:
@@ -93,5 +95,5 @@
 			executable='issm_ocean.exe'
 
-		#write queuing script 
+		#write queuing script
 		shortname=modelname[0:min(12,len(modelname))]
 		fid=open(modelname+'.queue','w')
@@ -106,18 +108,18 @@
 		fid.write('#PBS -l walltime=%s\n' % timestring) #walltime is hh:mm:ss
 		#fid.write('#PBS -l mem=%igb\n' % self.mem)
-		fid.write('#PBS -A %s\n' % self.accountname) 
+		fid.write('#PBS -A %s\n' % self.accountname)
 		fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath,dirname,modelname))
 		fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath,dirname,modelname))
 		fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
-		fid.write('module load intelcomp/17.0.0\n') 
+		fid.write('module load intelcomp/17.0.0\n')
 		fid.write('module load mpt/2.14\n')
 		fid.write('module load petsc/3.7.4d\n')
-		fid.write('module load parmetis/4.0.3\n') 
+		fid.write('module load parmetis/4.0.3\n')
 		fid.write('module load mumps/5.0.2\n')
 		fid.write('cd %s/%s/\n\n' % (self.executionpath,dirname))
 		fid.write('mpiexec_mpt -np %i %s/%s %s %s/%s %s\n' % (self.np,self.codepath,executable,str(solution),self.executionpath,dirname,modelname))
-                fid.close()
+		fid.close()
+		# }}}
 
-		# }}}
 	def UploadQueueJob(self,modelname,dirname,filelist):
 		# {{{
@@ -128,12 +130,11 @@
 		subprocess.call(compressstring,shell=True)
 
-		print 'uploading input file and queueing script'
+		print('uploading input file and queueing script')
 		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
+		# }}}
 
-		# }}}
 	def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch):
 		# {{{
-
-		print 'launching solution sequence on remote cluster'
+		print('launching solution sequence on remote cluster')
 		if restart:
 			launchcommand='cd %s && cd %s && qsub %s.queue' % (self.executionpath,dirname,modelname)
@@ -141,11 +142,10 @@
 			launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname)
 		issmssh(self.name,self.login,self.port,launchcommand)
+		# }}}
 
-		# }}}
 	def Download(self,dirname,filelist):
 		# {{{
-
 		#copy files from cluster to current directory
 		directory='%s/%s/' % (self.executionpath,dirname)
 		issmscpin(self.name,self.login,self.port,directory,filelist)
-                # }}}
+		# }}}
Index: /issm/trunk-jpl/src/m/classes/damage.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/damage.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/damage.py	(revision 23716)
@@ -3,5 +3,4 @@
 from checkfield import checkfield
 from WriteData import WriteData
-import MatlabFuncs as m
 
 class damage(object):
@@ -14,27 +13,26 @@
 
 	def __init__(self,*args):    # {{{
-			
-		#damage: 
-		self.isdamage           = 0.
-		self.D			= float('NaN')
-		self.law		= float('NaN')
-		self.spcdamage		= float('NaN')
-		self.max_damage		= float('NaN')
-		
+		#damage:
+		self.isdamage   = 0.
+		self.D					= float('NaN')
+		self.law				= float('NaN')
+		self.spcdamage	= float('NaN')
+		self.max_damage	= float('NaN')
+
 		#numerical
-		self.stabilization	= float('NaN')
-		self.maxiter		= float('NaN')
-		self.elementinterp      = ''
+		self.stabilization = float('NaN')
+		self.maxiter			 = float('NaN')
+		self.elementinterp = ''
 
-		#general parameters for evolution law: 
-		self.stress_threshold   = float('NaN')
-		self.kappa              = float('NaN')
-		self.c1                 = float('NaN')
-		self.c2                 = float('NaN')
-		self.c3                 = float('NaN')
-		self.c4                 = float('NaN')
-		self.healing		= float('NaN')
-		self.equiv_stress       = float('NaN')
-		self.requested_outputs  = []
+		#general parameters for evolution law:
+		self.stress_threshold  = float('NaN')
+		self.kappa             = float('NaN')
+		self.c1                = float('NaN')
+		self.c2                = float('NaN')
+		self.c3                = float('NaN')
+		self.c4                = float('NaN')
+		self.healing					 = float('NaN')
+		self.equiv_stress      = float('NaN')
+		self.requested_outputs = []
 
 		if not len(args):
@@ -42,9 +40,8 @@
 		else:
 			raise RuntimeError("constructor not supported")
+	# }}}
 
-	# }}}
 	def __repr__(self):    # {{{
 		s ='   Damage:\n'
-		
 		s+="%s\n" % fielddisplay(self,"isdamage","is damage mechanics being used? [0 (default) or 1]")
 		if self.isdamage:
@@ -53,6 +50,5 @@
 			s+="%s\n" % fielddisplay(self,"spcdamage","damage constraints (NaN means no constraint)")
 			s+="%s\n" % fielddisplay(self,"max_damage","maximum possible damage (0<=max_damage<1)")
-
-                        s+="%s\n" % fielddisplay(self,"stabilization","0: no, 1: artificial_diffusivity, 2: SUPG (not working), 4: Flux corrected transport")
+			s+="%s\n" % fielddisplay(self,"stabilization","0: no, 1: artificial_diffusivity, 2: SUPG (not working), 4: Flux corrected transport")
 			s+="%s\n" % fielddisplay(self,"maxiter","maximum number of non linear iterations")
 			s+="%s\n" %	fielddisplay(self,"elementinterp","interpolation scheme for finite elements [''P1'',''P2'']")
@@ -69,4 +65,5 @@
 		return s
 	# }}}
+
 	def extrude(self,md): # {{{
 		self.D=project3d(md,'vector',self.D,'type','node')
@@ -74,16 +71,15 @@
 		return self
 	#}}}
+
 	def setdefaultparameters(self):    # {{{
+		#damage parameters:
+		self.isdamage		=	0
+		self.D					=	0
+		self.law				=	0
+		self.max_damage	=	1-1e-5 #if damage reaches 1, solve becomes singular, as viscosity becomes nil
 
-		#damage parameters: 
-		self.isdamage=0
-		self.D=0
-		self.law=0
-
-		self.max_damage=1-1e-5 #if damage reaches 1, solve becomes singular, as viscosity becomes nil
-		
 		#Type of stabilization used
 		self.stabilization=4
-			
+
 		#Maximum number of iterations
 		self.maxiter=100
@@ -92,5 +88,5 @@
 		self.elementinterp='P1'
 
-		#damage evolution parameters 
+		#damage evolution parameters
 		self.stress_threshold=1.3e5
 		self.kappa=2.8
@@ -107,6 +103,6 @@
 		return self
 	# }}}
+
 	def defaultoutputs(self,md): # {{{
-		
 		if md.mesh.domaintype().lower()=='2dhorizontal':
 			list = ['DamageDbar']
@@ -114,8 +110,7 @@
 			list = ['DamageD']
 		return list
+	#}}}
 
-	#}}}
 	def checkconsistency(self,md,solution,analyses):    # {{{
-
 		md = checkfield(md,'fieldname','damage.isdamage','numel',[1],'values',[0,1])
 		if self.isdamage:
@@ -143,6 +138,6 @@
 		return md
 	# }}}
+
 	def marshall(self,prefix,md,fid):    # {{{
-
 		WriteData(fid,prefix,'object',self,'fieldname','isdamage','format','Boolean')
 		if self.isdamage:
@@ -162,5 +157,5 @@
 			WriteData(fid,prefix,'object',self,'fieldname','healing','format','Double')
 			WriteData(fid,prefix,'object',self,'fieldname','equiv_stress','format','Integer')
-			
+
 		#process requested outputs
 		outputs = self.requested_outputs
Index: /issm/trunk-jpl/src/m/classes/esa.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/esa.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/esa.py	(revision 23716)
@@ -9,9 +9,9 @@
 	"""
 	ESA class definition
-	
+
 		Usage:
 		  esa=esa();
 	"""
-	
+
 	def __init__(self): # {{{
 		self.deltathickness    = float('NaN')
@@ -22,8 +22,9 @@
 		self.requested_outputs = []
 		self.transitions       = []
-		
+
 		#set defaults
 		self.setdefaultparameters()
 		#}}}
+
 	def __repr__(self): # {{{
 			string='   esa parameters:'
@@ -31,5 +32,5 @@
 			string="%s\n%s"%(string,fielddisplay(self,'love_h','load Love number for radial displacement'))
 			string="%s\n%s"%(string,fielddisplay(self,'love_l','load Love number for horizontal displaements'))
-                        string="%s\n%s"%(string,fielddisplay(self,'hemisphere','North-south, East-west components of 2-D horiz displacement vector: -1 south, 1 north'))
+			string="%s\n%s"%(string,fielddisplay(self,'hemisphere','North-south, East-west components of 2-D horiz displacement vector: -1 south, 1 north'))
 			string="%s\n%s"%(string,fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions'))
 			string="%s\n%s"%(string,fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps'))
@@ -38,16 +39,16 @@
 			return string
 		# }}}
+
 	def setdefaultparameters(self): # {{{
-		
 		#numerical discretization accuracy
 		self.degacc=.01
-	
-                #computational flags:
-                self.hemisphere=0;
+
+		#computational flags:
+		self.hemisphere=0;
 
 		#output default:
 		self.requested_outputs=['default']
 
-		#transitions should be a cell array of vectors: 
+		#transitions should be a cell array of vectors:
 		self.transitions=[]
 
@@ -56,6 +57,6 @@
 		return self
 		#}}}
+
 	def checkconsistency(self,md,solution,analyses):    # {{{
-
 		#Early return
 		if (solution!='EsaAnalysis'):
@@ -69,12 +70,14 @@
 		md = checkfield(md,'fieldname','esa.requested_outputs','stringrow',1)
 
-		#check that love numbers are provided at the same level of accuracy: 
+		#check that love numbers are provided at the same level of accuracy:
 		if (size(self.love_h,0) != size(self.love_l,0)):
 			error('esa error message: love numbers should be provided at the same level of accuracy')
 		return md
 	# }}}
+
 	def defaultoutputs(self,md): # {{{
 		return ['EsaUmotion']
 	# }}}
+
 	def marshall(self,prefix,md,fid): # {{{
 		WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2)
@@ -84,5 +87,5 @@
 		WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double')
 		WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray')
-	
+
 		#process requested outputs
 		outputs = self.requested_outputs
Index: /issm/trunk-jpl/src/m/classes/flowequation.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/flowequation.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/flowequation.py	(revision 23716)
@@ -118,5 +118,5 @@
 			if any(self.element_equation==1):
 				if np.any(np.logical_and(self.vertex_equation,md.mask.groundedice_levelset)):
-					print "\n !!! Warning: SIA's model is not consistent on ice shelves !!!\n"
+					print("\n !!! Warning: SIA's model is not consistent on ice shelves !!!\n")
 
 		return md
Index: /issm/trunk-jpl/src/m/classes/fourierlove.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/fourierlove.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/fourierlove.py	(revision 23716)
@@ -10,100 +10,95 @@
 	      fourierlove=fourierlove();
 	"""
-
 	def __init__(self): # {{{
-                self.nfreq                =  0;
-		self.frequencies          =  0;
-		self.sh_nmax              =  0;
-		self.sh_nmin              =  0;
-		self.g0                   =  0; 
-		self.r0                   =  0; 
-		self.mu0                  =  0;
-                self.allow_layer_deletion =  0;
-                self.love_kernels 	  =  0;
-		self.forcing_type         =  0;
+		self.nfreq                = 0;
+		self.frequencies          = 0;
+		self.sh_nmax              = 0;
+		self.sh_nmin              = 0;
+		self.g0                   = 0;
+		self.r0                   = 0;
+		self.mu0                  = 0;
+		self.allow_layer_deletion = 0;
+		self.love_kernels					= 0;
+		self.forcing_type         = 0;
 
 		#set defaults
 		self.setdefaultparameters()
+		#}}}
 
+	def __repr__(self): # {{{
+		string='   Fourier Love class:'
+		string="%s\n%s"%(string,fielddisplay(self,'nfreq','number of frequencies sampled (default 1, elastic) [Hz]'))
+		string="%s\n%s"%(string,fielddisplay(self,'frequencies','frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
+		string="%s\n%s"%(string,fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)'))
+		string="%s\n%s"%(string,fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default 1)'))
+		string="%s\n%s"%(string,fielddisplay(self,'g0','adimensioning constant for gravity (default 10) [m/s^2]'))
+		string="%s\n%s"%(string,fielddisplay(self,'r0','adimensioning constant for radius (default 6378*10^3) [m]'))
+		string="%s\n%s"%(string,fielddisplay(self,'mu0','adimensioning constant for stress (default 10^11) [Pa]'))
+		string="%s\n%s"%(string,fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)'))
+		string="%s\n%s"%(string,fielddisplay(self,'love_kernels','compute love numbers at depth? (default 0)'))
+		string="%s\n%s"%(string,fielddisplay(self,'forcing_type','integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :'))
+		string="%s\n%s"%(string,'                                                     1:  Inner core boundary -- Volumic Potential')
+		string="%s\n%s"%(string,'                                                     2:  Inner core boundary -- Pressure')
+		string="%s\n%s"%(string,'                                                     3:  Inner core boundary -- Loading')
+		string="%s\n%s"%(string,'                                                     4:  Inner core boundary -- Tangential traction')
+		string="%s\n%s"%(string,'                                                     5:  Core mantle boundary -- Volumic Potential')
+		string="%s\n%s"%(string,'                                                     6:  Core mantle boundary -- Pressure')
+		string="%s\n%s"%(string,'                                                     7:  Core mantle boundary -- Loading')
+		string="%s\n%s"%(string,'                                                     8:  Core mantle boundary -- Tangential traction')
+		string="%s\n%s"%(string,'                                                     9:  Surface -- Volumic Potential')
+		string="%s\n%s"%(string,'                                                     10: Surface -- Pressure')
+		string="%s\n%s"%(string,'                                                     11: Surface -- Loading')
+		string="%s\n%s"%(string,'                                                     12: Surface -- Tangential traction ')
+
+		return string;
 		#}}}
-	def __repr__(self): # {{{
-		
-		string='   Fourier Love class:' 
-		
-                string="%s\n%s"%(string,fielddisplay(self,'nfreq','number of frequencies sampled (default 1, elastic) [Hz]'))
-                string="%s\n%s"%(string,fielddisplay(self,'frequencies','frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
-                string="%s\n%s"%(string,fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)'))
-                string="%s\n%s"%(string,fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default 1)'))
-                string="%s\n%s"%(string,fielddisplay(self,'g0','adimensioning constant for gravity (default 10) [m/s^2]'))
-                string="%s\n%s"%(string,fielddisplay(self,'r0','adimensioning constant for radius (default 6378*10^3) [m]'))
-                string="%s\n%s"%(string,fielddisplay(self,'mu0','adimensioning constant for stress (default 10^11) [Pa]'))
-                string="%s\n%s"%(string,fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)'))
-                string="%s\n%s"%(string,fielddisplay(self,'love_kernels','compute love numbers at depth? (default 0)'))
-                string="%s\n%s"%(string,fielddisplay(self,'forcing_type','integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :'))
-                string="%s\n%s"%(string,'                                                     1:  Inner core boundary -- Volumic Potential')
-                string="%s\n%s"%(string,'                                                     2:  Inner core boundary -- Pressure')
-                string="%s\n%s"%(string,'                                                     3:  Inner core boundary -- Loading')
-                string="%s\n%s"%(string,'                                                     4:  Inner core boundary -- Tangential traction')
-                string="%s\n%s"%(string,'                                                     5:  Core mantle boundary -- Volumic Potential')
-                string="%s\n%s"%(string,'                                                     6:  Core mantle boundary -- Pressure')
-                string="%s\n%s"%(string,'                                                     7:  Core mantle boundary -- Loading')
-                string="%s\n%s"%(string,'                                                     8:  Core mantle boundary -- Tangential traction')
-                string="%s\n%s"%(string,'                                                     9:  Surface -- Volumic Potential')
-                string="%s\n%s"%(string,'                                                     10: Surface -- Pressure')
-                string="%s\n%s"%(string,'                                                     11: Surface -- Loading')
-                string="%s\n%s"%(string,'                                                     12: Surface -- Tangential traction ')
 
-                return string;
-
-
-		#}}}
 	def extrude(self,md): # {{{
 		return self
 	#}}}
+
 	def setdefaultparameters(self): # {{{
+		#we setup an elastic love number computation by default.
+		self.nfreq=1
+		self.frequencies=[0]; #Hz
+		self.sh_nmax=256 # .35 degree, 40 km at the equator.
+		self.sh_nmin=1
+		self.g0=10 # m/s^2
+		self.r0=6378*1e3 #m
+		self.mu0=1e11 # Pa
+		self.allow_layer_deletion=1
+		self.love_kernels=0
+		self.forcing_type = 11
 
-            #we setup an elastic love number computation by default.
-            self.nfreq=1
-            self.frequencies=[0]; #Hz
-            self.sh_nmax=256 # .35 degree, 40 km at the equator.
-            self.sh_nmin=1
-            self.g0=10 # m/s^2
-            self.r0=6378*1e3 #m
-            self.mu0=1e11 # Pa
-            self.allow_layer_deletion=1
-            self.love_kernels=0 
-            self.forcing_type = 11
+		return self
+	#}}}
 
-            return self
-	#}}}
 	def checkconsistency(self,md,solution,analyses):    # {{{
+		md = checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',[1],'>',0);
+		md = checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',[md.love.nfreq]);
+		md = checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',[1],'>',0);
+		md = checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',[1],'>',0);
+		md = checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',[1],'>',0);
+		md = checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',[1],'>',0);
+		md = checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',[1],'>',0);
+		md = checkfield(md,'fieldname','love.allow_layer_deletion','values',[0,1]);
+		md = checkfield(md,'fieldname','love.love_kernels','values',[0,1]);
+		md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',[1],'>',0, '<=', 12);
+		if md.love.sh_nmin<=1 and md.love.forcing_type==9:
+			raise RuntimeError("Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.")
 
-            md = checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',[md.love.nfreq]);
-            md = checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.allow_layer_deletion','values',[0,1]);
-            md = checkfield(md,'fieldname','love.love_kernels','values',[0,1]);
-            md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',[1],'>',0, '<=', 12);
-            if md.love.sh_nmin<=1 and md.love.forcing_type==9:
-                raise RuntimeError("Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.")
+		return md
+	# }}}
 
-            return md
+	def marshall(self,prefix,md,fid):    # {{{
+		WriteData(fid,prefix,'object',self,'fieldname','nfreq','format','Integer');
+		WriteData(fid,prefix,'object',self,'fieldname','frequencies','format','DoubleMat','mattype',3);
+		WriteData(fid,prefix,'object',self,'fieldname','sh_nmax','format','Integer');
+		WriteData(fid,prefix,'object',self,'fieldname','sh_nmin','format','Integer');
+		WriteData(fid,prefix,'object',self,'fieldname','g0','format','Double');
+		WriteData(fid,prefix,'object',self,'fieldname','r0','format','Double');
+		WriteData(fid,prefix,'object',self,'fieldname','mu0','format','Double');
+		WriteData(fid,prefix,'object',self,'fieldname','allow_layer_deletion','format','Boolean');
+		WriteData(fid,prefix,'object',self,'fieldname','love_kernels','format','Boolean');
+		WriteData(fid,prefix,'object',self,'fieldname','forcing_type','format','Integer');
 	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-            
-            WriteData(fid,prefix,'object',self,'fieldname','nfreq','format','Integer');
-            WriteData(fid,prefix,'object',self,'fieldname','frequencies','format','DoubleMat','mattype',3);
-            WriteData(fid,prefix,'object',self,'fieldname','sh_nmax','format','Integer');
-            WriteData(fid,prefix,'object',self,'fieldname','sh_nmin','format','Integer');
-            WriteData(fid,prefix,'object',self,'fieldname','g0','format','Double');
-            WriteData(fid,prefix,'object',self,'fieldname','r0','format','Double');
-            WriteData(fid,prefix,'object',self,'fieldname','mu0','format','Double');
-            WriteData(fid,prefix,'object',self,'fieldname','allow_layer_deletion','format','Boolean');
-            WriteData(fid,prefix,'object',self,'fieldname','love_kernels','format','Boolean');
-            WriteData(fid,prefix,'object',self,'fieldname','forcing_type','format','Integer');
-
-	# }}}
Index: /issm/trunk-jpl/src/m/classes/frictioncoulomb.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/frictioncoulomb.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/frictioncoulomb.py	(revision 23716)
@@ -5,80 +5,80 @@
 
 class frictioncoulomb(object):
-    """
-    FRICTIONCOULOMB class definition
+	"""
+	FRICTIONCOULOMB class definition
 
-    Usage:
-        frictioncoulomb=frictioncoulomb()
-    """
+	Usage:
+	frictioncoulomb=frictioncoulomb()
+	"""
 
-    def __init__(self): # {{{
-        self.coefficient = float('NaN')
-        self.coefficientcoulomb = float('NaN')
-        self.p = float('NaN')
-	self.q = float('NaN')
-	self.coupling  	 = 0
-	self.effective_pressure	= float('NaN')
-	#set defaults
-	self.setdefaultparameters()
+	def __init__(self): # {{{
+		self.coefficient = float('NaN')
+		self.coefficientcoulomb = float('NaN')
+		self.p = float('NaN')
+		self.q = float('NaN')
+		self.coupling  	 = 0
+		self.effective_pressure	= float('NaN')
+		#set defaults
+		self.setdefaultparameters()
+    #}}}
 
-    #}}}
-    def __repr__(self): # {{{
-	string="Basal shear stress parameters: Sigma_b = min(coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b,\n coefficientcoulomb^2 * rho_i * g * (h-h_f)), (effective stress Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p)."
+	def __repr__(self): # {{{
+		string="Basal shear stress parameters: Sigma_b = min(coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b,\n coefficientcoulomb^2 * rho_i * g * (h-h_f)), (effective stress Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p)."
+		string="%s\n%s"%(string,fielddisplay(self,"coefficient","power law (Weertman) friction coefficient [SI]"))
+		string="%s\n%s"%(string,fielddisplay(self,"coefficientcoulomb","Coulomb friction coefficient [SI]"))
+		string="%s\n%s"%(string,fielddisplay(self,"p","p exponent"))
+		string="%s\n%s"%(string,fielddisplay(self,"q","q exponent"))
+		string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)'))
+		string="%s\n%s"%(string,fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]'))
+		return string
+	#}}}
+	def extrude(self,md): # {{{
+		self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1)
+		self.coefficientcoulomb=project3d(md,'vector',self.coefficientcoulomb,'type','node','layer',1)
+		self.p=project3d(md,'vector',self.p,'type','element')
+		self.q=project3d(md,'vector',self.q,'type','element')
+		if self.coupling==1:
+			self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1)
+		elif self.coupling==2:
+			raise ValueError('coupling not supported yet')
+		elif self.coupling > 2:
+			raise ValueError('md.friction.coupling larger than 2, not supported yet')
+		return self
+	#}}}
 
-	string="%s\n%s"%(string,fielddisplay(self,"coefficient","power law (Weertman) friction coefficient [SI]"))
-	string="%s\n%s"%(string,fielddisplay(self,"coefficientcoulomb","Coulomb friction coefficient [SI]"))
-	string="%s\n%s"%(string,fielddisplay(self,"p","p exponent"))
-	string="%s\n%s"%(string,fielddisplay(self,"q","q exponent"))
-	string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)'))
-	string="%s\n%s"%(string,fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]'))
-	return string
-    #}}}
-    def extrude(self,md): # {{{
-	self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1)
-	self.coefficientcoulomb=project3d(md,'vector',self.coefficientcoulomb,'type','node','layer',1)
-	self.p=project3d(md,'vector',self.p,'type','element')
-	self.q=project3d(md,'vector',self.q,'type','element')
-	if self.coupling==1:
-		self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1)
-	elif self.coupling==2:
-		raise ValueError('coupling not supported yet')
-	elif self.coupling > 2:
-		raise ValueError('md.friction.coupling larger than 2, not supported yet')	
-	return self
-    #}}}
-    def setdefaultparameters(self): # {{{
-	return self
-    #}}}
-    def checkconsistency(self,md,solution,analyses):    # {{{
+	def setdefaultparameters(self): # {{{
+		return self
+	#}}}
 
-	#Early return
-	if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-	    return md
+	def checkconsistency(self,md,solution,analyses):    # {{{
+		#Early return
+		if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
+			return md
 
-	md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1)
-	md = checkfield(md,'fieldname','friction.coefficientcoulomb','timeseries',1,'NaN',1,'Inf',1)
-	md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
-	md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
-	if self.coupling==1:
-		md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1)
-	elif self.coupling==2:
-		raise ValueError('coupling not supported yet')
-	elif self.coupling > 2:
-		raise ValueError('md.friction.coupling larger than 2, not supported yet')
-	return md
+		md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1)
+		md = checkfield(md,'fieldname','friction.coefficientcoulomb','timeseries',1,'NaN',1,'Inf',1)
+		md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
+		md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
+		if self.coupling==1:
+			md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1)
+		elif self.coupling==2:
+			raise ValueError('coupling not supported yet')
+		elif self.coupling > 2:
+			raise ValueError('md.friction.coupling larger than 2, not supported yet')
+		return md
+    # }}}
 
+	def marshall(self,prefix,md,fid):    # {{{
+		WriteData(fid,prefix,'name','md.friction.law','data',7,'format','Integer')
+		WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
+		WriteData(fid,prefix,'object',self,'fieldname','coefficientcoulomb','format','DoubleMat','mattype',1)
+		WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2)
+		WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2)
+		WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer')
+		if self.coupling==1:
+			WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
+		elif self.coupling==2:
+			raise ValueError('coupling not supported yet')
+		elif self.coupling > 2:
+			raise ValueError('md.friction.coupling larger than 2, not supported yet')
     # }}}
-    def marshall(self,prefix,md,fid):    # {{{
-	WriteData(fid,prefix,'name','md.friction.law','data',7,'format','Integer')
-	WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-	WriteData(fid,prefix,'object',self,'fieldname','coefficientcoulomb','format','DoubleMat','mattype',1)
-	WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2)
-	WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2)
-	WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer')
-	if self.coupling==1:
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-	elif self.coupling==2:
-		raise ValueError('coupling not supported yet')
-	elif self.coupling > 2:
-		raise ValueError('md.friction.coupling larger than 2, not supported yet')	
-    # }}}
Index: /issm/trunk-jpl/src/m/classes/frictionshakti.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/frictionshakti.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/frictionshakti.py	(revision 23716)
@@ -5,43 +5,44 @@
 
 class frictionshakti(object):
-    """
-    FRICTIONSHAKTI class definition
+	"""
+	FRICTIONSHAKTI class definition
 
-    Usage:
-        friction=frictionshakti()
-    """
+	Usage:
+	friction=frictionshakti()
+	"""
 
-    def __init__(self,md): # {{{
-        self.coefficient = md.friction.coefficient
-	#set defaults
-	self.setdefaultparameters()
+	def __init__(self,md): # {{{
+		self.coefficient = md.friction.coefficient
+		#set defaults
+		self.setdefaultparameters()
+	#}}}
 
-    #}}}
-    def __repr__(self): # {{{
-	string="Basal shear stress parameters: Sigma_b = coefficient^2 * Neff * u_b\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*(head-b))"
+	def __repr__(self): # {{{
+		string="Basal shear stress parameters: Sigma_b = coefficient^2 * Neff * u_b\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*(head-b))"
+		string="%s\n%s"%(string,fielddisplay(self,"coefficient","friction coefficient [SI]"))
+		return string
+	#}}}
 
-	string="%s\n%s"%(string,fielddisplay(self,"coefficient","friction coefficient [SI]"))
-	return string
-    #}}}
-    def extrude(self,md): # {{{
-	self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1)	
-	return self
-    #}}}
-    def setdefaultparameters(self): # {{{
-	return self
-    #}}}
-    def checkconsistency(self,md,solution,analyses):    # {{{
+	def extrude(self,md): # {{{
+		self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1)
+		return self
+	#}}}
 
-	#Early return
-	if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-	    return md
+	def setdefaultparameters(self): # {{{
+		return self
+	#}}}
 
-	md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1)
-	return md
+	def checkconsistency(self,md,solution,analyses):    # {{{
+		#Early return
+		if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
+			return md
 
+		md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1)
+		return md
+	# }}}
+
+	def marshall(self,prefix,md,fid):    # {{{
+		yts=md.constants.yts
+		WriteData(fid,prefix,'name','md.friction.law','data',8,'format','Integer')
+		WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
     # }}}
-    def marshall(self,prefix,md,fid):    # {{{
-	yts=md.constants.yts
-	WriteData(fid,prefix,'name','md.friction.law','data',8,'format','Integer')
-	WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)	
-    # }}}
Index: /issm/trunk-jpl/src/m/classes/frontalforcings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/frontalforcings.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/frontalforcings.py	(revision 23716)
@@ -13,11 +13,10 @@
 
 	def __init__(self): # {{{
-
 		self.meltingrate   = float('NaN')
 
 		#set defaults
 		self.setdefaultparameters()
+		#}}}
 
-		#}}}
 	def __repr__(self): # {{{
 		string='   Frontalforcings parameters:'
@@ -26,28 +25,26 @@
 		return string
 		#}}}
+
 	def extrude(self,md): # {{{
 		self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node')
 		return self
 	#}}}
+
 	def setdefaultparameters(self): # {{{
-
 		return self
 	#}}}
+
 	def checkconsistency(self,md,solution,analyses):    # {{{
+		#Early return
+		if (solution!='TransientSolution') or (not md.transient.ismovingfront):
+			return md
 
-		#Early return
-                if (solution!='TransientSolution') or (not md.transient.ismovingfront):
-                    return md
-
-                md = checkfield(md,'fieldname','frontalforcings.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-
+		md = checkfield(md,'fieldname','frontalforcings.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
 		return md
 	# }}}
+
 	def marshall(self,prefix,md,fid):    # {{{
-
-            yts=md.constants.yts
-
-	    WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',1,'format','Integer')
-            WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
-
-        # }}}
+		yts=md.constants.yts
+		WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',1,'format','Integer')
+		WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
+	# }}}
Index: /issm/trunk-jpl/src/m/classes/hydrologydc.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/hydrologydc.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/hydrologydc.py	(revision 23716)
@@ -148,5 +148,5 @@
 
 	def defaultoutputs(self,md): # {{{
-		list = ['SedimentHeadHydrostep','SedimentHeadResidual','EffectivePressureHydrostep','HydrologydcMaskThawedNode','HydrologydcMaskThawedElt']
+		list = ['SedimentHeadHydrostep','SedimentHeadResidual','EffectivePressureHydrostep']
 		if self.isefficientlayer==1:
 			list.extend(['EplHeadHydrostep','HydrologydcMaskEplactiveNode','HydrologydcMaskEplactiveElt','EplHeadSlopeX','EplHeadSlopeY','HydrologydcEplThicknessHydrostep'])
@@ -162,5 +162,5 @@
 		if np.all(np.isnan(self.basal_moulin_input)):
 			self.basal_moulin_input=np.zeros((md.mesh.numberofvertices))
-			print"      no hydrology.basal_moulin_input specified: values set as zero"
+			print("      no hydrology.basal_moulin_input specified: values set as zero")
 
 		return self
@@ -204,5 +204,5 @@
 			md = checkfield(md,'fieldname','hydrology.epl_max_thickness','numel',[1],'>',0.)
 			md = checkfield(md,'fieldname','hydrology.epl_initial_thickness','numel',[1],'>',0.)
-			md = checkfield(md,'fieldname','hydrology.epl_colapse_thickness','numel',[1],'>',0.,'<',self.epl_initial_thickness)
+			md = checkfield(md,'fieldname','hydrology.epl_colapse_thickness','numel',[1],'>',0.)
 			md = checkfield(md,'fieldname','hydrology.epl_thick_comp','numel',[1],'values',[0,1])
 			md = checkfield(md,'fieldname','hydrology.eplflip_lock','>=',0.,'numel',[1])
Index: /issm/trunk-jpl/src/m/classes/hydrologyshakti.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/hydrologyshakti.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/hydrologyshakti.py	(revision 23716)
@@ -30,5 +30,4 @@
 		#}}}
 	def __repr__(self): # {{{
-		
 		string='   hydrologyshakti solution parameters:'
 		string="%s\n%s"%(string,fielddisplay(self,'head','subglacial hydrology water head (m)'))
@@ -45,10 +44,12 @@
 		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
 		return string
-		#}}}
+	#}}}
+
 	def extrude(self,md): # {{{
 		return self
 	#}}}
+
 	def setdefaultparameters(self): # {{{
-		# Set under-relaxation parameter to be 1 (no under-relaxation of nonlinear iteration)	
+		# Set under-relaxation parameter to be 1 (no under-relaxation of nonlinear iteration)
 		self.relaxation=1
 		self.storage=0
@@ -56,4 +57,5 @@
 		return self
 	#}}}
+
 	def defaultoutputs(self,md): # {{{
 		list = ['HydrologyHead','HydrologyGapHeight','EffectivePressure','HydrologyBasalFlux','DegreeOfChannelization']
@@ -62,5 +64,4 @@
 
 	def checkconsistency(self,md,solution,analyses):    # {{{
-		
 		#Early return
 		if 'HydrologyShaktiAnalysis' not in analyses:
@@ -76,10 +77,10 @@
 		md = checkfield(md,'fieldname','hydrology.neumannflux','timeseries',1,'NaN',1,'Inf',1)
 		md = checkfield(md,'fieldname','hydrology.spchead','size',[md.mesh.numberofvertices])
-         	md = checkfield(md,'fieldname','hydrology.relaxation','>=',0)	
+		md = checkfield(md,'fieldname','hydrology.relaxation','>=',0)
 		md = checkfield(md,'fieldname','hydrology.storage','>=',0)
 		md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1)
-
 		return md
 	# }}}
+
 	def marshall(self,prefix,md,fid):    # {{{
 		yts=md.constants.yts
Index: /issm/trunk-jpl/src/m/classes/levelset.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/levelset.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/levelset.py	(revision 23716)
@@ -18,5 +18,5 @@
 		self.reinit_frequency = 0
 		self.calving_max      = 0.
-                self.fe               = 'P1'
+		self.fe               = 'P1'
 
 		#set defaults
@@ -30,5 +30,5 @@
 		string="%s\n%s"%(string,fielddisplay(self,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized'))
 		string="%s\n%s"%(string,fielddisplay(self,'calving_max','maximum allowed calving rate (m/a)'))
-                string="%s\n%s"%(string,fielddisplay(self,'fe','Finite Element type: ''P1'' (default), or ''P2'''))
+		string="%s\n%s"%(string,fielddisplay(self,'fe','Finite Element type: ''P1'' (default), or ''P2'''))
 
 		return string
@@ -41,10 +41,10 @@
 
 		#stabilization = 1 by default
-		self.stabilization = 1
+		self.stabilization		= 1
 		self.reinit_frequency = 5
 		self.calving_max      = 3000.
 
-                #Linear elements by default
-                self.fe='P1'
+		#Linear elements by default
+		self.fe='P1'
 
 		return self
@@ -59,5 +59,5 @@
 		md = checkfield(md,'fieldname','levelset.stabilization','values',[0,1,2]);
 		md = checkfield(md,'fieldname','levelset.calving_max','NaN',1,'Inf',1,'>',0);
-                md = checkfield(md,'fieldname','levelset.fe','values',['P1','P2']);
+		md = checkfield(md,'fieldname','levelset.fe','values',['P1','P2']);
 
 		return md
@@ -71,4 +71,4 @@
 		WriteData(fid,prefix,'object',self,'fieldname','reinit_frequency','format','Integer');
 		WriteData(fid,prefix,'object',self,'fieldname','calving_max','format','Double','scale',1./yts);
-                WriteData(fid,prefix,'object',self,'fieldname','fe','format','String');
+		WriteData(fid,prefix,'object',self,'fieldname','fe','format','String');
 	# }}}
Index: /issm/trunk-jpl/src/m/classes/linearbasalforcings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/linearbasalforcings.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/linearbasalforcings.py	(revision 23716)
@@ -15,5 +15,5 @@
 
 		if not len(args):
-			print 'empty init'
+			print('empty init')
 			self.groundedice_melting_rate  = float('NaN')
 			self.deepwater_melting_rate    = 0.
@@ -25,5 +25,5 @@
 			self.setdefaultparameters()
 		elif len(args)==1 and args[0].__module__=='basalforcings':
-			print 'converting basalforings to linearbasalforcings'
+			print('converting basalforings to linearbasalforcings')
 			inv=args[0]
 			self.groundedice_melting_rate  = inv.groundedice_melting_rate
@@ -53,5 +53,5 @@
 		if np.all(np.isnan(self.groundedice_melting_rate)):
 			self.groundedice_melting_rate=np.zeros((md.mesh.numberofvertices))
-			print "      no basalforcings.groundedice_melting_rate specified: values set as zero"
+			print("      no basalforcings.groundedice_melting_rate specified: values set as zero")
 
 		return self
Index: /issm/trunk-jpl/src/m/classes/m1qn3inversion.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/m1qn3inversion.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/m1qn3inversion.py	(revision 23716)
@@ -19,5 +19,5 @@
 
 		if not len(args):
-			print 'empty init'
+			print('empty init')
 			self.iscontrol                   = 0
 			self.incomplete_adjoint          = 0
@@ -41,5 +41,5 @@
 			self.setdefaultparameters()
 		elif len(args)==1 and args[0].__module__=='inversion':
-			print 'converting inversion to m1qn3inversion'
+			print('converting inversion to m1qn3inversion')
 			inv=args[0]
 			#first call setdefaultparameters: 
Index: /issm/trunk-jpl/src/m/classes/massfluxatgate.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/massfluxatgate.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/massfluxatgate.py	(revision 23716)
@@ -46,19 +46,19 @@
 	#}}}
 	def checkconsistency(self,md,solution,analyses):    # {{{
-		
-		if  not isinstance(self.name, basestring):
+
+		if  not isinstance(self.name, str):
 			raise RuntimeError("massfluxatgate error message: 'name' field should be a string!")
-			
-		if  not isinstance(self.profilename, basestring):
-			raise RuntimeError("massfluxatgate error message: 'profilename' field should be a string!") 
-		
+
+		if  not isinstance(self.profilename, str):
+			raise RuntimeError("massfluxatgate error message: 'profilename' field should be a string!")
+
 		OutputdefinitionStringArray=[]
 		for i in range(1,100):
 			x='Outputdefinition'+str(i)
 			OutputdefinitionStringArray.append(x)
-			
+
 		md = checkfield(md,'field',self.definitionstring,'values',OutputdefinitionStringArray)
-		
-		#check the profilename points to a file!: 
+
+		#check the profilename points to a file!:
 		if not os.path.isfile(self.profilename):
 			raise RuntimeError("massfluxatgate error message: file name for profile corresponding to gate does not point to a legitimate file on disk!")
@@ -67,9 +67,9 @@
 	# }}}
 	def marshall(self,prefix,md,fid):    # {{{
-		
-		#before marshalling, we need to create the segments out of the profilename: 
+
+		#before marshalling, we need to create the segments out of the profilename:
 		self.segments=MeshProfileIntersection(md.mesh.elements,md.mesh.x,md.mesh.y,self.profilename)[0]
 
-		#ok, marshall name and segments: 
+		#ok, marshall name and segments:
 		WriteData(fid,prefix,'data',self.name,'name','md.massfluxatgate.name','format','String');
 		WriteData(fid,prefix,'data',self.definitionstring,'name','md.massfluxatgate.definitionstring','format','String');
Index: /issm/trunk-jpl/src/m/classes/matdamageice.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/matdamageice.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/matdamageice.py	(revision 23716)
@@ -30,19 +30,18 @@
 		self.rheology_law              = ''
 
-		#giaivins: 
+		#giaivins:
 		self.lithosphere_shear_modulus  = 0.
 		self.lithosphere_density        = 0.
 		self.mantle_shear_modulus       = 0.
 		self.mantle_density             = 0.
-		
+
 		#SLR
 		self.earth_density= 5512;  # average density of the Earth, (kg/m^3)
 
-
 		self.setdefaultparameters()
 		#}}}
+
 	def __repr__(self): # {{{
 		string="   Materials:"
-
 		string="%s\n%s"%(string,fielddisplay(self,"rho_ice","ice density [kg/m^3]"))
 		string="%s\n%s"%(string,fielddisplay(self,"rho_water","water density [kg/m^3]"))
@@ -52,5 +51,5 @@
 		string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]"))
 		string="%s\n%s"%(string,fielddisplay(self,"temperateiceconductivity","temperate ice thermal conductivity [W/m/K]"))
-		string="%s\n%s"%(string,fielddisplay(self,"effectiveconductivity_averaging","computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+		string="%s\n%s"%(string,fielddisplay(self,"effectiveconductivity_averaging","computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
 		string="%s\n%s"%(string,fielddisplay(self,"meltingpoint","melting point of ice at 1atm in K"))
 		string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
@@ -66,8 +65,7 @@
 		string="%s\n%s"%(string,fielddisplay(self,"mantle_density","Mantle density [g/cm^-3]"))
 		string="%s\n%s"%(string,fielddisplay(self,"earth_density","Mantle density [kg/m^-3]"))
-
-
 		return string
 		#}}}
+
 	def extrude(self,md): # {{{
 		self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node')
@@ -75,44 +73,32 @@
 		return self
 	#}}}
+
 	def setdefaultparameters(self): # {{{
 		#ice density (kg/m^3)
 		self.rho_ice=917.
-
 		#ocean water density (kg/m^3)
 		self.rho_water=1023.
-
 		#fresh water density (kg/m^3)
 		self.rho_freshwater=1000.
-
 		#water viscosity (N.s/m^2)
-		self.mu_water=0.001787  
-
+		self.mu_water=0.001787
 		#ice heat capacity cp (J/kg/K)
 		self.heatcapacity=2093.
-
 		#ice latent heat of fusion L (J/kg)
 		self.latentheat=3.34*10**5
-
 		#ice thermal conductivity (W/m/K)
 		self.thermalconductivity=2.4
-
 		#temperate ice thermal conductivity (W/m/K)
 		self.temperateiceconductivity=0.24
-
-		#computation of effective conductivity
+    #computation of effective conductivity
 		self.effectiveconductivity_averaging=1
-        
 		#the melting point of ice at 1 atmosphere of pressure in K
 		self.meltingpoint=273.15
-
 		#rate of change of melting point with pressure (K/Pa)
 		self.beta=9.8*10**-8
-
 		#mixed layer (ice-water interface) heat capacity (J/kg/K)
 		self.mixed_layer_capacity=3974.
-
 		#thermal exchange velocity (ice-water interface) (m/s)
 		self.thermal_exchange_velocity=1.00*10**-4
-
 		#Rheology law: what is the temperature dependence of B with T
 		#available: none, paterson and arrhenius
@@ -124,11 +110,10 @@
 		self.mantle_shear_modulus       = 1.45*10**11 # (Pa)
 		self.mantle_density             = 3.34        # (g/cm^-3)
-		
+
 		#SLR
 		self.earth_density= 5512;  #average density of the Earth, (kg/m^3)
-
-
 		return self
 		#}}}
+
 	def checkconsistency(self,md,solution,analyses):    # {{{
 		md = checkfield(md,'fieldname','materials.rho_ice','>',0)
@@ -139,4 +124,5 @@
 		md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
 		md = checkfield(md,'fieldname','materials.rheology_law','values',['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson','Arrhenius','LliboutryDuval'])
+		md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0,1,2])
 		md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',[1]);
 		md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',[1]);
@@ -144,8 +130,7 @@
 		md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',[1]);
 		md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',[1]);
-		md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0,1,2])
-
 		return md
 	# }}}
+
 	def marshall(self,prefix,md,fid):    # {{{
 		WriteData(fid,prefix,'name','md.materials.type','data',1,'format','Integer');
@@ -166,5 +151,4 @@
 		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)
 		WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String')
-
 		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
 		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10.**3.);
Index: /issm/trunk-jpl/src/m/classes/matenhancedice.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/matenhancedice.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/matenhancedice.py	(revision 23716)
@@ -26,15 +26,15 @@
 		self.mixed_layer_capacity      = 0.
 		self.thermal_exchange_velocity = 0.
-		self.rheology_E		       = float('NaN')
+		self.rheology_E								 = float('NaN')
 		self.rheology_B                = float('NaN')
 		self.rheology_n                = float('NaN')
 		self.rheology_law              = ''
 
-		#giaivins: 
+		#giaivins:
 		self.lithosphere_shear_modulus  = 0.
 		self.lithosphere_density        = 0.
 		self.mantle_shear_modulus       = 0.
 		self.mantle_density             = 0.
-		
+
 		#SLR
 		self.earth_density= 0  # average density of the Earth, (kg/m^3)
@@ -42,7 +42,7 @@
 		self.setdefaultparameters()
 		#}}}
+
 	def __repr__(self): # {{{
 		string="   Materials:"
-
 		string="%s\n%s"%(string,fielddisplay(self,"rho_ice","ice density [kg/m^3]"))
 		string="%s\n%s"%(string,fielddisplay(self,"rho_water","water density [kg/m^3]"))
@@ -52,5 +52,5 @@
 		string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]"))
 		string="%s\n%s"%(string,fielddisplay(self,"temperateiceconductivity","temperate ice thermal conductivity [W/m/K]"))
-		string="%s\n%s"%(string,fielddisplay(self,"effectiveconductivity_averaging","computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+		string="%s\n%s"%(string,fielddisplay(self,"effectiveconductivity_averaging","computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
 		string="%s\n%s"%(string,fielddisplay(self,"meltingpoint","melting point of ice at 1atm in K"))
 		string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
@@ -67,7 +67,7 @@
 		string="%s\n%s"%(string,fielddisplay(self,"mantle_density","Mantle density [g/cm^-3]"))
 		string="%s\n%s"%(string,fielddisplay(self,"earth_density","Mantle density [kg/m^-3]"))
-
 		return string
 		#}}}
+
 	def extrude(self,md): # {{{
 		self.rheology_E=project3d(md,'vector',self.rheology_E,'type','node')
@@ -76,44 +76,32 @@
 		return self
 	#}}}
+
 	def setdefaultparameters(self): # {{{
 		#ice density (kg/m^3)
 		self.rho_ice=917.
-
 		#ocean water density (kg/m^3)
 		self.rho_water=1023.
-
 		#fresh water density (kg/m^3)
 		self.rho_freshwater=1000.
-
 		#water viscosity (N.s/m^2)
-		self.mu_water=0.001787  
-
+		self.mu_water=0.001787
 		#ice heat capacity cp (J/kg/K)
 		self.heatcapacity=2093.
-
 		#ice latent heat of fusion L (J/kg)
 		self.latentheat=3.34*10**5
-
 		#ice thermal conductivity (W/m/K)
 		self.thermalconductivity=2.4
-
 		#temperate ice thermal conductivity (W/m/K)
 		self.temperateiceconductivity=0.24
-	
-		#computation of effective conductivity
+    #computation of effective conductivity
 		self.effectiveconductivity_averaging=1
-
 		#the melting point of ice at 1 atmosphere of pressure in K
 		self.meltingpoint=273.15
-
 		#rate of change of melting point with pressure (K/Pa)
 		self.beta=9.8*10**-8
-
 		#mixed layer (ice-water interface) heat capacity (J/kg/K)
 		self.mixed_layer_capacity=3974.
-
 		#thermal exchange velocity (ice-water interface) (m/s)
 		self.thermal_exchange_velocity=1.00*10**-4
-
 		#Rheology law: what is the temperature dependence of B with T
 		#available: none, paterson and arrhenius
@@ -125,5 +113,5 @@
 		self.mantle_shear_modulus       = 1.45*10**11 # (Pa)
 		self.mantle_density             = 3.34        # (g/cm^-3)
-		
+
 		#SLR
 		self.earth_density= 5512  #average density of the Earth, (kg/m^3)
@@ -131,4 +119,5 @@
 		return self
 		#}}}
+
 	def checkconsistency(self,md,solution,analyses):    # {{{
 		md = checkfield(md,'fieldname','materials.rho_ice','>',0)
@@ -141,5 +130,5 @@
 		md = checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval'])
 		md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0,1,2])
-        
+
 		if 'GiaAnalysis' in analyses:
 			md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1)
@@ -151,4 +140,5 @@
 		return md
 	# }}}
+
 	def marshall(self,prefix,md,fid):    # {{{
 		WriteData(fid,prefix,'name','md.materials.type','data',4,'format','Integer')
@@ -170,5 +160,4 @@
 		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)
 		WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String')
-
 		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double')
 		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3)
Index: /issm/trunk-jpl/src/m/classes/materials.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/materials.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/materials.py	(revision 23716)
@@ -4,24 +4,25 @@
 from checkfield import checkfield
 from WriteData import WriteData
-		
+
 def naturetointeger(strnat): #{{{
-    
-    intnat=np.zeros(len(strnat))
-    for i in range(len(intnat)):
-        if strnat[i]=='damageice':
-            intnat[i]=1
-        elif strnat[i]=='estar':
-            intnat[i]=2 
-        elif strnat[i]=='ice':
-            intnat[i]=3 
-        elif strnat[i]=='enhancedice':
-            intnat[i]=4 
-        elif strnat[i]=='litho':
-            intnat[i]=5
-        else: 
-            raise RuntimeError("materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'')");
-    
-    return intnat
+
+	intnat=np.zeros(len(strnat))
+	for i in range(len(intnat)):
+		if strnat[i]=='damageice':
+			intnat[i]=1
+		elif strnat[i]=='estar':
+			intnat[i]=2
+		elif strnat[i]=='ice':
+			intnat[i]=3
+		elif strnat[i]=='enhancedice':
+			intnat[i]=4
+		elif strnat[i]=='litho':
+			intnat[i]=5
+		else:
+			raise RuntimeError("materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'')");
+
+		return intnat
 # }}}
+
 class materials(object):
 	"""
@@ -33,248 +34,234 @@
 
 	def __init__(self,*args): # {{{
-		
-                self.nature                    = []
-
-                if not len(args):
-                    self.nature=['ice']
-                else:
-                    self.nature=args
-
-                for i in range(len(self.nature)):
-                    if not(self.nature[i] == 'litho' or self.nature[i]=='ice'):
-                        raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')")
-                    
-                #start filling in the dynamic fields: 
-                for i in range(len(self.nature)):
-                    nat=self.nature[i]; 
-                    if nat=='ice':
-                        setattr(self,'rho_ice',0)
-                        setattr(self,'rho_ice',0);
-                        setattr(self,'rho_water',0);
-                        setattr(self,'rho_freshwater',0);
-                        setattr(self,'mu_water',0);
-                        setattr(self,'heatcapacity',0);
-                        setattr(self,'latentheat',0);
-                        setattr(self,'thermalconductivity',0);
-                        setattr(self,'temperateiceconductivity',0);
-                        setattr(self,'meltingpoint',0);
-                        setattr(self,'beta',0);
-                        setattr(self,'mixed_layer_capacity',0);
-                        setattr(self,'thermal_exchange_velocity',0);
-                        setattr(self,'rheology_B',0);
-                        setattr(self,'rheology_n',0);
-                        setattr(self,'rheology_law',0);
-                    elif nat=='litho':
-                        setattr(self,'numlayers',0);
-                        setattr(self,'radius',0);
-                        setattr(self,'viscosity',0);
-                        setattr(self,'lame_lambda',0);
-                        setattr(self,'lame_mu',0);
-                        setattr(self,'burgers_viscosity',0);
-                        setattr(self,'burgers_mu',0);
-                        setattr(self,'isburgers',0);
-                        setattr(self,'density',0);
-                        setattr(self,'issolid',0);
-                    else:
-                        raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')");
-                #set default parameters:
+		self.nature                    = []
+		if not len(args):
+			self.nature=['ice']
+		else:
+			self.nature=args
+
+		for i in range(len(self.nature)):
+			if not(self.nature[i] == 'litho' or self.nature[i]=='ice'):
+				raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')")
+
+		#start filling in the dynamic fields:
+		for i in range(len(self.nature)):
+			nat=self.nature[i];
+			if nat=='ice':
+				setattr(self,'rho_ice',0)
+				setattr(self,'rho_ice',0);
+				setattr(self,'rho_water',0);
+				setattr(self,'rho_freshwater',0);
+				setattr(self,'mu_water',0);
+				setattr(self,'heatcapacity',0);
+				setattr(self,'latentheat',0);
+				setattr(self,'thermalconductivity',0);
+				setattr(self,'temperateiceconductivity',0);
+				setattr(self,'meltingpoint',0);
+				setattr(self,'beta',0);
+				setattr(self,'mixed_layer_capacity',0);
+				setattr(self,'thermal_exchange_velocity',0);
+				setattr(self,'rheology_B',0);
+				setattr(self,'rheology_n',0);
+				setattr(self,'rheology_law',0);
+			elif nat=='litho':
+				setattr(self,'numlayers',0);
+				setattr(self,'radius',0);
+				setattr(self,'viscosity',0);
+				setattr(self,'lame_lambda',0);
+				setattr(self,'lame_mu',0);
+				setattr(self,'burgers_viscosity',0);
+				setattr(self,'burgers_mu',0);
+				setattr(self,'isburgers',0);
+				setattr(self,'density',0);
+				setattr(self,'issolid',0);
+			else:
+				raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')");
+			#set default parameters:
 		self.setdefaultparameters()
 		#}}}
+
 	def __repr__(self): # {{{
 		string="   Materials:"
-                for i in range(len(self.nature)):
-                    nat=self.nature[i]; 
-                    if nat=='ice':
-                        string="%s\n%s"%(string,'Ice:');
-                        string="%s\n%s"%(string,fielddisplay(self,"rho_ice","ice density [kg/m^3]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"rho_water","water density [kg/m^3]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"rho_freshwater","fresh water density [kg/m^3]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"mu_water","water viscosity [N s/m^2]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"heatcapacity","heat capacity [J/kg/K]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"temperateiceconductivity","temperate ice thermal conductivity [W/m/K]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"meltingpoint","melting point of ice at 1atm in K"))
-                        string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"beta","rate of change of melting point with pressure [K/Pa]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa s^(1/n)]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent"))
-                        string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
-                    elif nat=='litho':
-                        string="%s\n%s"%(string,'Litho:');
-                        string="%s\n%s"%(string,fielddisplay(self,'numlayers','number of layers (default 2)'))
-                        string="%s\n%s"%(string,fielddisplay(self,'radius','array describing the radius for each interface (numlayers+1) [m]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'viscosity','array describing each layer''s viscosity (numlayers) [Pa.s]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'burgers_viscosity','array describing each layer''s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'burgers_mu','array describing each layer''s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'isburgers','array describing whether we adopt a MaxWell (0) or Burgers (1) rheology (default 0)'))
-                        string="%s\n%s"%(string,fielddisplay(self,'density','array describing each layer''s density (numlayers) [kg/m^3]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)'))
-
-                    else:
-                        raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')");
+		for i in range(len(self.nature)):
+			nat=self.nature[i];
+			if nat=='ice':
+				string="%s\n%s"%(string,'Ice:');
+				string="%s\n%s"%(string,fielddisplay(self,"rho_ice","ice density [kg/m^3]"))
+				string="%s\n%s"%(string,fielddisplay(self,"rho_water","water density [kg/m^3]"))
+				string="%s\n%s"%(string,fielddisplay(self,"rho_freshwater","fresh water density [kg/m^3]"))
+				string="%s\n%s"%(string,fielddisplay(self,"mu_water","water viscosity [N s/m^2]"))
+				string="%s\n%s"%(string,fielddisplay(self,"heatcapacity","heat capacity [J/kg/K]"))
+				string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]"))
+				string="%s\n%s"%(string,fielddisplay(self,"temperateiceconductivity","temperate ice thermal conductivity [W/m/K]"))
+				string="%s\n%s"%(string,fielddisplay(self,"meltingpoint","melting point of ice at 1atm in K"))
+				string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
+				string="%s\n%s"%(string,fielddisplay(self,"beta","rate of change of melting point with pressure [K/Pa]"))
+				string="%s\n%s"%(string,fielddisplay(self,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
+				string="%s\n%s"%(string,fielddisplay(self,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
+				string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa s^(1/n)]"))
+				string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent"))
+				string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
+			elif nat=='litho':
+				string="%s\n%s"%(string,'Litho:');
+				string="%s\n%s"%(string,fielddisplay(self,'numlayers','number of layers (default 2)'))
+				string="%s\n%s"%(string,fielddisplay(self,'radius','array describing the radius for each interface (numlayers+1) [m]'))
+				string="%s\n%s"%(string,fielddisplay(self,'viscosity','array describing each layer''s viscosity (numlayers) [Pa.s]'))
+				string="%s\n%s"%(string,fielddisplay(self,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]'))
+				string="%s\n%s"%(string,fielddisplay(self,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]'))
+				string="%s\n%s"%(string,fielddisplay(self,'burgers_viscosity','array describing each layer''s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]'))
+				string="%s\n%s"%(string,fielddisplay(self,'burgers_mu','array describing each layer''s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]'))
+				string="%s\n%s"%(string,fielddisplay(self,'isburgers','array describing whether we adopt a MaxWell (0) or Burgers (1) rheology (default 0)'))
+				string="%s\n%s"%(string,fielddisplay(self,'density','array describing each layer''s density (numlayers) [kg/m^3]'))
+				string="%s\n%s"%(string,fielddisplay(self,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)'))
+
+			else:
+				raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')");
 
 		return string
 		#}}}
+
 	def extrude(self,md): # {{{
-            for i in range(len(self.nature)):
-                nat=self.nature[i]; 
-                if nat=='ice':
-                    self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node')
-                    self.rheology_n=project3d(md,'vector',self.rheology_n,'type','element')
-            return self
+		for i in range(len(self.nature)):
+			nat=self.nature[i];
+			if nat=='ice':
+				self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node')
+				self.rheology_n=project3d(md,'vector',self.rheology_n,'type','element')
+			return self
 	#}}}
+
 	def setdefaultparameters(self): # {{{
-            for i in range(len(self.nature)):
-                nat=self.nature[i]; 
-                if nat=='ice':
-                    #ice density (kg/m^3)
-                    self.rho_ice=917.
-
-                    #ocean water density (kg/m^3)
-                    self.rho_water=1023.
-
-                    #fresh water density (kg/m^3)
-                    self.rho_freshwater=1000.
-
-                    #water viscosity (N.s/m^2)
-                    self.mu_water=0.001787  
-
-                    #ice heat capacity cp (J/kg/K)
-                    self.heatcapacity=2093.
-
-                    #ice latent heat of fusion L (J/kg)
-                    self.latentheat=3.34*10^5
-
-                    #ice thermal conductivity (W/m/K)
-                    self.thermalconductivity=2.4
-                    
-                    #wet ice thermal conductivity (W/m/K)
-                    self.temperateiceconductivity=.24
-
-                    #the melting point of ice at 1 atmosphere of pressure in K
-                    self.meltingpoint=273.15
-
-                    #rate of change of melting point with pressure (K/Pa)
-                    self.beta=9.8*10^-8
-
-                    #mixed layer (ice-water interface) heat capacity (J/kg/K)
-                    self.mixed_layer_capacity=3974.
-
-                    #thermal exchange velocity (ice-water interface) (m/s)
-                    self.thermal_exchange_velocity=1.00*10^-4
-
-                    #Rheology law: what is the temperature dependence of B with T
-                    #available: none, paterson and arrhenius
-                    self.rheology_law='Paterson'
-
-                elif nat=='litho':
-                    #we default to a configuration that enables running GIA solutions using giacaron and/or giaivins. 
-                    self.numlayers=2
-
-                    #center of the earth (approximation, must not be 0), then the lab (lithosphere/asthenosphere boundary) then the surface
-                    #(with 1d3 to avoid numerical singularities) 
-                    self.radius=[1e3,6278*1e3,6378*1e3]
-
-                    self.viscosity=[1e21,1e40] #mantle and lithosphere viscosity (respectively) [Pa.s]
-                    self.lame_mu=[1.45*1e11,6.7*1e10]  # (Pa) #lithosphere and mantle shear modulus (respectively) [Pa]
-                    self.lame_lambda=self.lame_mu  # (Pa) #mantle and lithosphere lamba parameter (respectively) [Pa]
-                    self.burgers_viscosity=[np.nan,np.nan]
-                    self.burgers_mu=[np.nan,np.nan]
-                    self.isburgers=[0,0]
-                    self.density=[5.51*1e3,5.50*1e3]  # (Pa) #mantle and lithosphere density [kg/m^3]
-                    self.issolid=[1,1] # is layer solid or liquid.
-
-                else:
-                    raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho')");
+		for i in range(len(self.nature)):
+			nat=self.nature[i];
+			if nat=='ice':
+				#ice density (kg/m^3)
+				self.rho_ice=917.
+				#ocean water density (kg/m^3)
+				self.rho_water=1023.
+				#fresh water density (kg/m^3)
+				self.rho_freshwater=1000.
+				#water viscosity (N.s/m^2)
+				self.mu_water=0.001787
+				#ice heat capacity cp (J/kg/K)
+				self.heatcapacity=2093.
+				#ice latent heat of fusion L (J/kg)
+				self.latentheat=3.34*10^5
+				#ice thermal conductivity (W/m/K)
+				self.thermalconductivity=2.4
+				#wet ice thermal conductivity (W/m/K)
+				self.temperateiceconductivity=.24
+				#the melting point of ice at 1 atmosphere of pressure in K
+				self.meltingpoint=273.15
+				#rate of change of melting point with pressure (K/Pa)
+				self.beta=9.8*10^-8
+				#mixed layer (ice-water interface) heat capacity (J/kg/K)
+				self.mixed_layer_capacity=3974.
+				#thermal exchange velocity (ice-water interface) (m/s)
+				self.thermal_exchange_velocity=1.00*10^-4
+				#Rheology law: what is the temperature dependence of B with T
+				#available: none, paterson and arrhenius
+				self.rheology_law='Paterson'
+
+			elif nat=='litho':
+				#we default to a configuration that enables running GIA solutions using giacaron and/or giaivins.
+				self.numlayers=2
+				#center of the earth (approximation, must not be 0), then the lab (lithosphere/asthenosphere boundary) then the surface
+				#(with 1d3 to avoid numerical singularities)
+				self.radius=[1e3,6278*1e3,6378*1e3]
+				self.viscosity=[1e21,1e40] #mantle and lithosphere viscosity (respectively) [Pa.s]
+				self.lame_mu=[1.45*1e11,6.7*1e10]  # (Pa) #lithosphere and mantle shear modulus (respectively) [Pa]
+				self.lame_lambda=self.lame_mu  # (Pa) #mantle and lithosphere lamba parameter (respectively) [Pa]
+				self.burgers_viscosity=[np.nan,np.nan]
+				self.burgers_mu=[np.nan,np.nan]
+				self.isburgers=[0,0]
+				self.density=[5.51*1e3,5.50*1e3]  # (Pa) #mantle and lithosphere density [kg/m^3]
+				self.issolid=[1,1] # is layer solid or liquid.
+
+			else:
+				raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho')");
 
 		return self
 		#}}}
 	def checkconsistency(self,md,solution,analyses):    # {{{
-            for i in range(len(self.nature)):
-                nat=self.nature[i]; 
-                if nat=='ice':
-                    md = checkfield(md,'fieldname','materials.rho_ice','>',0)
-                    md = checkfield(md,'fieldname','materials.rho_water','>',0)
-                    md = checkfield(md,'fieldname','materials.rho_freshwater','>',0)
-                    md = checkfield(md,'fieldname','materials.mu_water','>',0)
-                    md = checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1)
-                    md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
-                    md = checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval'])
-                elif nat=='litho':
-                    if 'LoveAnalysis' not in analyses: 
-                        return md
-
-                    md = checkfield(md,'fieldname','materials.numlayers','NaN',1,'Inf',1,'>',0,'numel',[1])
-                    md = checkfield(md,'fieldname','materials.radius','NaN',1,'Inf',1,'size',[md.materials.numlayers+1,1],'>',0)
-                    md = checkfield(md,'fieldname','materials.lame_mu','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0)
-                    md = checkfield(md,'fieldname','materials.lame_lambda','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0)
-                    md = checkfield(md,'fieldname','materials.issolid','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0,'<',2)
-                    md = checkfield(md,'fieldname','materials.density','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>',0)
-                    md = checkfield(md,'fieldname','materials.viscosity','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0)
-                    md = checkfield(md,'fieldname','materials.isburgers','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0,'<=',1)
-                    md = checkfield(md,'fieldname','materials.burgers_viscosity','Inf',1,'size',[md.materials.numlayers,1],'>=',0)
-                    md = checkfield(md,'fieldname','materials.burgers_mu','Inf',1,'size',[md.materials.numlayers,1],'>=',0)
-
-                    for i in range(md.materials.numlayers):
-                        if md.materials.isburgers[i] and (np.isnan(md.materials.burgers_viscosity[i] or np.isnan(md.materials.burgers_mu[i]))):
-                            raise RuntimeError("materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with isburgers choice")
-                        
-                    if md.materials.issolid[0]==0 or md.materials.lame_mu[0]==0:
-                        raise RuntimeError('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.')
-                    
-                    for i in range(md.materials.numlayers-1):
-                        if (not md.materials.issolid[i]) and (not md.materials.issolid[i+1]): #if there are at least two consecutive indices that contain issolid = 0
-                            raise RuntimeError("%s%i%s"%('2 or more adjacent fluid layers detected starting at layer ',i,'. This is not supported yet. Consider merging them.'))
-
-                else:
-                    raise RuntimeError("materials checkconsistency error message: nature of the material not supported yet! ('ice' or 'litho')");
+		for i in range(len(self.nature)):
+			nat=self.nature[i];
+			if nat=='ice':
+				md = checkfield(md,'fieldname','materials.rho_ice','>',0)
+				md = checkfield(md,'fieldname','materials.rho_water','>',0)
+				md = checkfield(md,'fieldname','materials.rho_freshwater','>',0)
+				md = checkfield(md,'fieldname','materials.mu_water','>',0)
+				md = checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1)
+				md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
+				md = checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval'])
+
+			elif nat=='litho':
+				if 'LoveAnalysis' not in analyses:
+					return md
+
+				md = checkfield(md,'fieldname','materials.numlayers','NaN',1,'Inf',1,'>',0,'numel',[1])
+				md = checkfield(md,'fieldname','materials.radius','NaN',1,'Inf',1,'size',[md.materials.numlayers+1,1],'>',0)
+				md = checkfield(md,'fieldname','materials.lame_mu','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0)
+				md = checkfield(md,'fieldname','materials.lame_lambda','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0)
+				md = checkfield(md,'fieldname','materials.issolid','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0,'<',2)
+				md = checkfield(md,'fieldname','materials.density','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>',0)
+				md = checkfield(md,'fieldname','materials.viscosity','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0)
+				md = checkfield(md,'fieldname','materials.isburgers','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0,'<=',1)
+				md = checkfield(md,'fieldname','materials.burgers_viscosity','Inf',1,'size',[md.materials.numlayers,1],'>=',0)
+				md = checkfield(md,'fieldname','materials.burgers_mu','Inf',1,'size',[md.materials.numlayers,1],'>=',0)
+
+				for i in range(md.materials.numlayers):
+					if md.materials.isburgers[i] and (np.isnan(md.materials.burgers_viscosity[i] or np.isnan(md.materials.burgers_mu[i]))):
+						raise RuntimeError("materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with isburgers choice")
+
+					if md.materials.issolid[0]==0 or md.materials.lame_mu[0]==0:
+						raise RuntimeError('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.')
+
+					for i in range(md.materials.numlayers-1):
+						if (not md.materials.issolid[i]) and (not md.materials.issolid[i+1]): #if there are at least two consecutive indices that contain issolid = 0
+							raise RuntimeError("%s%i%s"%('2 or more adjacent fluid layers detected starting at layer ',i,'. This is not supported yet. Consider merging them.'))
+
+						else:
+							raise RuntimeError("materials checkconsistency error message: nature of the material not supported yet! ('ice' or 'litho')");
 
 		return md
 	# }}}
+
 	def marshall(self,prefix,md,fid):    # {{{
-
-            #1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum 
-            WriteData(fid,prefix,'name','md.materials.type','data',6,'format','Integer')
-            WriteData(fid,prefix,'name','md.materials.nature','data',naturetointeger(self.nature),'format','IntMat','mattype',3)
-
-            for i in range(len(self.nature)):
-                nat=self.nature[i]; 
-                if nat=='ice':
-
-                    WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)
-                    WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String')
-
-                elif nat=='litho':
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','numlayers','format','Integer') 
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','radius','format','DoubleMat','mattype',3)
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','lame_mu','format','DoubleMat','mattype',3)
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','lame_lambda','format','DoubleMat','mattype',3)
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','issolid','format','DoubleMat','mattype',3)
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','density','format','DoubleMat','mattype',3) 
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','viscosity','format','DoubleMat','mattype',3) 
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','isburgers','format','DoubleMat','mattype',3) 
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_viscosity','format','DoubleMat','mattype',3) 
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_mu','format','DoubleMat','mattype',3)
-
-                else:
-                    raise RuntimeError("materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'')")
-
+		#1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
+		WriteData(fid,prefix,'name','md.materials.type','data',6,'format','Integer')
+		WriteData(fid,prefix,'name','md.materials.nature','data',naturetointeger(self.nature),'format','IntMat','mattype',3)
+
+		for i in range(len(self.nature)):
+			nat=self.nature[i];
+			if nat=='ice':
+				WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)
+				WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String')
+
+			elif nat=='litho':
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','numlayers','format','Integer')
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','radius','format','DoubleMat','mattype',3)
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','lame_mu','format','DoubleMat','mattype',3)
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','lame_lambda','format','DoubleMat','mattype',3)
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','issolid','format','DoubleMat','mattype',3)
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','density','format','DoubleMat','mattype',3)
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','viscosity','format','DoubleMat','mattype',3)
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','isburgers','format','DoubleMat','mattype',3)
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_viscosity','format','DoubleMat','mattype',3)
+				WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_mu','format','DoubleMat','mattype',3)
+
+			else:
+				raise RuntimeError("materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'')")
 	# }}}
Index: /issm/trunk-jpl/src/m/classes/matestar.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/matestar.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/matestar.py	(revision 23716)
@@ -14,24 +14,23 @@
 
 	def __init__(self): # {{{
-		
-		rho_ice                    = 0.
-		rho_water                  = 0.
-		rho_freshwater             = 0.
-		mu_water                   = 0.
-		heatcapacity               = 0.
-		latentheat                 = 0.
-		thermalconductivity        = 0.
-		temperateiceconductivity   = 0.
+		rho_ice                   = 0.
+		rho_water                 = 0.
+		rho_freshwater            = 0.
+		mu_water                  = 0.
+		heatcapacity              = 0.
+		latentheat                = 0.
+		thermalconductivity       = 0.
+		temperateiceconductivity  = 0.
 		self.effectiveconductivity_averaging = 0.
-		meltingpoint               = 0.
-		beta                       = 0.
-		mixed_layer_capacity       = 0.
-		thermal_exchange_velocity  = 0.
-		rheology_B    = float('NaN')
-		rheology_Ec   = float('NaN')
-		rheology_Es   = float('NaN')
-		rheology_law = ''
+		meltingpoint              = 0.
+		beta                      = 0.
+		mixed_layer_capacity      = 0.
+		thermal_exchange_velocity = 0.
+		rheology_B								= float('NaN')
+		rheology_Ec								= float('NaN')
+		rheology_Es								= float('NaN')
+		rheology_law							= ''
 
-		#giaivins: 
+		#giaivins:
 		lithosphere_shear_modulus  = 0.
 		lithosphere_density        = 0.
@@ -42,10 +41,10 @@
 		earth_density              = 0
 
-                #set default parameters:
+		#set default parameters:
 		self.setdefaultparameters()
 	#}}}
+
 	def __repr__(self): # {{{
 		string="   Materials:"
-
 		string="%s\n%s"%(string,fielddisplay(self,'rho_ice','ice density [kg/m^3]'))
 		string="%s\n%s"%(string,fielddisplay(self,'rho_water','ocean water density [kg/m^3]'))
@@ -55,5 +54,5 @@
 		string="%s\n%s"%(string,fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']))
 		string="%s\n%s"%(string,fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]'))
-		string="%s\n%s"%(string,fielddisplay(self,"effectiveconductivity_averaging","computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+		string="%s\n%s"%(string,fielddisplay(self,"effectiveconductivity_averaging","computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
 		string="%s\n%s"%(string,fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K'))
 		string="%s\n%s"%(string,fielddisplay(self,'latentheat','latent heat of fusion [J/kg]'))
@@ -70,57 +69,44 @@
 		string="%s\n%s"%(string,fielddisplay(self,'mantle_density','Mantle density [g/cm^-3]'))
 		string="%s\n%s"%(string,fielddisplay(self,'earth_density','Mantle density [kg/m^-3]'))
-
 		return string
 	#}}}
+
 	def extrude(self,md): # {{{
 		self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node')
 		self.rheology_Ec=project3d(md,'vector',self.rheology_Ec,'type','node')
 		self.rheology_Es=project3d(md,'vector',self.rheology_Es,'type','node')
-       		return self
+		return self
 	#}}}
+
 	def setdefaultparameters(self): # {{{
 		#ice density (kg/m^3)
 		self.rho_ice=917.
-
 		#ocean water density (kg/m^3)
 		self.rho_water=1023.
-
 		#fresh water density (kg/m^3)
 		self.rho_freshwater=1000.
-
 		#water viscosity (N.s/m^2)
-		self.mu_water=0.001787 
-
+		self.mu_water=0.001787
 		#ice heat capacity cp (J/kg/K)
 		self.heatcapacity=2093.
-
 		#ice latent heat of fusion L (J/kg)
 		self.latentheat=3.34*10**5
-
 		#ice thermal conductivity (W/m/K)
 		self.thermalconductivity=2.4
-			
 		#wet ice thermal conductivity (W/m/K)
 		self.temperateiceconductivity=.24
-
-		#computation of effective conductivity
+    #computation of effective conductivity
 		self.effectiveconductivity_averaging=1
-        
 		#the melting point of ice at 1 atmosphere of pressure in K
 		self.meltingpoint=273.15
-
 		#rate of change of melting point with pressure (K/Pa)
 		self.beta=9.8*10**-8
-
 		#mixed layer (ice-water interface) heat capacity (J/kg/K)
 		self.mixed_layer_capacity=3974.
-
 		#thermal exchange velocity (ice-water interface) (m/s)
 		self.thermal_exchange_velocity=1.00*10**-4
-
 		#Rheology law: what is the temperature dependence of B with T
 		#available: none, paterson and arrhenius
 		self.rheology_law='Paterson'
-
 		# GIA:
 		self.lithosphere_shear_modulus  = 6.7*10**10  # (Pa)
@@ -128,5 +114,4 @@
 		self.mantle_shear_modulus       = 1.45*10**11 # (Pa)
 		self.mantle_density             = 3.34      # (g/cm^-3)
-
 		#SLR
 		self.earth_density= 5512  # average density of the Earth, (kg/m^3)
@@ -134,4 +119,5 @@
 		return self
 	#}}}
+
 	def checkconsistency(self,md,solution,analyses):    # {{{
 		md = checkfield(md,'fieldname','materials.rho_ice','>',0)
@@ -150,4 +136,5 @@
 			md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1)
 			md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1)
+
 		if 'SealevelriseAnalysis' in analyses:
 			md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1)
@@ -155,4 +142,5 @@
 		return md
 	# }}}
+
 	def marshall(self,prefix,md,fid):    # {{{
 		WriteData(fid,prefix,'name','md.materials.type','data',2,'format','Integer')
@@ -174,5 +162,4 @@
 		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_Es','format','DoubleMat','mattype',1)
 		WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String')
-
 		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double')
 		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3)
Index: /issm/trunk-jpl/src/m/classes/matice.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/matice.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/matice.py	(revision 23716)
@@ -30,17 +30,16 @@
 		self.rheology_law              = ''
 
-		#giaivins: 
+		#giaivins:
 		self.lithosphere_shear_modulus  = 0.
 		self.lithosphere_density        = 0.
 		self.mantle_shear_modulus       = 0.
-		self.mantle_density             = 0.  
-		
+		self.mantle_density             = 0.
+
 		#SLR
-		self.earth_density= 5512;  
-
-
+		self.earth_density= 5512;
 
 		self.setdefaultparameters()
 		#}}}
+
 	def __repr__(self): # {{{
 		string="   Materials:"
@@ -53,5 +52,5 @@
 		string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]"))
 		string="%s\n%s"%(string,fielddisplay(self,"temperateiceconductivity","temperate ice thermal conductivity [W/m/K]"))
-		string="%s\n%s"%(string,fielddisplay(self,"effectiveconductivity_averaging","computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+		string="%s\n%s"%(string,fielddisplay(self,"effectiveconductivity_averaging","computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
 		string="%s\n%s"%(string,fielddisplay(self,"meltingpoint","melting point of ice at 1atm in K"))
 		string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
@@ -67,8 +66,7 @@
 		string="%s\n%s"%(string,fielddisplay(self,"mantle_density","Mantle density [g/cm^-3]"))
 		string="%s\n%s"%(string,fielddisplay(self,"earth_density","Mantle density [kg/m^-3]"))
-
-
 		return string
 		#}}}
+
 	def extrude(self,md): # {{{
 		self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node')
@@ -76,44 +74,32 @@
 		return self
 	#}}}
+
 	def setdefaultparameters(self): # {{{
 		#ice density (kg/m^3)
 		self.rho_ice=917.
-
 		#ocean water density (kg/m^3)
 		self.rho_water=1023.
-
 		#fresh water density (kg/m^3)
 		self.rho_freshwater=1000.
-
 		#water viscosity (N.s/m^2)
-		self.mu_water=0.001787  
-
+		self.mu_water=0.001787
 		#ice heat capacity cp (J/kg/K)
 		self.heatcapacity=2093.
-
 		#ice latent heat of fusion L (J/kg)
 		self.latentheat=3.34*10**5
-
 		#ice thermal conductivity (W/m/K)
 		self.thermalconductivity=2.4
-
+    #computation of effective conductivity
+		self.effectiveconductivity_averaging=1
 		#temperate ice thermal conductivity (W/m/K)
 		self.temperateiceconductivity=0.24
-
-		#computation of effective conductivity
-		self.effectiveconductivity_averaging=1
-
 		#the melting point of ice at 1 atmosphere of pressure in K
 		self.meltingpoint=273.15
-
 		#rate of change of melting point with pressure (K/Pa)
 		self.beta=9.8*10**-8
-
 		#mixed layer (ice-water interface) heat capacity (J/kg/K)
 		self.mixed_layer_capacity=3974.
-
 		#thermal exchange velocity (ice-water interface) (m/s)
 		self.thermal_exchange_velocity=1.00*10**-4
-
 		#Rheology law: what is the temperature dependence of B with T
 		#available: none, paterson and arrhenius
@@ -125,11 +111,10 @@
 		self.mantle_shear_modulus       = 1.45*10**11 # (Pa)
 		self.mantle_density             = 3.34        # (g/cm^-3)
-		
+
 		#SLR
 		self.earth_density= 5512;  # average density of the Earth, (kg/m^3)
-
-
 		return self
 		#}}}
+
 	def checkconsistency(self,md,solution,analyses):    # {{{
 		md = checkfield(md,'fieldname','materials.rho_ice','>',0)
@@ -140,4 +125,5 @@
 		md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
 		md = checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval'])
+		md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0,1,2])
 		md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',[1]);
 		md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',[1]);
@@ -145,8 +131,7 @@
 		md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',[1]);
 		md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',[1]);
-		md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0,1,2])
-
 		return md
 	# }}}
+
 	def marshall(self,prefix,md,fid):    # {{{
 		WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer');
Index: /issm/trunk-jpl/src/m/classes/mismipbasalforcings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/mismipbasalforcings.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/mismipbasalforcings.py	(revision 23716)
@@ -6,90 +6,82 @@
 
 class mismipbasalforcings(object):
-    """ 
-    MISMIP Basal Forcings class definition
+	"""
+	MISMIP Basal Forcings class definition
 
-        Usage:
-	    mismipbasalforcings=mismipbasalforcings()
-    """
+	Usage:
+	mismipbasalforcings=mismipbasalforcings()
+	"""
 
-    def __init__(self): # {{{
+	def __init__(self): # {{{
+		self.groundedice_melting_rate = float('NaN')
+		self.meltrate_factor = float('NaN')
+		self.threshold_thickness = float('NaN')
+		self.upperdepth_melt = float('NaN')
+		self.geothermalflux = float('NaN')
+		self.setdefaultparameters()
 
-        self.groundedice_melting_rate = float('NaN')
-        self.meltrate_factor = float('NaN')
-        self.threshold_thickness = float('NaN')
-        self.upperdepth_melt = float('NaN')
-        self.geothermalflux = float('NaN')
+		#}}}
+	def __repr__(self): # {{{
+		string=" MISMIP+ basal melt parameterization\n"
+		string="%s\n%s"%(string,fielddisplay(self,"groundedice_melting_rate","basal melting rate (positive if melting) [m/yr]"))
+		string="%s\n%s"%(string,fielddisplay(self,"meltrate_factor","Melt-rate rate factor [1/yr] (sign is opposite to MISMIP+ benchmark to remain consistent with ISSM convention of positive values for melting)"))
+		string="%s\n%s"%(string,fielddisplay(self,"threshold_thickness","Threshold thickness for saturation of basal melting [m]"))
+		string="%s\n%s"%(string,fielddisplay(self,"upperdepth_melt","Depth above which melt rate is zero [m]"))
+		string="%s\n%s"%(string,fielddisplay(self,"geothermalflux","Geothermal heat flux [W/m^2]"))
+		return string
+	#}}}
+	def extrude(self,md): # {{{
+		self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1)
+		self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1)    #bedrock only gets geothermal flux
+		return self
+	#}}}
+	def initialize(self,md): # {{{
+		if np.all(np.isnan(self.groundedice_melting_rate)):
+			self.groundedice_melting_rate=np.zeros((md.mesh.numberofvertices))
+			print(' no basalforcings.groundedice_melting_rate specified: values set as zero')
+		if np.all(np.isnan(self.geothermalflux)):
+			self.geothermalflux=np.zeros((md.mesh.numberofvertices))
+			print("      no basalforcings.geothermalflux specified: values set as zero")
+		return self
+	#}}}
+	def setdefaultparameters(self): # {{{
+		# default values for melting parameterization
+		self.meltrate_factor = 0.2
+		self.threshold_thickness = 75.
+		self.upperdepth_melt = -100.
+		return self
+	#}}}
+	def checkconsistency(self,md,solution,analyses):    # {{{
+		#Early return
+		if 'MasstransportAnalysis' in analyses and not (solution=='TransientSolution' and md.transient.ismasstransport==0):
+			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
+			md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',[1])
+			md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',[1])
+			md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',[1])
 
-	self.setdefaultparameters()
+		if 'BalancethicknessAnalysis' in analyses:
+			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
+			md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',[1])
+			md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',[1])
+			md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',[1])
 
-    #}}}
-    def __repr__(self): # {{{
-        string=" MISMIP+ basal melt parameterization\n"
-        string="%s\n%s"%(string,fielddisplay(self,"groundedice_melting_rate","basal melting rate (positive if melting) [m/yr]"))
-        string="%s\n%s"%(string,fielddisplay(self,"meltrate_factor","Melt-rate rate factor [1/yr] (sign is opposite to MISMIP+ benchmark to remain consistent with ISSM convention of positive values for melting)"))
-        string="%s\n%s"%(string,fielddisplay(self,"threshold_thickness","Threshold thickness for saturation of basal melting [m]"))
-        string="%s\n%s"%(string,fielddisplay(self,"upperdepth_melt","Depth above which melt rate is zero [m]"))
-        string="%s\n%s"%(string,fielddisplay(self,"geothermalflux","Geothermal heat flux [W/m^2]"))
-	return string
-    #}}}
-    def extrude(self,md): # {{{
-        self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1)
-        self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1)    #bedrock only gets geothermal flux
-	return self
-    #}}}
-    def initialize(self,md): # {{{
-        if np.all(np.isnan(self.groundedice_melting_rate)):
-            self.groundedice_melting_rate=np.zeros((md.mesh.numberofvertices))
-            print ' no basalforcings.groundedice_melting_rate specified: values set as zero'
-	if np.all(np.isnan(self.geothermalflux)):
-			self.geothermalflux=np.zeros((md.mesh.numberofvertices))
-			print "      no basalforcings.geothermalflux specified: values set as zero"
-        return self
-    #}}}
-    def setdefaultparameters(self): # {{{
-        # default values for melting parameterization
-        self.meltrate_factor = 0.2
-        self.threshold_thickness = 75.
-        self.upperdepth_melt = -100.
-	return self
-    #}}}
-    def checkconsistency(self,md,solution,analyses):    # {{{
+		if 'ThermalAnalysis' in analyses and not (solution=='TransientSolution' and md.transient.isthermal==0):
+			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
+			md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',[1])
+			md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',[1])
+			md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',[1])
+			md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0)
+		return md
+	# }}}
+	def marshall(self,prefix,md,fid):    # {{{
+		yts=md.constants.yts
+		if yts!=365.2422*24.*3600.:
+			print('WARNING: value of yts for MISMIP+ runs different from ISSM default!')
 
-	#Early return
-        if 'MasstransportAnalysis' in analyses and not (solution=='TransientSolution' and md.transient.ismasstransport==0):
-
-	    md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
-	    md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',[1])
-
-        if 'BalancethicknessAnalysis' in analyses:
-
-	    md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-	    md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',[1])
-
-        if 'ThermalAnalysis' in analyses and not (solution=='TransientSolution' and md.transient.isthermal==0):
-
-	    md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
-	    md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0)
-	return md
+		WriteData(fid,prefix,'name','md.basalforcings.model','data',3,'format','Integer')
+		WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
+		WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
+		WriteData(fid,prefix,'object',self,'fieldname','meltrate_factor','format','Double','scale',1./yts)
+		WriteData(fid,prefix,'object',self,'fieldname','threshold_thickness','format','Double')
+		WriteData(fid,prefix,'object',self,'fieldname','upperdepth_melt','format','Double')
     # }}}
-    def marshall(self,prefix,md,fid):    # {{{
-
-        yts=md.constants.yts
-        if yts!=365.2422*24.*3600.:
-            print 'WARNING: value of yts for MISMIP+ runs different from ISSM default!'
-
-	WriteData(fid,prefix,'name','md.basalforcings.model','data',3,'format','Integer')
-	WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-	WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-	WriteData(fid,prefix,'object',self,'fieldname','meltrate_factor','format','Double','scale',1./yts)
-	WriteData(fid,prefix,'object',self,'fieldname','threshold_thickness','format','Double')
-	WriteData(fid,prefix,'object',self,'fieldname','upperdepth_melt','format','Double')
-
-    # }}}
Index: /issm/trunk-jpl/src/m/classes/model.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/model.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/model.py	(revision 23716)
@@ -81,24 +81,24 @@
 		# 	self.__dict__[classe] = classtype[str(classe)]
 
-		self.mesh             = mesh2d()
-		self.mask             = mask()
-		self.geometry         = geometry()
-		self.constants        = constants()
-		self.smb              = SMBforcing()
-		self.basalforcings    = basalforcings()
-		self.materials        = matice()
-		self.damage           = damage()
-		self.friction         = friction()
-		self.flowequation     = flowequation()
-		self.timestepping     = timestepping()
-		self.initialization   = initialization()
-		self.rifts            = rifts()
-		self.slr              = slr()
-
-		self.debug            = debug()
-		self.verbose          = verbose()
-		self.settings         = issmsettings()
-		self.toolkits         = toolkits()
-		self.cluster          = generic()
+		self.mesh           = mesh2d()
+		self.mask           = mask()
+		self.geometry       = geometry()
+		self.constants      = constants()
+		self.smb            = SMBforcing()
+		self.basalforcings  = basalforcings()
+		self.materials      = matice()
+		self.damage         = damage()
+		self.friction       = friction()
+		self.flowequation   = flowequation()
+		self.timestepping   = timestepping()
+		self.initialization = initialization()
+		self.rifts          = rifts()
+		self.slr            = slr()
+
+		self.debug    = debug()
+		self.verbose  = verbose()
+		self.settings = issmsettings()
+		self.toolkits = toolkits()
+		self.cluster  = generic()
 
 		self.balancethickness = balancethickness()
@@ -112,12 +112,12 @@
 		self.levelset         = levelset()
 		self.calving          = calving()
-	        self.frontalforcings  = frontalforcings()
-                self.gia              = giaivins()
-		self.love             = fourierlove()
-		self.esa	      = esa()
-		self.autodiff         = autodiff()
-		self.inversion        = inversion()
-		self.qmu              = qmu()
-		self.amr	      = amr()
+		self.frontalforcings  = frontalforcings()
+		self.gia              = giaivins()
+		self.love							= fourierlove()
+		self.esa							= esa()
+		self.autodiff					= autodiff()
+		self.inversion				= inversion()
+		self.qmu							= qmu()
+		self.amr							= amr()
 
 		self.results          = results()
@@ -129,5 +129,5 @@
 	def properties(self):    # {{{
 		# ordered list of properties since vars(self) is random
-                return ['mesh',
+		return ['mesh',
 		        'mask',
 		        'geometry',
@@ -158,8 +158,8 @@
 		        'levelset',
 		        'calving',
-                        'frontalforcings',
-			'love',
-			'gia',
-			'esa',
+						'frontalforcings',
+						'love',
+						'gia',
+						'esa',
 		        'autodiff',
 		        'inversion',
@@ -218,5 +218,5 @@
 	# }}}
 	def checkmessage(self,string):    # {{{
-		print "model not consistent: ", string
+		print(("model not consistent: ", string))
 		self.private.isconsistent=False
 		return self
@@ -399,9 +399,9 @@
 		#Penalties
 		if np.any(np.logical_not(np.isnan(md2.stressbalance.vertex_pairing))):
-			for i in xrange(np.size(md1.stressbalance.vertex_pairing,axis=0)):
+			for i in range(np.size(md1.stressbalance.vertex_pairing,axis=0)):
 				md2.stressbalance.vertex_pairing[i,:]=Pnode[md1.stressbalance.vertex_pairing[i,:]]
 			md2.stressbalance.vertex_pairing=md2.stressbalance.vertex_pairing[np.nonzero(md2.stressbalance.vertex_pairing[:,0])[0],:]
 		if np.any(np.logical_not(np.isnan(md2.masstransport.vertex_pairing))):
-			for i in xrange(np.size(md1.masstransport.vertex_pairing,axis=0)):
+			for i in range(np.size(md1.masstransport.vertex_pairing,axis=0)):
 				md2.masstransport.vertex_pairing[i,:]=Pnode[md1.masstransport.vertex_pairing[i,:]]
 			md2.masstransport.vertex_pairing=md2.masstransport.vertex_pairing[np.nonzero(md2.masstransport.vertex_pairing[:,0])[0],:]
@@ -419,5 +419,5 @@
 			md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements2d,md2.mesh.vertexconnectivity)[0]
 			segments=contourenvelope(md2)
-			md2.mesh.vertexonboundary=np.zeros(numberofvertices2/md2.mesh.numberoflayers,bool)
+			md2.mesh.vertexonboundary=np.zeros(int(numberofvertices2/md2.mesh.numberoflayers),bool)
 			md2.mesh.vertexonboundary[segments[:,0:2]-1]=True
 			md2.mesh.vertexonboundary=np.tile(md2.mesh.vertexonboundary,md2.mesh.numberoflayers)
@@ -440,5 +440,5 @@
 				md2.stressbalance.spcvx[nodestoflag2]=np.nan
 				md2.stressbalance.spcvy[nodestoflag2]=np.nan
-				print "\n!! extract warning: spc values should be checked !!\n\n"
+				print("\n!! extract warning: spc values should be checked !!\n\n")
 			#put 0 for vz
 			md2.stressbalance.spcvz[nodestoflag2]=0
@@ -449,5 +449,5 @@
 		if md1.results:
 			md2.results=results()
-			for solutionfield,field in md1.results.__dict__.iteritems():
+			for solutionfield,field in list(md1.results.__dict__.items()):
 				if   isinstance(field,list):
 					setattr(md2.results,solutionfield,[])
@@ -458,5 +458,5 @@
 							fieldr=getattr(md2.results,solutionfield)[i]
 							#get subfields
-							for solutionsubfield,subfield in fieldi.__dict__.iteritems():
+							for solutionsubfield,subfield in list(fieldi.__dict__.items()):
 								if   np.size(subfield)==numberofvertices1:
 									setattr(fieldr,solutionsubfield,subfield[pos_node])
@@ -472,5 +472,5 @@
 						fieldr=getattr(md2.results,solutionfield)
 						#get subfields
-						for solutionsubfield,subfield in field.__dict__.iteritems():
+						for solutionsubfield,subfield in list(field.__dict__.items()):
 							if   np.size(subfield)==numberofvertices1:
 								setattr(fieldr,solutionsubfield,subfield[pos_node])
@@ -482,5 +482,5 @@
 		#OutputDefinitions fields
 		if md1.outputdefinition.definitions:
-			for solutionfield,field in md1.outputdefinition.__dict__.iteritems():
+			for solutionfield,field in list(md1.outputdefinition.__dict__.items()):
 				if isinstance(field,list):
 					#get each definition
@@ -489,5 +489,5 @@
 							fieldr=getattr(md2.outputdefinition,solutionfield)[i]
 							#get subfields
-							for solutionsubfield,subfield in fieldi.__dict__.iteritems():
+							for solutionsubfield,subfield in list(fieldi.__dict__.items()):
 								if   np.size(subfield)==numberofvertices1:
 									setattr(fieldr,solutionsubfield,subfield[pos_node])
@@ -593,5 +593,5 @@
 
 		#Create the new layers
-		for i in xrange(numlayers):
+		for i in range(numlayers):
 			x3d=np.concatenate((x3d,md.mesh.x))
 			y3d=np.concatenate((y3d,md.mesh.y))
@@ -602,5 +602,5 @@
 		#Extrude elements
 		elements3d=np.empty((0,6),int)
-		for i in xrange(numlayers-1):
+		for i in range(numlayers-1):
 			elements3d=np.vstack((elements3d,np.hstack((md.mesh.elements+i*md.mesh.numberofvertices,md.mesh.elements+(i+1)*md.mesh.numberofvertices))))    #Create the elements of the 3d mesh for the non extruded part
 		number_el3d=np.size(elements3d,axis=0)    #number of 3d nodes for the non extruded part of the mesh
@@ -669,7 +669,7 @@
 		#connectivity
 		md.mesh.elementconnectivity=np.tile(md.mesh.elementconnectivity,(numlayers-1,1))
-		md.mesh.elementconnectivity[np.nonzero(md.mesh.elementconnectivity==0)]=-sys.maxint-1
+		md.mesh.elementconnectivity[np.nonzero(md.mesh.elementconnectivity==0)]=-sys.maxsize-1
 		if not np.isnan(md.mesh.elementconnectivity).all():
-			for i in xrange(1,numlayers-1):
+			for i in range(1,numlayers-1):
 				md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:] \
 						=md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:]+md.mesh.numberofelements2d
@@ -704,5 +704,5 @@
 		#Check that the model is really a 3d model
 		if md.mesh.domaintype().lower() != '3d':
-			raise StandardError("only a 3D model can be collapsed")
+			raise Exception("only a 3D model can be collapsed")
 
 		#dealing with the friction law
@@ -783,14 +783,12 @@
 
 		# Hydrologydc variables
-		hydrofields=md.hydrology.__dict__.keys()
-		for field in hydrofields:
-			try:
-				isvector=np.logical_or(np.shape(md.hydrology.__dict__[field])[0]==md.mesh.numberofelements,
-															 np.shape(md.hydrology.__dict__[field])[0]==md.mesh.numberofvertices)
-			except IndexError:
-				isvector=False
-			#we colpase only fields that are vertices or element based
-			if isvector:
-				md.hydrology.__dict__[field]=project2d(md,md.hydrology.__dict__[field],1)
+		if type(md.hydrology) is 'hydrologydc':
+			md.hydrology.spcsediment_head=project2d(md,md.hydrology.spcsediment_head,1)
+			md.hydrology.sediment_transmitivity=project2d(md,md.hydrology.sediment_transmitivity,1)
+			md.hydrology.basal_moulin_input=project2d(md,md.hydrology.basal_moulin_input,1)
+			md.hydrology.mask_thawed_node=project2d(md,md.hydrology.mask_thawed_node,1)
+			if md.hydrology.isefficientlayer == 1:
+				md.hydrology.mask_eplactive_node=project2d(md,md.hydrology.mask_eplactive_node,1)
+				md.hydrology.spcepl_head=project2d(md,md.hydrology.spcepl_head,1)
 
 		#boundary conditions
@@ -836,5 +834,5 @@
 		#OutputDefinitions
 		if md.outputdefinition.definitions:
-			for solutionfield,field in md.outputdefinition.__dict__.iteritems():
+			for solutionfield,field in list(md.outputdefinition.__dict__.items()):
 				if isinstance(field,list):
 					#get each definition
@@ -843,5 +841,5 @@
 							fieldr=getattr(md.outputdefinition,solutionfield)[i]
 							#get subfields
-							for solutionsubfield,subfield in fieldi.__dict__.iteritems():
+							for solutionsubfield,subfield in list(fieldi.__dict__.items()):
 								if   np.size(subfield)==md.mesh.numberofvertices:
 									setattr(fieldr,solutionsubfield,project2d(md,subfield,1))
Index: /issm/trunk-jpl/src/m/classes/organizer.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/organizer.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/organizer.py	(revision 23716)
@@ -6,5 +6,5 @@
 from savevars import savevars
 from model import model
-from whichdb import whichdb
+from dbm.ndbm import whichdb
 import MatlabFuncs as m
 
@@ -39,5 +39,5 @@
 		#Get prefix
 		prefix=options.getfieldvalue('prefix','model.')
-		if not isinstance(prefix,(str,unicode)):
+		if not isinstance(prefix,str):
 			raise TypeError("prefix is not a string")
 		if not m.strcmp(prefix,prefix.strip()) or len(prefix.split()) > 1:
@@ -47,5 +47,5 @@
 		#Get repository
 		repository=options.getfieldvalue('repository','./')
-		if not isinstance(repository,(str,unicode)):
+		if not isinstance(repository,str):
 			raise TypeError("repository is not a string")
 		if not os.path.isdir(repository):
@@ -59,5 +59,5 @@
 		if options.exist('trunkprefix'):
 			trunkprefix=options.getfieldvalue('trunkprefix','')
-			if not isinstance(trunkprefix,(str,unicode)):
+			if not isinstance(trunkprefix,str):
 				raise TypeError("trunkprefix is not a string")
 			if not m.strcmp(trunkprefix,trunkprefix.strip()) or len(trunkprefix.split()) > 1:
@@ -79,5 +79,5 @@
 
 		#Get model path
-		if not isinstance(string,(str,unicode)):
+		if not isinstance(string,str):
 			raise TypeError("argument provided is not a string")
 		path=os.path.join(self.repository,self.prefix+string)
@@ -86,5 +86,5 @@
 		if os.path.exists(path):
 			struc=loadvars(path)
-			name=name=[key for key in struc.iterkeys()]
+			name=name=[key for key in list(struc.keys())]
 			md=struc.name[0]
 		else:
@@ -96,5 +96,5 @@
 
 		#Get model path
-		if not isinstance(string,(str,unicode)):
+		if not isinstance(string,str):
 			raise TypeError("argument provided is not a string")
 		path1=os.path.join(self.repository,self.prefix+string+'.python')
@@ -115,5 +115,5 @@
 				raise IOError("Could find neither '%s' nor '%s'" % (path,path2))
 			else:
-				print "--> Branching '%s' from trunk '%s'" % (self.prefix,self.trunkprefix)
+				print(("--> Branching '%s' from trunk '%s'" % (self.prefix,self.trunkprefix)))
 				md=loadmodel(path2)
 				return md
@@ -126,5 +126,5 @@
 
 		#Some checks
-		if not isinstance(string,(str,unicode)):
+		if not isinstance(string,str):
 			raise TypeError("Step provided should be a string")
 		if not m.strcmp(string,string.strip()) or len(string.split()) > 1:
@@ -142,10 +142,10 @@
 		if 0 in self.requestedsteps:
 			if self._currentstep==1:
-				print "   prefix: %s" % self.prefix
-			print "   step #%i : %s" % (self.steps[self._currentstep-1]['id'],self.steps[self._currentstep-1]['string'])
+				print(("   prefix: %s" % self.prefix))
+			print(("   step #%i : %s" % (self.steps[self._currentstep-1]['id'],self.steps[self._currentstep-1]['string'])))
 
 		#Ok, now if _currentstep is a member of steps, return true
 		if self._currentstep in self.requestedsteps:
-			print "\n   step #%i : %s\n" % (self.steps[self._currentstep-1]['id'],self.steps[self._currentstep-1]['string'])
+			print(("\n   step #%i : %s\n" % (self.steps[self._currentstep-1]['id'],self.steps[self._currentstep-1]['string'])))
 			bool=True
 
@@ -167,5 +167,5 @@
 		else:
 			name=os.path.join(self.repository,name)
-		print "saving model as: '%s'" % name
+		print(("saving model as: '%s'" % name))
 
 		#check that md is a model
Index: /issm/trunk-jpl/src/m/classes/pairoptions.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/pairoptions.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/pairoptions.py	(revision 23716)
@@ -5,5 +5,5 @@
 	"""
 	PAIROPTIONS class definition
- 
+
 	   Usage:
 	      pairoptions=pairoptions();
@@ -27,14 +27,14 @@
 	# }}}
 	def __repr__(self):    # {{{
-		s="   functionname: '%s'\n" % self.functionname
+		s="   functionname: '{}'\n".format(self.functionname)
 		if self.list:
-			s+="   list: (%ix%i)\n\n" % (len(self.list),2)
-			for item in self.list.iteritems():
-				if   isinstance(item[1],(str,unicode)):
-					s+="     field: %-10s value: '%s'\n" % (item[0],item[1])
-				elif isinstance(item[1],(bool,int,long,float)):
-					s+="     field: %-10s value: %g\n" % (item[0],item[1])
-				else:
-					s+="     field: %-10s value: %s\n" % (item[0],type(item[1]))
+			s+="   list: ({}x{}) \n\n".format(len(self.list),2)
+			for item in list(self.list.items()):
+				#if   isinstance(item[1],str):
+				s+="     field: {} value: '{}'\n".format((item[0],item[1]))
+				# elif isinstance(item[1],(bool,int,float)):
+				# 	s+="     field: %-10s value: %g\n" % (item[0],item[1])
+				# else:
+				# 	s+="     field: %-10s value: %s\n" % (item[0],type(item[1]))
 		else:
 			s+="   list: empty\n"
@@ -46,25 +46,25 @@
 		#check length of input
 		if len(arg) % 2:
-			raise TypeError('Invalid parameter/value pair arguments') 
-		numoptions = len(arg)/2
+			raise TypeError('Invalid parameter/value pair arguments')
+		numoptions = int(len(arg)/2)
 
 		#go through arg and build list of objects
-		for i in xrange(numoptions):
-			if isinstance(arg[2*i],(str,unicode)):
+		for i in range(numoptions):
+			if isinstance(arg[2*i],str):
 				self.list[arg[2*i]] = arg[2*i+1];
 			else:
 				#option is not a string, ignore it
-				print "WARNING: option number %d is not a string and will be ignored." % (i+1)
+				print(("WARNING: option number {} is not a string and will be ignored.".format(i+1)))
 	# }}}
 	def addfield(self,field,value):    # {{{
 		"""ADDFIELD - add a field to an options list"""
-		if isinstance(field,(str,unicode)):
+		if isinstance(field,str):
 			if field in self.list:
-				print "WARNING: field '%s' with value=%s exists and will be overwritten with value=%s." % (field,str(self.list[field]),str(value))
+				print(("WARNING: field '{}' with value={} exists and will be overwritten with value={}.".format(field,str(self.list[field]),str(value))))
 			self.list[field] = value
 	# }}}
 	def addfielddefault(self,field,value):    # {{{
 		"""ADDFIELDDEFAULT - add a field to an options list if it does not already exist"""
-		if isinstance(field,(str,unicode)):
+		if isinstance(field,str):
 			if field not in self.list:
 				self.list[field] = value
@@ -72,9 +72,9 @@
 	def AssignObjectFields(self,obj2):    # {{{
 		"""ASSIGNOBJECTFIELDS - assign object fields from options"""
-		for item in self.list.iteritems():
+		for item in list(self.list.items()):
 			if item[0] in dir(obj2):
 				setattr(obj2,item[0],item[1])
 			else:
-				print "WARNING: field '%s' is not a property of '%s'." % (item[0],type(obj2))
+				print(("WARNING: field '%s' is not a property of '%s'." % (item[0],type(obj2))))
 		return obj2
 	# }}}
@@ -87,8 +87,8 @@
 		"""EXIST - check if the option exist"""
 
-		#some argument checking: 
+		#some argument checking:
 		if field == None or field == '':
 			raise ValueError('exist error message: bad usage');
-		if not isinstance(field,(str,unicode)):
+		if not isinstance(field,str):
 			raise TypeError("exist error message: field '%s' should be a string." % str(field));
 
@@ -102,11 +102,11 @@
 		"""
 		GETOPTION - get the value of an option
-	
+
 		Usage:
 		   value=options.getfieldvalue(field,default)
-	 
+
 		Find an option value from a field. A default option
 		can be given in input if the field does not exist
-	 
+
 		Examples:
 		   value=options.getfieldvalue(options,'caxis')
@@ -114,8 +114,8 @@
 		"""
 
-		#some argument checking: 
+		#some argument checking:
 		if field == None or field == '':
 			raise ValueError('getfieldvalue error message: bad usage');
-		if not isinstance(field,(str,unicode)):
+		if not isinstance(field,str):
 			raise TypeError("getfieldvalue error message: field '%s' should be a string." % str(field));
 
@@ -134,8 +134,8 @@
 		"""
 		REMOVEFIELD - delete a field in an option list
-	 
+
 		Usage:
 		   obj=removefield(self,field,warn)
-	 
+
 		if warn==1 display an info message to warn user that
 		some of his options have been removed.
@@ -150,9 +150,9 @@
 			#warn user if requested
 			if warn:
-				print "removefield info: option '%s' has been removed from the list of options." % field
+				print(("removefield info: option '%s' has been removed from the list of options." % field))
 	# }}}
 	def marshall(self,md,fid,firstindex):    # {{{
 
-		for i,item in enumerate(self.list.iteritems()):
+		for i,item in enumerate(self.list.items()):
 			name  = item[0]
 			value = item[1]
Index: /issm/trunk-jpl/src/m/classes/plotoptions.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/plotoptions.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/plotoptions.py	(revision 23716)
@@ -23,9 +23,9 @@
 		if self.list:
 			s+="	list: (%ix%i)\n" % (len(self.list),2)
-			for item in self.list.iteritems():
+			for item in list(self.list.items()):
 				#s+="	options of plot number %i\n" % item
-				if   isinstance(item[1],(str,unicode)):
+				if   isinstance(item[1],str):
 					s+="	field: %-10s value: '%s'\n" % (item[0],item[1])
-				elif isinstance(item[1],(bool,int,long,float)):
+				elif isinstance(item[1],(bool,int,float)):
 					s+="	field: %-10s value: '%g'\n" % (item[0],item[1])
 				else:
@@ -42,13 +42,13 @@
 		#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
 
-		for i in xrange(numoptions):
-			if isinstance(arg[2*i],(str,unicode)):
+		for i in range(numoptions):
+			if isinstance(arg[2*i],str):
 				rawlist.append([arg[2*i],arg[2*i+1]])
 			else:
 				#option is not a string, ignore it
-				print "WARNING: option number %d is not a string and will be ignored." % (i+1)
+				print(("WARNING: option number %d is not a string and will be ignored." % (i+1)))
 
 		#get figure number
@@ -68,14 +68,14 @@
 		#initialize self.list (will need a list of dict's (or nested dict) for numberofplots>1)
 		#self.list=defaultdict(dict)
-		for i in xrange(numberofplots):
+		for i in range(numberofplots):
 			self.list[i]=pairoptions.pairoptions()
 
 		#process plot options
-		for i in xrange(len(rawlist)):
+		for i in range(len(rawlist)):
 
 			#if alloptions flag is on, apply to all plots
 			if (allflag and 'data' not in rawlist[i][0] and '#' not in rawlist[i][0]):
 
-				for j in xrange(numberofplots):
+				for j in range(numberofplots):
 					self.list[j].addfield(rawlist[i][0],rawlist[i][1])
 
@@ -88,5 +88,5 @@
 
 				#loop over plotnums
-				for k in xrange(len(plotnums)):
+				for k in range(len(plotnums)):
 					plotnum=plotnums[k]
 
@@ -96,5 +96,5 @@
 					# '#all'
 					elif 'all' in plotnum:
-						for j in xrange(numberofplots):
+						for j in range(numberofplots):
 							self.list[j].addfield(field,rawlist[i][1])
 
@@ -105,5 +105,5 @@
 						if False in [x.isdigit() for x in nums]:
 							raise ValueError('error: in option i-j both i and j must be integers')
-						for j in xrange(int(nums[0])-1,int(nums[1])):
+						for j in range(int(nums[0])-1,int(nums[1])):
 							self.list[j].addfield(field,rawlist[i][1])
 
@@ -125,4 +125,4 @@
 						j=j+1
 				if j+1>numberofplots:
-					print "WARNING: too many instances of '%s' in options" % rawlist[i][0]
+					print(("WARNING: too many instances of '%s' in options" % rawlist[i][0]))
 	#}}}
Index: /issm/trunk-jpl/src/m/classes/plumebasalforcings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/plumebasalforcings.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/plumebasalforcings.py	(revision 23716)
@@ -32,5 +32,5 @@
 
 	def __repr__(self): # {{{
-		print '   mantle plume basal melt parameterization:'
+		print('   mantle plume basal melt parameterization:')
 
 		string="%s\n%s"%(string,fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]'))
@@ -55,8 +55,8 @@
 		if np.all(np.isnan(self.groundedice_melting_rate)):
 			self.groundedice_melting_rate=np.zeros((md.mesh.numberofvertices,))
-			print '      no basalforcings.groundedice_melting_rate specified: values set as zero'
+			print('      no basalforcings.groundedice_melting_rate specified: values set as zero')
 		if np.all(np.isnan(self.floatingice_melting_rate)):
 			self.floatingice_melting_rate=np.zeros((md.mesh.numberofvertices,))
-			print '      no basalforcings.floatingice_melting_rate specified: values set as zero'
+			print('      no basalforcings.floatingice_melting_rate specified: values set as zero')
 		return
 	#}}}
Index: /issm/trunk-jpl/src/m/classes/qmu.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu.py	(revision 23716)
@@ -80,6 +80,6 @@
 			params = np.hstack(np.atleast_1d(np.array(self.params)))
 		for param in params:
-			print type(param)
-			print param
+			print(type(param))
+			print(param)
 			s+="         params:  (array of method-independent parameters)\n"
 			fnames=vars(param)
Index: /issm/trunk-jpl/src/m/classes/qmu/@dakota_method/dakota_method.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/@dakota_method/dakota_method.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/@dakota_method/dakota_method.py	(revision 23716)
@@ -54,10 +54,8 @@
 		#properites
 		self.params   =struct()
-	
+
 	@staticmethod
 	def dakota_method(*args):
-
 		dm = dakota_method()
-
 		#  return a default object
 		if len(args) == 0:
@@ -72,5 +70,5 @@
 				#dm=method
 				object=method
-				for field in object.iterkeys():
+				for field in object.keys():
 					if field in vars(dm):
 						setattr(dm,field,object[field])
@@ -79,776 +77,790 @@
 			#given argument was a way of constructing a method
 			else:
-				mlist=[
-		                    'dot_bfgs',
-		                    'dot_frcg',
-		                    'dot_mmfd',
-		                    'dot_slp',
-		                    'dot_sqp',
-		                    'npsol_sqp',
-		                    'conmin_frcg',
-		                    'conmin_mfd',
-		                    'optpp_cg',
-		                    'optpp_q_newton',
-		                    'optpp_fd_newton',
-		                    'optpp_newton',
-		                    'optpp_pds',
-		                    'asynch_pattern_search',
-		                    'coliny_cobyla',
-		                    'coliny_direct',
-		                    'coliny_ea',
-		                    'coliny_pattern_search',
-		                    'coliny_solis_wets',
-		                    'ncsu_direct',
-		                    'surrogate_based_local',
-		                    'surrogate_based_global',
-		                    'moga',
-		                    'soga',
-		                    'nl2sol',
-		                    'nlssol_sqp',
-		                    'optpp_g_newton',
-		                    'nond_sampling',
-		                    'nond_local_reliability',
-		                    'nond_global_reliability',
-		                    'nond_polynomial_chaos',
-		                    'nond_stoch_collocation',
-		                    'nond_evidence',
-		                    'dace',
-		                    'fsu_quasi_mc',
-		                    'fsu_cvt',
-		                    'vector_parameter_study',
-		                    'list_parameter_study',
-		                    'centered_parameter_study',
-		                    'multidim_parameter_study',
-				    'bayes_calibration']
-
-		                mlist2=[]
+				mlist=['dot_bfgs',
+							 'dot_frcg',
+							 'dot_mmfd',
+							 'dot_slp',
+							 'dot_sqp',
+							 'npsol_sqp',
+							 'conmin_frcg',
+							 'conmin_mfd',
+							 'optpp_cg',
+							 'optpp_q_newton',
+							 'optpp_fd_newton',
+							 'optpp_newton',
+							 'optpp_pds',
+							 'asynch_pattern_search',
+							 'coliny_cobyla',
+							 'coliny_direct',
+							 'coliny_ea',
+							 'coliny_pattern_search',
+							 'coliny_solis_wets',
+							 'ncsu_direct',
+							 'surrogate_based_local',
+							 'surrogate_based_global',
+							 'moga',
+							 'soga',
+							 'nl2sol',
+							 'nlssol_sqp',
+							 'optpp_g_newton',
+							 'nond_sampling',
+							 'nond_local_reliability',
+							 'nond_global_reliability',
+							 'nond_polynomial_chaos',
+							 'nond_stoch_collocation',
+							 'nond_evidence',
+							 'dace',
+							 'fsu_quasi_mc',
+							 'fsu_cvt',
+							 'vector_parameter_study',
+							 'list_parameter_study',
+							 'centered_parameter_study',
+							 'multidim_parameter_study',
+							 'bayes_calibration']
+
+				mlist2=[]
 				for i in range(len(mlist)):
-		                	if strncmpi(method,mlist[i],len(method)):
-		                        	mlist2.append(mlist[i])
-
-				#  check for a unique match in the list of methods
-
-		                l = len(mlist2)
-		                if l == 0:
-		                        raise RuntimeError('Unrecognized method: '+str(method)+'.')
-		                elif l == 1:
-		                        dm.method=mlist2[0]
-		                else:
-		                        raise RuntimeError('Non-unique method: '+str(method)+' matches '+string_cell(mlist2))
-		                
+					if strncmpi(method,mlist[i],len(method)):
+						mlist2.append(mlist[i])
+						#  check for a unique match in the list of methods
+				l = len(mlist2)
+				if l == 0:
+					raise RuntimeError('Unrecognized method: '+str(method)+'.')
+				elif l == 1:
+					dm.method=mlist2[0]
+				else:
+					raise RuntimeError('Non-unique method: '+str(method)+' matches '+string_cell(mlist2))
+
 				#  assign the default values for the method
-		                #switch dm.method
-		                if dm.method in ['dot_bfgs',
-		                         	   'dot_frcg']:
-		                        dm.type     ='dot'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.optimization_type='minimize'
-		                elif dm.method in ['dot_mmfd',
-		                          	     'dot_slp',
-		                          	     'dot_sqp']:
-		                        dm.type     ='dot'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.optimization_type='minimize'
+			  # switch dm.method
+				if dm.method in ['dot_bfgs','dot_frcg']:
+					dm.type     ='dot'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.constraint_tolerance=False
+					dm.params.output=False
+					dm.params.speculative=False
+					dm.params.scaling=False
+					dm.params.optimization_type='minimize'
+
+				elif dm.method in ['dot_mmfd','dot_slp','dot_sqp']:
+					dm.type     ='dot'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =['linear_inequality_constraint',
+												'linear_equality_constraint']
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.constraint_tolerance=False
+					dm.params.output=False
+					dm.params.speculative=False
+					dm.params.scaling=False
+					dm.params.optimization_type='minimize'
 
 				elif dm.method == 'npsol_sqp':
 					dm.type     ='npsol'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.verify_level=-1
-		                        dm.params.function_precision=1.0e-10
-		                        dm.params.linesearch_tolerance=0.9
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =['linear_inequality_constraint',
+												'linear_equality_constraint']
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.constraint_tolerance=False
+					dm.params.output=False
+					dm.params.speculative=False
+					dm.params.scaling=False
+					dm.params.verify_level=-1
+					dm.params.function_precision=1.0e-10
+					dm.params.linesearch_tolerance=0.9
 
 				elif dm.method == 'conmin_frcg':
-		                        dm.type     ='conmin'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
+					dm.type     ='conmin'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.constraint_tolerance=False
+					dm.params.output=False
+					dm.params.speculative=False
+					dm.params.scaling=False
+
 				elif dm.method == 'conmin_mfd':
-		                        dm.type     ='conmin'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
+					dm.type     ='conmin'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =['linear_inequality_constraint',
+												'linear_equality_constraint']
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.constraint_tolerance=False
+					dm.params.output=False
+					dm.params.speculative=False
+					dm.params.scaling=False
 
 				elif dm.method == 'optpp_cg':
-		                        dm.type     ='optpp'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.max_step=1000.
-		                        dm.params.gradient_tolerance=1.0e-4
+					dm.type     ='optpp'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.output=False
+					dm.params.speculative=False
+					dm.params.scaling=False
+					dm.params.max_step=1000.
+					dm.params.gradient_tolerance=1.0e-4
+
 				elif dm.method in ['optpp_q_newton',
-		                          	    'optpp_fd_newton',
-		                         	    'optpp_newton']:
-		                        dm.type     ='optpp'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.value_based_line_search=False
-		                        dm.params.gradient_based_line_search=False
-		                        dm.params.trust_region=False
-		                        dm.params.tr_pds=False
-		                        dm.params.max_step=1000.
-		                        dm.params.gradient_tolerance=1.0e-4
-		                        dm.params.merit_function='argaez_tapia'
-		                        dm.params.central_path=dm.params.merit_function
-		                        dm.params.steplength_to_boundary=0.99995
-		                        dm.params.centering_parameter=0.2
+													 'optpp_fd_newton',
+													 'optpp_newton']:
+					dm.type     ='optpp'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =['linear_inequality_constraint',
+												'linear_equality_constraint']
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.output=False
+					dm.params.speculative=False
+					dm.params.scaling=False
+					dm.params.value_based_line_search=False
+					dm.params.gradient_based_line_search=False
+					dm.params.trust_region=False
+					dm.params.tr_pds=False
+					dm.params.max_step=1000.
+					dm.params.gradient_tolerance=1.0e-4
+					dm.params.merit_function='argaez_tapia'
+					dm.params.central_path=dm.params.merit_function
+					dm.params.steplength_to_boundary=0.99995
+					dm.params.centering_parameter=0.2
+
 				elif dm.method == 'optpp_pds':
-		                        dm.type     ='optpp'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.search_scheme_size=32
+					dm.type     ='optpp'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.output=False
+					dm.params.speculative=False
+					dm.params.scaling=False
+					dm.params.search_scheme_size=32
 
 				elif dm.method == 'asynch_pattern_search':
-		                        dm.type     ='apps'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.initial_delta=1.0
-		                        dm.params.threshold_delta=0.01
-		                        dm.params.contraction_factor=0.5
-		                        dm.params.solution_target=False
-		                        dm.params.synchronization='nonblocking'
-		                        dm.params.merit_function='merit2_smooth'
-		                        dm.params.constraint_penalty=1.0
-		                        dm.params.smoothing_factor=1.0
+					dm.type     ='apps'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =['linear_inequality_constraint',
+												'linear_equality_constraint']
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_function_evaluations=False
+					dm.params.constraint_tolerance=False
+					dm.params.output=False
+					dm.params.scaling=False
+					dm.params.initial_delta=1.0
+					dm.params.threshold_delta=0.01
+					dm.params.contraction_factor=0.5
+					dm.params.solution_target=False
+					dm.params.synchronization='nonblocking'
+					dm.params.merit_function='merit2_smooth'
+					dm.params.constraint_penalty=1.0
+					dm.params.smoothing_factor=1.0
 
 				elif dm.method == 'coliny_cobyla':
-		                        dm.type     ='coliny'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.show_misc_options=False
-		                        dm.params.misc_options=[]
-		                        dm.params.solution_accuracy=-np.inf
-		                        dm.params.initial_delta=[]
-		                        dm.params.threshold_delta=[]
+					dm.type     ='coliny'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.output=False
+					dm.params.scaling=False
+					dm.params.show_misc_options=False
+					dm.params.misc_options=[]
+					dm.params.solution_accuracy=-np.inf
+					dm.params.initial_delta=[]
+					dm.params.threshold_delta=[]
+
 				elif dm.method == 'coliny_direct':
-		                        dm.type     ='coliny'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.show_misc_options=False
-		                        dm.params.misc_options=[]
-		                        dm.params.solution_accuracy=-np.inf
-		                        dm.params.division='major_dimension'
-		                        dm.params.global_balance_parameter=0.0
-		                        dm.params.local_balance_parameter=1.0e-8
-		                        dm.params.max_boxsize_limit=0.0
-		                        dm.params.min_boxsize_limit=0.0001
-		                        dm.params.constraint_penalty=1000.0
+					dm.type     ='coliny'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.output=False
+					dm.params.scaling=False
+					dm.params.show_misc_options=False
+					dm.params.misc_options=[]
+					dm.params.solution_accuracy=-np.inf
+					dm.params.division='major_dimension'
+					dm.params.global_balance_parameter=0.0
+					dm.params.local_balance_parameter=1.0e-8
+					dm.params.max_boxsize_limit=0.0
+					dm.params.min_boxsize_limit=0.0001
+					dm.params.constraint_penalty=1000.0
+
 				elif dm.method == 'coliny_ea':
-		                        dm.type     ='coliny'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.show_misc_options=False
-		                        dm.params.misc_options=[]
-		                        dm.params.solution_accuracy=-np.inf
-		                        dm.params.seed=False
-		                        dm.params.population_size=50
-		                        dm.params.initialization_type='unique_random'
-		                        dm.params.fitness_type='linear_rank'
-		                        dm.params.replacement_type='elitist'
-		                        dm.params.random=[]
-		                        dm.params.chc=[]
-		                        dm.params.elitist=[]
-		                        dm.params.new_solutions_generated='population_size - replacement_size'
-		                        dm.params.crossover_type='two_point'
-		                        dm.params.crossover_rate=0.8
-		                        dm.params.mutation_type='offset_normal'
-		                        dm.params.mutation_scale=0.1
-		                        dm.params.mutation_range=1
-		                        dm.params.dimension_ratio=1.0
-		                        dm.params.mutation_rate=1.0
-		                        dm.params.non_adaptive=False
+					dm.type     ='coliny'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.output=False
+					dm.params.scaling=False
+					dm.params.show_misc_options=False
+					dm.params.misc_options=[]
+					dm.params.solution_accuracy=-np.inf
+					dm.params.seed=False
+					dm.params.population_size=50
+					dm.params.initialization_type='unique_random'
+					dm.params.fitness_type='linear_rank'
+					dm.params.replacement_type='elitist'
+					dm.params.random=[]
+					dm.params.chc=[]
+					dm.params.elitist=[]
+					dm.params.new_solutions_generated='population_size - replacement_size'
+					dm.params.crossover_type='two_point'
+					dm.params.crossover_rate=0.8
+					dm.params.mutation_type='offset_normal'
+					dm.params.mutation_scale=0.1
+					dm.params.mutation_range=1
+					dm.params.dimension_ratio=1.0
+					dm.params.mutation_rate=1.0
+					dm.params.non_adaptive=False
+
 				elif dm.method == 'coliny_pattern_search':
-		                        dm.type     ='coliny'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.show_misc_options=False
-		                        dm.params.misc_options=[]
-		                        dm.params.solution_accuracy=-np.inf
-		                        dm.params.stochastic=False
-		                        dm.params.seed=False
-		                        dm.params.initial_delta=[]
-		                        dm.params.threshold_delta=[]
-		                        dm.params.constraint_penalty=1.0
-		                        dm.params.constant_penalty=False
-		                        dm.params.pattern_basis='coordinate'
-		                        dm.params.total_pattern_size=False
-		                        dm.params.no_expansion=False
-		                        dm.params.expand_after_success=1
-		                        dm.params.contraction_factor=0.5
-		                        dm.params.synchronization='nonblocking'
-		                        dm.params.exploratory_moves='basic_pattern'
+					dm.type     ='coliny'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.output=False
+					dm.params.scaling=False
+					dm.params.show_misc_options=False
+					dm.params.misc_options=[]
+					dm.params.solution_accuracy=-np.inf
+					dm.params.stochastic=False
+					dm.params.seed=False
+					dm.params.initial_delta=[]
+					dm.params.threshold_delta=[]
+					dm.params.constraint_penalty=1.0
+					dm.params.constant_penalty=False
+					dm.params.pattern_basis='coordinate'
+					dm.params.total_pattern_size=False
+					dm.params.no_expansion=False
+					dm.params.expand_after_success=1
+					dm.params.contraction_factor=0.5
+					dm.params.synchronization='nonblocking'
+					dm.params.exploratory_moves='basic_pattern'
+
 				elif dm.method == 'coliny_solis_wets':
-		                        dm.type     ='coliny'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.show_misc_options=False
-		                        dm.params.misc_options=[]
-		                        dm.params.solution_accuracy=-np.inf
-		                        dm.params.seed=False
-		                        dm.params.initial_delta=[]
-		                        dm.params.threshold_delta=[]
-		                        dm.params.no_expansion=False
-		                        dm.params.expand_after_success=5
-		                        dm.params.contract_after_failure=3
-		                        dm.params.contraction_factor=0.5
-		                        dm.params.constraint_penalty=1.0
-		                        dm.params.constant_penalty=False
+					dm.type     ='coliny'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.output=False
+					dm.params.scaling=False
+					dm.params.show_misc_options=False
+					dm.params.misc_options=[]
+					dm.params.solution_accuracy=-np.inf
+					dm.params.seed=False
+					dm.params.initial_delta=[]
+					dm.params.threshold_delta=[]
+					dm.params.no_expansion=False
+					dm.params.expand_after_success=5
+					dm.params.contract_after_failure=3
+					dm.params.contraction_factor=0.5
+					dm.params.constraint_penalty=1.0
+					dm.params.constant_penalty=False
 
 				elif dm.method == 'ncsu_direct':
-		                        dm.type     ='ncsu'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']  #  ?
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']  #  ?
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.scaling=False
-		                        dm.params.solution_accuracy=0.
-		                        dm.params.min_boxsize_limit=1.0e-8
-		                        dm.params.vol_boxsize_limit=1.0e-8
-
-	#                               if dm.method in ['surrogate_based_local',
-	#                                   		   'surrogate_based_global']:
+					dm.type     ='ncsu'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =['linear_inequality_constraint',
+												'linear_equality_constraint']  #  ?
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']  #  ?
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.scaling=False
+					dm.params.solution_accuracy=0.
+					dm.params.min_boxsize_limit=1.0e-8
+					dm.params.vol_boxsize_limit=1.0e-8
+
+					#if dm.method in ['surrogate_based_local',
+					#'surrogate_based_global']:
 
 				elif dm.method == 'moga':
-		                        dm.type     ='jega'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.seed=False
-		                        dm.params.log_file='JEGAGlobal.log'
-		                        dm.params.population_size=50
-		                        dm.params.print_each_pop=False
-	#                               according to documentation, uses method-indepent control
-	#                               dm.params.output='normal'
-		                        dm.params.initialization_type='unique_random'
-		                        dm.params.mutation_type='replace_uniform'
-		                        dm.params.mutation_scale=0.15
-		                        dm.params.mutation_rate=0.08
-		                        dm.params.replacement_type=''
-		                        dm.params.below_limit=6
-		                        dm.params.shrinkage_percentage=0.9
-		                        dm.params.crossover_type='shuffle_random'
-		                        dm.params.multi_point_binary=[]
-		                        dm.params.multi_point_parameterized_binary=[]
-		                        dm.params.multi_point_real=[]
-		                        dm.params.shuffle_random=[]
-		                        dm.params.num_parents=2
-		                        dm.params.num_offspring=2
-		                        dm.params.crossover_rate=0.8
-		                        dm.params.fitness_type=''
-		                        dm.params.niching_type=False
-		                        dm.params.radial=[0.01]
-		                        dm.params.distance=[0.01]
-		                        dm.params.metric_tracker=False
-		                        dm.params.percent_change=0.1
-		                        dm.params.num_generations=10
-		                        dm.params.postprocessor_type=False
-		                        dm.params.orthogonal_distance=[0.01]
+					dm.type     ='jega'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =['linear_inequality_constraint',
+												'linear_equality_constraint']
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.output=False
+					dm.params.scaling=False
+					dm.params.seed=False
+					dm.params.log_file='JEGAGlobal.log'
+					dm.params.population_size=50
+					dm.params.print_each_pop=False
+					#according to documentation, uses method-indepent control
+					#dm.params.output='normal'
+					dm.params.initialization_type='unique_random'
+					dm.params.mutation_type='replace_uniform'
+					dm.params.mutation_scale=0.15
+					dm.params.mutation_rate=0.08
+					dm.params.replacement_type=''
+					dm.params.below_limit=6
+					dm.params.shrinkage_percentage=0.9
+					dm.params.crossover_type='shuffle_random'
+					dm.params.multi_point_binary=[]
+					dm.params.multi_point_parameterized_binary=[]
+					dm.params.multi_point_real=[]
+					dm.params.shuffle_random=[]
+					dm.params.num_parents=2
+					dm.params.num_offspring=2
+					dm.params.crossover_rate=0.8
+					dm.params.fitness_type=''
+					dm.params.niching_type=False
+					dm.params.radial=[0.01]
+					dm.params.distance=[0.01]
+					dm.params.metric_tracker=False
+					dm.params.percent_change=0.1
+					dm.params.num_generations=10
+					dm.params.postprocessor_type=False
+					dm.params.orthogonal_distance=[0.01]
+
 				elif dm.method == 'soga':
-		                        dm.type     ='jega'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.seed=False
-		                        dm.params.log_file='JEGAGlobal.log'
-		                        dm.params.population_size=50
-		                        dm.params.print_each_pop=False
-		                        dm.params.output='normal'
-		                        dm.params.initialization_type='unique_random'
-		                        dm.params.mutation_type='replace_uniform'
-		                        dm.params.mutation_scale=0.15
-		                        dm.params.mutation_rate=0.08
-		                        dm.params.replacement_type=''
-		                        dm.params.below_limit=6
-		                        dm.params.shrinkage_percentage=0.9
-		                        dm.params.crossover_type='shuffle_random'
-		                        dm.params.multi_point_binary=[]
-		                        dm.params.multi_point_parameterized_binary=[]
-		                        dm.params.multi_point_real=[]
-		                        dm.params.shuffle_random=[]
-		                        dm.params.num_parents=2
-		                        dm.params.num_offspring=2
-		                        dm.params.crossover_rate=0.8
-		                        dm.params.fitness_type='merit_function'
-		                        dm.params.constraint_penalty=1.0
-		                        dm.params.replacement_type=''
-		                        dm.params.convergence_type=False
-		                        dm.params.num_generations=10
-		                        dm.params.percent_change=0.1
+					dm.type     ='jega'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =['linear_inequality_constraint',
+												'linear_equality_constraint']
+					dm.responses=['objective_function',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.output=False
+					dm.params.scaling=False
+					dm.params.seed=False
+					dm.params.log_file='JEGAGlobal.log'
+					dm.params.population_size=50
+					dm.params.print_each_pop=False
+					dm.params.output='normal'
+					dm.params.initialization_type='unique_random'
+					dm.params.mutation_type='replace_uniform'
+					dm.params.mutation_scale=0.15
+					dm.params.mutation_rate=0.08
+					dm.params.replacement_type=''
+					dm.params.below_limit=6
+					dm.params.shrinkage_percentage=0.9
+					dm.params.crossover_type='shuffle_random'
+					dm.params.multi_point_binary=[]
+					dm.params.multi_point_parameterized_binary=[]
+					dm.params.multi_point_real=[]
+					dm.params.shuffle_random=[]
+					dm.params.num_parents=2
+					dm.params.num_offspring=2
+					dm.params.crossover_rate=0.8
+					dm.params.fitness_type='merit_function'
+					dm.params.constraint_penalty=1.0
+					dm.params.replacement_type=''
+					dm.params.convergence_type=False
+					dm.params.num_generations=10
+					dm.params.percent_change=0.1
 
 				elif dm.method == 'nl2sol':
-		                        dm.type     ='lsq'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['least_squares_term']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.function_precision=1.0e-10
-		                        dm.params.absolute_conv_tol=-1.
-		                        dm.params.x_conv_tol=-1.
-		                        dm.params.singular_conv_tol=-1.
-		                        dm.params.singular_radius=-1.
-		                        dm.params.False_conv_tol=-1.
-		                        dm.params.initial_trust_radius=-1.
-		                        dm.params.covariance=0
-		                        dm.params.regression_stressbalances=False
+					dm.type     ='lsq'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['least_squares_term']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.output=False
+					dm.params.scaling=False
+					dm.params.function_precision=1.0e-10
+					dm.params.absolute_conv_tol=-1.
+					dm.params.x_conv_tol=-1.
+					dm.params.singular_conv_tol=-1.
+					dm.params.singular_radius=-1.
+					dm.params.False_conv_tol=-1.
+					dm.params.initial_trust_radius=-1.
+					dm.params.covariance=0
+					dm.params.regression_stressbalances=False
+
 				elif dm.method == 'nlssol_sqp':
-		                        dm.type     ='lsq'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['least_squares_term',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.verify_level=-1
-		                        dm.params.function_precision=1.0e-10
-		                        dm.params.linesearch_tolerance=0.9
+					dm.type     ='lsq'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =['linear_inequality_constraint',
+												'linear_equality_constraint']
+					dm.responses=['least_squares_term',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.constraint_tolerance=False
+					dm.params.output=False
+					dm.params.speculative=False
+					dm.params.scaling=False
+					dm.params.verify_level=-1
+					dm.params.function_precision=1.0e-10
+					dm.params.linesearch_tolerance=0.9
+
 				elif dm.method == 'optpp_g_newton':
-		                        dm.type     ='lsq'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['least_squares_term',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.value_based_line_search=False
-		                        dm.params.gradient_based_line_search=False
-		                        dm.params.trust_region=False
-		                        dm.params.tr_pds=False
-		                        dm.params.max_step=1000.
-		                        dm.params.gradient_tolerance=1.0e-4
-		                        dm.params.merit_function='argaez_tapia'
-		                        dm.params.central_path=dm.params.merit_function
-		                        dm.params.steplength_to_boundary=0.99995
-		                        dm.params.centering_parameter=0.2
+					dm.type     ='lsq'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =['linear_inequality_constraint',
+												'linear_equality_constraint']
+					dm.responses=['least_squares_term',
+												'nonlinear_inequality_constraint',
+												'nonlinear_equality_constraint']
+					dm.ghspec   =['grad']
+					dm.params.max_iterations=False
+					dm.params.max_function_evaluations=False
+					dm.params.convergence_tolerance=False
+					dm.params.output=False
+					dm.params.speculative=False
+					dm.params.scaling=False
+					dm.params.value_based_line_search=False
+					dm.params.gradient_based_line_search=False
+					dm.params.trust_region=False
+					dm.params.tr_pds=False
+					dm.params.max_step=1000.
+					dm.params.gradient_tolerance=1.0e-4
+					dm.params.merit_function='argaez_tapia'
+					dm.params.central_path=dm.params.merit_function
+					dm.params.steplength_to_boundary=0.99995
+					dm.params.centering_parameter=0.2
 
 				elif dm.method == 'nond_sampling':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =[]
-	#                               not documented, but apparently works
-		                        dm.params.output=False
-		                        dm.params.seed=False
-		                        dm.params.fixed_seed=False
-		                        dm.params.rng=False
-		                        dm.params.samples=False
-		                        dm.params.sample_type='lhs'
-		                        dm.params.all_variables=False
-		                        dm.params.variance_based_decomp=False
-		                        dm.params.previous_samples=0
+					dm.type     ='nond'
+					dm.variables=['normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['response_function']
+					dm.ghspec   =[]
+					#                               not documented, but apparently works
+					dm.params.output=False
+					dm.params.seed=False
+					dm.params.fixed_seed=False
+					dm.params.rng=False
+					dm.params.samples=False
+					dm.params.sample_type='lhs'
+					dm.params.all_variables=False
+					dm.params.variance_based_decomp=False
+					dm.params.previous_samples=0
+
 				elif dm.method == 'nond_local_reliability':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =['grad']
-	#                               not documented, but may work
-		                        dm.params.output=False
-		                        dm.params.max_iterations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.mpp_search=False
-		                        dm.params.sqp=False
-		                        dm.params.nip=False
-		                        dm.params.integration='first_order'
-		                        dm.params.refinement=False
-		                        dm.params.samples=0
-		                        dm.params.seed=False
+					dm.type     ='nond'
+					dm.variables=['normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['response_function']
+					dm.ghspec   =['grad']
+					#                               not documented, but may work
+					dm.params.output=False
+					dm.params.max_iterations=False
+					dm.params.convergence_tolerance=False
+					dm.params.mpp_search=False
+					dm.params.sqp=False
+					dm.params.nip=False
+					dm.params.integration='first_order'
+					dm.params.refinement=False
+					dm.params.samples=0
+					dm.params.seed=False
+
 				elif dm.method == 'nond_global_reliability':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =['grad']
-	#                               not documented, but may work
-		                        dm.params.output=False
-		                        dm.params.x_gaussian_process=False
-		                        dm.params.u_gaussian_process=False
-		                        dm.params.all_variables=False
-		                        dm.params.seed=False
+					dm.type     ='nond'
+					dm.variables=['normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['response_function']
+					dm.ghspec   =['grad']
+					#                               not documented, but may work
+					dm.params.output=False
+					dm.params.x_gaussian_process=False
+					dm.params.u_gaussian_process=False
+					dm.params.all_variables=False
+					dm.params.seed=False
+
 				elif dm.method == 'nond_polynomial_chaos':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =['grad']
-	#                               not documented, but may work
-		                        dm.params.output=False
-		                        dm.params.expansion_order=[]
-		                        dm.params.expansion_terms=[]
-		                        dm.params.quadrature_order=[]
-		                        dm.params.sparse_grid_level=[]
-		                        dm.params.expansion_samples=[]
-		                        dm.params.incremental_lhs=False
-		                        dm.params.collocation_points=[]
-		                        dm.params.collocation_ratio=[]
-		                        dm.params.reuse_samples=False
-		                        dm.params.expansion_import_file=''
-		                        dm.params.seed=False
-		                        dm.params.fixed_seed=False
-		                        dm.params.samples=0
-		                        dm.params.sample_type='lhs'
-		                        dm.params.all_variables=False
+					dm.type     ='nond'
+					dm.variables=['normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['response_function']
+					dm.ghspec   =['grad']
+					#                               not documented, but may work
+					dm.params.output=False
+					dm.params.expansion_order=[]
+					dm.params.expansion_terms=[]
+					dm.params.quadrature_order=[]
+					dm.params.sparse_grid_level=[]
+					dm.params.expansion_samples=[]
+					dm.params.incremental_lhs=False
+					dm.params.collocation_points=[]
+					dm.params.collocation_ratio=[]
+					dm.params.reuse_samples=False
+					dm.params.expansion_import_file=''
+					dm.params.seed=False
+					dm.params.fixed_seed=False
+					dm.params.samples=0
+					dm.params.sample_type='lhs'
+					dm.params.all_variables=False
+
 				elif dm.method == 'nond_stoch_collocation':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =['grad']
-	#                               not documented, but may work
-		                        dm.params.output=False
-		                        dm.params.quadrature_order=[]
-		                        dm.params.sparse_grid_level=[]
-		                        dm.params.seed=False
-		                        dm.params.fixed_seed=False
-		                        dm.params.samples=0
-		                        dm.params.sample_type='lhs'
-		                        dm.params.all_variables=False
+					dm.type     ='nond'
+					dm.variables=['normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['response_function']
+					dm.ghspec   =['grad']
+					#                               not documented, but may work
+					dm.params.output=False
+					dm.params.quadrature_order=[]
+					dm.params.sparse_grid_level=[]
+					dm.params.seed=False
+					dm.params.fixed_seed=False
+					dm.params.samples=0
+					dm.params.sample_type='lhs'
+					dm.params.all_variables=False
+
 				elif dm.method == 'nond_evidence':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =['grad']
-	#                               not documented, but may work
-		                        dm.params.output=False
-		                        dm.params.seed=False
-		                        dm.params.samples=10000
+					dm.type     ='nond'
+					dm.variables=['normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['response_function']
+					dm.ghspec   =['grad']
+					#                               not documented, but may work
+					dm.params.output=False
+					dm.params.seed=False
+					dm.params.samples=10000
 
 				elif dm.method == 'dace':
-		                        dm.type     ='dace'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.grid=False
-		                        dm.params.random=False
-		                        dm.params.oas=False
-		                        dm.params.lhs=False
-		                        dm.params.oa_lhs=False
-		                        dm.params.box_behnken=False
-		                        dm.params.central_composite=False
-		                        dm.params.seed=False
-		                        dm.params.fixed_seed=False
-		                        dm.params.samples=False
-		                        dm.params.symbols=False
-		                        dm.params.quality_metrics=False
-		                        dm.params.variance_based_decomp=False
+					dm.type     ='dace'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'response_function']
+					dm.ghspec   =[]
+					dm.params.grid=False
+					dm.params.random=False
+					dm.params.oas=False
+					dm.params.lhs=False
+					dm.params.oa_lhs=False
+					dm.params.box_behnken=False
+					dm.params.central_composite=False
+					dm.params.seed=False
+					dm.params.fixed_seed=False
+					dm.params.samples=False
+					dm.params.symbols=False
+					dm.params.quality_metrics=False
+					dm.params.variance_based_decomp=False
+
 				elif dm.method == 'fsu_quasi_mc':
-		                        dm.type     ='dace'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.halton=False
-		                        dm.params.hammersley=False
-		                        dm.params.samples=0
-		                        dm.params.sequence_start=[0]
-		                        dm.params.sequence_leap=[1]
-		                        dm.params.prime_base=False
-		                        dm.params.fixed_sequence=False
-		                        dm.params.latinize=False
-		                        dm.params.variance_based_decomp=False
-		                        dm.params.quality_metrics=False
+					dm.type     ='dace'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'response_function']
+					dm.ghspec   =[]
+					dm.params.halton=False
+					dm.params.hammersley=False
+					dm.params.samples=0
+					dm.params.sequence_start=[0]
+					dm.params.sequence_leap=[1]
+					dm.params.prime_base=False
+					dm.params.fixed_sequence=False
+					dm.params.latinize=False
+					dm.params.variance_based_decomp=False
+					dm.params.quality_metrics=False
+
 				elif dm.method == 'fsu_cvt':
-		                        dm.type     ='dace'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.seed=False
-		                        dm.params.fixed_seed=False
-		                        dm.params.samples=0
-		                        dm.params.num_trials=10000
-		                        dm.params.trial_type='random'
-		                        dm.params.latinize=False
-		                        dm.params.variance_based_decomp=False
-		                        dm.params.quality_metrics=False
+					dm.type     ='dace'
+					dm.variables=['continuous_design',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'response_function']
+					dm.ghspec   =[]
+					dm.params.seed=False
+					dm.params.fixed_seed=False
+					dm.params.samples=0
+					dm.params.num_trials=10000
+					dm.params.trial_type='random'
+					dm.params.latinize=False
+					dm.params.variance_based_decomp=False
+					dm.params.quality_metrics=False
 
 				elif dm.method == 'vector_parameter_study':
-		                        dm.type     ='param'
-		                        dm.variables=['continuous_design',
-		                                        'normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.output=False
-		                        dm.params.final_point=[]
-		                        dm.params.step_length=[]
-		                        dm.params.num_steps=[]
-		                        dm.params.step_vector=[]
-		                        dm.params.num_steps=[]
+					dm.type     ='param'
+					dm.variables=['continuous_design',
+												'normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'response_function']
+					dm.ghspec   =[]
+					dm.params.output=False
+					dm.params.final_point=[]
+					dm.params.step_length=[]
+					dm.params.num_steps=[]
+					dm.params.step_vector=[]
+					dm.params.num_steps=[]
+
 				elif dm.method == 'list_parameter_study':
-		                        dm.type     ='param'
-		                        dm.variables=['continuous_design',
-		                                        'normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.output=False
-		                        dm.params.list_of_points=[]
+					dm.type     ='param'
+					dm.variables=['continuous_design',
+												'normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'response_function']
+					dm.ghspec   =[]
+					dm.params.output=False
+					dm.params.list_of_points=[]
+
 				elif dm.method == 'centered_parameter_study':
-		                        dm.type     ='param'
-		                        dm.variables=['continuous_design',
-		                                        'normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.output=False
-		                        dm.params.percent_delta=[]
-		                        dm.params.deltas_per_variable=[]
+					dm.type     ='param'
+					dm.variables=['continuous_design',
+												'normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'response_function']
+					dm.ghspec   =[]
+					dm.params.output=False
+					dm.params.percent_delta=[]
+					dm.params.deltas_per_variable=[]
+
 				elif dm.method == 'multidim_parameter_study':
-		                        dm.type     ='param'
-		                        dm.variables=['continuous_design',
-		                                        'normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.output=False
-		                        dm.params.partitions=[]
+					dm.type     ='param'
+					dm.variables=['continuous_design',
+												'normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'response_function']
+					dm.ghspec   =[]
+					dm.params.output=False
+					dm.params.partitions=[]
+
 				elif dm.method == 'bayes_calibration':
-		                        dm.type     ='bayes'
-		                        dm.variables=['continuous_design',
-		                                        'normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function',
-																'calibration_function']
-		                        dm.ghspec   =[]
-		                        dm.params.queso=False
+					dm.type     ='bayes'
+					dm.variables=['continuous_design',
+												'normal_uncertain',
+												'uniform_uncertain',
+												'continuous_state']
+					dm.lcspec   =[]
+					dm.responses=['objective_function',
+												'response_function',
+												'calibration_function']
+					dm.ghspec   =[]
+					dm.params.queso=False
 					dm.params.dream=False
 					dm.params.gpmsa=False
-		                        dm.params.samples=0
-					dm.params.seed=False
-					dm.params.output=False
-					
+					dm.params.samples=0
+					dm.params.seed=False
+					dm.params.output=False
 					dm.params.metropolis_hastings=False
-					
 					dm.params.proposal_covariance=False
 					dm.params.diagonal=False
@@ -856,9 +868,9 @@
 
 				else:
-					raise RuntimeError('Unimplemented method: '+str(dm.method)+'.')
+					raise RuntimeError('Unimplemented method: {}.'.format(dm.method))
 
 		#  if more than one argument, issue warning
 		else:
-			print 'Warning: dakota_method:extra_arg: Extra arguments for object of class '+str(type(dm))+'.'
+			print('Warning: dakota_method:extra_arg: Extra arguments for object of class '+str(type(dm))+'.')
 		return dm
 
@@ -886,5 +898,5 @@
 		for i in range(len(fnames)):
 			maxlen=max(maxlen,len(fnames[i]))
-		        
+
 		for i in fnames:
 			string += '       params.{:{space}s}: {}\n'.format(str(i),str(dm.params.__dict__[i]),space=maxlen+1)
@@ -892,3 +904,2 @@
 			#with maxlen+1 spaces between x and :
 		return string
-
Index: /issm/trunk-jpl/src/m/classes/qmu/@dakota_method/dmeth_params_set.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/@dakota_method/dmeth_params_set.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/@dakota_method/dmeth_params_set.py	(revision 23716)
@@ -16,12 +16,8 @@
 		if isfield(dm.params,args[i]):
 			#vars(dresp)[fnames[i]]
-	    		exec('dm.params.%s = args[i+1]')%(args[i])
+	    		exec(('dm.params.%s = args[i+1]')%(args[i]))
 			#vars(dm.params)[args[i]]=args[i+1]
 		else:
-			print 'WARNING: dmeth_params_set:unknown_param No parameter \''+str(args[i])+'\' for dakota_method \''+str(dm.method)+'\'.'
+			print('WARNING: dmeth_params_set:unknown_param No parameter \''+str(args[i])+'\' for dakota_method \''+str(dm.method)+'\'.')
 
 	return dm
-    
-
-
-
Index: /issm/trunk-jpl/src/m/classes/qmu/@dakota_method/dmeth_params_write.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/@dakota_method/dmeth_params_write.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/@dakota_method/dmeth_params_write.py	(revision 23716)
@@ -41,13 +41,12 @@
 		#switch dm.method
 		if dm.method in ['dot_bfgs',
-		        	 'dot_frcg',
-		         	 'dot_mmfd',
-		         	 'dot_slp',
-		         	 'dot_sqp']:
-		        param_write(fid,sbeg,'optimization_type',' = ','\n',dm.params)
-
-		else:
-		        raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
+										 'dot_frcg',
+										 'dot_mmfd',
+										 'dot_slp',
+										 'dot_sqp']:
+			param_write(fid,sbeg,'optimization_type',' = ','\n',dm.params)
+
+		else:
+			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
 
 	elif dm.type == 'npsol':
@@ -67,5 +66,4 @@
 		else:
 			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
 
 	elif dm.type == 'conmin':
@@ -78,10 +76,8 @@
 		param_write(fid,sbeg,'scaling','','\n',dm.params)
 		#switch dm.method
-		if dm.method in ['conmin_frcg',
-		          'conmin_mfd']:
+		if dm.method in ['conmin_frcg','conmin_mfd']:
 			pass
 		else:
 			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
 
 	elif dm.type == 'optpp':
@@ -94,34 +90,30 @@
 		#switch dm.method
 		if dm.method == 'optpp_cg':
-		        param_write(fid,sbeg,'max_step','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'gradient_tolerance',' = ','\n',dm.params)
-
-		elif dm.method in ['optpp_q_newton',
-		          'optpp_fd_newton',
-		          'optpp_newton']:
-		        if (dm.params.value_based_line_search + 
-		            dm.params.gradient_based_line_search + 
-		            dm.params.trust_region + 
-		            dm.params.tr_pds > 1):
-		        	raise RuntimeError('#s'' method must have only one algorithm.',
-		                	dm.method)
-		        
-		        param_write(fid,sbeg,'value_based_line_search','','\n',dm.params)
-		        param_write(fid,sbeg,'gradient_based_line_search','','\n',dm.params)
-		        param_write(fid,sbeg,'trust_region','','\n',dm.params)
-		        param_write(fid,sbeg,'tr_pds','','\n',dm.params)
-		        param_write(fid,sbeg,'max_step','               = ','\n',dm.params)
-		        param_write(fid,sbeg,'gradient_tolerance','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'merit_function','         = ','\n',dm.params)
-		        param_write(fid,sbeg,'central_path','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'steplength_to_boundary',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'centering_parameter','    = ','\n',dm.params)
+			param_write(fid,sbeg,'max_step','           = ','\n',dm.params)
+			param_write(fid,sbeg,'gradient_tolerance',' = ','\n',dm.params)
+
+		elif dm.method in ['optpp_q_newton','optpp_fd_newton','optpp_newton']:
+			if (dm.params.value_based_line_search +
+					dm.params.gradient_based_line_search +
+					dm.params.trust_region +
+					dm.params.tr_pds > 1):
+				raise RuntimeError('#s'' method must have only one algorithm.',
+													 dm.method)
+			param_write(fid,sbeg,'value_based_line_search','','\n',dm.params)
+			param_write(fid,sbeg,'gradient_based_line_search','','\n',dm.params)
+			param_write(fid,sbeg,'trust_region','','\n',dm.params)
+			param_write(fid,sbeg,'tr_pds','','\n',dm.params)
+			param_write(fid,sbeg,'max_step','               = ','\n',dm.params)
+			param_write(fid,sbeg,'gradient_tolerance','     = ','\n',dm.params)
+			param_write(fid,sbeg,'merit_function','         = ','\n',dm.params)
+			param_write(fid,sbeg,'central_path','           = ','\n',dm.params)
+			param_write(fid,sbeg,'steplength_to_boundary',' = ','\n',dm.params)
+			param_write(fid,sbeg,'centering_parameter','    = ','\n',dm.params)
 
 		elif dm.method == 'optpp_pds':
-		        param_write(fid,sbeg,'search_scheme_size',' = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
+			param_write(fid,sbeg,'search_scheme_size',' = ','\n',dm.params)
+
+		else:
+			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
 
 	elif dm.type == 'apps':
@@ -132,16 +124,15 @@
 		#switch dm.method
 		if dm.method == 'asynch_pattern_search':
-		        param_write(fid,sbeg,'initial_delta','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'threshold_delta','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'contraction_factor',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'solution_target','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'synchronization','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'merit_function','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_penalty',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'smoothing_factor','   = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
+			param_write(fid,sbeg,'initial_delta','      = ','\n',dm.params)
+			param_write(fid,sbeg,'threshold_delta','    = ','\n',dm.params)
+			param_write(fid,sbeg,'contraction_factor',' = ','\n',dm.params)
+			param_write(fid,sbeg,'solution_target','    = ','\n',dm.params)
+			param_write(fid,sbeg,'synchronization','    = ','\n',dm.params)
+			param_write(fid,sbeg,'merit_function','     = ','\n',dm.params)
+			param_write(fid,sbeg,'constraint_penalty',' = ','\n',dm.params)
+			param_write(fid,sbeg,'smoothing_factor','   = ','\n',dm.params)
+
+		else:
+			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
 
 	elif dm.type == 'coliny':
@@ -151,5 +142,4 @@
 		param_write(fid,sbeg,'output',' ','\n',dm.params)
 		param_write(fid,sbeg,'scaling','','\n',dm.params)
-
 		param_write(fid,sbeg,'show_misc_options','','\n',dm.params)
 		param_write(fid,sbeg,'misc_options','      = ','\n',dm.params)
@@ -157,63 +147,62 @@
 		#switch dm.method
 		if dm.method == 'coliny_cobyla':
-		        param_write(fid,sbeg,'initial_delta','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'threshold_delta',' = ','\n',dm.params)
+			param_write(fid,sbeg,'initial_delta','   = ','\n',dm.params)
+			param_write(fid,sbeg,'threshold_delta',' = ','\n',dm.params)
 
 		elif dm.method == 'coliny_direct':
-		        param_write(fid,sbeg,'division','                 = ','\n',dm.params)
-		        param_write(fid,sbeg,'global_balance_parameter',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'local_balance_parameter','  = ','\n',dm.params)
-		        param_write(fid,sbeg,'max_boxsize_limit','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'min_boxsize_limit','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_penalty','       = ','\n',dm.params)
+			param_write(fid,sbeg,'division','                 = ','\n',dm.params)
+			param_write(fid,sbeg,'global_balance_parameter',' = ','\n',dm.params)
+			param_write(fid,sbeg,'local_balance_parameter','  = ','\n',dm.params)
+			param_write(fid,sbeg,'max_boxsize_limit','        = ','\n',dm.params)
+			param_write(fid,sbeg,'min_boxsize_limit','        = ','\n',dm.params)
+			param_write(fid,sbeg,'constraint_penalty','       = ','\n',dm.params)
 
 		elif dm.method == 'coliny_ea':
-		        param_write(fid,sbeg,'seed','                    = ','\n',dm.params)
-		        param_write(fid,sbeg,'population_size','         = ','\n',dm.params)
-		        param_write(fid,sbeg,'initialization_type','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'fitness_type','            = ','\n',dm.params)
-		        param_write(fid,sbeg,'replacement_type','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'random','                  = ','\n',dm.params)
-		        param_write(fid,sbeg,'chc','                     = ','\n',dm.params)
-		        param_write(fid,sbeg,'elitist','                 = ','\n',dm.params)
-		        param_write(fid,sbeg,'new_solutions_generated',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'crossover_type','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'crossover_rate','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'mutation_type','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'mutation_scale','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'mutation_range','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'dimension_ratio','         = ','\n',dm.params)
-		        param_write(fid,sbeg,'mutation_rate','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'non_adaptive','','\n',dm.params)
+			param_write(fid,sbeg,'seed','                    = ','\n',dm.params)
+			param_write(fid,sbeg,'population_size','         = ','\n',dm.params)
+			param_write(fid,sbeg,'initialization_type','     = ','\n',dm.params)
+			param_write(fid,sbeg,'fitness_type','            = ','\n',dm.params)
+			param_write(fid,sbeg,'replacement_type','        = ','\n',dm.params)
+			param_write(fid,sbeg,'random','                  = ','\n',dm.params)
+			param_write(fid,sbeg,'chc','                     = ','\n',dm.params)
+			param_write(fid,sbeg,'elitist','                 = ','\n',dm.params)
+			param_write(fid,sbeg,'new_solutions_generated',' = ','\n',dm.params)
+			param_write(fid,sbeg,'crossover_type','          = ','\n',dm.params)
+			param_write(fid,sbeg,'crossover_rate','          = ','\n',dm.params)
+			param_write(fid,sbeg,'mutation_type','           = ','\n',dm.params)
+			param_write(fid,sbeg,'mutation_scale','          = ','\n',dm.params)
+			param_write(fid,sbeg,'mutation_range','          = ','\n',dm.params)
+			param_write(fid,sbeg,'dimension_ratio','         = ','\n',dm.params)
+			param_write(fid,sbeg,'mutation_rate','           = ','\n',dm.params)
+			param_write(fid,sbeg,'non_adaptive','','\n',dm.params)
 
 		elif dm.method == 'coliny_pattern_search':
-		        param_write(fid,sbeg,'stochastic','','\n',dm.params)
-		        param_write(fid,sbeg,'seed','                 = ','\n',dm.params)
-		        param_write(fid,sbeg,'initial_delta','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'threshold_delta','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_penalty','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'constant_penalty','','\n',dm.params)
-		        param_write(fid,sbeg,'pattern_basis','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'total_pattern_size','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'no_expansion','','\n',dm.params)
-		        param_write(fid,sbeg,'expand_after_success',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'contraction_factor','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'synchronization','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'exploratory_moves','    = ','\n',dm.params)
+			param_write(fid,sbeg,'stochastic','','\n',dm.params)
+			param_write(fid,sbeg,'seed','                 = ','\n',dm.params)
+			param_write(fid,sbeg,'initial_delta','        = ','\n',dm.params)
+			param_write(fid,sbeg,'threshold_delta','      = ','\n',dm.params)
+			param_write(fid,sbeg,'constraint_penalty','   = ','\n',dm.params)
+			param_write(fid,sbeg,'constant_penalty','','\n',dm.params)
+			param_write(fid,sbeg,'pattern_basis','        = ','\n',dm.params)
+			param_write(fid,sbeg,'total_pattern_size','   = ','\n',dm.params)
+			param_write(fid,sbeg,'no_expansion','','\n',dm.params)
+			param_write(fid,sbeg,'expand_after_success',' = ','\n',dm.params)
+			param_write(fid,sbeg,'contraction_factor','   = ','\n',dm.params)
+			param_write(fid,sbeg,'synchronization','      = ','\n',dm.params)
+			param_write(fid,sbeg,'exploratory_moves','    = ','\n',dm.params)
 
 		elif dm.method == 'coliny_solis_wets':
-		        param_write(fid,sbeg,'seed','                   = ','\n',dm.params)
-		        param_write(fid,sbeg,'initial_delta','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'threshold_delta','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'no_expansion','','\n',dm.params)
-		        param_write(fid,sbeg,'expand_after_success','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'contract_after_failure',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'contraction_factor','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_penalty','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'constant_penalty','','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
+			param_write(fid,sbeg,'seed','                   = ','\n',dm.params)
+			param_write(fid,sbeg,'initial_delta','          = ','\n',dm.params)
+			param_write(fid,sbeg,'threshold_delta','        = ','\n',dm.params)
+			param_write(fid,sbeg,'no_expansion','','\n',dm.params)
+			param_write(fid,sbeg,'expand_after_success','   = ','\n',dm.params)
+			param_write(fid,sbeg,'contract_after_failure',' = ','\n',dm.params)
+			param_write(fid,sbeg,'contraction_factor','     = ','\n',dm.params)
+			param_write(fid,sbeg,'constraint_penalty','     = ','\n',dm.params)
+			param_write(fid,sbeg,'constant_penalty','','\n',dm.params)
+
+		else:
+			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
 
 	elif dm.type == 'ncsu':
@@ -223,11 +212,10 @@
 		#switch dm.method
 		if dm.method == 'ncsu_direct':
-		        param_write(fid,sbeg,'solution_accuracy',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'min_boxsize_limit',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'vol_boxsize_limit',' = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
+			param_write(fid,sbeg,'solution_accuracy',' = ','\n',dm.params)
+			param_write(fid,sbeg,'min_boxsize_limit',' = ','\n',dm.params)
+			param_write(fid,sbeg,'vol_boxsize_limit',' = ','\n',dm.params)
+
+		else:
+			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
 
 	elif dm.type == 'jega':
@@ -236,5 +224,4 @@
 		param_write(fid,sbeg,'output',' ','\n',dm.params)
 		param_write(fid,sbeg,'scaling','','\n',dm.params)
-
 		param_write(fid,sbeg,'seed','                             = ','\n',dm.params)
 		param_write(fid,sbeg,'log_file','                         = ','\n',dm.params)
@@ -260,175 +247,164 @@
 		#switch dm.method
 		if dm.method == 'moga':
-		        param_write(fid,sbeg,'fitness_type','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'niching_type','        = ','\n',dm.params)
-		        if not isempty(dm.params.radial) and not isempty(dm.params.distance):
-		        	raise RuntimeError('#s'' method must have only one niching distance.',
-		        		dm.method)
-		        
-		        param_write(fid,sbeg,'radial','              = ','\n',dm.params)
-		        param_write(fid,sbeg,'distance','            = ','\n',dm.params)
-		        param_write(fid,sbeg,'metric_tracker','','\n',dm.params)
-		        param_write(fid,sbeg,'percent_change','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'num_generations','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'postprocessor_type','  = ','\n',dm.params)
-		        param_write(fid,sbeg,'orthogonal_distance',' = ','\n',dm.params)
+			param_write(fid,sbeg,'fitness_type','        = ','\n',dm.params)
+			param_write(fid,sbeg,'niching_type','        = ','\n',dm.params)
+			if not isempty(dm.params.radial) and not isempty(dm.params.distance):
+				raise RuntimeError('#s'' method must have only one niching distance.',
+													 dm.method)
+			param_write(fid,sbeg,'radial','              = ','\n',dm.params)
+			param_write(fid,sbeg,'distance','            = ','\n',dm.params)
+			param_write(fid,sbeg,'metric_tracker','','\n',dm.params)
+			param_write(fid,sbeg,'percent_change','      = ','\n',dm.params)
+			param_write(fid,sbeg,'num_generations','     = ','\n',dm.params)
+			param_write(fid,sbeg,'postprocessor_type','  = ','\n',dm.params)
+			param_write(fid,sbeg,'orthogonal_distance',' = ','\n',dm.params)
 
 		elif dm.method == 'soga':
-		        param_write(fid,sbeg,'fitness_type','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_penalty',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'replacement_type','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'convergence_type','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'num_generations','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'percent_change','     = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
+			param_write(fid,sbeg,'fitness_type','       = ','\n',dm.params)
+			param_write(fid,sbeg,'constraint_penalty',' = ','\n',dm.params)
+			param_write(fid,sbeg,'replacement_type','   = ','\n',dm.params)
+			param_write(fid,sbeg,'convergence_type','   = ','\n',dm.params)
+			param_write(fid,sbeg,'num_generations','    = ','\n',dm.params)
+			param_write(fid,sbeg,'percent_change','     = ','\n',dm.params)
+
+		else:
+			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
 
 	elif dm.type == 'lsq':
 		#switch dm.method
 		if dm.method == 'nl2sol':
-		        param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'output',' ','\n',dm.params)
-		        param_write(fid,sbeg,'scaling','','\n',dm.params)
-
-		        param_write(fid,sbeg,'function_precision','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'absolute_conv_tol','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'x_conv_tol','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'singular_conv_tol','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'singular_radius','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'false_conv_tol','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'initial_trust_radius',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'covariance','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'regression_stressbalances','','\n',dm.params)
+			param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
+			param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
+			param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
+			param_write(fid,sbeg,'output',' ','\n',dm.params)
+			param_write(fid,sbeg,'scaling','','\n',dm.params)
+			param_write(fid,sbeg,'function_precision','   = ','\n',dm.params)
+			param_write(fid,sbeg,'absolute_conv_tol','    = ','\n',dm.params)
+			param_write(fid,sbeg,'x_conv_tol','           = ','\n',dm.params)
+			param_write(fid,sbeg,'singular_conv_tol','    = ','\n',dm.params)
+			param_write(fid,sbeg,'singular_radius','      = ','\n',dm.params)
+			param_write(fid,sbeg,'false_conv_tol','       = ','\n',dm.params)
+			param_write(fid,sbeg,'initial_trust_radius',' = ','\n',dm.params)
+			param_write(fid,sbeg,'covariance','           = ','\n',dm.params)
+			param_write(fid,sbeg,'regression_stressbalances','','\n',dm.params)
 
 		elif dm.method == 'nlssol_sqp':
-		        param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_tolerance','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'output',' ','\n',dm.params)
-		        param_write(fid,sbeg,'speculative','','\n',dm.params)
-		        param_write(fid,sbeg,'scaling','','\n',dm.params)
-
-		        param_write(fid,sbeg,'verify_level','         = ','\n',dm.params)
-		        param_write(fid,sbeg,'function_precision','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'linesearch_tolerance',' = ','\n',dm.params)
+			param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
+			param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
+			param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
+			param_write(fid,sbeg,'constraint_tolerance','     = ','\n',dm.params)
+			param_write(fid,sbeg,'output',' ','\n',dm.params)
+			param_write(fid,sbeg,'speculative','','\n',dm.params)
+			param_write(fid,sbeg,'scaling','','\n',dm.params)
+			param_write(fid,sbeg,'verify_level','         = ','\n',dm.params)
+			param_write(fid,sbeg,'function_precision','   = ','\n',dm.params)
+			param_write(fid,sbeg,'linesearch_tolerance',' = ','\n',dm.params)
 
 		elif dm.method == 'optpp_g_newton':
-		        param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'output',' ','\n',dm.params)
-		        param_write(fid,sbeg,'speculative','','\n',dm.params)
-		        param_write(fid,sbeg,'scaling','','\n',dm.params)
-
-		        if (dm.params.value_based_line_search + 
-		            dm.params.gradient_based_line_search + 
-		            dm.params.trust_region + 
-		            dm.params.tr_pds > 1):
-		        	raise RuntimeError('#s'' method must have only one algorithm.',
-		                	dm.method)
-		        
-		        param_write(fid,sbeg,'value_based_line_search','','\n',dm.params)
-		        param_write(fid,sbeg,'gradient_based_line_search','','\n',dm.params)
-		        param_write(fid,sbeg,'trust_region','','\n',dm.params)
-		        param_write(fid,sbeg,'tr_pds','','\n',dm.params)
-		        param_write(fid,sbeg,'max_step','               = ','\n',dm.params)
-		        param_write(fid,sbeg,'gradient_tolerance','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'merit_function','         = ','\n',dm.params)
-		        param_write(fid,sbeg,'central_path','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'steplength_to_boundary',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'centering_parameter','    = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
+			param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
+			param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
+			param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
+			param_write(fid,sbeg,'output',' ','\n',dm.params)
+			param_write(fid,sbeg,'speculative','','\n',dm.params)
+			param_write(fid,sbeg,'scaling','','\n',dm.params)
+
+			if (dm.params.value_based_line_search +
+					dm.params.gradient_based_line_search +
+					dm.params.trust_region +
+					dm.params.tr_pds > 1):
+				raise RuntimeError('#s'' method must have only one algorithm.',
+													 dm.method)
+
+			param_write(fid,sbeg,'value_based_line_search','','\n',dm.params)
+			param_write(fid,sbeg,'gradient_based_line_search','','\n',dm.params)
+			param_write(fid,sbeg,'trust_region','','\n',dm.params)
+			param_write(fid,sbeg,'tr_pds','','\n',dm.params)
+			param_write(fid,sbeg,'max_step','               = ','\n',dm.params)
+			param_write(fid,sbeg,'gradient_tolerance','     = ','\n',dm.params)
+			param_write(fid,sbeg,'merit_function','         = ','\n',dm.params)
+			param_write(fid,sbeg,'central_path','           = ','\n',dm.params)
+			param_write(fid,sbeg,'steplength_to_boundary',' = ','\n',dm.params)
+			param_write(fid,sbeg,'centering_parameter','    = ','\n',dm.params)
+
+		else:
+			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
 
 	elif dm.type == 'nond':
 		#switch dm.method
 		if dm.method == 'nond_sampling':
-		        param_write(fid,sbeg,'seed','             = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
+			param_write(fid,sbeg,'seed','             = ','\n',dm.params)
+			param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
 			dver = str(IssmConfig('_DAKOTA_VERSION_')[0])
-		        if ((int(dver[0])==4 and int(dver[2])>2) or int(dver[0])>4):
-		        	param_write(fid,sbeg,'rng','                ','\n',dm.params)
-		        
-		        param_write(fid,sbeg,'samples','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'sample_type','        ','\n',dm.params)
-		        param_write(fid,sbeg,'all_variables','','\n',dm.params)
-		        param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
-		        if strcmp(dm.params.sample_type,'incremental_random') or strcmp(dm.params.sample_type,'incremental_lhs'):
-		        	param_write(fid,sbeg,'previous_samples',' = ','\n',dm.params)
-		        
-		        param_write(fid,sbeg,'output',' ','\n',dm.params)
+			if ((int(dver[0])==4 and int(dver[2])>2) or int(dver[0])>4):
+				param_write(fid,sbeg,'rng','                ','\n',dm.params)
+				param_write(fid,sbeg,'samples','          = ','\n',dm.params)
+				param_write(fid,sbeg,'sample_type','        ','\n',dm.params)
+				param_write(fid,sbeg,'all_variables','','\n',dm.params)
+				param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
+				if strcmp(dm.params.sample_type,'incremental_random') or strcmp(dm.params.sample_type,'incremental_lhs'):
+					param_write(fid,sbeg,'previous_samples',' = ','\n',dm.params)
+					param_write(fid,sbeg,'output',' ','\n',dm.params)
 
 		elif dm.method == 'nond_local_reliability':
-		        param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-
-		        param_write(fid,sbeg,'mpp_search','  = ','\n',dm.params)
-		        if type(dm.params.mpp_search) == str:
-		        	if (dm.params.sqp + 
-		                    dm.params.nip > 1):
-		                	raise RuntimeError('#s'' method must have only one algorithm.',
-		                    		dm.method)
-		            
+			param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
+			param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
+			param_write(fid,sbeg,'mpp_search','  = ','\n',dm.params)
+			if type(dm.params.mpp_search) == str:
+				if (dm.params.sqp +dm.params.nip > 1):
+					raise RuntimeError('#s'' method must have only one algorithm.',
+														 dm.method)
+
 				param_write(fid,sbeg,'sqp','','\n',dm.params)
 				param_write(fid,sbeg,'nip','','\n',dm.params)
 				param_write(fid,sbeg,'integration','   ','\n',dm.params)
 				param_write(fid,sbeg,'refinement','  = ','\n',dm.params)
-		        	if type(dm.params.refinement) == str:
-		            		param_write(fid,sbeg,'samples','     = ','\n',dm.params)
-		            		param_write(fid,sbeg,'seed','        = ','\n',dm.params)
-		            
-		        
-		        param_write(fid,sbeg,'output',' ','\n',dm.params)
+				if type(dm.params.refinement) == str:
+					param_write(fid,sbeg,'samples','     = ','\n',dm.params)
+					param_write(fid,sbeg,'seed','        = ','\n',dm.params)
+					param_write(fid,sbeg,'output',' ','\n',dm.params)
 
 		elif dm.method == 'nond_global_reliability':
 			if (dm.params.x_gaussian_process + dm.params.u_gaussian_process != 1):
-		        	raise RuntimeError('#s'' method must have one and only one algorithm.',
-		                	dm.method)
-		        
-		        param_write(fid,sbeg,'x_gaussian_process','','\n',dm.params)
-		        param_write(fid,sbeg,'u_gaussian_process','','\n',dm.params)
-		        param_write(fid,sbeg,'all_variables','','\n',dm.params)
-		        param_write(fid,sbeg,'seed',' = ','\n',dm.params)
+				raise RuntimeError('#s'' method must have one and only one algorithm.',
+													 dm.method)
+
+			param_write(fid,sbeg,'x_gaussian_process','','\n',dm.params)
+			param_write(fid,sbeg,'u_gaussian_process','','\n',dm.params)
+			param_write(fid,sbeg,'all_variables','','\n',dm.params)
+			param_write(fid,sbeg,'seed',' = ','\n',dm.params)
 
 		elif dm.method == 'nond_polynomial_chaos':
-		        param_write(fid,sbeg,'expansion_order','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'expansion_terms','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'quadrature_order','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'sparse_grid_level','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'expansion_samples','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'incremental_lhs','','\n',dm.params)
-		        param_write(fid,sbeg,'collocation_points','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'collocation_ratio','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'reuse_samples','','\n',dm.params)
-		        param_write(fid,sbeg,'expansion_import_file',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'seed','                  = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
-		        param_write(fid,sbeg,'samples','               = ','\n',dm.params)
-		        param_write(fid,sbeg,'sample_type','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'all_variables','','\n',dm.params)
+			param_write(fid,sbeg,'expansion_order','       = ','\n',dm.params)
+			param_write(fid,sbeg,'expansion_terms','       = ','\n',dm.params)
+			param_write(fid,sbeg,'quadrature_order','      = ','\n',dm.params)
+			param_write(fid,sbeg,'sparse_grid_level','     = ','\n',dm.params)
+			param_write(fid,sbeg,'expansion_samples','     = ','\n',dm.params)
+			param_write(fid,sbeg,'incremental_lhs','','\n',dm.params)
+			param_write(fid,sbeg,'collocation_points','    = ','\n',dm.params)
+			param_write(fid,sbeg,'collocation_ratio','     = ','\n',dm.params)
+			param_write(fid,sbeg,'reuse_samples','','\n',dm.params)
+			param_write(fid,sbeg,'expansion_import_file',' = ','\n',dm.params)
+			param_write(fid,sbeg,'seed','                  = ','\n',dm.params)
+			param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
+			param_write(fid,sbeg,'samples','               = ','\n',dm.params)
+			param_write(fid,sbeg,'sample_type','           = ','\n',dm.params)
+			param_write(fid,sbeg,'all_variables','','\n',dm.params)
 
 		elif dm.method == 'nond_stoch_collocation':
-		        param_write(fid,sbeg,'quadrature_order','  = ','\n',dm.params)
-		        param_write(fid,sbeg,'sparse_grid_level',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'seed','              = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
-		        param_write(fid,sbeg,'samples','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'sample_type','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'all_variables','','\n',dm.params)
+			param_write(fid,sbeg,'quadrature_order','  = ','\n',dm.params)
+			param_write(fid,sbeg,'sparse_grid_level',' = ','\n',dm.params)
+			param_write(fid,sbeg,'seed','              = ','\n',dm.params)
+			param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
+			param_write(fid,sbeg,'samples','           = ','\n',dm.params)
+			param_write(fid,sbeg,'sample_type','       = ','\n',dm.params)
+			param_write(fid,sbeg,'all_variables','','\n',dm.params)
 
 		elif dm.method == 'nond_evidence':
-		        param_write(fid,sbeg,'seed','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'samples',' = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
+			param_write(fid,sbeg,'seed','    = ','\n',dm.params)
+			param_write(fid,sbeg,'samples',' = ','\n',dm.params)
+
+		else:
+			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
+
 
 	elif dm.type == 'dace':
@@ -436,49 +412,48 @@
 		if dm.method == 'dace':
 			if (dm.params.grid + dm.params.random + dm.params.oas + dm.params.lhs + dm.params.oa_lhs + dm.params.box_behnken + dm.params.central_composite != 1):
-		        	raise RuntimeError('#s'' method must have one and only one algorithm.',
-		                	dm.method)
-		        
-		        param_write(fid,sbeg,'grid','','\n',dm.params)
-		        param_write(fid,sbeg,'random','','\n',dm.params)
-		        param_write(fid,sbeg,'oas','','\n',dm.params)
-		        param_write(fid,sbeg,'lhs','','\n',dm.params)
-		        param_write(fid,sbeg,'oa_lhs','','\n',dm.params)
-		        param_write(fid,sbeg,'box_behnken','','\n',dm.params)
-		        param_write(fid,sbeg,'central_composite','','\n',dm.params)
-		        param_write(fid,sbeg,'seed','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
-		        param_write(fid,sbeg,'samples',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'symbols',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'quality_metrics','','\n',dm.params)
-		        param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
+				raise RuntimeError('#s'' method must have one and only one algorithm.',
+													 dm.method)
+
+			param_write(fid,sbeg,'grid','','\n',dm.params)
+			param_write(fid,sbeg,'random','','\n',dm.params)
+			param_write(fid,sbeg,'oas','','\n',dm.params)
+			param_write(fid,sbeg,'lhs','','\n',dm.params)
+			param_write(fid,sbeg,'oa_lhs','','\n',dm.params)
+			param_write(fid,sbeg,'box_behnken','','\n',dm.params)
+			param_write(fid,sbeg,'central_composite','','\n',dm.params)
+			param_write(fid,sbeg,'seed','    = ','\n',dm.params)
+			param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
+			param_write(fid,sbeg,'samples',' = ','\n',dm.params)
+			param_write(fid,sbeg,'symbols',' = ','\n',dm.params)
+			param_write(fid,sbeg,'quality_metrics','','\n',dm.params)
+			param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
 
 		elif dm.method == 'fsu_quasi_mc':
-		        if (dm.params.halton + dm.params.hammersley != 1):
-		        	raise RuntimeError('#s'' method must have one and only one sequence type.',dm.method)
-		        
-		        param_write(fid,sbeg,'halton','','\n',dm.params)
-		        param_write(fid,sbeg,'hammersley','','\n',dm.params)
-		        param_write(fid,sbeg,'samples','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'sequence_start',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'sequence_leap','  = ','\n',dm.params)
-		        param_write(fid,sbeg,'prime_base','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_sequence','','\n',dm.params)
-		        param_write(fid,sbeg,'latinize','','\n',dm.params)
-		        param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
-		        param_write(fid,sbeg,'quality_metrics','','\n',dm.params)
+			if (dm.params.halton + dm.params.hammersley != 1):
+				raise RuntimeError('#s'' method must have one and only one sequence type.',dm.method)
+
+			param_write(fid,sbeg,'halton','','\n',dm.params)
+			param_write(fid,sbeg,'hammersley','','\n',dm.params)
+			param_write(fid,sbeg,'samples','        = ','\n',dm.params)
+			param_write(fid,sbeg,'sequence_start',' = ','\n',dm.params)
+			param_write(fid,sbeg,'sequence_leap','  = ','\n',dm.params)
+			param_write(fid,sbeg,'prime_base','     = ','\n',dm.params)
+			param_write(fid,sbeg,'fixed_sequence','','\n',dm.params)
+			param_write(fid,sbeg,'latinize','','\n',dm.params)
+			param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
+			param_write(fid,sbeg,'quality_metrics','','\n',dm.params)
 
 		elif dm.method == 'fsu_cvt':
-		        param_write(fid,sbeg,'seed','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
-		        param_write(fid,sbeg,'samples','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'num_trials',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'trial_type',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'latinize','','\n',dm.params)
-		        param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
-		        param_write(fid,sbeg,'quality_metrics','','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
+			param_write(fid,sbeg,'seed','       = ','\n',dm.params)
+			param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
+			param_write(fid,sbeg,'samples','    = ','\n',dm.params)
+			param_write(fid,sbeg,'num_trials',' = ','\n',dm.params)
+			param_write(fid,sbeg,'trial_type',' = ','\n',dm.params)
+			param_write(fid,sbeg,'latinize','','\n',dm.params)
+			param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
+			param_write(fid,sbeg,'quality_metrics','','\n',dm.params)
+
+		else:
+			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
 
 	elif dm.type == 'param':
@@ -486,44 +461,44 @@
 		#switch dm.method
 		if dm.method == 'vector_parameter_study':
-		        if not np.logical_xor(isempty(dm.params.final_point),isempty(dm.params.step_vector)):
-		        	raise RuntimeError(str(dm.method)+' method must have one and only one specification.')
-		        
-		        if not isempty(dm.params.final_point):
-		        	param_write(fid,sbeg,'final_point',' = ','\n',dm.params)
-		        	param_write(fid,sbeg,'step_length',' = ','\n',dm.params)
-			        param_write(fid,sbeg,'num_steps','   = ','\n',dm.params)
-		        elif not isempty(dm.params.step_vector):
-		        	param_write(fid,sbeg,'step_vector',' = ','\n',dm.params)
-		        	param_write(fid,sbeg,'num_steps','   = ','\n',dm.params)
-		        
+			if not np.logical_xor(isempty(dm.params.final_point),isempty(dm.params.step_vector)):
+				raise RuntimeError(str(dm.method)+' method must have one and only one specification.')
+
+			if not isempty(dm.params.final_point):
+				param_write(fid,sbeg,'final_point',' = ','\n',dm.params)
+				param_write(fid,sbeg,'step_length',' = ','\n',dm.params)
+				param_write(fid,sbeg,'num_steps','   = ','\n',dm.params)
+
+			elif not isempty(dm.params.step_vector):
+				param_write(fid,sbeg,'step_vector',' = ','\n',dm.params)
+				param_write(fid,sbeg,'num_steps','   = ','\n',dm.params)
 
 		elif dm.method == 'list_parameter_study':
-		        param_write(fid,sbeg,'list_of_points',' = ','\n',dm.params)
+			param_write(fid,sbeg,'list_of_points',' = ','\n',dm.params)
 
 		elif dm.method == 'centered_parameter_study':
-		        param_write(fid,sbeg,'percent_delta','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'deltas_per_variable',' = ','\n',dm.params)
+			param_write(fid,sbeg,'percent_delta','       = ','\n',dm.params)
+			param_write(fid,sbeg,'deltas_per_variable',' = ','\n',dm.params)
 
 		elif dm.method == 'multidim_parameter_study':
-		        param_write(fid,sbeg,'partitions',' = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
+			param_write(fid,sbeg,'partitions',' = ','\n',dm.params)
+
+		else:
+			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
+
 
 	elif dm.type == 'bayes':
 		#switch dm.method
 		if dm.method == 'bayes_calibration':
-		# if (dm.params.queso + 
-		#    dm.params.dream + 
+		# if (dm.params.queso +
+		#    dm.params.dream +
 		#	 dm.params.gpmsa ~= 1)
 		#    raise RuntimeError('''#s'' method must have one and only one bayes type. YOU SUCK',
 		#       dm.method)
-		# 
+		#
 			param_write(fid,sbeg,'queso','','\n',dm.params)
-		        param_write(fid,sbeg,'dream','','\n',dm.params)
-		        param_write(fid,sbeg,'gpmsa','','\n',dm.params)
-		        param_write(fid,sbeg,'samples','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'seed','      = ','\n',dm.params)
+			param_write(fid,sbeg,'dream','','\n',dm.params)
+			param_write(fid,sbeg,'gpmsa','','\n',dm.params)
+			param_write(fid,sbeg,'samples','        = ','\n',dm.params)
+			param_write(fid,sbeg,'seed','      = ','\n',dm.params)
 			param_write(fid,sbeg,'output','    =','\n',dm.params)
 			param_write(fid,sbeg,'metropolis_hastings','','\n',dm.params)
@@ -531,17 +506,12 @@
 			param_write(fid,sbeg,'diagonal','','\n',dm.params)
 			param_write(fid,sbeg,'values','     = ','\n',dm.params)
-		
+
 	else:
 		raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
 
-
 ##  function to write a structure of parameters
-
 def param_struc_write(fidi,sbeg,smid,s,params):
-
 	#  loop through each parameter field in the structure
-
 	fnames=fieldnames(params)
-
 	for i in range(np.size(fnames)):
 		param_write(fidi,sbeg,fnames[i],smid,s,params)
@@ -550,9 +520,6 @@
 
 ##  function to write a parameter
-
 def param_write(fidi,sbeg,pname,smid,s,params):
-
 	#  check for errors
-
 	if not isfield(params,pname):
 		warning('param_write:param_not_found',
@@ -562,26 +529,25 @@
 		return
 	elif isempty(vars(params)[pname]):
-		print 'Warning: param_write:param_empty: Parameter '+pname+' requires input of type '+type(vars(params)[pname])+'.'
+		print('Warning: param_write:param_empty: Parameter {} requires input of type {}.'.format(pname,type(vars(params)[pname])))
 		return
 
-
 	#  construct the parameter string based on type
-
 	if type(vars(params)[pname]) == bool:
 		fidi.write(sbeg+str(pname)+s)
+
 	elif type(vars(params)[pname]) in [int,float]:
 		fidi.write(sbeg+str(pname)+smid+str(vars(params)[pname])+s)
+
 	elif type(vars(params)[pname]) == list:
 		fidi.write(sbeg+str(pname)+smid+str(vars(params)[pname][0]))
 		for i in range(1,np.size(vars(params)[pname])):
 			fidi.write(' '+str(vars(params)[pname][i]))
-    
+
 		fidi.write(s)
+
 	elif type(vars(params)[pname]) == str:
 		fidi.write(sbeg+str(pname)+smid+str(vars(params)[pname])+s)
+
 	else:
-		print 'Warning: param_write:param_unrecog: Parameter '+pname+' is of unrecognized type '+type(vars(params)[pname])+'.'
+		print('Warning: param_write:param_unrecog: Parameter {} is of unrecognized type {}.'.format(pname,type(vars(params)[pname])))
 		return
-
-
-
Index: /issm/trunk-jpl/src/m/classes/qmu/calibration_function.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/calibration_function.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/calibration_function.py	(revision 23716)
@@ -42,5 +42,5 @@
 				asizec = array_size(*args[0:min(nargin,4)])
 				cf = [calibration_function() for i in range(asizec[0]) for j in range(asizec[1])]
-								
+
 			for i in range(np.size(cf)):
 				if (np.size(args[0]) > 1):
@@ -59,5 +59,5 @@
 					cf[i].weight = args[3]
 			if nargin > 4:
-				print 'WARNING: calibration_function:extra_arg: Extra arguments for object of class '+str(type(cf))+'.'		
+				print('WARNING: calibration_function:extra_arg: Extra arguments for object of class '+str(type(cf))+'.')
 
 		return cf
@@ -71,11 +71,9 @@
 		string += '         scale: '+str(self.scale) + '\n'
 		string += '        weight: '+str(self.weight) + '\n'
-
 		return string
 
 	# from here on, cf is either a single, or a 1d vector of, calibration_function
-
-    	@staticmethod
-        def prop_desc(cf,dstr):
+	@staticmethod
+	def prop_desc(cf,dstr):
 		if type(cf) not in [list,np.ndarray]:
 			if cf.descriptor != '' or type(cf.descriptor) != str:
@@ -95,41 +93,40 @@
 			else:
 				desc[i] = 'cf'+str(string_dim(cf,i,'vector'))
-                
+
 		desc = allempty(desc)
-
 		return desc
 
-    	@staticmethod	
+	@staticmethod
 	def prop_stype(cf):
 		stype=''
 		return stype
 
-    	@staticmethod
+	@staticmethod
 	def prop_weight(cf):
 		weight=[]
 		return weight
 
-    	@staticmethod
+	@staticmethod
 	def prop_lower(cf):
 		lower=[]
 		return lower
 
-    	@staticmethod
+	@staticmethod
 	def prop_upper(cf):
 		upper=[]
 		return upper
 
-    	@staticmethod
+	@staticmethod
 	def prop_target(cf):
 		target=[]
 		return target
 
-    	@staticmethod
+	@staticmethod
 	def prop_scale(cf):
 		scale=[]
 		return scale
 
-    	@staticmethod
-        def dakota_write(fidi,dresp,rdesc):
+	@staticmethod
+	def dakota_write(fidi,dresp,rdesc):
 		# collect only the responses of the appropriate class
 		cf = [struc_class(i,'calibration_function','cf') for i in dresp]
@@ -139,5 +136,5 @@
 		return rdesc
 
-    	@staticmethod
+	@staticmethod
 	def dakota_rlev_write(fidi,dresp,params):
 		return
Index: /issm/trunk-jpl/src/m/classes/qmu/continuous_design.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/continuous_design.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/continuous_design.py	(revision 23716)
@@ -96,5 +96,5 @@
 
 			if (nargin > 6):
-				print 'WARNING: continuous_design:extra_arg: Extra arguments for object of class '+str(type(cdv))+'.'
+				print('WARNING: continuous_design:extra_arg: Extra arguments for object of class '+str(type(cdv))+'.')
 
 		return cdv
Index: /issm/trunk-jpl/src/m/classes/qmu/continuous_state.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/continuous_state.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/continuous_state.py	(revision 23716)
@@ -76,5 +76,5 @@
 
 			if (nargin > 4):
-				print 'continuous_state:extra_arg','Extra arguments for object of class '+str(type(csv))+'.'
+				print('continuous_state:extra_arg','Extra arguments for object of class '+str(type(csv))+'.')
 
 		return csv
Index: /issm/trunk-jpl/src/m/classes/qmu/least_squares_term.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/least_squares_term.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/least_squares_term.py	(revision 23716)
@@ -26,5 +26,5 @@
 		self.scale      =  1.
 		self.weight     =  1.
-    
+
 	@staticmethod
 	def least_squares_term(*args):
@@ -32,9 +32,9 @@
 
 		#create a default object
-               	if nargin == 0:
+		if nargin == 0:
 			return least_squares_term()
 
 		#copy the object or create the object from the input
-                else:
+		else:
 			if  (nargin == 1) and isinstance(args[0],least_squares_term):
 				lst = args[0]
@@ -42,12 +42,12 @@
 				asizec = np.shape(*args[0:min(nargin,4)])
 				lst = [least_squares_term() for i in range(asizec[0]) for j in range(asizec[1])]
-                        
+
 				for i in range(np.size(lst)):
 					if (np.size(args[0]) > 1):
-						lst[i].descriptor         = args[0][i]
+						lst[i].descriptor = args[0][i]
 					else:
-						lst[i].descriptor         = str(args[0])+string_dim(lst,i,'vector')
+						lst[i].descriptor = str(args[0])+string_dim(lst,i,'vector')
 
-				if (nargin >= 2):                            
+				if (nargin >= 2):
 					for i in range(np.size(lst)):
 						if (np.size(args[1]) > 1):
@@ -59,17 +59,17 @@
 					for i in range(np.size(lst)):
 						if (np.size(args[2]) > 1):
-							lst[i].scale      = args[2][i]
+							lst[i].scale = args[2][i]
 						else:
-							lst[i].scale      = args[2]
+							lst[i].scale = args[2]
 
 				if (nargin >= 4):
 					for i in range(np.size(lst)):
 						if (np.size(args[3]) > 1):
-							lst[i].weight     = args[3][i]
+							lst[i].weight = args[3][i]
 						else:
-							lst[i].weight     = args[3]
-           
+							lst[i].weight = args[3]
+
 				if (nargin > 4):
-					print 'WARNING: least_squares_term:extra_arg Extra arguments for object of class '+str(type(lst))+'.'
+					print('WARNING: least_squares_term:extra_arg Extra arguments for object of class '+str(type(lst))+'.')
 
 		return lst
@@ -83,9 +83,8 @@
 		string += '         scale: '+str(self.scale) + '\n'
 		string += '        weight: '+str(self.weight) + '\n'
-
 		return string
 
 	@staticmethod
-        def prop_desc(lst,dstr):
+	def prop_desc(lst,dstr):
 		if type(lst) not in [list,np.ndarray]:
 			lst = [lst]
@@ -101,9 +100,8 @@
 
 		desc = allempty(desc)
-
 		return desc
 
 	@staticmethod
-        def prop_stype(lst):
+	def prop_stype(lst):
 		if type(lst) not in [list,np.ndarray]:
 			return str(lst.scale_type)
@@ -112,11 +110,10 @@
 		for i in range(np.size(lst)):
 			stype[i] = str(lst[i].scale_type)
-            
+
 		stype = allequal(stype,'none')
-
 		return stype
 
 	@staticmethod
-        def prop_scale(lst):
+	def prop_scale(lst):
 		if type(lst) not in [list,np.ndarray]:
 			return lst.scale
@@ -125,7 +122,6 @@
 		for i in range(np.size(lst)):
 			scale[i] = lst[i].scale
-            
+
 		scale = allequal(scale,1.)
-
 		return scale
 
@@ -138,21 +134,20 @@
 		for i in range(np.size(lst)):
 			weight[i] = lst[i].weight
-            
+
 		weight = allequal(weight,1.)
-
 		return weight
 
 	@staticmethod
-        def prop_lower(lst):
+	def prop_lower(lst):
 		lower=[]
 		return lower
 
 	@staticmethod
-        def prop_upper(lst):
+	def prop_upper(lst):
 		upper=[]
 		return upper
 
 	@staticmethod
-        def prop_target(lst):
+	def prop_target(lst):
 		target=[]
 		return target
@@ -166,6 +161,6 @@
 		rdesc = rlist_write(fidi,'least_squares_terms','least_squares_term',lst,rdesc)
 		return rdesc
-        
+
 	@staticmethod
-        def dakota_rlev_write(fidi,dresp,params):
-        	return
+	def dakota_rlev_write(fidi,dresp,params):
+		return
Index: /issm/trunk-jpl/src/m/classes/qmu/linear_equality_constraint.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/linear_equality_constraint.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/linear_equality_constraint.py	(revision 23716)
@@ -81,5 +81,5 @@
 
 			if (nargin > 4):
-				print 'WARNING: linear_equality_constraint:extra_arg: Extra arguments for object of class '+str(type(lec))+'.'
+				print('WARNING: linear_equality_constraint:extra_arg: Extra arguments for object of class '+str(type(lec))+'.')
 
 		return lec
Index: /issm/trunk-jpl/src/m/classes/qmu/linear_inequality_constraint.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/linear_inequality_constraint.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/linear_inequality_constraint.py	(revision 23716)
@@ -94,5 +94,5 @@
 
 			if (nargin > 5):
-				print 'WARNING: linear_inequality_constraint:extra_arg: Extra arguments for object of class '+str(type(lic))+'.'
+				print('WARNING: linear_inequality_constraint:extra_arg: Extra arguments for object of class '+str(type(lic))+'.')
 
 		return lic
Index: /issm/trunk-jpl/src/m/classes/qmu/nonlinear_equality_constraint.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/nonlinear_equality_constraint.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/nonlinear_equality_constraint.py	(revision 23716)
@@ -72,5 +72,5 @@
 
 			if (nargin > 4):
-				print 'WARNING: nonlinear_equality_constraint:extra_arg: Extra arguments for object of class '+str(type(nec))+'.'
+				print('WARNING: nonlinear_equality_constraint:extra_arg: Extra arguments for object of class '+str(type(nec))+'.')
 
 		return nec
Index: /issm/trunk-jpl/src/m/classes/qmu/nonlinear_inequality_constraint.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/nonlinear_inequality_constraint.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/nonlinear_inequality_constraint.py	(revision 23716)
@@ -83,5 +83,5 @@
                                 
 			if (nargin > 5):
-				print 'WARNING: nonlinear_inequality_constraint:extra_arg: Extra arguments for object of class '+str(type(nic))+'.'
+				print('WARNING: nonlinear_inequality_constraint:extra_arg: Extra arguments for object of class '+str(type(nic))+'.')
 
 		return nic
Index: /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/normal_uncertain.py	(revision 23716)
@@ -1,4 +1,4 @@
 import numpy as np
-from vlist_write import *
+#from vlist_write import *
 from MatlabArray import *
 
@@ -29,5 +29,5 @@
 		self.upper      = np.Inf
 
-	@staticmethod    
+	@staticmethod
 	def normal_uncertain(*args):
 		nargin = len(args)
@@ -38,5 +38,5 @@
 
 		# copy the object
-                elif nargin == 1:
+		elif nargin == 1:
 			if isinstance(args[0],normal_uncertain):
 				nuv = args[0]
@@ -45,14 +45,13 @@
 
 		# not enough arguments
-                elif nargin == 2:
-                    raise RuntimeError('Construction of "normal_uncertain" class object requires at least 3 inputs.')
+		elif nargin == 2:
+			raise RuntimeError('Construction of "normal_uncertain" class object requires at least 3 inputs.')
 
 		# create the object from the input
-                else:
+		else:
 			# lines differ here in other classes/tests; see asizec problem in notes
 			nuv=normal_uncertain()
-
 			nuv.descriptor = str(args[0])
-			nuv.mean   = args[1]     
+			nuv.mean   = args[1]
 			nuv.stddev = args[2]
 			if nargin >= 4:
@@ -61,5 +60,5 @@
 				nuv.upper = args[4]
 			if nargin > 5:
-				print 'WARNING: normal_uncertain:extra_arg: Extra arguments for object of class '+str(type(nuv))+'.'
+				print('WARNING: normal_uncertain:extra_arg: Extra arguments for object of class '+str(type(nuv))+'.')
 
 		return [nuv]
@@ -98,15 +97,15 @@
 			else:
 				desc[i] = 'nuv'+str(string_dim(nuv,i,'vector'))
-                
+
 		desc = allempty(desc)
 
 		return desc
 
-	@staticmethod        
+	@staticmethod
 	def prop_initpt(nuv):
 		initpt=[]
 		return initpt
 
-	@staticmethod        
+	@staticmethod
 	def prop_lower(nuv):
 		if type(nuv) not in [list,np.ndarray]:
@@ -121,5 +120,5 @@
 		return lower
 
-	@staticmethod        
+	@staticmethod
 	def prop_upper(nuv):
 		if type(nuv) not in [list,np.ndarray]:
@@ -131,8 +130,7 @@
 
 		upper = allequal(upper,-np.inf)
-
 		return upper
 
-	@staticmethod        
+	@staticmethod
 	def prop_mean(nuv):
 		if type(nuv) not in [list,np.ndarray]:
@@ -145,5 +143,5 @@
 		return mean
 
-	@staticmethod        
+	@staticmethod
 	def prop_stddev(nuv):
 		if type(nuv) not in [list,np.ndarray]:
@@ -154,5 +152,5 @@
 			stddev[i] = nuv[i].stddev
 
-		return stddev        
+		return stddev
 
 	@staticmethod
@@ -161,13 +159,13 @@
 		return initst
 
-	@staticmethod        
+	@staticmethod
 	def prop_stype(nuv):
 		stype=[]
 		return stype
 
-	@staticmethod        
+	@staticmethod
 	def prop_scale(nuv):
 		scale=[]
-        	return scale
+		return scale
 
 	@staticmethod
@@ -176,6 +174,6 @@
 		nuv = [struc_class(i,'normal_uncertain','nuv') for i in dvar]
 
-		# possible namespace pollution, the above import seems not to work		
-		from vlist_write import *
+		# possible namespace pollution, the above import seems not to work
+		from vlist_write import vlist_write
 		# write variables
 		vlist_write(fidi,'normal_uncertain','nuv',nuv)
Index: /issm/trunk-jpl/src/m/classes/qmu/objective_function.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/objective_function.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/objective_function.py	(revision 23716)
@@ -36,5 +36,5 @@
 
 		#  copy the object or create the object from the input
-                else:
+		else:
 			if  (nargin == 1) and isinstance(args[0],objective_function):
 				of = args[0]
@@ -43,11 +43,11 @@
 				of = [objective_function() for i in range(shapec[0]) for j in range(shapec[1])]
 
-		          	for i in range(np.size(of)):
+				for i in range(np.size(of)):
 					if (np.size(args[0]) > 1):
-						of[i].descriptor         = args[0][i]
+						of[i].descriptor = args[0][i]
 					else:
-						of[i].descriptor         = str(args[0])+string_dim(of,i,'vector')
+						of[i].descriptor = str(args[0])+string_dim(of,i,'vector')
 
-				if (nargin >= 2):                            
+				if (nargin >= 2):
 					for i in range(np.size(of)):
 						if (np.size(args[1]) > 1):
@@ -59,17 +59,17 @@
 					for i in range(np.size(of)):
 						if (np.size(args[2]) > 1):
-							of[i].scale      = args[2][i]
+							of[i].scale = args[2][i]
 						else:
-							of[i].scale      = args[2]
+							of[i].scale = args[2]
 
 				if (nargin >= 4):
 					for i in range(np.size(of)):
 						if (np.size(args[3]) > 1):
-							of[i].weight     = args[3][i]
+							of[i].weight = args[3][i]
 						else:
-							of[i].weight     = args[3]
+							of[i].weight = args[3]
 
 				if (nargin > 4):
-					print 'WARNING: objective_function:extra_arg Extra arguments for object of class '+str(type(of))+'.'
+					print('WARNING: objective_function:extra_arg Extra arguments for object of class '+str(type(of))+'.')
 
 		return of
@@ -84,5 +84,4 @@
 		string += '         scale: '  +str(self.scale) + '\n'
 		string += '        weight: '  +str(self.weight) + '\n'
-	
 		return string
 
@@ -106,7 +105,6 @@
 			else:
 				desc[i] = 'of'+str(string_dim(of,i,'vector'))
-                
+
 		desc = allempty(desc)
-
 		return desc
 
@@ -134,7 +132,6 @@
 		for i in range(np.size(of)):
 			weight[i] = of[i].weight
-		
+
 		weight = allequal(weight,1.)
-
 		return weight
 
@@ -147,7 +144,6 @@
 		for i in range(np.size(of)):
 			stype[i] = str(of[i].scale_type)
-		
+
 		stype = allequal(stype,'none')
-
 		return stype
 
@@ -160,9 +156,8 @@
 		for i in range(np.size(of)):
 			scale[i] = of[i].scale
-		
+
 		scale = allequal(scale,1.)
+		return scale
 
-		return scale
-    
 	@staticmethod
 	def dakota_write(fidi,dresp,rdesc):
Index: /issm/trunk-jpl/src/m/classes/qmu/response_function.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/response_function.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/response_function.py	(revision 23716)
@@ -1,4 +1,4 @@
 import numpy as np
-from rlist_write import *
+#from rlist_write import *
 from rlev_write import *
 from MatlabArray import *
@@ -35,5 +35,5 @@
 
 	@staticmethod
-        def response_function(*args):
+	def response_function(*args):
 
 		nargin = len(args)
@@ -49,5 +49,5 @@
 				asizec = array_size(*args[0:min(nargin,1)])
 				rf = [response_function() for i in range(asizec[0]) for j in range(asizec[1])]
-                        
+
 				for i in range(np.size(rf)):
 					if (np.size(args[0]) > 1):
@@ -73,9 +73,8 @@
 
 				if nargin > 5:
-					print 'WARNING: response_function:extra_arg: Extra arguments for object of class '+str(type(rf))+'.'
+					print('WARNING: response_function:extra_arg: Extra arguments for object of class '+str(type(rf))+'.')
 
 		return rf
 
-           
 	def __repr__(self):
 		#  display the object
@@ -109,7 +108,6 @@
 			else:
 				desc[i] = 'rf'+str(string_dim(rf,i,'vector'))
-                
+
 		desc = allempty(desc)
-
 		return desc
 
@@ -118,30 +116,30 @@
 		stype=[]
 		return stype
-        
+
 	@staticmethod
 	def prop_scale(rf):
 		scale=[]
 		return scale
-        
+
 	@staticmethod
 	def prop_weight(rf):
 		weight=[]
 		return weight
-        
+
 	@staticmethod
 	def prop_lower(rf):
 		lower=[]
 		return lower
-        
+
 	@staticmethod
 	def prop_upper(rf):
 		upper=[]
 		return upper
-        
+
 	@staticmethod
 	def prop_target(rf):
 		target=[]
 		return target
-        
+
 	@staticmethod
 	def prop_levels(rf):
@@ -151,23 +149,19 @@
 
 		respl = empty_nd_list(np.size(rf))
-
 		probl = empty_nd_list(np.size(rf))
-
 		rell = empty_nd_list(np.size(rf))
-
 		grell = empty_nd_list(np.size(rf))
 
 		for i in range(np.size(rf)):
 			respl[i] = rf[i].respl
-                	probl[i] = rf[i].probl
+			probl[i] = rf[i].probl
 			rell [i] = rf[i].rell
-                	grell[i] = rf[i].grell
-            
+			grell[i] = rf[i].grell
+
 		respl = allempty(respl)
 		probl = allempty(probl)
 		rell  = allempty(rell)
 		grell = allempty(grell)
-        
-    		return [respl,probl,rell,grell]
+		return [respl,probl,rell,grell]
 
 	@staticmethod
Index: /issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.py	(revision 23716)
@@ -1,4 +1,4 @@
 import numpy as np
-from vlist_write import *
+#from vlist_write import *
 from MatlabArray import *
 
@@ -41,5 +41,4 @@
 
 		# not enough arguments
-
 		elif nargin == 2:
 			raise RuntimeError('Construction of "uniform_uncertain" class object requires at least 3 inputs.')
@@ -50,17 +49,14 @@
 			#asizec=array_size(*args[0:min(nargin,3)])
 			#uuv = [uniform_uncertain() for i in range(asizec[0]) for j in range(asizec[1])]
-
-                    	uuv = uniform_uncertain()
-
+			uuv = uniform_uncertain()
 			uuv.descriptor = str(args[0])
 			uuv.lower      = args[1]
 			uuv.upper      = args[2]
 		if (nargin > 3):
-			print 'WARNING: uniform_uncertain:extra_arg: Extra arguments for object of class '+type(uuv)+'.'
+			print('WARNING: uniform_uncertain:extra_arg: Extra arguments for object of class '+type(uuv)+'.')
 
 		return [uuv]
 
-
-        def __repr__(self):
+	def __repr__(self):
 		# display an individual object
 		string = '\n'
@@ -93,14 +89,14 @@
 			else:
 				desc[i] = 'uuv'+str(string_dim(uuv,i,'vector'))
-                
+
 			desc = allempty(desc)
 
 		return desc
-        
+
 	@staticmethod
 	def prop_initpt(uuv):
 		initpt=[]
 		return initpt
-        
+
 	@staticmethod
 	def prop_lower(uuv):
@@ -111,9 +107,9 @@
 		for i in range(np.size(uuv)):
 			lower[i] = uuv[i].lower
-            
+
 		lower = allequal(lower,-np.Inf)
 
 		return lower
-        
+
 	@staticmethod
 	def prop_upper(uuv):
@@ -124,41 +120,40 @@
 		for i in range(np.size(uuv)):
 			upper[i] = uuv[i].upper
-            
+
 		upper = allequal(upper, np.Inf)
 
 		return upper
-        
+
 	@staticmethod
 	def prop_mean(uuv):
 		mean=[]
 		return mean
-        
+
 	@staticmethod
 	def prop_stddev(uuv):
 		stddev=[]
 		return stddev
-        
+
 	@staticmethod
 	def prop_initst(uuv):
 		initst=[]
 		return initst
-        
+
 	@staticmethod
 	def prop_stype(uuv):
 		stype=[]
 		return stype
-       	
+
 	@staticmethod
 	def prop_scale(uuv):
 		scale=[]
 		return scale
-        
+
 	@staticmethod
 	def dakota_write(fidi,dvar):
 		# collect only the variables of the appropriate class
 		uuv = [struc_class(i,'uniform_uncertain','uuv') for i in dvar]
-		
-		# possible namespace pollution, the above import seems not to work		
-		from vlist_write import *
+		# possible namespace pollution, the above import seems not to work
+		from vlist_write import vlist_write
 		# write variables
 		vlist_write(fidi,'uniform_uncertain','uuv',uuv)
Index: /issm/trunk-jpl/src/m/classes/regionaloutput.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/regionaloutput.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/regionaloutput.py	(revision 23716)
@@ -75,8 +75,8 @@
 	def checkconsistency(self,md,solution,analyses):    # {{{
 		
-		if  not isinstance(self.name, basestring):
+		if  not isinstance(self.name, str):
 			raise RuntimeError("regionaloutput error message: 'name' field should be a string!")
 			
-		if  not isinstance(self.outputnamestring, basestring):
+		if  not isinstance(self.outputnamestring, str):
 			raise RuntimeError("regionaloutput error message: 'outputnamestring' field should be a string!") 
 		
Index: /issm/trunk-jpl/src/m/classes/results.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/results.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/results.py	(revision 23716)
@@ -25,5 +25,5 @@
 			s+="%s\n" % fielddisplay(self,'SolutionType',"solution type")
 
-		for name in self.__dict__.iterkeys():
+		for name in list(self.__dict__.keys()):
 			if name not in ['step','time','SolutionType','errlog','outlog']:
 				if   isinstance(getattr(self,name),list):
Index: /issm/trunk-jpl/src/m/classes/rifts.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/rifts.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/rifts.py	(revision 23716)
@@ -47,5 +47,5 @@
 				md.checkmessage("model should be processed for rifts (run meshprocessrifts)!")
 			for i,rift in enumerate(self.riftstruct):
-				md = checkfield(md,'fieldname',"rifts.riftstruct[%d]['fill']" % i,'values',['Water','Air','Ice','Melange',0,1,2,3])
+				md = checkfield(md,'fieldname',"rifts.riftstruct[{}]['fill']".format(i),'values',['Water','Air','Ice','Melange',0,1,2,3])
 		else:
 			if self.riftstruct and np.any(np.logical_not(isnans(self.riftstruct))):
Index: /issm/trunk-jpl/src/m/classes/slr.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/slr.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/slr.py	(revision 23716)
@@ -9,13 +9,12 @@
 	"""
 	SLR class definition
-	
+
 		Usage:
 		  slr=slr()
 	"""
-	
 	def __init__(self): # {{{
 		self.deltathickness         = float('NaN')
 		self.sealevel               = float('NaN')
-		self.spcthickness	    = float('NaN')
+		self.spcthickness						= float('NaN')
 		self.maxiter                = 0
 		self.reltol                 = 0
@@ -26,7 +25,7 @@
 		self.tide_love_k            = 0 #ideam
 		self.tide_love_h            = 0 #ideam
-		self.fluid_love             = 0 
-		self.equatorial_moi         = 0 
-		self.polar_moi	            = 0 
+		self.fluid_love             = 0
+		self.equatorial_moi         = 0
+		self.polar_moi	            = 0
 		self.angular_velocity       = 0
 		self.rigid                  = 0
@@ -44,11 +43,12 @@
 		self.requested_outputs      = []
 		self.transitions            = []
-		
+
 		#set defaults
 		self.setdefaultparameters()
 		#}}}
+
 	def __repr__(self): # {{{
 			string='   slr parameters:'
-                        string="%s\n%s"%(string,fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]'))
+			string="%s\n%s"%(string,fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]'))
 			string="%s\n%s"%(string,fielddisplay(self,'sealevel','current sea level (prior to computation) [m]'))
 			string="%s\n%s"%(string,fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint) [m]'))
@@ -64,8 +64,8 @@
 			string="%s\n%s"%(string,fielddisplay(self,'equatorial_moi','mean equatorial moment of inertia [kg m^2]'))
 			string="%s\n%s"%(string,fielddisplay(self,'polar_moi','polar moment of inertia [kg m^2]'))
-			string="%s\n%s"%(string,fielddisplay(self,'angular_velocity','mean rotational velocity of earth [per second]')) 
+			string="%s\n%s"%(string,fielddisplay(self,'angular_velocity','mean rotational velocity of earth [per second]'))
 			string="%s\n%s"%(string,fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'))
 			string="%s\n%s"%(string,fielddisplay(self,'steric_rate','rate of steric ocean expansion [mm/yr]'))
-			string="%s\n%s"%(string,fielddisplay(self,'Ngia','rate of viscous (GIA) geoid expansion (in mm/yr)')) 
+			string="%s\n%s"%(string,fielddisplay(self,'Ngia','rate of viscous (GIA) geoid expansion (in mm/yr)'))
 			string="%s\n%s"%(string,fielddisplay(self,'Ugia','rate of viscous (GIA) bedrock uplift (in mm/yr)'))
 			string="%s\n%s"%(string,fielddisplay(self,'loop_increment','vector assembly (in the convolution) framentation'))
@@ -81,57 +81,57 @@
 			return string
 		# }}}
+
 	def setdefaultparameters(self): # {{{
-		
 		#Convergence criterion: absolute, relative and residual
-		self.reltol=0.01 #default
-		self.abstol=float('NaN') #1 mm of sea level rise
+		self.reltol	=	0.01 #default
+		self.abstol	=	float('NaN') #1 mm of sea level rise
 
 		#maximum of non-linear iterations.
-		self.maxiter=5
-		self.loop_increment=200
-
-		#computational flags: 
-		self.geodetic=0
-		self.rigid=1
-		self.elastic=1
-		self.ocean_area_scaling=0
-		self.rotation=1
-
-		#tidal love numbers: 
-		self.tide_love_h=0.6149 #degree 2
-		self.tide_love_k=0.3055 #degree 2
-		
-      #secular fluid love number: 
-		self.fluid_love=0.942 
-		
-		#moment of inertia: 
-		self.equatorial_moi=8.0077*10**37 # [kg m^2] 
-		self.polar_moi	    =8.0345*10**37 # [kg m^2] 
-		
-		#mean rotational velocity of earth 
-		self.angular_velocity=7.2921*10**-5 # [s^-1] 
+		self.maxiter				=	5
+		self.loop_increment	=	200
+
+		#computational flags:
+		self.geodetic						=	0
+		self.rigid							=	1
+		self.elastic						=	1
+		self.ocean_area_scaling	=	0
+		self.rotation						=	1
+
+		#tidal love numbers:
+		self.tide_love_h = 0.6149 #degree 2
+		self.tide_love_k = 0.3055 #degree 2
+
+      #secular fluid love number:
+		self.fluid_love	=	0.942
+
+		#moment of inertia:
+		self.equatorial_moi	=	8.0077*10**37 # [kg m^2]
+		self.polar_moi	    =	8.0345*10**37 # [kg m^2]
+
+		#mean rotational velocity of earth
+		self.angular_velocity	=	7.2921*10**-5 # [s^-1]
 
 		#numerical discretization accuracy
-		self.degacc=.01
+		self.degacc	=	.01
 
 		#steric:
-		self.steric_rate=0
+		self.steric_rate = 0
 
 		#how many time steps we skip before we run SLR solver during transient
-		self.geodetic_run_frequency=1
-		
+		self.geodetic_run_frequency	=	1
+
 		#output default:
-		self.requested_outputs=['default']
-
-		#transitions should be a cell array of vectors: 
-		self.transitions=[]
+		self.requested_outputs = ['default']
+
+		#transitions should be a cell array of vectors:
+		self.transitions = []
 
 		#horizontal displacement?  (not by default)
-		self.horiz=0
+		self.horiz = 0
 
 		return self
 		#}}}
+
 	def checkconsistency(self,md,solution,analyses):    # {{{
-
 		#Early return
 		if (solution!='SealevelriseAnalysis'):
@@ -162,24 +162,26 @@
 		md = checkfield(md,'fieldname','slr.Ugia','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
 
-		#check that love numbers are provided at the same level of accuracy: 
+		#check that love numbers are provided at the same level of accuracy:
 		if (size(self.love_h,0) != size(self.love_k,0) | size(self.love_h,0) != size(self.love_l,0)):
 			error('slr error message: love numbers should be provided at the same level of accuracy')
 
-		#cross check that whereever we have an ice load, the mask is <0 on each vertex: 
+		#cross check that whereever we have an ice load, the mask is <0 on each vertex:
 		pos=np.where(self.deltathickness)
-		maskpos=md.mask.ice_levelset[md.mesh.elements[pos,:]] 
+		maskpos=md.mask.ice_levelset[md.mesh.elements[pos,:]]
 		els=np.where(maskpos>0)
 		if len(els[0])>0:
 			warnings.warn('slr checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!')
-		
-		#check that  if geodetic is requested, we are a mesh3dsurface model (planet), or if we are not, 
-		#a coupler to a planet model is provided. 
+
+		#check that  if geodetic is requested, we are a mesh3dsurface model (planet), or if we are not,
+		#a coupler to a planet model is provided.
 		if self.geodetic and not md.transient.iscoupler and domaintype(md.mesh)!='mesh3dsurface':
 			error('model is requesting geodetic computations without being a mesh3dsurface, or being coupled to one!')
 		return md
 	# }}}
+
 	def defaultoutputs(self,md): # {{{
 		return ['Sealevel']
 	# }}}
+
 	def marshall(self,prefix,md,fid): # {{{
 		WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2)
@@ -211,5 +213,5 @@
 		WriteData(fid,prefix,'object',self,'fieldname','horiz','format','Integer')
 		WriteData(fid,prefix,'object',self,'fieldname','geodetic','format','Integer')
-	
+
 		#process requested outputs
 		outputs = self.requested_outputs
Index: /issm/trunk-jpl/src/m/classes/stressbalance.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/stressbalance.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/stressbalance.py	(revision 23716)
@@ -142,5 +142,5 @@
 #		if ~any((~isnan(md.stressbalance.spcvx)+~isnan(md.stressbalance.spcvy))==2),
 		if not np.any(np.logical_and(np.logical_not(np.isnan(md.stressbalance.spcvx)),np.logical_not(np.isnan(md.stressbalance.spcvy)))):
-			print "\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n"
+			print("\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n")
 		#CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
 #		if any(sum(isnan(md.stressbalance.referential),2)~=0 & sum(isnan(md.stressbalance.referential),2)~=6),
Index: /issm/trunk-jpl/src/m/classes/timesteppingadaptive.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/timesteppingadaptive.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/timesteppingadaptive.py	(revision 23716)
@@ -20,5 +20,5 @@
 			self.interp_forcings = 1
 			self.coupling_time   = 0.
-			
+
 			#set defaults
 			self.setdefaultparameters()
@@ -26,14 +26,15 @@
 		elif len(args)==1 and args[0].__module__=='timestepping':
 			old=args[0]
-			#first call setdefaultparameters: 
+			#first call setdefaultparameters:
 			self.setdefaultparameters()
-			self.start_time      = old.start_time      
-			self.final_time      = old.final_time      
-			self.interp_forcings = old.interp_forcings 
-                        self.coupling_time   = old.coupling_time
+			self.start_time      = old.start_time
+			self.final_time      = old.final_time
+			self.interp_forcings = old.interp_forcings
+			self.coupling_time   = old.coupling_time
 
 		else:
 			raise Exception('constructor not supported')
-		#}}}
+	#}}}
+
 	def __repr__(self): # {{{
 		string="   timesteppingadaptive parameters:"
@@ -46,7 +47,8 @@
 		string="%s\n%s"%(string,fielddisplay(self,"coupling_time","coupling time steps with ocean model [yr]"))
 		return string
-		#}}}
+	# }}}
+
 	def setdefaultparameters(self): # {{{
-		
+
 		#time between 2 time steps
 		self.time_step_min=0.01
@@ -56,7 +58,7 @@
 		self.final_time=10.*self.time_step_max
 
-		#time adaptation? 
+		#time adaptation?
 		self.cfl_coefficient=0.5
-		
+
 		#should we interpolate forcings between timesteps?
 		self.interp_forcings=1
@@ -64,6 +66,6 @@
 		return self
 	#}}}
+
 	def checkconsistency(self,md,solution,analyses):    # {{{
-
 		md = checkfield(md,'fieldname','timestepping.start_time','numel',[1],'NaN',1,'Inf',1)
 		md = checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1)
@@ -78,6 +80,6 @@
 		return md
 	# }}}
+
 	def marshall(self,prefix,md,fid):    # {{{
-
 		yts=md.constants.yts
 		WriteData(fid,prefix,'name','md.timestepping.type','data',2,'format','Integer');
Index: /issm/trunk-jpl/src/m/classes/toolkits.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/toolkits.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/toolkits.py	(revision 23716)
@@ -35,5 +35,5 @@
 	def __repr__(self):    # {{{
 		s ="List of toolkits options per analysis:\n\n"
-		for analysis in vars(self).iterkeys():
+		for analysis in list(vars(self).keys()):
 			s+="%s\n" % fielddisplay(self,analysis,'')
 
@@ -56,5 +56,5 @@
 	# }}}
 	def checkconsistency(self,md,solution,analyses):    # {{{
-		for analysis in vars(self).iterkeys():
+		for analysis in list(vars(self).keys()):
 			if not getattr(self,analysis):
 				md.checkmessage("md.toolkits.%s is empty" % analysis)
@@ -83,5 +83,5 @@
 
 		#start writing options
-		for analysis in vars(self).iterkeys():
+		for analysis in list(vars(self).keys()):
 			options=getattr(self,analysis)
 
@@ -89,5 +89,5 @@
 			fid.write("\n+%s\n" % analysis)    #append a + to recognize it's an analysis enum
 			#now, write options
-			for optionname,optionvalue in options.iteritems():
+			for optionname,optionvalue in list(options.items()):
 
 				if not optionvalue:
@@ -96,7 +96,7 @@
 				else:
 					#option with value. value can be string or scalar
-					if   isinstance(optionvalue,(bool,int,long,float)):
+					if   isinstance(optionvalue,(bool,int,float)):
 						fid.write("-%s %g\n" % (optionname,optionvalue))
-					elif isinstance(optionvalue,(str,unicode)):
+					elif isinstance(optionvalue,str):
 						fid.write("-%s %s\n" % (optionname,optionvalue))
 					else:
Index: /issm/trunk-jpl/src/m/classes/verbose.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/verbose.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/classes/verbose.py	(revision 23716)
@@ -50,5 +50,5 @@
 		elif len(args) == 1:
 			binary=args[0]
-			if   isinstance(binary,(str,unicode)):
+			if   isinstance(binary,str):
 				if binary.lower()=='all':
 					binary=2**11-1    #all ones
@@ -58,5 +58,5 @@
 					binary=int(binary,2)
 					self.BinaryToVerbose(binary)
-			elif isinstance(binary,(int,long,float)):
+			elif isinstance(binary,(int,float)):
 				self.BinaryToVerbose(int(binary))
 
@@ -67,6 +67,6 @@
 			#Cast to logicals
 			listproperties=vars(self)
-			for fieldname,fieldvalue in listproperties.iteritems():
-				if isinstance(fieldvalue,bool) or isinstance(fieldvalue,(int,long,float)):
+			for fieldname,fieldvalue in list(listproperties.items()):
+				if isinstance(fieldvalue,bool) or isinstance(fieldvalue,(int,float)):
 					setattr(self,fieldname,bool(fieldvalue))
 				else:
Index: /issm/trunk-jpl/src/m/consistency/checkfield.py
===================================================================
--- /issm/trunk-jpl/src/m/consistency/checkfield.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/consistency/checkfield.py	(revision 23716)
@@ -1,4 +1,5 @@
 import numpy as np
 import os
+from re import findall,split
 from pairoptions import pairoptions
 from operator import attrgetter
@@ -42,7 +43,19 @@
 	else:
 		fieldname=options.getfieldvalue('fieldname')
-		exec("field=md.{}".format(fieldname))
-
-	if isinstance(field,(bool,int,long,float)):
+		fieldprefix=split(r'\[(.*?)\]',fieldname)[0]
+		fieldindexes=findall(r'\[(.*?)\]',fieldname)
+		field=attrgetter(fieldprefix)(md)
+		for index in fieldindexes:
+			try:
+				field=field[index.strip("\'")]
+			except TypeError:
+				field=field[int(index)] #looking for an index and not a key
+
+# that works for py2
+#		exec("field=md.{}".format(fieldname))
+#		exec("field=md.{}".format(fieldname),namespace)
+
+
+	if isinstance(field,(bool,int,float)):
 		field=np.array([field])
 
@@ -65,5 +78,5 @@
 				try:
 					exec("md.{}=np.squeeze(field)".format(fieldname))
-					print('{} had been squeezed if it was a matrix with only one column'.format(fieldname))
+					print(('{} had been squeezed if it was a matrix with only one column'.format(fieldname)))
 				except IndexError:
 					md = md.checkmessage(options.getfieldvalue('message',"field {} should have {} dimension".format(fieldname,len(fieldsize))))
@@ -102,4 +115,5 @@
 				"NaN values found in field '%s'" % fieldname))
 
+
 	#check Inf
 	if options.getfieldvalue('Inf',0):
@@ -107,4 +121,5 @@
 			md = md.checkmessage(options.getfieldvalue('message',\
 				"Inf values found in field '%s'" % fieldname))
+
 
 	#check cell
@@ -206,6 +221,7 @@
 				else:
 					maxval=np.nanmax(field[0])
+
 				if maxval>=upperbound:
-					md = md.checkmessage(options.getfieldvalue('message',"field '{}' should have values below {}".format(fieldname,upperbound)))
+					md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have values below %d" % (fieldname,upperbound)))
 
 	#check file
Index: /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py
===================================================================
--- /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 23716)
@@ -1,5 +1,5 @@
 def AnalysisConfiguration(solutiontype): #{{{
 	"""
-	ANALYSISCONFIGURATION - return type of analyses, number of analyses 
+	ANALYSISCONFIGURATION - return type of analyses, number of analyses
 
 		Usage:
@@ -9,38 +9,26 @@
 	if   solutiontype == 'StressbalanceSolution':
 		analyses=['StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis']
-
 	elif solutiontype == 'SteadystateSolution':
 		analyses=['StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis']
-
 	elif solutiontype == 'ThermalSolution':
 		analyses=['EnthalpyAnalysis','ThermalAnalysis','MeltingAnalysis']
-
 	elif solutiontype == 'MasstransportSolution':
 		analyses=['MasstransportAnalysis']
-
 	elif solutiontype == 'BalancethicknessSolution':
 		analyses=['BalancethicknessAnalysis']
-
 	elif solutiontype == 'SurfaceSlopeSolution':
 		analyses=['L2ProjectionBaseAnalysis']
-
 	elif solutiontype == 'BalancevelocitySolution':
 		analyses=['BalancevelocityAnalysis']
-
 	elif solutiontype == 'BedSlopeSolution':
 		analyses=['L2ProjectionBaseAnalysis']
-
 	elif solutiontype == 'GiaSolution':
 		analyses=['GiaIvinsAnalysis']
-
-        elif solutiontype == 'LoveSolution':
-                analyses=['LoveAnalysis']
-
+	elif solutiontype == 'LoveSolution':
+		analyses=['LoveAnalysis']
 	elif solutiontype == 'TransientSolution':
 		analyses=['StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis']
-
 	elif solutiontype == 'HydrologySolution':
 		analyses=['L2ProjectionBaseAnalysis','HydrologyShreveAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis']
-
 	elif 'DamageEvolutionSolution':
 		analyses=['DamageEvolutionAnalysis']
@@ -86,3 +74,2 @@
 	if not md.private.isconsistent:
 		raise RuntimeError('Model not consistent, see messages above.')
-
Index: /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/ClassTry.py
===================================================================
--- /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/ClassTry.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/ClassTry.py	(revision 23716)
@@ -13,5 +13,5 @@
 		def netCDFread(filename):
 			def walktree(data):
-				keys = data.groups.keys()
+				keys = list(data.groups.keys())
 				yield keys
 				for key in keys:
@@ -20,5 +20,5 @@
 
 			if path.exists(filename):
-				print ('Opening {} for reading '.format(filename))
+				print(('Opening {} for reading '.format(filename)))
 				NCData=Dataset(filename, 'r')
 				class_dict={}
@@ -35,5 +35,5 @@
 			classtype=self.default_prop()
 			
-		module=map(__import__,dict.values(classtype))
+		module=list(map(__import__,dict.values(classtype)))
 
 		for i,mod in enumerate(dict.keys(classtype)):
Index: /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py
===================================================================
--- /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 23716)
@@ -11,10 +11,10 @@
 	#Now going on Real treatment
 	if path.exists(filename):
-		print ('File {} allready exist'.format(filename))
-		newname=raw_input('Give a new name or "delete" to replace: ')
+		print(('File {} allready exist'.format(filename)))
+		newname=eval(input('Give a new name or "delete" to replace: '))
 		if newname=='delete':
 			remove(filename)
 		else:
-			print ('New file name is {}'.format(newname))
+			print(('New file name is {}'.format(newname)))
 			filename=newname
 
@@ -34,10 +34,10 @@
 	dimlist=[2,md.mesh.numberofelements,md.mesh.numberofvertices,np.shape(md.mesh.elements)[1]]
 	for i in range(0,4):
-		if dimlist[i] not in DimDict.keys():
+		if dimlist[i] not in list(DimDict.keys()):
 			dimindex+=1
 			NewDim=NCData.createDimension('DimNum'+str(dimindex),dimlist[i])
 			DimDict[len(NewDim)]='DimNum'+str(dimindex)
 
-	typelist=[bool,str,unicode,int,float,complex,
+	typelist=[bool,str,str,int,float,complex,
 						collections.OrderedDict,
 						np.int64,np.ndarray,np.float64]
@@ -93,5 +93,5 @@
 				DimDict=CreateVar(NCData,Var,field,NCgroup,DimDict)
 			elif md.__dict__[group].__dict__[field] is None:
-				print( 'field md.{}.{} is None'.format(group,field))
+				print(( 'field md.{}.{} is None'.format(group,field)))
 				#do nothing
 			#if it is a masked array
@@ -140,5 +140,5 @@
 	#Now define and fill up variable
 	#treating scalar string or bool as atribute
-	if val_type in [str,unicode,bool]:
+	if val_type in [str,str,bool]:
 		Group.__setattr__(str(field).swapcase(), str(var))
 	#treating list as string table
@@ -182,5 +182,5 @@
 			ncvar[:] = var
 	else:
-		print('WARNING type "{}" is unknown for "{}.{}"'.format(val_type,Group.name,field))
+		print(('WARNING type "{}" is unknown for "{}.{}"'.format(val_type,Group.name,field)))
 	return DimDict
 
@@ -200,5 +200,5 @@
 					DimDict[len(NewDim)]='DimNum'+str(index)
 					output=output+[str(DimDict[shape[dim]])]
-		elif type(shape[0])==str or type(shape[0])==unicode:#dealling with a dictionnary
+		elif type(shape[0])==str or type(shape[0])==str:#dealling with a dictionnary
 			try:
 				#dimension5 is 2 to treat with dict
Index: /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/read_netCDF.py
===================================================================
--- /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/read_netCDF.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/read_netCDF.py	(revision 23716)
@@ -7,5 +7,5 @@
 	
 	def walktree(data):
-		keys = data.groups.keys()
+		keys = list(data.groups.keys())
 		yield keys
 		for key in keys:
@@ -14,5 +14,5 @@
 				
 	if path.exists(filename):
-		print ('Opening {} for reading '.format(filename))
+		print(('Opening {} for reading '.format(filename)))
 		NCData=Dataset(filename, 'r')
 		class_dict={}
@@ -22,4 +22,4 @@
 				class_dict[str(child)]=str(getattr(NCData.groups[str(child)],'classtype')+'()')
 
-		print class_dict
+		print(class_dict)
 				
Index: /issm/trunk-jpl/src/m/contrib/defleurian/paraview/enveloppeVTK.py
===================================================================
--- /issm/trunk-jpl/src/m/contrib/defleurian/paraview/enveloppeVTK.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/contrib/defleurian/paraview/enveloppeVTK.py	(revision 23716)
@@ -27,6 +27,6 @@
 
 	if os.path.exists(filename):
-		print ('File {} allready exist'.format(filename))
-		newname=raw_input('Give a new name or "delete" to replace: ')
+		print(('File {} allready exist'.format(filename)))
+		newname=eval(input('Give a new name or "delete" to replace: '))
 		if newname=='delete':
 			filelist = glob.glob(filename+'/*')
@@ -34,5 +34,5 @@
 				os.remove(oldfile)
 		else:
-			print ('New file name is {}'.format(newname))
+			print(('New file name is {}'.format(newname)))
 			filename=newname
 			os.mkdir(filename)
Index: /issm/trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py
===================================================================
--- /issm/trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py	(revision 23716)
@@ -27,6 +27,6 @@
 
 	if os.path.exists(filename):
-		print ('File {} allready exist'.format(filename))
-		newname=raw_input('Give a new name or "delete" to replace: ')
+		print(('File {} allready exist'.format(filename)))
+		newname=eval(input('Give a new name or "delete" to replace: '))
 		if newname=='delete':
 			filelist = glob.glob(filename+'/*')
@@ -34,5 +34,5 @@
 				os.remove(oldfile)
 		else:
-			print ('New file name is {}'.format(newname))
+			print(('New file name is {}'.format(newname)))
 			filename=newname
 			os.mkdir(filename)
@@ -101,5 +101,5 @@
 				fid.write('6 %d %d %d %d %d %d\n' %(model.mesh.elements[elt,0]-1,model.mesh.elements[elt,1]-1,model.mesh.elements[elt,2]-1,model.mesh.elements[elt,3]-1,model.mesh.elements[elt,4]-1,model.mesh.elements[elt,5]-1))
 		else:
-			print 'Number of nodes per element not supported'
+			print('Number of nodes per element not supported')
 
 		fid.write('CELL_TYPES %d\n' %num_of_elt)
@@ -193,5 +193,5 @@
 							for node in range(0,num_of_points):
 								#paraview does not like NaN, replacing
-								print other_struct.__dict__[field][node]
+								print((other_struct.__dict__[field][node]))
 								if np.isnan(other_struct.__dict__[field][node]):
 									fid.write('%e\n' % -9999.9999)
Index: /issm/trunk-jpl/src/m/contrib/morlighem/bamg/YamsCall.py
===================================================================
--- /issm/trunk-jpl/src/m/contrib/morlighem/bamg/YamsCall.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/contrib/morlighem/bamg/YamsCall.py	(revision 23716)
@@ -29,19 +29,19 @@
 	#Compute Hessian
 	t1=time.time()
-	print "%s" % '      computing Hessian...'
+	print(("%s" % '      computing Hessian...'))
 	hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node')
 	t2=time.time()
-	print "%s%d%s\n" % (' done (',t2-t1,' seconds)')
+	print(("%s%d%s\n" % (' done (',t2-t1,' seconds)')))
 
 	#Compute metric
 	t1=time.time()
-	print "%s" % '      computing metric...'
+	print(("%s" % '      computing metric...'))
 	metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,np.empty(0,int))
 	t2=time.time()
-	print "%s%d%s\n" % (' done (',t2-t1,' seconds)')
+	print(("%s%d%s\n" % (' done (',t2-t1,' seconds)')))
 
 	#write files
 	t1=time.time()
-	print "%s" % '      writing initial mesh files...'
+	print(("%s" % '      writing initial mesh files...'))
 	np.savetxt('carre0.met',metric)
 
@@ -56,10 +56,10 @@
 	#Vertices
 	f.write("\n%s\n%i\n\n" % ('Vertices',md.mesh.numberofvertices))
-	for i in xrange(0,md.mesh.numberofvertices):
+	for i in range(0,md.mesh.numberofvertices):
 		f.write("%8g %8g %i\n" % (md.mesh.x[i],md.mesh.y[i],0))
 
 	#Triangles
 	f.write("\n\n%s\n%i\n\n" % ('Triangles',md.mesh.numberofelements))
-	for i in xrange(0,md.mesh.numberofelements):
+	for i in range(0,md.mesh.numberofelements):
 		f.write("%i %i %i %i\n" % (md.mesh.elements[i,0],md.mesh.elements[i,1],md.mesh.elements[i,2],0))
 	numberofelements1=md.mesh.numberofelements
@@ -80,8 +80,8 @@
 	f.close()
 	t2=time.time()
-	print "%s%d%s\n" % (' done (',t2-t1,' seconds)')
+	print(("%s%d%s\n" % (' done (',t2-t1,' seconds)')))
 
 	#call yams
-	print "%s\n" % '      call Yams...'
+	print(("%s\n" % '      call Yams...'))
 	if   m.ispc():
 		#windows
@@ -96,5 +96,5 @@
 	#plug new mesh
 	t1=time.time()
-	print "\n%s" % '      reading final mesh files...'
+	print(("\n%s" % '      reading final mesh files...'))
 	Tria=np.loadtxt('carre1.tria',int)
 	Coor=np.loadtxt('carre1.coor',float)
@@ -107,9 +107,9 @@
 	numberofelements2=md.mesh.numberofelements
 	t2=time.time()
-	print "%s%d%s\n\n" % (' done (',t2-t1,' seconds)')
+	print(("%s%d%s\n\n" % (' done (',t2-t1,' seconds)')))
 
 	#display number of elements
-	print "\n%s %i" % ('      inital number of elements:',numberofelements1)
-	print "\n%s %i\n\n" % ('      new    number of elements:',numberofelements2)
+	print(("\n%s %i" % ('      inital number of elements:',numberofelements1)))
+	print(("\n%s %i\n\n" % ('      new    number of elements:',numberofelements2)))
 
 	#clean up:
Index: /issm/trunk-jpl/src/m/coordsystems/gmtmask.py
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/gmtmask.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/coordsystems/gmtmask.py	(revision 23716)
@@ -21,7 +21,7 @@
 
 	if recursive:
-		print '             recursing: num vertices #'+str(lenlat)
+		print(('             recursing: num vertices #'+str(lenlat)))
 	else:
-		print 'gmtmask: num vertices #'+str(lenlat)
+		print(('gmtmask: num vertices #'+str(lenlat)))
 	
 	#Check lat and long size is not more than 50,000 If so, recursively call gmtmask: 
@@ -32,5 +32,5 @@
 			if j>lenlat:
 				j=lenlat
-			mask[i:j]=gmtmask(lat[i:j],long[i:j],1)
+			mask[i:j]=gmtmask(lat[i:j],int[i:j],1)
 		return mask
 	
@@ -38,5 +38,5 @@
 	#First, write our lat,long file for gmt:
 	nv=lenlat
-	np.savetxt('./all_vertices.txt',np.transpose([long, lat, np.arange(1,nv+1)]),delimiter='\t',fmt='%.10f')
+	np.savetxt('./all_vertices.txt',np.transpose([int, lat, np.arange(1,nv+1)]),delimiter='\t',fmt='%.10f')
 
 	#Avoid bypassing of the ld library path by Matlab (:()
@@ -77,4 +77,4 @@
 	subprocess.call('rm -rf ./all_vertices.txt ./oce_vertices.txt ./gmt.history',shell=True)
 	if not recursive:
-		print 'gmtmask: done'
+		print('gmtmask: done')
 	return mask
Index: /issm/trunk-jpl/src/m/coordsystems/ll2xy.py
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/ll2xy.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/coordsystems/ll2xy.py	(revision 23716)
@@ -23,9 +23,9 @@
 		delta = 45
 		slat = 70
-		print '		ll2xy: creating coordinates in north polar stereographic (Std Latitude: 70N Meridian: 45)'
+		print('		ll2xy: creating coordinates in north polar stereographic (Std Latitude: 70N Meridian: 45)')
 	else: 
 		delta = central_meridian
 		slat = standard_parallel
-		print '		ll2xy: creating coordinates in south polar stereographic (Std Latitude: 71S Meridian: 0)'
+		print('		ll2xy: creating coordinates in south polar stereographic (Std Latitude: 71S Meridian: 0)')
 	
 	# Conversion constant from degrees to radians
Index: /issm/trunk-jpl/src/m/coordsystems/xy2ll.py
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/xy2ll.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/coordsystems/xy2ll.py	(revision 23716)
@@ -27,13 +27,13 @@
 			delta = 45. 
 			slat = 70.
-			print '		xy2ll: creating coordinates in north polar stereographic (Std Latitude: 70degN Meridian: 45deg)'
+			print('		xy2ll: creating coordinates in north polar stereographic (Std Latitude: 70degN Meridian: 45deg)')
 		elif sgn == -1:
 			delta = 0.  
 			slat = 71.
-			print '		xy2ll: creating coordinates in south polar stereographic (Std Latitude: 71degS Meridian: 0deg)'
+			print('		xy2ll: creating coordinates in south polar stereographic (Std Latitude: 71degS Meridian: 0deg)')
 		else:
 			raise ValueError('sgn should be either +1 or -1')
 	else:
-		raise StandardError('bad usage: type "help(xy2ll)" for details')
+		raise Exception('bad usage: type "help(xy2ll)" for details')
 
 	# if x,y passed as lists, convert to np.arrays
Index: /issm/trunk-jpl/src/m/dev/ISSM.py
===================================================================
--- /issm/trunk-jpl/src/m/dev/ISSM.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/dev/ISSM.py	(revision 23716)
@@ -1,3 +1,3 @@
-print 'WARNING: EXPERIMENTAL FEATURE ISSM.py: universal Python ISSM import'
+print('WARNING: EXPERIMENTAL FEATURE ISSM.py: universal Python ISSM import')
 
 #Most common imports
@@ -42,5 +42,5 @@
 def python_help():
 	'''Prints out key code fragments that may be useful to users'''
-	print 'Differences between Python and Matlab code:'
+	print('Differences between Python and Matlab code:')
 	#...
 
Index: /issm/trunk-jpl/src/m/dev/devpath.py
===================================================================
--- /issm/trunk-jpl/src/m/dev/devpath.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/dev/devpath.py	(revision 23716)
@@ -4,5 +4,5 @@
 
 #Recover ISSM_DIR and USERNAME
-ISSM_DIR = os.getenv('ISSM_DIR')
+ISSM_DIR = os.getenv('ISSM_DEV_DIR')
 USERNAME = os.getenv('USER')
 JPL_SVN  = os.getenv('JPL_SVN')
@@ -10,5 +10,5 @@
 	raise NameError('"ISSM_DIR" environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!')
 
-#Go through src/m and append any directory that contains a *.py file to PATH 
+#Go through src/m and append any directory that contains a *.py file to PATH
 for root,dirs,files in os.walk(ISSM_DIR+ '/src/m'):
 	if '.svn' in dirs:
@@ -22,5 +22,5 @@
 #Also add the Nightly run directory
 sys.path.append(ISSM_DIR + '/test/NightlyRun')
-				
+
 sys.path.append(ISSM_DIR + '/lib')
 sys.path.append(ISSM_DIR + '/src/wrappers/python/.libs')
@@ -42,3 +42,4 @@
 #c.InteractiveShellApp.exec_lines.append('print "Warning: disable autoreload in startup.py to improve performance." ')
 
-print("\n  ISSM development path correctly loaded\n\n")
+print("\n  ISSM development path correctly loaded")
+print(("Current path is {}\n\n".format(ISSM_DIR)))
Index: /issm/trunk-jpl/src/m/dev/issmversion.py
===================================================================
--- /issm/trunk-jpl/src/m/dev/issmversion.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/dev/issmversion.py	(revision 23716)
@@ -9,11 +9,12 @@
 	"""
 
-print ' '
-print IssmConfig('PACKAGE_NAME')[0]+' Version '+IssmConfig('PACKAGE_VERSION')[0]
-print '(website: '+IssmConfig('PACKAGE_URL')[0]+' contact: '+IssmConfig('PACKAGE_BUGREPORT')[0]+')'
-print ' '
-print 'Build date: '+IssmConfig('PACKAGE_BUILD_DATE')[0]
-print 'Copyright (c) 2009-2019 California Institute of Technology'
-print ' '
-print '    to get started type: issmdoc'
-print ' '
+
+print(' ')
+print((IssmConfig('PACKAGE_NAME')[0]+' Version '+IssmConfig('PACKAGE_VERSION')[0]))
+print(('(website: '+IssmConfig('PACKAGE_URL')[0]+' contact: '+IssmConfig('PACKAGE_BUGREPORT')[0]+')'))
+print(' ')
+print(('Build date: '+IssmConfig('PACKAGE_BUILD_DATE')[0]))
+print('Copyright (c) 2009-2018 California Institute of Technology')
+print(' ')
+print('    to get started type: issmdoc')
+print(' ')
Index: /issm/trunk-jpl/src/m/exp/expcoarsen.py
===================================================================
--- /issm/trunk-jpl/src/m/exp/expcoarsen.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/exp/expcoarsen.py	(revision 23716)
@@ -23,5 +23,5 @@
 		raise OSError("expcoarsen error message: file '%s' not found!" % oldfile)
 	if os.path.exists(newfile):
-		choice=raw_input('A file ' + newfile + ' already exists, do you want to modify it? (y/n)')
+		choice=eval(input('A file ' + newfile + ' already exists, do you want to modify it? (y/n)'))
 		if choice not in 'y': 
 			print('no modification done ... exiting')
Index: /issm/trunk-jpl/src/m/exp/expdisp.py
===================================================================
--- /issm/trunk-jpl/src/m/exp/expdisp.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/exp/expdisp.py	(revision 23716)
@@ -5,55 +5,55 @@
 
 def expdisp(ax,options):
-    '''
-    plot the contents of a domain outline file
+	'''
+	plot the contents of a domain outline file
 
-    This routine reads in an exp file and plots all of the x,y points/lines/patches
+	This routine reads in an exp file and plots all of the x,y points/lines/patches
 
-    'ax' is a handle to the current plot axes, onto which we want to plot
+	'ax' is a handle to the current plot axes, onto which we want to plot
 
-    Usage:
-        expdisp(ax,options)
+	Usage:
+	expdisp(ax,options)
 
-    List of options passable to plotmodel:
-        'expdisp'      : path (or list of paths) to the exp file to be plotted
-        'explinewidth' : linewidth
-        'explinestyle' : matplotlib linestyle string
-        'explinecolor' : matplotlib color string
-        'expfill'      : (True/False) fill a closed contour
-        'expfillcolor' : Color for a filled contour, only used if expfill is True
-        'expfillalpha' : alpha transparency for filled contour
+	List of options passable to plotmodel:
+	'expdisp'      : path (or list of paths) to the exp file to be plotted
+	'explinewidth' : linewidth
+	'explinestyle' : matplotlib linestyle string
+	'explinecolor' : matplotlib color string
+	'expfill'      : (True/False) fill a closed contour
+	'expfillcolor' : Color for a filled contour, only used if expfill is True
+	'expfillalpha' : alpha transparency for filled contour
 
-    All options should be passed as lists of length len(number of exp files passed)
-    '''
+	All options should be passed as lists of length len(number of exp files passed)
+	'''
 
-    filenames=options.getfieldvalue('expdisp')
-    linewidth=options.getfieldvalue('explinewidth',[1]*len(filenames))
-    linestyle=options.getfieldvalue('explinestyle',['-']*len(filenames))
-    linecolor=options.getfieldvalue('explinecolor',['k']*len(filenames))
-    fill=options.getfieldvalue('expfill',[0]*len(filenames))
-    alpha=options.getfieldvalue('expfillalpha',[1]*len(filenames))
-    facecolor=options.getfieldvalue('expfillcolor',['r']*len(filenames))
-    unitmultiplier=options.getfieldvalue('unit',1)
-    for i in xrange(len(filenames)):
-	linestylei=linestyle[i]
-        linecolori=linecolor[i]
-        linewidthi=linewidth[i]
-        alphai=alpha[i]
-        facecolori=facecolor[i]
-	filenamei=filenames[i]
-        filli=fill[i]
-        domain=expread(filenamei)
-        for j in xrange(len(domain)):
-            if domain[j]['nods']==1:
-                ax.plot(domain[j]['x']*unitmultiplier,domain[j]['y']*unitmultiplier,'o',mec='k',mfc='r',ms=10)
-            elif filli:
-                verts=np.column_stack((domain[j]['x'],domain[j]['y']))
-                codes=[Path.MOVETO] + [Path.LINETO]*(len(domain[j]['x'])-2) + [Path.CLOSEPOLY]
-                path=Path(verts, codes)
-                patch=patches.PathPatch(path,facecolor=facecolori,edgecolor=linecolori,alpha=alphai,
-                        lw=linewidthi)
-                ax.add_patch(patch)
-            else:
-                x=domain[j]['x'].tolist() # since expread returns a string representation of the arrays
-                y=domain[j]['y'].tolist()
-                ax.plot(x*unitmultiplier,y*unitmultiplier,ls=linestylei,lw=linewidthi,c=linecolori)
+	filenames=options.getfieldvalue('expdisp')
+	linewidth=options.getfieldvalue('explinewidth',[1]*len(filenames))
+	linestyle=options.getfieldvalue('explinestyle',['-']*len(filenames))
+	linecolor=options.getfieldvalue('explinecolor',['k']*len(filenames))
+	fill=options.getfieldvalue('expfill',[0]*len(filenames))
+	alpha=options.getfieldvalue('expfillalpha',[1]*len(filenames))
+	facecolor=options.getfieldvalue('expfillcolor',['r']*len(filenames))
+	unitmultiplier=options.getfieldvalue('unit',1)
+	for i in range(len(filenames)):
+		linestylei=linestyle[i]
+		linecolori=linecolor[i]
+		linewidthi=linewidth[i]
+		alphai=alpha[i]
+		facecolori=facecolor[i]
+		filenamei=filenames[i]
+		filli=fill[i]
+		domain=expread(filenamei)
+		for j in range(len(domain)):
+			if domain[j]['nods']==1:
+				ax.plot(domain[j]['x']*unitmultiplier,domain[j]['y']*unitmultiplier,'o',mec='k',mfc='r',ms=10)
+			elif filli:
+				verts=np.column_stack((domain[j]['x'],domain[j]['y']))
+				codes=[Path.MOVETO] + [Path.LINETO]*(len(domain[j]['x'])-2) + [Path.CLOSEPOLY]
+				path=Path(verts, codes)
+				patch=patches.PathPatch(path,facecolor=facecolori,edgecolor=linecolori,alpha=alphai,
+																lw=linewidthi)
+				ax.add_patch(patch)
+			else:
+				x=domain[j]['x'].tolist() # since expread returns a string representation of the arrays
+				y=domain[j]['y'].tolist()
+				ax.plot(x*unitmultiplier,y*unitmultiplier,ls=linestylei,lw=linewidthi,c=linecolori)
Index: /issm/trunk-jpl/src/m/exp/expread.py
===================================================================
--- /issm/trunk-jpl/src/m/exp/expread.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/exp/expread.py	(revision 23716)
@@ -76,5 +76,5 @@
 		contour['x']=np.empty(contour['nods'])
 		contour['y']=np.empty(contour['nods'])
-		for i in xrange(int(contour['nods'])):
+		for i in range(int(contour['nods'])):
 			A=fid.readline().split()
 			contour['x'][i]=float(A[0])
Index: /issm/trunk-jpl/src/m/extrusion/DepthAverage.py
===================================================================
--- /issm/trunk-jpl/src/m/extrusion/DepthAverage.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/extrusion/DepthAverage.py	(revision 23716)
@@ -20,5 +20,5 @@
 	# coerce to array in case float is passed
 	if type(vector)!=np.ndarray:
-		print 'coercing array'
+		print('coercing array')
 		vector=np.array(value)
 
@@ -31,5 +31,5 @@
 	if vector.shape[0]==md.mesh.numberofvertices:
 		vector_average=np.zeros(md.mesh.numberofvertices2d)
-		for i in xrange(1,md.mesh.numberoflayers):
+		for i in range(1,md.mesh.numberoflayers):
 			vector_average=vector_average+(project2d(md,vector,i)+project2d(md,vector,i+1))/2.*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i))
 		vector_average=vector_average/project2d(md,md.geometry.thickness,1)
@@ -38,5 +38,5 @@
 	elif vector.shape[0]==md.mesh.numberofelements:
 		vector_average=np.zeros(md.mesh.numberofelements2d)
-		for i in xrange(1,md.mesh.numberoflayers):
+		for i in range(1,md.mesh.numberoflayers):
 			vector_average=vector_average+project2d(md,vector,i)*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i))
 		vector_average=vector_average/project2d(md,md.geometry.thickness,1)
Index: /issm/trunk-jpl/src/m/extrusion/project2d.py
===================================================================
--- /issm/trunk-jpl/src/m/extrusion/project2d.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/extrusion/project2d.py	(revision 23716)
@@ -19,5 +19,5 @@
 
 	if md3d.mesh.domaintype().lower() != '3d':
-		raise StandardError("model passed to project2d function should be 3D")
+		raise Exception("model passed to project2d function should be 3D")
 
 	if layer<1 or layer>md3d.mesh.numberoflayers:
@@ -26,5 +26,5 @@
 	# coerce to array in case float is passed
 	if type(value)!=np.ndarray:
-		print 'coercing array'
+		print('coercing array')
 		value=np.array(value)
 
Index: /issm/trunk-jpl/src/m/extrusion/project3d.py
===================================================================
--- /issm/trunk-jpl/src/m/extrusion/project3d.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/extrusion/project3d.py	(revision 23716)
@@ -41,5 +41,5 @@
 		vector2d=vector2d.reshape(-1,)
 
-	if isinstance(vector2d,(bool,int,long,float)) or np.size(vector2d)==1:
+	if isinstance(vector2d,(bool,int,float)) or np.size(vector2d)==1:
 		projected_vector=vector2d
 
@@ -58,5 +58,5 @@
 			#Fill in
 			if layer==0:
-				for i in xrange(md.mesh.numberoflayers):
+				for i in range(md.mesh.numberoflayers):
 					projected_vector[(i*md.mesh.numberofvertices2d):((i+1)*md.mesh.numberofvertices2d)]=vector2d
 			else:
@@ -73,5 +73,5 @@
 			#Fill in
 			if layer==0:
-				for i in xrange(md.mesh.numberoflayers):
+				for i in range(md.mesh.numberoflayers):
 					projected_vector[(i*md.mesh.numberofvertices2d):((i+1)*md.mesh.numberofvertices2d),:]=vector2d
 			else:
@@ -93,5 +93,5 @@
 			#Fill in
 			if layer==0:
-				for i in xrange(md.mesh.numberoflayers-1):
+				for i in range(md.mesh.numberoflayers-1):
 					projected_vector[(i*md.mesh.numberofelements2d):((i+1)*md.mesh.numberofelements2d)]=vector2d
 			else:
@@ -108,5 +108,5 @@
 			#Fill in
 			if layer==0:
-				for i in xrange(md.mesh.numberoflayers-1):
+				for i in range(md.mesh.numberoflayers-1):
 					projected_vector[(i*md.mesh.numberofelements2d):((i+1)*md.mesh.numberofelements2d),:]=vector2d
 			else:
Index: /issm/trunk-jpl/src/m/geometry/FlagElements.py
===================================================================
--- /issm/trunk-jpl/src/m/geometry/FlagElements.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/geometry/FlagElements.py	(revision 23716)
@@ -22,5 +22,5 @@
 	"""
 
-	if   isinstance(region,(str,unicode)):
+	if   isinstance(region,str):
 		if   not region:
 			flag=np.zeros(md.mesh.numberofelements,bool)
Index: /issm/trunk-jpl/src/m/geometry/NowickiProfile.py
===================================================================
--- /issm/trunk-jpl/src/m/geometry/NowickiProfile.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/geometry/NowickiProfile.py	(revision 23716)
@@ -28,5 +28,5 @@
 
 	#upstream of the GL
-	for i in range(np.size(x) / 2):
+	for i in range(int(np.size(x)/2)):
 		ss = np.roots([1, 4 * lamda * beta, 0, 0, 6 * lamda * ms * x[i]**2 +
 				12 * lamda * q * x[i] - hg**4 - 4 * lamda * beta * hg**3])
@@ -38,5 +38,5 @@
 
 	#downstream of the GL
-	for i in range(np.size(x) / 2, np.size(x)):
+	for i in range(int(np.size(x)/2), int(np.size(x))):
 		h[i] = (x[i] / (4. * (delta+1) * q) + hg**(-2))**(-0.5) # ice thickness for ice shelf from (3.1)
 		b[i] = sea - h[i] * (1. / (1+delta))
Index: /issm/trunk-jpl/src/m/interp/SectionValues.py
===================================================================
--- /issm/trunk-jpl/src/m/interp/SectionValues.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/interp/SectionValues.py	(revision 23716)
@@ -45,5 +45,5 @@
 	S=np.array([0.])  #curvilinear coordinate
 	
-	for i in xrange(nods-1):
+	for i in range(nods-1):
 	
 		x_start=x[i]
@@ -60,5 +60,5 @@
 		s_segment=np.zeros(portion)
 
-		for j in xrange(int(portion)):
+		for j in range(int(portion)):
 			x_segment[j]=x_start+(j)*(x_end-x_start)/portion
 			y_segment[j]=y_start+(j)*(y_end-y_start)/portion
@@ -88,5 +88,5 @@
 	
 		#Compute index
-		index=np.array([range(1,numberofnodes),range(2,numberofnodes+1)]).T
+		index=np.array([list(range(1,numberofnodes)),list(range(2,numberofnodes+1))]).T
 	
 	else:
@@ -116,5 +116,5 @@
 	
 		#Get new coordinates in 3d
-		for i in xrange(1,layers+1):
+		for i in range(1,layers+1):
 			X3[i-1::layers]=X
 			Y3[i-1::layers]=Y
Index: /issm/trunk-jpl/src/m/interp/averaging.py
===================================================================
--- /issm/trunk-jpl/src/m/interp/averaging.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/interp/averaging.py	(revision 23716)
@@ -5,5 +5,5 @@
 	from scipy.sparse import csc_matrix
 except ImportError:
-	print "could not import scipy, no averaging capabilities enabled"
+	print("could not import scipy, no averaging capabilities enabled")
 
 def averaging(md,data,iterations,layer=0):
@@ -30,5 +30,5 @@
 
 	if len(data)!=md.mesh.numberofelements and len(data)!=md.mesh.numberofvertices:
-		raise StandardError('averaging error message: data not supported yet')
+		raise Exception('averaging error message: data not supported yet')
 	if md.mesh.dimension()==3 and layer!=0:
 		if layer<=0 or layer>md.mesh.numberoflayers:
Index: /issm/trunk-jpl/src/m/interp/holefiller.py
===================================================================
--- /issm/trunk-jpl/src/m/interp/holefiller.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/interp/holefiller.py	(revision 23716)
@@ -26,5 +26,5 @@
 
 	if len(x) != len(data) or len(y) != len(data):
-		raise StandardError('nearestneighbors error: x and y should have the same length as "data"')
+		raise Exception('nearestneighbors error: x and y should have the same length as "data"')
 
 	filled=data
Index: /issm/trunk-jpl/src/m/interp/interp.py
===================================================================
--- /issm/trunk-jpl/src/m/interp/interp.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/interp/interp.py	(revision 23716)
@@ -6,6 +6,6 @@
 	import matplotlib.pyplot as plt
 except ImportError:
-	print 'could not import matplotlib, no plotting functions enabled.\
-			Set plotonly=False in function call'
+	print('could not import matplotlib, no plotting functions enabled.\
+			Set plotonly=False in function call')
 
 def MeshSplineToMesh2d(x,y,data,xi,yi,tol=1e-6,fill_nans=False,**kwargs):#{{{
@@ -63,5 +63,5 @@
 	ind=np.nonzero(mask)[0]
 	if len(ind) and fill_nans:
-		print "		WARNING: filling nans using spline fit through good data points, which may or may not be appropriate. Check results carefully."
+		print("		WARNING: filling nans using spline fit through good data points, which may or may not be appropriate. Check results carefully.")
 	subdata=np.delete(subdata,ind)
 	points=np.delete(points,ind,axis=0)
@@ -133,5 +133,5 @@
 	# create points array and flattened data array
 	if len(x)==data.shape[1] and len(y)==data.shape[0]:
-		print '		x,y taken to define the center of data grid cells'
+		print('		x,y taken to define the center of data grid cells')
 		xind=np.nonzero(np.logical_and(x>xlim[0],x<xlim[1]))[0]
 		yind=np.nonzero(np.logical_and(y>ylim[0],y<ylim[1]))[0]
@@ -139,5 +139,5 @@
 		subdata=data[yind[0]:yind[-1]+1,xind[0]:xind[-1]+1]
 	elif len(x)==data.shape[1]+1 and len(y)==data.shape[0]+1:
-		print '		x,y taken to define the corners of data grid cells'
+		print('		x,y taken to define the corners of data grid cells')
 		xcenter=np.fromiter(((x[i]+x[i+1])/2 for i in range(len(x)-1)),np.float)
 		ycenter=np.fromiter(((y[i]+y[i+1])/2 for i in range(len(y)-1)),np.float)
@@ -161,5 +161,5 @@
 	ind=np.nonzero(mask)[0]
 	if len(ind) and fill_nans:
-		print "		WARNING: filling nans using spline fit through good data points, which may or may not be appropriate. Check results carefully."
+		print("		WARNING: filling nans using spline fit through good data points, which may or may not be appropriate. Check results carefully.")
 	goodsubdata=np.delete(flatsubdata,ind)
 	goodpoints=np.delete(points,ind,axis=0)
Index: /issm/trunk-jpl/src/m/io/loadmodel.py
===================================================================
--- /issm/trunk-jpl/src/m/io/loadmodel.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/io/loadmodel.py	(revision 23716)
@@ -1,4 +1,4 @@
 from loadvars import loadvars
-from whichdb import whichdb
+from dbm.ndbm import whichdb
 from netCDF4 import Dataset
 
@@ -27,5 +27,5 @@
 	#recover model on file and name it md
 	struc=loadvars(path)
-	name=[key for key in struc.iterkeys()]
+	name=[key for key in list(struc.keys())]
 	if len(name)>1:
 		raise IOError("loadmodel error message: file '%s' contains several variables. Only one model should be present." % path)
Index: /issm/trunk-jpl/src/m/io/loadvars.py
===================================================================
--- /issm/trunk-jpl/src/m/io/loadvars.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/io/loadvars.py	(revision 23716)
@@ -7,5 +7,5 @@
 from os import path
 from collections import OrderedDict
-from whichdb import whichdb
+from dbm.ndbm import whichdb
 from model import *
 
@@ -31,5 +31,5 @@
 	nvdict={}
 
-	if len(args) >= 1 and isinstance(args[0],(str,unicode)):
+	if len(args) >= 1 and isinstance(args[0],str):
 		filename=args[0]
 		if not filename:
@@ -39,5 +39,5 @@
 		raise TypeError("Missing file name.")
 
-	if   len(args) >= 2 and isinstance(args[1],(str,unicode)):    # (filename,name)
+	if   len(args) >= 2 and isinstance(args[1],str):    # (filename,name)
 		for name in args[1:]:
 			nvdict[name]=None
@@ -57,20 +57,20 @@
 
 	if whichdb(filename):
-		print "Loading variables from file '%s'." % filename
+		print(("Loading variables from file '%s'." % filename))
 
 		my_shelf = shelve.open(filename,'r') # 'r' for read-only
 		if nvdict:
-			for name in nvdict.iterkeys():
+			for name in list(nvdict.keys()):
 				try:
 					nvdict[name] = my_shelf[name]
-					print "Variable '%s' loaded." % name
+					print(("Variable '%s' loaded." % name))
 				except KeyError:
 					value = None
-					print "Variable '%s' not found." % name
+					print(("Variable '%s' not found." % name))
 
 		else:
-			for name in my_shelf.iterkeys():
+			for name in list(my_shelf.keys()):
 				nvdict[name] = my_shelf[name]
-				print "Variable '%s' loaded." % name
+				print(("Variable '%s' loaded." % name))
 
 		my_shelf.close()
@@ -173,5 +173,5 @@
 								strings1=[str(arg[0]) for arg in varval if arg[0]!='toolkits']
 								strings2=[str(arg[1]) for arg in varval if arg[0]!='toolkits']
-								Tree.__dict__[str(var)].update(zip(strings1, strings2))
+								Tree.__dict__[str(var)].update(list(zip(strings1, strings2)))
 							else:
 								if type(Tree)==list:
@@ -194,5 +194,5 @@
 								Tree.__dict__[str(var)]=varval[:,:,:]
 						else:
-							print 'table dimension greater than 3 not implemented yet'
+							print('table dimension greater than 3 not implemented yet')
 				for attr in listclass.ncattrs():
 					if  attr!='classtype': #classtype is for treatment, don't get it back
@@ -210,5 +210,5 @@
 								Tree.__dict__[str(attr).swapcase()]=False
 		NCFile.close()
-	if   len(args) >= 2 and isinstance(args[1],(str,unicode)):    # (value)
+	if   len(args) >= 2 and isinstance(args[1],str):    # (value)
 		value=[nvdict[name] for name in args[1:]]
 		return value
@@ -223,5 +223,5 @@
 
 def netCDFread(filename):
-	print ('Opening {} for reading '.format(filename))
+	print(('Opening {} for reading '.format(filename)))
 	NCData=Dataset(filename, 'r')
 	class_dict={}
@@ -244,5 +244,5 @@
 					class_tree[classe]=[group,]
 			except AttributeError:
-				print('group {} is empty'.format(group))
+				print(('group {} is empty'.format(group)))
 	NCData.close()
 	return class_dict,class_tree
Index: /issm/trunk-jpl/src/m/io/savevars.py
===================================================================
--- /issm/trunk-jpl/src/m/io/savevars.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/io/savevars.py	(revision 23716)
@@ -23,5 +23,5 @@
 	nvdict={}
 
-	if len(args) >= 1 and isinstance(args[0],(str,unicode)):
+	if len(args) >= 1 and isinstance(args[0],str):
 		filename=args[0]
 		if not filename:
@@ -31,6 +31,6 @@
 		raise TypeError("Missing file name.")
 
-	if   len(args) >= 3 and isinstance(args[1],(str,unicode)):    # (filename,name,value)
-		for i in xrange(1,len(args),2):
+	if   len(args) >= 3 and isinstance(args[1],str):    # (filename,name,value)
+		for i in range(1,len(args),2):
 			nvdict[args[i]]=args[i+1]
 
@@ -46,16 +46,16 @@
 
 	if os.path.exists(filename):
-		print "Shelving variables to existing file '%s'." % filename
+		print(("Shelving variables to existing file '%s'." % filename))
 	else:
-		print "Shelving variables to new file '%s'." % filename
+		print(("Shelving variables to new file '%s'." % filename))
 
 	my_shelf = shelve.open(filename,'c') # 'c' for create if not exist, else 'n' for new
 
-	for name,value in nvdict.iteritems():
+	for name,value in list(nvdict.items()):
 		try:
 			my_shelf[name] = value
-			print "Variable '%s' shelved." % name
+			print(("Variable '%s' shelved." % name))
 		except TypeError:
-			print "Variable '%s' not shelved." % name
+			print(("Variable '%s' not shelved." % name))
 
 	my_shelf.close()
Index: /issm/trunk-jpl/src/m/mech/analyticaldamage.py
===================================================================
--- /issm/trunk-jpl/src/m/mech/analyticaldamage.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mech/analyticaldamage.py	(revision 23716)
@@ -58,9 +58,9 @@
 	# check inputs
 	if 'strainrate' not in md.results.__dict__:
-		raise StandardError('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
+		raise Exception('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
 	if not '2d' in md.mesh.__doc__:
-		raise StandardError('only 2d (planview) model supported currently')
+		raise Exception('only 2d (planview) model supported currently')
 	if np.any(md.flowequation.element_equation!=2):
-		print 'Warning: the model has some non SSA elements. These will be treated like SSA elements'
+		print('Warning: the model has some non SSA elements. These will be treated like SSA elements')
 
 	a,b,theta,ex=thomasparams(md,eq=eq,smoothing=smoothing,coordsys=coordsys)
Index: /issm/trunk-jpl/src/m/mech/backstressfrominversion.py
===================================================================
--- /issm/trunk-jpl/src/m/mech/backstressfrominversion.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mech/backstressfrominversion.py	(revision 23716)
@@ -50,9 +50,9 @@
 	# some checks
 	if not hasattr(md.results,'strainrate'):
-		raise StandardError('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
+		raise Exception('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
 	if not '2d' in md.mesh.__doc__:
-		raise StandardError('only 2d (planview) model supported currently')
+		raise Exception('only 2d (planview) model supported currently')
 	if any(md.flowequation.element_equation!=2):
-		raise StandardError('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
+		raise Exception('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
 
 	T=0.5*md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)*md.geometry.thickness
Index: /issm/trunk-jpl/src/m/mech/calcbackstress.py
===================================================================
--- /issm/trunk-jpl/src/m/mech/calcbackstress.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mech/calcbackstress.py	(revision 23716)
@@ -44,9 +44,9 @@
 	# some checks
 	if not hasattr(md.results,'strainrate'):
-		raise StandardError('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
+		raise Exception('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
 	if not '2d' in md.mesh.__doc__:
-		raise StandardError('only 2d (planview) model supported currently')
+		raise Exception('only 2d (planview) model supported currently')
 	if any(md.flowequation.element_equation!=2):
-		raise StandardError('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
+		raise Exception('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
 
 	T=0.5*md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)*md.geometry.thickness
Index: /issm/trunk-jpl/src/m/mech/damagefrominversion.py
===================================================================
--- /issm/trunk-jpl/src/m/mech/damagefrominversion.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mech/damagefrominversion.py	(revision 23716)
@@ -19,9 +19,9 @@
 	# check inputs
 	if not hasattr(md.results,'strainrate'):
-		raise StandardError('md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
+		raise Exception('md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
 	if not '2d' in md.mesh.__doc__:
-		raise StandardError('only 2d (planview) model supported currently')
+		raise Exception('only 2d (planview) model supported currently')
 	if any(md.flowequation.element_equation!=2):
-		raise StandardError('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
+		raise Exception('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
 	if np.ndim(md.results.StressbalanceSolution.MaterialsRheologyBbar)==2:
 		Bi=md.results.StressbalanceSolution.MaterialsRheologyBbar.reshape(-1,)
Index: /issm/trunk-jpl/src/m/mech/mechanicalproperties.py
===================================================================
--- /issm/trunk-jpl/src/m/mech/mechanicalproperties.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mech/mechanicalproperties.py	(revision 23716)
@@ -28,5 +28,5 @@
 
 	if np.any(md.flowequation.element_equation!=2):
-		print 'Warning: the model has some non SSA elements. These will be treated like SSA elements'
+		print('Warning: the model has some non SSA elements. These will be treated like SSA elements')
 
         #unpack kwargs
@@ -85,5 +85,5 @@
 		nu[location]=10^18
 	elif 'matdamageice' in md.materials.__module__ and damage is not None:
-		print 'computing damage-dependent properties!'
+		print('computing damage-dependent properties!')
 		Zinv=np.dot(1-damage[index-1],summation/3.).reshape(-1,)
 		location=np.nonzero(second_inv)
@@ -93,5 +93,5 @@
 		#clear Zinv
 	else:
-		raise StandardError('class of md.materials (' + md.materials.__module__ + ') not recognized or not supported')
+		raise Exception('class of md.materials (' + md.materials.__module__ + ') not recognized or not supported')
 	
 	#compute stress
Index: /issm/trunk-jpl/src/m/mech/steadystateiceshelftemp.py
===================================================================
--- /issm/trunk-jpl/src/m/mech/steadystateiceshelftemp.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mech/steadystateiceshelftemp.py	(revision 23716)
@@ -48,5 +48,5 @@
 		temperature[pos]=-( (Tb[pos]-Ts[pos])*ki/wi[pos] + Hi[pos]*Tb[pos] - (Hi[pos]*Ts[pos] + (Tb[pos]-Ts[pos])*ki/wi[pos])*np.exp(Hi[pos]*wi[pos]/ki) )/( Hi[pos]*(np.exp(Hi[pos]*wi[pos]/ki)-1))
 	except FloatingPointError:
-		print 'steadystateiceshelf warning: overflow encountered in multipy/divide/exp, trying another formulation.' 
+		print('steadystateiceshelf warning: overflow encountered in multipy/divide/exp, trying another formulation.') 
 		temperature[pos]=-( ((Tb[pos]-Ts[pos])*ki/wi[pos] + Hi[pos]*Tb[pos])/np.exp(Hi[pos]*wi[pos]/ki) - Hi[pos]*Ts[pos] + (Tb[pos]-Ts[pos])*ki/wi[pos])/( Hi[pos]*(1-np.exp(-Hi[pos]*wi[pos]/ki)))
 	
Index: /issm/trunk-jpl/src/m/mech/thomasparams.py
===================================================================
--- /issm/trunk-jpl/src/m/mech/thomasparams.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mech/thomasparams.py	(revision 23716)
@@ -61,9 +61,9 @@
 	# some checks
 	if not hasattr(md.results,'strainrate'):
-		raise StandardError('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
+		raise Exception('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
 	if not '2d' in md.mesh.__doc__:
-		raise StandardError('only 2d (planview) model supported currently')
+		raise Exception('only 2d (planview) model supported currently')
 	if any(md.flowequation.element_equation!=2):
-		raise StandardError('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
+		raise Exception('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
 
 	# average element strain rates onto vertices
@@ -77,9 +77,9 @@
 	pos=np.nonzero(e1==0)
 	if np.any(pos==1):
-		print 'WARNING: first principal strain rate equal to zero.  Value set to 1e-13 s^-1'
+		print('WARNING: first principal strain rate equal to zero.  Value set to 1e-13 s^-1')
 		e1[pos]=1.e-13
 	pos=np.nonzero(e2==0)
 	if np.any(pos==1):
-		print 'WARNING: second principal strain rate equal to zero.  Value set to 1e-13 s^-1'
+		print('WARNING: second principal strain rate equal to zero.  Value set to 1e-13 s^-1')
 		e2[pos]=1.e-13
 	
@@ -126,5 +126,5 @@
 	pos=np.nonzero(np.abs((np.abs(a)-2.))<1.e-3)
 	if len(pos)>0:
-		print 'Warning: ', len(pos), ' vertices have alpha within 1e-3 of -2'
+		print(('Warning: ', len(pos), ' vertices have alpha within 1e-3 of -2'))
 	a[pos]=-2+1e-3
 
Index: /issm/trunk-jpl/src/m/mesh/ComputeMetric.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/ComputeMetric.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mesh/ComputeMetric.py	(revision 23716)
@@ -55,5 +55,5 @@
 	pos=np.nonzero(np.isnan(metric))[0]
 	if np.size(pos):
-		print(" %i NaN found in the metric. Use Numpy routine..." % np.size(pos))
+		print((" %i NaN found in the metric. Use Numpy routine..." % np.size(pos)))
 		for posi in pos:
 			H=np.array([[hessian[posi,0],hessian[posi,1]],[hessian[posi,1],hessian[posi,2]]])
Index: /issm/trunk-jpl/src/m/mesh/bamg.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/bamg.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mesh/bamg.py	(revision 23716)
@@ -226,5 +226,5 @@
 				elif np.any(np.logical_not(flags)):
 					#We LOTS of work to do
-					print "Rift tip outside of or on the domain has been detected and is being processed..."
+					print("Rift tip outside of or on the domain has been detected and is being processed...")
 
 					#check that only one point is outside (for now)
@@ -247,5 +247,5 @@
 					x2=rifti['x'][1]
 					y2=rifti['y'][1]
-					for j in xrange(0,np.size(domain[0]['x'])-1):
+					for j in range(0,np.size(domain[0]['x'])-1):
 						if SegIntersect(np.array([[x1,y1],[x2,y2]]),np.array([[domain[0]['x'][j],domain[0]['y'][j]],[domain[0]['x'][j+1],domain[0]['y'][j+1]]])):
 
@@ -269,5 +269,5 @@
 
 							if np.min(tipdis)/segdis < options.getfieldvalue('toltip',0):
-								print "moving tip-domain intersection point"
+								print("moving tip-domain intersection point")
 
 								#Get position of the closer point
@@ -323,5 +323,5 @@
 			#read tracks
 			track=options.getfieldvalue('tracks')
-			if all(isinstance(track,(str,unicode))):
+			if all(isinstance(track,str)):
 				A=expread(track)
 				track=np.hstack((A.x.reshape(-1,),A.y.reshape(-1,)))
@@ -487,5 +487,5 @@
 	raise RuntimeError("bamg.py/processgeometry is not complete.")
 	#Deal with edges
-	print "Checking Edge crossing..."
+	print("Checking Edge crossing...")
 	i=0
 	while (i<np.size(geom.Edges,axis=0)):
@@ -542,5 +542,5 @@
 
 	#Check point outside
-	print "Checking for points outside the domain..."
+	print("Checking for points outside the domain...")
 	i=0
 	num=0
@@ -572,5 +572,5 @@
 
 	if num:
-		print "WARNING: %d points outside the domain outline have been removed" % num
+		print(("WARNING: %d points outside the domain outline have been removed" % num))
 
 	"""
Index: /issm/trunk-jpl/src/m/mesh/squaremesh.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/squaremesh.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mesh/squaremesh.py	(revision 23716)
@@ -27,12 +27,12 @@
 
 	#create coordinates
-	for n in xrange(0,nx):
-		for m in xrange(0,ny):
+	for n in range(0,nx):
+		for m in range(0,ny):
 			x[n*ny+m]=float(n)
 			y[n*ny+m]=float(m)
 
 	#create index
-	for n in xrange(0,nx-1):
-		for m in xrange(0,ny-1):
+	for n in range(0,nx-1):
+		for m in range(0,ny-1):
 			A=n*ny+(m+1)
 			B=A+1
Index: /issm/trunk-jpl/src/m/mesh/triangle.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/triangle.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/mesh/triangle.py	(revision 23716)
@@ -37,7 +37,7 @@
 	#Check that mesh was not already run, and warn user: 
 	if md.mesh.numberofelements:
-		choice = raw_input('This model already has a mesh. Are you sure you want to go ahead? (y/n)')
+		choice = eval(input('This model already has a mesh. Are you sure you want to go ahead? (y/n)'))
 		if not m.strcmp(choice,'y'):
-			print 'no meshing done ... exiting'
+			print('no meshing done ... exiting')
 			return None
 
Index: /issm/trunk-jpl/src/m/miscellaneous/fielddisplay.py
===================================================================
--- /issm/trunk-jpl/src/m/miscellaneous/fielddisplay.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/miscellaneous/fielddisplay.py	(revision 23716)
@@ -21,5 +21,5 @@
 
 	#string
-	if isinstance(field,(str,unicode)):
+	if isinstance(field,str):
 
 		if len(field)>30:
@@ -29,5 +29,5 @@
 
 	#numeric
-	elif isinstance(field,(int,long,float)):
+	elif isinstance(field,(int,float)):
 		string=displayunit(offset,name,str(field),comment) 
 
@@ -67,5 +67,5 @@
 		offset+='   '
 
-		for structure_field,sfield in field.iteritems():
+		for structure_field,sfield in list(field.items()):
 			string+=parsedisplay(offset,str(structure_field),sfield,'')+'\n'
 
@@ -93,7 +93,7 @@
 	if len(field)<5:
 		for fieldi in field:
-			if   isinstance(fieldi,(str,unicode)):
+			if   isinstance(fieldi,str):
 				string+="'%s'," % fieldi
-			elif isinstance(fieldi,(bool,int,long,float)):
+			elif isinstance(fieldi,(bool,int,float)):
 				string+="%s," % str(fieldi)
 			else:
@@ -127,5 +127,5 @@
 		string="%s%-23s: %-15s" % (offset,name,characterization)
 	else:
-		if   isinstance(comment,(str,unicode)):
+		if   isinstance(comment,str):
 			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment)
 		elif isinstance(comment,list):
Index: /issm/trunk-jpl/src/m/miscellaneous/parallelrange.py
===================================================================
--- /issm/trunk-jpl/src/m/miscellaneous/parallelrange.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/miscellaneous/parallelrange.py	(revision 23716)
@@ -9,14 +9,14 @@
 
 	#We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
-	num_local_rows=[int(globalsize/numprocs) for i in xrange(numprocs)]
+	num_local_rows=[int(globalsize/numprocs) for i in range(numprocs)]
 
 	#There may be some rows left. Distribute evenly.
 	row_rest=globalsize - numprocs*int(globalsize/numprocs)
 
-	for i in xrange(row_rest):
+	for i in range(row_rest):
 		num_local_rows[i]=num_local_rows[i]+1
 
 	i1=0
-	for i in xrange(rank-1):
+	for i in range(rank-1):
 		i1+=num_local_rows[i]
 	i2=i1+num_local_rows[rank-1]-1
Index: /issm/trunk-jpl/src/m/modules/MeshPartition.py
===================================================================
--- /issm/trunk-jpl/src/m/modules/MeshPartition.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/modules/MeshPartition.py	(revision 23716)
@@ -15,5 +15,5 @@
 '''
 	if md == None or numpartitions == None:
-		print MeshPartition.__doc__
+		print((MeshPartition.__doc__))
 		raise RuntimeError('Wrong usage (see above)')
 
Index: /issm/trunk-jpl/src/m/os/issmscpin.py
===================================================================
--- /issm/trunk-jpl/src/m/os/issmscpin.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/os/issmscpin.py	(revision 23716)
@@ -43,6 +43,6 @@
 				raise OSError("issmscpin error message: could not find ISSM_DIR_WIN environment variable.")
 
-			username=raw_input('Username: (quoted string) ')
-			key=raw_input('Key: (quoted string) ')
+			username=eval(input('Username: (quoted string) '))
+			key=eval(input('Key: (quoted string) '))
 
 			for package in packages:
Index: /issm/trunk-jpl/src/m/os/issmscpout.py
===================================================================
--- /issm/trunk-jpl/src/m/os/issmscpout.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/os/issmscpout.py	(revision 23716)
@@ -36,6 +36,6 @@
 				raise OSError("issmscpout error message: could not find ISSM_DIR_WIN environment variable.")
 
-			username=raw_input('Username: (quoted string) ')
-			key=raw_input('Key: (quoted string) ')
+			username=eval(input('Username: (quoted string) '))
+			key=eval(input('Key: (quoted string) '))
 
 			for package in packages:
Index: /issm/trunk-jpl/src/m/os/issmssh.py
===================================================================
--- /issm/trunk-jpl/src/m/os/issmssh.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/os/issmssh.py	(revision 23716)
@@ -29,6 +29,6 @@
 				raise OSError("issmssh error message: could not find ISSM_DIR_WIN environment variable.")
 
-			username=raw_input('Username: (quoted string) ')
-			key=raw_input('Key: (quoted string) ')
+			username=eval(input('Username: (quoted string) '))
+			key=eval(input('Key: (quoted string) '))
 
 			subprocess.call('%s/externalpackages/ssh/plink.exe -ssh -l "%s" -pw "%s" %s "%s"' % (ISSM_DIR,username,key,host,command),shell=True);
Index: /issm/trunk-jpl/src/m/parameterization/contourenvelope.py
===================================================================
--- /issm/trunk-jpl/src/m/parameterization/contourenvelope.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/parameterization/contourenvelope.py	(revision 23716)
@@ -27,10 +27,10 @@
 		flags=args[0]
 
-		if   isinstance(flags,(str,unicode)):
+		if   isinstance(flags,str):
 			file=flags
 			if not os.path.exists(file):
 				raise IOError("contourenvelope error message: file '%s' not found" % file)
 			isfile=1
-		elif isinstance(flags,(bool,int,long,float)):
+		elif isinstance(flags,(bool,int,float)):
 			#do nothing for now
 			isfile=0
@@ -118,5 +118,5 @@
 			nods1=elements[el1,:]
 			flag=np.setdiff1d(nods1,elements[els2,:])
-			for j in xrange(0,3):
+			for j in range(0,3):
 				nods=np.delete(nods1,j)
 				if np.any(m.ismember(flag,nods)):
Index: /issm/trunk-jpl/src/m/parameterization/parameterize.py
===================================================================
--- /issm/trunk-jpl/src/m/parameterization/parameterize.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/parameterization/parameterize.py	(revision 23716)
@@ -22,5 +22,5 @@
 
 	#Try and run parameter file.
-	execfile(parametername)
+	exec(compile(open(parametername).read(), parametername, 'exec'))
 
 	#Name and notes
Index: /issm/trunk-jpl/src/m/parameterization/setflowequation.py
===================================================================
--- /issm/trunk-jpl/src/m/parameterization/setflowequation.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/parameterization/setflowequation.py	(revision 23716)
@@ -11,6 +11,6 @@
 	   'SIA','SSA','HO','L1L2','FS' and 'fill' are the possible options
 	   that must be followed by the corresponding exp file or flags list
-	   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
-	   If user wants every element outside the domain to be 
+	   It can either be a domain file (argus type, .exp extension), or an array of element flags.
+	   If user wants every element outside the domain to be
 	   setflowequationd, add '~' to the name of the domain file (ex: '~HO.exp');
 	   an empty string '' will be considered as an empty domain
@@ -58,5 +58,5 @@
 	#check that each element has only one flag
 	if any(SIAflag+SSAflag+L1L2flag+HOflag+FSflag>1):
-		print "setflowequation warning message: some elements have several types, higher order type is used for them"
+		print("setflowequation warning message: some elements have several types, higher order type is used for them")
 		SIAflag[np.where(np.logical_and(SIAflag,SSAflag))]=False
 		SIAflag[np.where(np.logical_and(SIAflag,HOflag))]=False
@@ -96,5 +96,5 @@
 
 	#Then complete with NoneApproximation or the other model used if there is no FS
-	if any(FSflag): 
+	if any(FSflag):
 		if   any(HOflag):    #fill with HO
 			HOflag[~FSflag]=True
@@ -103,5 +103,5 @@
 			SSAflag[~FSflag]=True
 			nodeonSSA[md.mesh.elements[np.where(SSAflag),:]-1]=True
-		else:    #fill with none 
+		else:    #fill with none
 			noneflag[np.where(~FSflag)]=True
 
@@ -123,5 +123,5 @@
 		if np.all(np.logical_not(np.isnan(bordernodes2d))):
 			penalties=np.zeros((0,2))
-			for	i in xrange(1,numlayers):
+			for	i in range(1,numlayers):
 				penalties=np.vstack((penalties,np.vstack((bordernodes2d,bordernodes2d+md.mesh.numberofvertices2d*(i))).T))
 			md.stressbalance.vertex_pairing=penalties
@@ -285,3 +285,2 @@
 
 	return md
-
Index: /issm/trunk-jpl/src/m/parameterization/setmask.py
===================================================================
--- /issm/trunk-jpl/src/m/parameterization/setmask.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/parameterization/setmask.py	(revision 23716)
@@ -10,6 +10,6 @@
 	SETMASK - establish boundaries between grounded and floating ice.
 
-	   By default, ice is considered grounded. The contour floatingicename defines nodes 
-	   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
+	   By default, ice is considered grounded. The contour floatingicename defines nodes
+	   for which ice is floating. The contour groundedicename defines nodes inside an floatingice,
 	   that are grounded (ie: ice rises, islands, etc ...)
 	   All input files are in the Argus format (extension .exp).
@@ -39,8 +39,8 @@
 	#Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
 	elementonfloatingice = FlagElements(md, floatingicename)
-	elementongroundedice = FlagElements(md, groundedicename) 
+	elementongroundedice = FlagElements(md, groundedicename)
 
-	#Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
-	#arrays come from domain outlines that can intersect one another: 
+	#Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous
+	#arrays come from domain outlines that can intersect one another:
 
 	elementonfloatingice = np.logical_and(elementonfloatingice,np.logical_not(elementongroundedice))
Index: /issm/trunk-jpl/src/m/partition/partitioner.py
===================================================================
--- /issm/trunk-jpl/src/m/partition/partitioner.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/partition/partitioner.py	(revision 23716)
@@ -59,5 +59,5 @@
 		md=adjacency(md)
 	else:
-		print 'skipping adjacency matrix computation as requested in the options'
+		print('skipping adjacency matrix computation as requested in the options')
 
 	if m.strcmpi(package,'chaco'):
@@ -104,5 +104,5 @@
 		if (npart == md.mesh.numberofelements) or (md.qmu.numberofpartitions == md.mesh.numberofelements):
 			part=np.arange(1,1+md.mesh.numberofelements,1)
-			print 'Linear partitioner requesting partitions on elements'
+			print('Linear partitioner requesting partitions on elements')
 		else:
 			part=np.arange(1,1+md.mesh.numberofvertices,1)
@@ -113,5 +113,5 @@
 
 	else:
-		print help
+		print(help)
 		raise RuntimeError('partitioner error message: could not find '+str(package)+' partitioner')
 
Index: /issm/trunk-jpl/src/m/plot/applyoptions.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/applyoptions.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/applyoptions.py	(revision 23716)
@@ -12,5 +12,5 @@
 	import matplotlib.pyplot as plt
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 def applyoptions(md,data,options,fig,axgrid,gridindex):
@@ -142,5 +142,5 @@
 	# }}}
 	# {{{ xlim, ylim, zlim
- 	if options.exist('xlim'):
+	if options.exist('xlim'):
 		ax.set_xlim(options.getfieldvalue('xlim'))
 	if options.exist('ylim'):
Index: /issm/trunk-jpl/src/m/plot/checkplotoptions.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/checkplotoptions.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/checkplotoptions.py	(revision 23716)
@@ -29,5 +29,5 @@
 		if 'on' in options.getfieldvalue('showsection','on'):
 			options.changefieldvalue('showsection',4)
-	# }}}	
+	# }}}
 	# {{{ smooth values
 	if options.exist('smooth'):
@@ -54,14 +54,14 @@
 		textlist.extend([text] if isinstance(text,str) else text)
 		numtext=len(textlist)
-		# text position	
+		# text position
 		textpos=options.getfieldvalue('textposition',[0.5,0.5])
 		if not isinstance(textpos,list):
 			raise Exception('textposition should be passed as a list')
 		if any(isinstance(i,list) for i in textpos):
-		    textx=[item[0] for item in textpos]
-		    texty=[item[1] for item in textpos]
-                else:
-                    textx=[textpos[0]]
-                    texty=[textpos[1]]
+			textx=[item[0] for item in textpos]
+			texty=[item[1] for item in textpos]
+		else:
+			textx=[textpos[0]]
+			texty=[textpos[1]]
 		if len(textx)!=numtext or len(texty)!=numtext:
 			raise Exception('textposition should contain one list of x,y vertices for every text instance')
Index: /issm/trunk-jpl/src/m/plot/colormaps/cmaptools.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/colormaps/cmaptools.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/colormaps/cmaptools.py	(revision 23716)
@@ -4,5 +4,5 @@
 	import matplotlib as mpl
 except ImportError:
-	print 'cannot import matplotlib, no plotting capabilities enabled'
+	print('cannot import matplotlib, no plotting capabilities enabled')
 
 def truncate_colormap(cmap, minval=0.0, maxval=1.0, n=100):
Index: /issm/trunk-jpl/src/m/plot/export_gl.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/export_gl.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/export_gl.py	(revision 23716)
@@ -42,7 +42,7 @@
 	#Deal with contour {{{
 	print ('getting contour')
-	print (md.mesh.segments)
-	segmenets0 = map(lambda s: s - 1, md.mesh.segments[:,0]);
-	segmenets1 = map(lambda s: s - 1, md.mesh.segments[:,1]);
+	print((md.mesh.segments))
+	segmenets0 = [s - 1 for s in md.mesh.segments[:,0]];
+	segmenets1 = [s - 1 for s in md.mesh.segments[:,1]];
 	
 	contour_lat1=md.mesh.lat.take(segmenets0)
@@ -56,11 +56,11 @@
 	R2=6371000*np.ones(len(contour_surface2))+scaling_factor*contour_surface2;
 
-	model.contourx1 = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.cos(math.radians(long)), R1, contour_lat1, contour_long1);
-	model.contoury1 = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.sin(math.radians(long)), R1, contour_lat1, contour_long1);
-	model.contourz1 = map(lambda r, lat: r * math.sin(math.radians(lat)), R1, contour_lat1);
+	model.contourx1 = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.cos(math.radians(int)), R1, contour_lat1, contour_long1));
+	model.contoury1 = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.sin(math.radians(int)), R1, contour_lat1, contour_long1));
+	model.contourz1 = list(map(lambda r, lat: r * math.sin(math.radians(lat)), R1, contour_lat1));
 	
-	model.contourx2 = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.cos(math.radians(long)), R2, contour_lat2, contour_long2);
-	model.contoury2 = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.sin(math.radians(long)), R2, contour_lat2, contour_long2);
-	model.contourz2 = map(lambda r, lat: r * math.sin(math.radians(lat)), R2, contour_lat2);
+	model.contourx2 = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.cos(math.radians(int)), R2, contour_lat2, contour_long2));
+	model.contoury2 = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.sin(math.radians(int)), R2, contour_lat2, contour_long2));
+	model.contourz2 = list(map(lambda r, lat: r * math.sin(math.radians(lat)), R2, contour_lat2));
 
 	#}}}
@@ -72,7 +72,7 @@
 	R=6371000*np.ones(len(md.mesh.lat))+scaling_factor*surface;
 	
-	x = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.cos(math.radians(long)), R, md.mesh.lat,md.mesh.long);
-	y = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.sin(math.radians(long)), R, md.mesh.lat,md.mesh.long);
-	z = map(lambda r, lat: r * math.sin(math.radians(lat)), R, md.mesh.lat);
+	x = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.cos(math.radians(int)), R, md.mesh.lat,md.mesh.long));
+	y = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.sin(math.radians(int)), R, md.mesh.lat,md.mesh.long));
+	z = list(map(lambda r, lat: r * math.sin(math.radians(lat)), R, md.mesh.lat));
 	
 	#Deal with triangulation: 
@@ -88,5 +88,5 @@
 	#Deal with data: 
 	print('getting data')
-	for i in xrange(0,len(optionslist)):
+	for i in range(0,len(optionslist)):
 		options=optionslist[i]; 
 		options=checkplotoptions(md,options);
Index: /issm/trunk-jpl/src/m/plot/plot_BC.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_BC.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_BC.py	(revision 23716)
@@ -2,5 +2,5 @@
 	import pylab as p
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 import numpy as  np
Index: /issm/trunk-jpl/src/m/plot/plot_contour.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_contour.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_contour.py	(revision 23716)
@@ -5,5 +5,5 @@
 	import matplotlib.pyplot as plt
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 def plot_contour(md,datain,options,ax):
Index: /issm/trunk-jpl/src/m/plot/plot_elementnumbering.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_elementnumbering.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_elementnumbering.py	(revision 23716)
@@ -2,5 +2,5 @@
 	import pylab as p
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 import numpy as  np
@@ -26,5 +26,5 @@
 		ax.triplot(x,y,elements)
 	else:
-		print 'Not Implemented Yet'
+		print('Not Implemented Yet')
 
 	XLims=[np.min(x),np.max(x)]
Index: /issm/trunk-jpl/src/m/plot/plot_icefront.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_icefront.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_icefront.py	(revision 23716)
@@ -2,5 +2,5 @@
 	import pylab as p
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 import numpy as  np
 from processmesh import processmesh
Index: /issm/trunk-jpl/src/m/plot/plot_manager.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_manager.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_manager.py	(revision 23716)
@@ -3,5 +3,5 @@
 	import matplotlib.pyplot as plt
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 from checkplotoptions import checkplotoptions
@@ -19,5 +19,5 @@
 	overlaysupport=True
 except ImportError:
-	print 'osgeo/gdal for python not installed, overlay plots are not enabled'
+	print('osgeo/gdal for python not installed, overlay plots are not enabled')
 	overlaysupport=False
 
@@ -60,5 +60,5 @@
 	# }}}
 	# {{{ dealing with special plot
-	if isinstance(data,(str,unicode)):
+	if isinstance(data,str):
 		if data=='mesh': 
 			plot_mesh(md,options,fig,axgrid,gridindex)
@@ -76,9 +76,9 @@
 			return
 		elif data=='none':
-			print 'no data provided to plot (TODO: write plot_none.py)'
+			print('no data provided to plot (TODO: write plot_none.py)')
 			applyoptions(md,[],options,fig,axgrid,gridindex)
 			return
 		else:
-			print "WARNING: '%s' is not implemented or is not a valid string for option 'data'" % data
+			print(("WARNING: '%s' is not implemented or is not a valid string for option 'data'" % data))
 	# }}}
 	# {{{ Gridded plot TODO
Index: /issm/trunk-jpl/src/m/plot/plot_mesh.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_mesh.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_mesh.py	(revision 23716)
@@ -2,5 +2,5 @@
 	import pylab as p
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 import numpy as np
@@ -46,5 +46,5 @@
 		
 		for triangle in triel:
-			tri=zip(x[triangle],y[triangle],z[triangle])
+			tri=list(zip(x[triangle],y[triangle],z[triangle]))
 			pl3=Line3DCollection([tri],edgecolor='r')
 			ax.add_collection3d(pl3)
Index: /issm/trunk-jpl/src/m/plot/plot_overlay.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_overlay.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_overlay.py	(revision 23716)
@@ -9,9 +9,9 @@
 	from mpl_toolkits.basemap import Basemap
 except ImportError:
-	print 'Basemap toolkit not installed'
+	print('Basemap toolkit not installed')
 try:
 	from osgeo import gdal
 except ImportError:
-	print 'osgeo/gdal for python not installed, plot_overlay is disabled'
+	print('osgeo/gdal for python not installed, plot_overlay is disabled')
 
 
@@ -32,8 +32,8 @@
 
 	if not is2d:
-		raise StandardError('overlay plot not supported for 3D meshes, project on a 2D layer first')
+		raise Exception('overlay plot not supported for 3D meshes, project on a 2D layer first')
 
 	if not options.exist('overlay_image'):
-		raise StandardError('overlay error: provide overlay_image with path to geotiff file')
+		raise Exception('overlay error: provide overlay_image with path to geotiff file')
 	image=options.getfieldvalue('overlay_image')
 
@@ -111,5 +111,5 @@
 			lon_0=0
 		else:
-			hemisphere=raw_input('epsg code {} is not supported chose your hemisphere (1 for North, -1 for south)'.format(mesh.epsg))
+			hemisphere=eval(input('epsg code {} is not supported chose your hemisphere (1 for North, -1 for south)'.format(mesh.epsg)))
 
 		lat,lon=xy2ll(xlim,ylim,hemisphere,lon_0,st_lat)
Index: /issm/trunk-jpl/src/m/plot/plot_quiver.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_quiver.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_quiver.py	(revision 23716)
@@ -15,5 +15,5 @@
 	#scaling of arrow length (giving info to change as it seems that there is no better way to work arround it)
 	scale=options.getfieldvalue('scaling',scaler)
-	print('the current value for "scaling" is {}, increase it to shorten the arrows'.format(scale))
+	print(('the current value for "scaling" is {}, increase it to shorten the arrows'.format(scale)))
 	#sizing of the arrows
 	width=options.getfieldvalue('width',5.0e-3)
Index: /issm/trunk-jpl/src/m/plot/plot_streamlines.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_streamlines.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_streamlines.py	(revision 23716)
@@ -8,5 +8,5 @@
 	from scipy.interpolate import griddata
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 def plot_streamlines(md,options,ax):
@@ -42,5 +42,5 @@
 
     if not is2d:
-        raise StandardError('plot_streamlines error: streamlines option not supported for 3D plots')
+        raise Exception('plot_streamlines error: streamlines option not supported for 3D plots')
 
     # format data for matplotlib streamplot function
Index: /issm/trunk-jpl/src/m/plot/plot_unit.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_unit.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_unit.py	(revision 23716)
@@ -10,5 +10,5 @@
 	from mpl_toolkits.mplot3d.art3d import Poly3DCollection
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 def plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options,fig,axgrid,gridindex):
@@ -116,5 +116,5 @@
 			recindex=eltind[idx[np.where(recur==1)]]
 			for i,rectangle in enumerate(recel):
-				rec=zip(x[rectangle],y[rectangle],z[rectangle])
+				rec=list(zip(x[rectangle],y[rectangle],z[rectangle]))
 				pl3=Poly3DCollection([rec])
 				color=loccmap.to_rgba(data[recindex[i]])
@@ -133,5 +133,5 @@
 			triindex=eltind[idx[np.where(recur==1)]]
 			for i,triangle in enumerate(triel):
-				tri=zip(x[triangle],y[triangle],z[triangle])
+				tri=list(zip(x[triangle],y[triangle],z[triangle]))
 				pl3=Poly3DCollection([tri])
 				color=loccmap.to_rgba(data[triindex[i]])
@@ -182,5 +182,5 @@
 			recel= recface[idx[np.where(recur==1)]]
 			for rectangle in recel:
-				rec=zip(x[rectangle],y[rectangle],z[rectangle])
+				rec=list(zip(x[rectangle],y[rectangle],z[rectangle]))
 				pl3=Poly3DCollection([rec])
 				color=loccmap.to_rgba(np.mean(data[rectangle]))
@@ -196,5 +196,5 @@
 			triel= triface[idx[np.where(recur==1)]]
 			for triangle in triel:
-				tri=zip(x[triangle],y[triangle],z[triangle])
+				tri=list(zip(x[triangle],y[triangle],z[triangle]))
 				pl3=Poly3DCollection([tri])
 				color=loccmap.to_rgba(np.mean(data[triangle]))
@@ -222,5 +222,5 @@
 
 	elif datatype==4:
-		print 'plot_unit message: P1 patch plot not implemented yet'
+		print('plot_unit message: P1 patch plot not implemented yet')
 		return
 
@@ -229,5 +229,5 @@
 
 	elif datatype==5:
-		print 'plot_unit message: P0 patch plot not implemented yet'
+		print('plot_unit message: P0 patch plot not implemented yet')
 		return
 
Index: /issm/trunk-jpl/src/m/plot/plot_vertexnumbering.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_vertexnumbering.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plot_vertexnumbering.py	(revision 23716)
@@ -2,5 +2,5 @@
 	import pylab as p
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 import numpy as  np
@@ -28,5 +28,5 @@
 		ax.triplot(x,y,elements)
 	else:
-		print 'Not Implemented Yet'
+		print('Not Implemented Yet')
 
 	XPad=0.1*(np.max(x)-np.min(x))
Index: /issm/trunk-jpl/src/m/plot/plotdoc.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plotdoc.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plotdoc.py	(revision 23716)
@@ -170,9 +170,9 @@
 	print("   Options: ")
 	print("     'data' : and a model field or one of the following options.")
-	for key in pydata.keys():
-		print("     - {} : {}".format(key,pydata[key]))
+	for key in list(pydata.keys()):
+		print(("     - {} : {}".format(key,pydata[key])))
 	print("")
 	print("   The general look of the plot is then given by the following keywords")
 	for key in sorted(pyoptions):
-		print("     - {} : {}".format(key,pyoptions[key]))
+		print(("     - {} : {}".format(key,pyoptions[key])))
 	print("       any options (except 'data') can be followed by '#i' where 'i' is the subplot number, or '#all' if applied to all plots")
Index: /issm/trunk-jpl/src/m/plot/plotmodel.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plotmodel.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/plotmodel.py	(revision 23716)
@@ -11,5 +11,5 @@
 	from mpl_toolkits.mplot3d import Axes3D
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+	print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 def plotmodel(md,*args):
@@ -48,9 +48,9 @@
 	#check that nrows and ncols were given at the same time!
 	if not nr==nc:
-		raise StandardError('error: nrows and ncols need to be specified together, or not at all')
+		raise Exception('error: nrows and ncols need to be specified together, or not at all')
 
 	#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)
 
@@ -104,3 +106,3 @@
 		fig.show()
 	else:
-		raise StandardError('plotmodel error message: no output data found.')
+		raise Exception('plotmodel error message: no output data found.')
Index: /issm/trunk-jpl/src/m/plot/processdata.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/processdata.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/processdata.py	(revision 23716)
@@ -57,5 +57,5 @@
 		options.addfielddefault('clim',[lb,ub])
 		options.addfielddefault('cmap_set_under','1')
-		print "WARNING: nan's treated as", nanfill, "by default.  Change using pairoption 'nan',nan_fill_value in plotmodel call"
+		print(("WARNING: nan's treated as", nanfill, "by default.  Change using pairoption 'nan',nan_fill_value in plotmodel call"))
   # }}}  
 	# {{{ log
@@ -117,6 +117,6 @@
 		datatype=2
 		spccol=options.getfieldvalue('spccol',0)
-		print 'multiple-column spc field; specify column to plot using option "spccol"'
-		print 'column ', spccol, ' plotted for time: ', procdata[-1,spccol]
+		print('multiple-column spc field; specify column to plot using option "spccol"')
+		print(('column ', spccol, ' plotted for time: ', procdata[-1,spccol]))
 		procdata=procdata[0:-1,spccol]
     
Index: /issm/trunk-jpl/src/m/plot/writejsfield.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/writejsfield.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/writejsfield.py	(revision 23716)
@@ -11,5 +11,5 @@
 		fid.write('<!-- {0}{{{{{{-->\n'.format(name))
 		fid.write('{0}=['.format(name))
-		for i in xrange(0, nods-1):
+		for i in range(0, nods-1):
 			fid.write('{0},'.format(variable[i]))
 		fid.write('{0}];\n'.format(variable[-1]))
@@ -19,7 +19,7 @@
 		fid.write('<!-- {0}{{{{{{-->\n'.format(name))
 		fid.write('{0}=[]\n'.format(name))
-		for i in xrange(0, len(variable[2])):
+		for i in range(0, len(variable[2])):
 			fid.write('{0}["{1}"]=['.format(name,i))
-			for j in xrange(1, nods-1):
+			for j in range(1, nods-1):
 				fid.write('{0},'.format(variable[j][i]))
 			fid.write('{0}];\n'.format(variable[-1][i]))
Index: /issm/trunk-jpl/src/m/plot/writejsfile.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/writejsfile.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/plot/writejsfile.py	(revision 23716)
@@ -20,5 +20,5 @@
 	fid.write('<!-- model["index"]{{{-->\n')
 	fid.write('model["index"]=[')
-	for i in xrange(0, nel-1):
+	for i in range(0, nel-1):
 		fid.write('[{0}, {1}, {2}],'.format(model.index[i][0],model.index[i][1],model.index[i][2]))
 	fid.write('[{0}, {1}, {2}]];\n'.format(model.index[-1][0],model.index[-1][1],model.index[-1][2]))
@@ -40,5 +40,5 @@
 	fid.write('results={};\n')
 
-	for i in xrange(0,len(results)):
+	for i in range(0,len(results)):
 		fid.write('result={};\n')
 		writejsfield(fid,'result["data"]',results[i].data,nods)
Index: /issm/trunk-jpl/src/m/qmu/dakota_in_data.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/dakota_in_data.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/dakota_in_data.py	(revision 23716)
@@ -45,14 +45,12 @@
 	#  get default set of parameters
 	params=dakota_in_params(struct())
-
 	#  merge specified parameters into default set, whether or not
 	#  they already exist
 	fnames=fieldnames(dparams)
 
-	for i in range(np.size(fnames)):
-		if not isfield(params,fnames[i]):
-			print 'WARNING: dakota_in_data:unknown_param: No parameter '+str(fnames[i])+' in default parameter set.'	
-			
-	    	exec('params.%s = vars(dparams)[fnames[i]]')%(fnames[i])
+	for fieldname in fnames:
+		if not isfield(params,fieldname):
+			print('WARNING: dakota_in_data:unknown_param: No parameter {} in default parameter set.'.format(str(fieldname)))
+		exec('params.{} = vars(dparams)[fieldname]'.format(fieldname))
 
 	# use matlab even though we are running python
@@ -76,5 +74,5 @@
 	for i in range(len(fnames)):
 		# currently all variable types can just be copied
-		exec('dvar.%s = vars(variables)[fnames[i]]')%(fnames[i])
+		exec(('dvar.%s = vars(variables)[fnames[i]]')%(fnames[i]))
 
 	##  responses
@@ -83,5 +81,5 @@
 	for i in range(len(fnames)):
 		#  currently all response types can just be copied
-		exec('dresp.%s = vars(responses)[fnames[i]]')%(fnames[i])
+		exec(('dresp.%s = vars(responses)[fnames[i]]')%(fnames[i]))
 
 
Index: /issm/trunk-jpl/src/m/qmu/dakota_in_params.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/dakota_in_params.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/dakota_in_params.py	(revision 23716)
@@ -182,3 +182,2 @@
 
 	return params
-
Index: /issm/trunk-jpl/src/m/qmu/dakota_in_write.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/dakota_in_write.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/dakota_in_write.py	(revision 23716)
@@ -43,5 +43,5 @@
 	#  process the input parameters
 	if len(fieldnames(method)) == 0:
-		method=str(input('Method?  '))
+		method=str(eval(input('Method?  ')))
 
 	if type(method) == str:
@@ -53,5 +53,5 @@
 
 	if len(filei) == 0:
-		filei=str(input('Dakota input file to write?  '))
+		filei=str(eval(input('Dakota input file to write?  ')))
 
 	[pathstr,name,ext] = fileparts(filei)
@@ -62,5 +62,5 @@
 	filei2=fullfile(pathstr,name+ext)
 
-	print 'Opening Dakota input file \''+filei2 + '\'.'
+	print('Opening Dakota input file \''+filei2 + '\'.')
 	try:
 		with open(filei2,'w+') as fidi:
@@ -93,7 +93,7 @@
 
 	except IOError:
-		print filei2 + ' could not be opened.'
-
-	print 'End of file successfully written.'
+		print(filei2 + ' could not be opened.')
+
+	print('End of file successfully written.')
 
 
@@ -102,5 +102,5 @@
 def strategy_write(fidi,params):
 
-	print 'Writing strategy section of Dakota input file.'
+	print('Writing strategy section of Dakota input file.')
 
 	fidi.write('strategy,\n')
@@ -116,5 +116,5 @@
 def environment_write(fidi,params):
 
-	print 'Writing environment section of Dakota input file.'
+	print('Writing environment section of Dakota input file.')
 
 	fidi.write('environment,\n')
@@ -129,5 +129,5 @@
 def method_write(fidi,dmeth,dresp,params):
 
-	print 'Writing method section of Dakota input file.'
+	print('Writing method section of Dakota input file.')
 
 	fidi.write('method,\n')
@@ -151,5 +151,5 @@
 def model_write(fidi):
 
-	print 'Writing model section of Dakota input file.'
+	print('Writing model section of Dakota input file.')
 
 	fidi.write('model,\n')
@@ -161,5 +161,5 @@
 def variables_write(fidi,dmeth,dvar):
 
-	print 'Writing variables section of Dakota input file.'
+	print('Writing variables section of Dakota input file.')
 
 	fidi.write('variables,\n')
@@ -174,6 +174,6 @@
 		str_name = dmeth.variables[j]
 
-		# organize so that multiple instances of the same qmu class 
-		# (2 different variable instances of "normal_uncertain" for example)  
+		# organize so that multiple instances of the same qmu class
+		# (2 different variable instances of "normal_uncertain" for example)
 		# are in the same dakota_write call regardless of individual size;
 		# but that each class has its own dakota_write call
@@ -205,5 +205,5 @@
 def interface_write(fidi,params):
 
-	print 'Writing interface section of Dakota input file.'
+	print('Writing interface section of Dakota input file.')
 
 	fidi.write('interface,\n')
@@ -213,5 +213,4 @@
 	elif params.system+params.fork+params.direct > 1:
 		raise RuntimeError('Too many interfaces selected.')
-
 	if params.system or params.fork:
 		param_write(fidi,'\t','asynchronous','','\n',params)
@@ -230,12 +229,12 @@
 		if len(params.input_filter) != 0:
 			param_write(fidi,'\t  ','input_filter','    = ','\n',params)
-		
+
 		if len(params.output_filter) != 0:
 			param_write(fidi,'\t  ','output_filter','   = ','\n',params)
-		
+
 		param_write(fidi,'\t  ','failure_capture','   ','\n',params)
 		param_write(fidi,'\t  ','deactivate','        ','\n',params)
-		param_write(fidi,'\t  ','parameters_file',' = ','\n',params)
-		param_write(fidi,'\t  ','results_file','    = ','\n',params)
+		param_write(fidi,'\t  ','parameters_file',' =  \'','\'\n',params)
+		param_write(fidi,'\t  ','results_file',' =  \'','\'\n',params)
 		param_write(fidi,'\t  ','verbatim', '','\n',params)
 		param_write(fidi,'\t  ','aprepro', '','\n',params)
@@ -257,14 +256,14 @@
 			if ext != '':
 				ext='.py'
-		
+
 			params.analysis_components=fullfile(pathstr,name+ext)
 			param_write(fidi,'\t  ','analysis_components',' = \'','\'\n',params)
-		
+
 		if len(params.input_filter) != 0:
 			param_write(fidi,'\t  ','input_filter','    = ','\n',params)
-		
+
 		if len(params.output_filter) != 0:
 			param_write(fidi,'\t  ','output_filter','   = ','\n',params)
-		
+
 		param_write(fidi,'\t  ','failure_capture','   ','\n',params)
 		param_write(fidi,'\t  ','deactivate','        ','\n',params)
@@ -278,5 +277,5 @@
 def responses_write(fidi,dmeth,dresp,params):
 
-	print 'Writing responses section of Dakota input file.'
+	print('Writing responses section of Dakota input file.')
 
 	fidi.write('responses,\n')
@@ -312,5 +311,5 @@
 		elif (params.numerical_gradients+params.analytic_gradients > 1):
 			raise RuntimeError('Too many gradients selected.')
-		
+
 		if params.numerical_gradients:
 			param_write(fidi,'\t','numerical_gradients','','\n',params)
@@ -329,5 +328,2 @@
 	else:
 		fidi.write('\tno_hessians\n')
-
-
-
Index: /issm/trunk-jpl/src/m/qmu/dakota_out_parse.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/dakota_out_parse.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/dakota_out_parse.py	(revision 23716)
@@ -54,5 +54,5 @@
 
 	if not isfile(filei) or getsize(filei) == 0:
-		filei=str(input('Input file?  '))
+		filei=str(eval(input('Input file?  ')))
 	
 	#fidi=fopen(sprintf('%s',filei),'r')
@@ -88,10 +88,10 @@
 				[ntokens,tokens]=fltokens(fline)
 				method=tokens[0].strip()
-				print 'Dakota method =\''+method+'\'.'
+				print('Dakota method =\''+method+'\'.')
 			elif fline[6] in ['N','n']:
 				fline=findline(fidi,'methodName = ');
 				[ntokens,tokens]=fltokens(fline)
 				method=tokens[2].strip()
-				print 'Dakota methodName="'+method+'".'
+				print('Dakota methodName="'+method+'".')
 
 		##  loop through the file to find the function evaluation summary
@@ -160,5 +160,5 @@
 		#     return
 		# 
-		print 'End of file successfully reached.'
+		print('End of file successfully reached.')
 		#close(fidi)
 	#except Exception as err:
@@ -173,5 +173,5 @@
 ##  function to parse the dakota tabular output file
 
-	print 'Reading Dakota tabular output file.'
+	print('Reading Dakota tabular output file.')
 
 	#  process column headings of matrix (skipping eval_id)
@@ -190,5 +190,5 @@
 		desc[0][i]=str(tokens[i+offset])
 
-	print "Number of columns (Dakota V+R)="+str(ntokens-2)+'.'
+	print("Number of columns (Dakota V+R)="+str(ntokens-2)+'.')
 
 	#  process rows of matrix
@@ -213,5 +213,5 @@
 		nrow=nrow+1
 		
-	print 'Number of rows (Dakota func evals)='+str(nrow)+'.'
+	print('Number of rows (Dakota func evals)='+str(nrow)+'.')
 
 	#  calculate statistics
@@ -297,5 +297,5 @@
 	[ntokens,tokens]=fltokens(fline)
 	nfeval=tokens[4]
-	print '  Dakota function evaluations='+str(int(nfeval))+'.'
+	print('  Dakota function evaluations='+str(int(nfeval))+'.')
 
 	return nfeval
@@ -311,5 +311,5 @@
 	[ntokens,tokens]=fltokens(fline)
 	nsamp=tokens[3]
-	print '  Dakota samples='+str(int(nsamp))+'.'
+	print('  Dakota samples='+str(int(nsamp))+'.')
 
 	return nsamp
@@ -323,5 +323,5 @@
 		return
 
-	print 'Reading moments for response functions:'
+	print('Reading moments for response functions:')
 	
 	while True:
@@ -336,10 +336,10 @@
 		dresp.append(struct())
 		dresp[-1].descriptor=tokens[ 0]
-		print '  '+str(dresp[-1].descriptor)
+		print('  '+str(dresp[-1].descriptor))
 		dresp[-1].mean      =tokens[ 3]
 		dresp[-1].stddev    =tokens[ 6]
 		dresp[-1].coefvar   =tokens[12]
 
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
+	print('  Number of Dakota response functions='+str(len(dresp))+'.')
 
 	return dresp
@@ -353,5 +353,5 @@
 		return
 
-	print 'Reading moment-based statistics for response functions:'
+	print('Reading moment-based statistics for response functions:')
 
 	#  skip column headings of moment-based statistics
@@ -370,5 +370,5 @@
 		dresp.append(struct())
 		dresp[-1].descriptor=tokens[ 0]
-		print '  '+str(dresp[-1].descriptor)
+		print('  '+str(dresp[-1].descriptor))
 		dresp[-1].mean      =tokens[ 1]
 		dresp[-1].stddev    =tokens[ 2]
@@ -376,5 +376,5 @@
 		dresp[-1].kurtosis  =tokens[ 4]
 	
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
+	print('  Number of Dakota response functions='+str(len(dresp))+'.')
 
 	return dresp
@@ -388,5 +388,5 @@
 		return
 
-	print 'Reading 95% confidence intervals for response functions:'
+	print('Reading 95% confidence intervals for response functions:')
 
 	while True:
@@ -418,5 +418,5 @@
 			dresp.append(struct())
 			dresp[idresp].descriptor=tokens[0]
-			print '  '+str(dresp[idresp].descriptor)
+			print('  '+str(dresp[idresp].descriptor))
 		
 		#  add confidence intervals to response functions
@@ -435,5 +435,5 @@
 			dresp[i].stddevci[1,0]=tokens[ 4]
 
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
+	print('  Number of Dakota response functions='+str(len(dresp))+'.')
 
 	return dresp
@@ -450,5 +450,5 @@
 				return
 
-	print 'Reading CDF''s for response functions:'
+	print('Reading CDF''s for response functions:')
 
 	while fline == '' or fline.isspace():
@@ -475,5 +475,5 @@
 				dresp.append(struct())
 				dresp[idresp].descriptor=tokens[ 5]
-				print '  '+str(dresp(idresp).descriptor)
+				print('  '+str(dresp(idresp).descriptor))
 			
 
@@ -501,5 +501,5 @@
 				fline=fidi.readline()
 
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
+	print('  Number of Dakota response functions='+str(len(dresp))+'.')
 
 	return dresp
@@ -513,5 +513,5 @@
 		return
 
-	print 'Reading PDF''s for response functions:'
+	print('Reading PDF''s for response functions:')
 
 	while (fline != '' and not fline.isspace()):
@@ -539,5 +539,5 @@
 				dresp.append(struct)
 				dresp[idresp].descriptor=tokens[ 2]
-				print '  '+str(dresp[idresp].descriptor)
+				print('  '+str(dresp[idresp].descriptor))
 			
 
@@ -561,5 +561,5 @@
 				fline=fidi.readline()
 
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
+	print('  Number of Dakota response functions='+str(len(dresp))+'.')
 
 	return dresp
@@ -575,5 +575,5 @@
 			return
 
-	print 'Reading ' +fline+ '.'
+	print('Reading ' +fline+ '.')
 
 	cmat.title=fline
@@ -627,5 +627,5 @@
 			return
 
-	print 'Reading MV statistics for response functions:'
+	print('Reading MV statistics for response functions:')
 
 	ndresp=0
@@ -638,5 +638,5 @@
 		dresp.append(struct())
 		dresp[-1].descriptor=tokens[3]
-		print '  '+str(dresp[-1].descriptor)
+		print('  '+str(dresp[-1].descriptor))
 		fline=fidi.readline()
 		[ntokens,tokens]=fltokens(fline)
@@ -674,5 +674,5 @@
 
 		if not idvar:
-			print '    Importance Factors not available.'
+			print('    Importance Factors not available.')
 			dresp[-1].var   =[]
 			dresp[-1].impfac=[]
@@ -709,5 +709,5 @@
 				dresp.append(struct())
 				dresp[idresp].descriptor=tokens[ 5]
-				print '  '+str(dresp[idresp].descriptor)
+				print('  '+str(dresp[idresp].descriptor))
 			
 			#  skip column headings of cdf
@@ -736,10 +736,10 @@
 
 		if not icdf:
-			print '    Cumulative Distribution Function not available.'
+			print('    Cumulative Distribution Function not available.')
 			dresp[ndresp].cdf=[]
 			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'MV Statistics for ',18) and not strncmp (fline,'-',1):
 				fline=fidi.readline()
 
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
+	print('  Number of Dakota response functions='+str(len(dresp))+'.')
 
 	return dresp
@@ -758,5 +758,5 @@
 		dresp[-1].best=struct()
 	
-	print 'Reading values for best function evaluation:'
+	print('Reading values for best function evaluation:')
 
 	while (fline != '' and not fline.isspace()) and strncmpi(fline,'<<<<< Best ',11):
@@ -766,5 +766,5 @@
 
 		if strncmpi(str(tokens[2]),'parameter', 9):
-			print '  '+fline
+			print('  '+fline)
 
 			fline=fidi.readline()
@@ -782,5 +782,5 @@
 
 		elif strncmpi(str(tokens[2]),'objective', 9) and strncmpi(str(tokens[3]),'function' , 8):
-			print '  '+fline
+			print('  '+fline)
 
 			fline=fidi.readline()
@@ -796,5 +796,5 @@
 
 		elif strncmpi(str(tokens[2]),'residual', 8) and strncmpi(str(tokens[3]),'norm'    , 4):
-			print '  '+fline
+			print('  '+fline)
 			dresp.best.norm   =        tokens[ 5]
 			dresp.best.hnormsq=        tokens[10]
@@ -808,5 +808,5 @@
 
 		elif strncmpi(str(tokens[2]),'residual', 8) and strncmpi(str(tokens[3]),'term'    , 4):
-			print '  '+fline
+			print('  '+fline)
 
 			fline=fidi.readline()
@@ -822,5 +822,5 @@
 
 		elif strncmpi(str(tokens[2]),'constraint',10) and strncmpi(str(tokens[3]),'value'     , 5):
-			print '  '+fline
+			print('  '+fline)
 
 			fline=fidi.readline()
@@ -836,5 +836,5 @@
 
 		elif strncmpi(str(tokens[2]),'data'    , 4) and strncmpi(str(tokens[3]),'captured', 8):
-			print '  '+fline
+			print('  '+fline)
 			dresp.best.eval=        tokens[7]
 
@@ -846,5 +846,5 @@
 			#  read until next best or blank or end
 		else:
-			print '  '+fline+'  (ignored)'
+			print('  '+fline+'  (ignored)')
 
 			fline=fidi.readline()
@@ -868,5 +868,5 @@
 		dresp[-1].vum=[]
 	
-	print 'Reading measures for volumetric uniformity.'
+	print('Reading measures for volumetric uniformity.')
 
 	fline=fidi.readline()
@@ -904,5 +904,5 @@
 	[ntokens,tokens]=fltokens(fline)
 	method=tokens[2]
-	print 'Dakota iterator \''+str(method)+'\' completed.'
+	print('Dakota iterator \''+str(method)+'\' completed.')
 
 	return method
@@ -927,5 +927,5 @@
 
 	#  issue warning and reset file position
-	print 'Warning: findline:str_not_found: String '+str(string)+' not found in file.'
+	print('Warning: findline:str_not_found: String '+str(string)+' not found in file.')
 	fidi.seek(ipos,0)
 	return None
@@ -947,5 +947,5 @@
 	strings = re.split(':| ',fline)
 	# remove blank strings
-	strings = filter(lambda a: (a != '' and not a.isspace()),strings)
+	strings = [a for a in strings if (a != '' and not a.isspace())]
 
 	ntokens=0
Index: /issm/trunk-jpl/src/m/qmu/expandresponses.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/expandresponses.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/expandresponses.py	(revision 23716)
@@ -12,8 +12,8 @@
 	for k in fnames:
 		v = eval('responses.{}'.format(k))
-		exec 'dresp.{} = type(v)()'.format(k)
+		exec('dresp.{} = type(v)()'.format(k))
 		for j in range(len(v)):
 			#call setupdesign
-			exec 'dresp.{}=QmuSetupResponses(md,dresp.{},v[j])'.format(k,k)
+			exec('dresp.{}=QmuSetupResponses(md,dresp.{},v[j])'.format(k,k))
 
 	return dresp
Index: /issm/trunk-jpl/src/m/qmu/expandvariables.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/expandvariables.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/expandvariables.py	(revision 23716)
@@ -16,12 +16,12 @@
 		#  for linear constraints, just copy
 		if isinstance(v,linear_inequality_constraint) or isinstance(v,linear_equality_constraint):
-			exec 'dvar.{} = v'.format(k)
+			exec('dvar.{} = v'.format(k))
 
 		#  for variables, call the setup function
 		else:
-			exec 'dvar.{} = type(v)()'.format(k)
+			exec('dvar.{} = type(v)()'.format(k))
 			for j in range(len(v)):
 				#call setupdesign
-				exec 'dvar.{}=QmuSetupVariables(md,dvar.{},v[j])'.format(k,k)
+				exec('dvar.{}=QmuSetupVariables(md,dvar.{},v[j])'.format(k,k))
 
 
Index: /issm/trunk-jpl/src/m/qmu/helpers.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/helpers.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/helpers.py	(revision 23716)
@@ -128,5 +128,5 @@
 
 		for a,b in zip(args[0::2],args[1::2]):
-			exec('self.%s = b')%(a)
+			exec(('self.%s = b')%(a))
 		return
 
@@ -155,5 +155,5 @@
 		# re-route calls to vars(x) and x.__dict__
 		if attr == '__dict__':
-			return OrderedDict(self.items())
+			return OrderedDict(list(self.items()))
 		else:
 			return object.__getattribute__(self, attr)
@@ -186,6 +186,6 @@
 		# unless redefined as an entirely different structure
 		newInstance = type(self)()
-		for k,v in self.items():
-			exec('newInstance.%s = v')%(k)
+		for k,v in list(self.items()):
+			exec(('newInstance.%s = v')%(k))
 		return newInstance
 
@@ -197,6 +197,6 @@
 		# but will generally work in this case
 		newInstance = type(self)()
-		for k,v in self.items():
-			exec('newInstance.%s = deepcopy(v)')%(k)
+		for k,v in list(self.items()):
+			exec(('newInstance.%s = deepcopy(v)')%(k))
 		return newInstance
 
@@ -217,5 +217,5 @@
 		return self._v
 	def items(self):
-		return zip(self._k,self._v)
+		return list(zip(self._k,self._v))
 
 def isempty(x):
@@ -256,8 +256,8 @@
 	'''returns a list of fields of x
 	ignore_internals ignores all fieldnames starting with '_' and is True by default'''
-	result = vars(x).keys()
+	result = list(vars(x).keys())
 
 	if ignore_internals:
-		result = filter(lambda i: i[0] != '_',result)
+		result = [i for i in result if i[0] != '_']
 
 	return result
Index: /issm/trunk-jpl/src/m/qmu/lclist_write.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/lclist_write.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/lclist_write.py	(revision 23716)
@@ -38,5 +38,5 @@
 	#  write linear constraints
 
-	print '  Writing '+str(nvar)+' '+cstring+' linear constraints.'
+	print('  Writing '+str(nvar)+' '+cstring+' linear constraints.')
 
 	if len(pmatrix) != 0:
Index: /issm/trunk-jpl/src/m/qmu/param_write.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/param_write.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/param_write.py	(revision 23716)
@@ -7,5 +7,5 @@
 '''
 	if not isfield(params,pname):
-		print 'WARNING: param_write:param_not_found: Parameter '+str(pname)+' not found in structure.'
+		print('WARNING: param_write:param_not_found: Parameter {} not found in structure.'.format(pname))
 		return
 
@@ -19,9 +19,6 @@
 
 	elif type(params_pname) in [str]:
-		fidi.write(sbeg+str(pname)+smid+params_pname+s)
+		fidi.write(sbeg+pname+smid+params_pname+s)
 
 	elif type(params_pname) in [int, float]:
 		fidi.write(sbeg+str(pname)+smid+str(params_pname)+s)
-
-
-
Index: /issm/trunk-jpl/src/m/qmu/postqmu.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/postqmu.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/postqmu.py	(revision 23716)
@@ -22,5 +22,5 @@
 		with open(qmuerrfile,'r') as fide:
 			fline=fide.read()
-			print fline
+			print(fline)
 
 		raise RuntimeError('Dakota returned error in '+str(qmuerrfile)+' file.  '+str(qmudir)+' directory retained.')
Index: /issm/trunk-jpl/src/m/qmu/preqmu.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/preqmu.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/preqmu.py	(revision 23716)
@@ -26,5 +26,5 @@
 '''
 
-	print 'preprocessing dakota inputs'
+	print('preprocessing dakota inputs')
 	qmudir    = options.getfieldvalue('qmudir','qmu'+str(os.getpid()))
 	# qmudir = ['qmu_' datestr(now,'yyyymmdd_HHMMSS')]
Index: /issm/trunk-jpl/src/m/qmu/rlev_write.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/rlev_write.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/rlev_write.py	(revision 23716)
@@ -1,11 +1,9 @@
 import numpy as np
-
 #move this later
 from helpers import *
-
 from vector_write import *
 from param_write import *
+
 #import relevent qmu classes
-
 from MatlabArray import *
 
@@ -23,7 +21,6 @@
 	else:
 		fidi.write(' ' + str(len(levels)))
-	
+
 	fidi.write('\n')
-
 	fidi.write('\t  '+str(ltype)+' =\n')
 
@@ -35,5 +32,5 @@
 	else:
 		vector_write(fidi,'\t    ',levels,8,76)
-	
+
 	return
 
@@ -95,11 +92,11 @@
 	    rlevi_write(fidi,'response_levels',respl)
 	    param_write(fidi,'\t  ','compute',' ','\n',params)
-	 
+
 	if len(probl) != 0:
 	    rlevi_write(fidi,'probability_levels',probl)
-	
+
 	if len(rell) != 0:
 	    rlevi_write(fidi,'reliability_levels',rell)
-	
+
 	if len(grell) != 0:
 	    rlevi_write(fidi,'gen_reliability_levels',grell)
Index: /issm/trunk-jpl/src/m/qmu/rlist_write.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/rlist_write.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/rlist_write.py	(revision 23716)
@@ -48,5 +48,5 @@
 	# write responses
 
-	print '  Writing '+str(nresp)+' '+cstring+' responses.'
+	print('  Writing '+str(nresp)+' '+cstring+' responses.')
 
 	if strcmp(cstring,'calibration_terms')==1:
Index: /issm/trunk-jpl/src/m/qmu/vlist_write.py
===================================================================
--- /issm/trunk-jpl/src/m/qmu/vlist_write.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/qmu/vlist_write.py	(revision 23716)
@@ -41,9 +41,9 @@
 	if dvar == None:
 		return
-	from uniform_uncertain import *
+	#from uniform_uncertain import *
 	func = eval(cstring)
 
 	# put variables into lists for writing
-	
+
 	if type(dvar) not in [list,np.ndarray]:
 		dvar = [dvar]
@@ -89,5 +89,5 @@
 
 	# write variables
-	print '  Writing '+str(nvar)+' '+cstring+' variables.'
+	print('  Writing '+str(nvar)+' '+cstring+' variables.')
 
 	fidi.write('\t'+cstring+' = '+str(nvar)+'\n')
Index: /issm/trunk-jpl/src/m/solve/WriteData.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/WriteData.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/solve/WriteData.py	(revision 23716)
@@ -1,6 +1,5 @@
 import numpy as np
-import struct
+from struct import pack,unpack
 import pairoptions
-import MatlabFuncs as m
 
 def WriteData(fid,prefix,*args):
@@ -31,5 +30,5 @@
 		name = options.getfieldvalue('name')
 
-	format  = options.getfieldvalue('format')
+	datatype  = options.getfieldvalue('format')
 	mattype = options.getfieldvalue('mattype',0)    #only required for matrices
 	timeserieslength = options.getfieldvalue('timeserieslength',-1)
@@ -56,65 +55,66 @@
 
 	#Step 1: write the enum to identify this record uniquely
-	fid.write(struct.pack('i',len(name)))
-	fid.write(struct.pack('%ds' % 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   m.strcmpi(format,'Boolean'):    # {{{
+	if datatype=='Boolean':    # {{{
+#		if len(data) !=1:
+#			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
+		# }}}
+
+	elif datatype=='Integer':    # {{{
 #		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(struct.pack('i',4+4))  #1 bool (disguised as an int)+code
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
+		fid.write(pack('i',4+4))  #1 integer + code
+
+		#write data code:
+		fid.write(pack('i',FormatToCode(datatype)))
 
 		#now write integer
-		fid.write(struct.pack('i',int(data)))  #send an int, not easy to send a bool
-		# }}}
-
-	elif m.strcmpi(format,'Integer'):    # {{{
+		fid.write(pack('i',int(data))) #force an int,
+		# }}}
+
+	elif datatype=='Double':    # {{{
 #		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(struct.pack('i',4+4))  #1 integer + code
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
-
-		#now write integer
-		fid.write(struct.pack('i',data))
-		# }}}
-
-	elif m.strcmpi(format,'Double'):    # {{{
-#		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(struct.pack('i',8+4))  #1 double+code
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
+		fid.write(pack('i',8+4))  #1 double+code
+
+		#write data code:
+		fid.write(pack('i',FormatToCode(datatype)))
 
 		#now write double
-		fid.write(struct.pack('d',data))
-		# }}}
-
-	elif m.strcmpi(format,'String'):    # {{{
-		#first write length of record
-		fid.write(struct.pack('i',len(data)+4+4))  #string + string size + code
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
+		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)))
 
 		#now write string
-		fid.write(struct.pack('i',len(data)))
-		fid.write(struct.pack('%ds' % len(data),data))
-		# }}}
-
-	elif m.strcmpi(format,'BooleanMat'):    # {{{
-
-		if   isinstance(data,bool):
+		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)):
 			data=np.array([data])
 		elif isinstance(data,(list,tuple)):
@@ -133,66 +133,27 @@
 
 		#first write length of record
-		fid.write(struct.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(struct.pack('i',FormatToCode(format)))
-		fid.write(struct.pack('i',mattype))
+		fid.write(pack('i',FormatToCode(datatype)))
+		fid.write(pack('i',mattype))
 
 		#now write matrix
-		if np.ndim(data)==1:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',1))
-			for i in xrange(s[0]):
-				fid.write(struct.pack('d',float(data[i])))    #get to the "c" convention, hence the transpose
-		else:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',s[1]))
-			for i in xrange(s[0]):
-				for j in xrange(s[1]):
-					fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
-		# }}}
-
-	elif m.strcmpi(format,'IntMat'):    # {{{
-
-		if   isinstance(data,(int,long)):
-			data=np.array([data])
-		elif isinstance(data,(list,tuple)):
-			data=np.array(data).reshape(-1,)
-		if np.ndim(data) == 1:
-			if np.size(data):
-				data=data.reshape(np.size(data),)
-			else:
-				data=data.reshape(0,0)
-
-		#Get size
-		s=data.shape
-		#if matrix = NaN, then do not write anything
-		if np.ndim(data)==2 and np.product(s)==1 and np.all(np.isnan(data)):
-			s=(0,0)
-
-		#first write length of record
-		fid.write(struct.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(struct.pack('i',FormatToCode(format)))
-		fid.write(struct.pack('i',mattype))
-
-		#now write matrix
-		if np.ndim(data) == 1:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',1))
-			for i in xrange(s[0]):
-				fid.write(struct.pack('d',float(data[i])))    #get to the "c" convention, hence the transpose
-		else:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',s[1]))
-			for i in xrange(s[0]):
-				for j in xrange(s[1]):
-					fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
-		# }}}
-
-	elif m.strcmpi(format,'DoubleMat'):    # {{{
-
-		if   isinstance(data,(bool,int,long,float)):
+		if np.ndim(data) == 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]))
+			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
+		# }}}
+
+	elif datatype=='DoubleMat':    # {{{
+
+		if   isinstance(data,(bool,int,float)):
 			data=np.array([data])
 		elif isinstance(data,(list,tuple)):
@@ -213,29 +174,29 @@
 		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(struct.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(struct.pack('i',FormatToCode(format)))
-		fid.write(struct.pack('i',mattype))
+		fid.write(pack('i',FormatToCode(datatype)))
+		fid.write(pack('i',mattype))
 
 		#now write matrix
 		if np.ndim(data) == 1:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',1))
-			for i in xrange(s[0]):
-				fid.write(struct.pack('d',float(data[i])))    #get to the "c" convention, hence the transpose
-		else:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',s[1]))
-			for i in xrange(s[0]):
-				for j in xrange(s[1]):
-					fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
-		# }}}
-
-	elif m.strcmpi(format,'CompressedMat'):    # {{{
-
-		if   isinstance(data,(bool,int,long,float)):
+			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]))
+			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
+		# }}}
+
+	elif datatype=='CompressedMat':    # {{{
+
+		if   isinstance(data,(bool,int,float)):
 			data=np.array([data])
 		elif isinstance(data,(list,tuple)):
@@ -264,9 +225,9 @@
 			raise ValueError('field %s cannot be marshalled because it is larger than 4^31 bytes!' % enum)
 
-		fid.write(struct.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(struct.pack('i',FormatToCode(format)))
-		fid.write(struct.pack('i',mattype))
+		fid.write(pack('i',FormatToCode(datatype)))
+		fid.write(pack('i',mattype))
 
 		#Write offset and range
@@ -282,33 +243,33 @@
 		#now write matrix
 		if np.ndim(data) == 1:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',1))
-			fid.write(struct.pack('d',float(offsetA)))
-			fid.write(struct.pack('d',float(rangeA)))
-			for i in xrange(s[0]-1):
-				fid.write(struct.pack('B',int(A[i])))
-
-			fid.write(struct.pack('d',float(data[s[0]-1])))    #get to the "c" convention, hence the transpose
+			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
 
 		elif np.product(s) > 0:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',s[1]))
-			fid.write(struct.pack('d',float(offsetA)))
-			fid.write(struct.pack('d',float(rangeA)))
-			for i in xrange(s[0]-1):
-				for j in xrange(s[1]):
-					fid.write(struct.pack('B',int(A[i][j])))    #get to the "c" convention, hence the transpose
-
-			for j in xrange(s[1]):
-				fid.write(struct.pack('d',float(data[s[0]-1][j])))
-
-		# }}}
-
-	elif m.strcmpi(format,'MatArray'):    # {{{
+			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
+
+			for j in range(s[1]):
+				fid.write(pack('d',float(data[s[0]-1][j])))
+
+		# }}}
+
+	elif datatype=='MatArray':    # {{{
 
 		#first get length of record
 		recordlength=4+4    #number of records + code
 		for matrix in data:
-			if   isinstance(matrix,(bool,int,long,float)):
+			if   isinstance(matrix,(bool,int,float)):
 				matrix=np.array([matrix])
 			elif isinstance(matrix,(list,tuple)):
@@ -324,14 +285,14 @@
 
 		#write length of record
-		fid.write(struct.pack('i',recordlength))
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
+		fid.write(pack('i',recordlength))
+
+		#write data code:
+		fid.write(pack('i',FormatToCode(datatype)))
 
 		#write data, first number of records
-		fid.write(struct.pack('i',len(data)))
+		fid.write(pack('i',len(data)))
 
 		for matrix in data:
-			if   isinstance(matrix,(bool,int,long,float)):
+			if   isinstance(matrix,(bool,int,float)):
 				matrix=np.array([matrix])
 			elif isinstance(matrix,(list,tuple)):
@@ -343,17 +304,17 @@
 
 			if np.ndim(matrix) == 1:
-				fid.write(struct.pack('i',s[0]))
-				fid.write(struct.pack('i',1))
-				for i in xrange(s[0]):
-					fid.write(struct.pack('d',float(matrix[i])))    #get to the "c" convention, hence the transpose
+				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
 			else:
-				fid.write(struct.pack('i',s[0]))
-				fid.write(struct.pack('i',s[1]))
-				for i in xrange(s[0]):
-					for j in xrange(s[1]):
-						fid.write(struct.pack('d',float(matrix[i][j])))
-		# }}}
-
-	elif m.strcmpi(format,'StringArray'):    # {{{
+				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])))
+		# }}}
+
+	elif datatype=='StringArray':    # {{{
 
 		#first get length of record
@@ -363,48 +324,48 @@
 
 		#write length of record
-		fid.write(struct.pack('i',recordlength))
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
+		fid.write(pack('i',recordlength))
+
+		#write data code:
+		fid.write(pack('i',FormatToCode(datatype)))
 
 		#now write length of string array
-		fid.write(struct.pack('i',len(data)))
+		fid.write(pack('i',len(data)))
 
 		#now write the strings
 		for string in data:
-			fid.write(struct.pack('i',len(string)))
-			fid.write(struct.pack('%ds' % len(string),string))
+			fid.write(pack('i',len(string)))
+			fid.write(pack('{}s'.format(len(string)),string.encode()))
 		# }}}
 
 	else:    # {{{
-		raise TypeError('WriteData error message: data type: %d not supported yet! (%s)' % (format,enum))
+		raise TypeError('WriteData error message: data type: {} not supported yet! ({})'.format(datatype,enum))
 	# }}}
 
-def FormatToCode(format): # {{{
+def FormatToCode(datatype): # {{{
 	"""
-	This routine takes the format string, and hardcodes it into an integer, which
+	This routine takes the datatype string, and hardcodes it into an integer, which
 	is passed along the record, in order to identify the nature of the dataset being
 	sent.
 	"""
 
-	if   m.strcmpi(format,'Boolean'):
+	if datatype=='Boolean':
 		code=1
-	elif m.strcmpi(format,'Integer'):
+	elif datatype=='Integer':
 		code=2
-	elif m.strcmpi(format,'Double'):
+	elif datatype=='Double':
 		code=3
-	elif m.strcmpi(format,'String'):
+	elif datatype=='String':
 		code=4
-	elif m.strcmpi(format,'BooleanMat'):
+	elif datatype=='BooleanMat':
 		code=5
-	elif m.strcmpi(format,'IntMat'):
+	elif datatype=='IntMat':
 		code=6
-	elif m.strcmpi(format,'DoubleMat'):
+	elif datatype=='DoubleMat':
 		code=7
-	elif m.strcmpi(format,'MatArray'):
+	elif datatype=='MatArray':
 		code=8
-	elif m.strcmpi(format,'StringArray'):
+	elif datatype=='StringArray':
 		code=9
-	elif m.strcmpi(format,'CompressedMat'):
+	elif datatype=='CompressedMat':
 		code=10
 	else:
Index: /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 23716)
@@ -37,7 +37,7 @@
 			md=loadresultsfromdisk(md,md.miscellaneous.name+'.outbin')
 		else:
-			print 'WARNING, outbin file is empty for run '+md.miscellaneous.name
+			print(('WARNING, outbin file is empty for run '+md.miscellaneous.name))
 	elif not md.qmu.isdakota:
-		print 'WARNING, outbin file does not exist '+md.miscellaneous.name
+		print(('WARNING, outbin file does not exist '+md.miscellaneous.name))
 		
 	#erase the log and output files
@@ -88,3 +88,3 @@
 		os.remove(filename+extension)
 	except OSError:
-		print 'WARNING, no '+extension+'  is present for run '+filename
+		print(('WARNING, no '+extension+'  is present for run '+filename))
Index: /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 23716)
@@ -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/m/solve/marshall.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/marshall.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/solve/marshall.py	(revision 23716)
@@ -12,5 +12,5 @@
 	"""
 	if md.verbose.solution:
-		print "marshalling file '%s.bin'." % md.miscellaneous.name
+		print(("marshalling file '%s.bin'." % md.miscellaneous.name))
 
 	#open file for binary writing
Index: /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 23716)
@@ -9,5 +9,4 @@
 	else:
 		saveres=parseresultsfromdiskioserial(md,filename)
-
 	return saveres
 
@@ -17,7 +16,7 @@
 		fid=open(filename,'rb')
 	except IOError as e:
-		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
-
-	#initialize results: 
+		raise IOError("loadresultsfromdisk error message: could not open '{}' for binary reading.".format(filename))
+
+	#initialize results:
 	saveres=[]
 
@@ -30,5 +29,5 @@
 
 	while loadres:
-		#check that the new result does not add a step, which would be an error: 
+		#check that the new result does not add a step, which would be an error:
 		if check_nomoresteps:
 			if loadres['step']>=1:
@@ -42,5 +41,5 @@
 		#Add result
 		if loadres['step']==0:
-			#if we have a step = 0, this is a steady state solution, don't expect more steps. 
+			#if we have a step = 0, this is a steady state solution, don't expect more steps.
 			index = 0;
 			check_nomoresteps=1
@@ -49,12 +48,12 @@
 		else:
 			index = counter;
-		
+
 		if index > len(saveres)-1:
-			for i in xrange(len(saveres)-1,index-1):
+			for i in range(len(saveres)-1,index-1):
 				saveres.append(None)
 			saveres.append(resultsclass.results())
 		elif saveres[index] is None:
 			saveres[index]=resultsclass.results()
-			
+
 		#Get time and step
 		if loadres['step'] != -9999.:
@@ -79,9 +78,9 @@
 		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=[]
 
-	#if we have done split I/O, ie, we have results that are fragmented across patches, 
+	#if we have done split I/O, ie, we have results that are fragmented across patches,
 	#do a first pass, and figure out the structure of results
 	loadres=ReadDataDimensions(fid)
@@ -90,9 +89,9 @@
 		#Get time and step
 		if loadres['step'] > len(saveres):
-			for i in xrange(len(saveres),loadres['step']-1):
+			for i in range(len(saveres),loadres['step']-1):
 				saveres.append(None)
 			saveres.append(resultsclass.results())
 		setattr(saveres[loadres['step']-1],'step',loadres['step'])
-		setattr(saveres[loadres['step']-1],'time',loadres['time']) 
+		setattr(saveres[loadres['step']-1],'time',loadres['time'])
 
 		#Add result
@@ -117,9 +116,9 @@
 		#Get time and step
 		if loadres['step']> len(saveres):
-			for i in xrange(len(saveres),loadres['step']-1):
+			for i in range(len(saveres),loadres['step']-1):
 				saveres.append(None)
 			saveres.append(saveresclass.saveres())
 		setattr(saveres[loadres['step']-1],'step',loadres['step'])
-		setattr(saveres[loadres['step']-1],'time',loadres['time']) 
+		setattr(saveres[loadres['step']-1],'time',loadres['time'])
 
 		#Add result
@@ -134,8 +133,9 @@
 	return saveres
 	# }}}
+
 def ReadData(fid,md):    # {{{
 	"""
 	READDATA - ...
-	 
+
 	    Usage:
 	       field=ReadData(fid,md)
@@ -145,29 +145,33 @@
 	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]
+		fieldname=fieldname.decode() #strings are booleans when stored so need to be converted back
 		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 xrange(M):
-				field[i,:]=struct.unpack('%dd' % N,fid.read(N*struct.calcsize('d')))
-		elif type==4:
+			for i in range(M):
+				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 xrange(M):
-				field[i,:]=struct.unpack('%ii' % N,fid.read(N*struct.calcsize('i')))
+			for i in range(M):
+				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!
@@ -209,8 +213,8 @@
 		elif fieldname=='SmbRunoff':
 			field = field*yts
-                elif fieldname=='SmbEvaporation':
-                        field = field*yts;
-                elif fieldname=='SmbRefreeze':
-                        field = field*yts;
+		elif fieldname=='SmbEvaporation':
+			field = field*yts;
+		elif fieldname=='SmbRefreeze':
+			field = field*yts;
 		elif fieldname=='SmbEC':
 			field = field*yts
@@ -219,6 +223,6 @@
 		elif fieldname=='SmbMelt':
 			field = field*yts
-    		elif fieldname=='SmbMAdd':
-        		field = field*yts
+		elif fieldname=='SmbMAdd':
+			field = field*yts
 		elif fieldname=='CalvingCalvingrate':
 			field = field*yts
@@ -256,5 +260,5 @@
 	"""
 	READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
-	 
+
 	    Usage:
 	       field=ReadDataDimensions(fid)
@@ -264,21 +268,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()
Index: /issm/trunk-jpl/src/m/solve/solve.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/solve.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/solve/solve.py	(revision 23716)
@@ -13,9 +13,9 @@
 	"""
 	SOLVE - apply solution sequence for this model
- 
+
 	   Usage:
 	      md=solve(md,solutionstring,varargin)
 	      where varargin is a list of paired arguments of string OR enums
- 
+
 		solution types available comprise:
 		 - 'Stressbalance'    or 'sb'
@@ -39,5 +39,5 @@
 		  - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on consistency of model
 		  - restart: 'directory name (relative to the execution directory) where the restart file is located.
- 
+
 	   Examples:
 	      md=solve(md,'Stressbalance');
@@ -49,5 +49,5 @@
 		solutionstring = 'StressbalanceSolution';
 	elif solutionstring.lower() == 'mt' or solutionstring.lower() == 'masstransport':
-		solutionstring = 'MasstransportSolution';	
+		solutionstring = 'MasstransportSolution';
 	elif solutionstring.lower() == 'th' or solutionstring.lower() == 'thermal':
 		solutionstring = 'ThermalSolution';
@@ -70,11 +70,11 @@
 	elif solutionstring.lower() == 'gia' or solutionstring.lower() == 'gia':
 		solutionstring = 'GiaSolution';
-        elif solutionstring.lower() == 'lv' or solutionstring.lower() == 'love':
-                solutionstring = 'LoveSolution';
+	elif solutionstring.lower() == 'lv' or solutionstring.lower() == 'love':
+		solutionstring = 'LoveSolution';
 	elif solutionstring.lower() == 'esa':
 		solutionstring = 'EsaSolution';
 	elif solutionstring.lower() == 'slr' or solutionstring.lower() == 'sealevelrise':
 		solutionstring = 'SealevelriseSolution';
-	else: 	
+	else:
 		raise ValueError("solutionstring '%s' not supported!" % solutionstring)
 	options=pairoptions('solutionstring',solutionstring,*args)
@@ -82,5 +82,5 @@
 	#recover some fields
 	md.private.solution=solutionstring
-	cluster=md.cluster 
+	cluster=md.cluster
 	if options.getfieldvalue('batch','no')=='yes':
 		batch=1
@@ -91,5 +91,5 @@
 	if options.getfieldvalue('checkconsistency','yes')=='yes':
 		if md.verbose.solution:
-			print "checking model consistency"
+			print("checking model consistency")
 		ismodelselfconsistent(md)
 
@@ -106,8 +106,8 @@
 				md.private.runtimename="%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name,c.month,c.day,c.year,c.hour,c.minute,c.second,os.getpid())
 			else:
-				md.private.runtimename=md.miscellaneous.name 
+				md.private.runtimename=md.miscellaneous.name
 
 	#if running qmu analysis, some preprocessing of dakota files using models
-	#fields needs to be carried out. 
+	#fields needs to be carried out.
 	if md.qmu.isdakota:
 		md=preqmu(md,options)
@@ -120,15 +120,15 @@
 
 	#Write all input files
-	marshall(md)                                           # bin file
-	md.toolkits.ToolkitsFile(md.miscellaneous.name+'.toolkits')    # toolkits file
-	cluster.BuildQueueScript(md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof,md.qmu.isdakota,md.transient.isoceancoupling)    # queue file
+	marshall(md)																					 # bin file
+	md.toolkits.ToolkitsFile(md.miscellaneous.name+'.toolkits')		 # toolkits file
+	cluster.BuildQueueScript(md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof,md.qmu.isdakota,md.transient.isoceancoupling)		# queue file
 
 	#Stop here if batch mode
 	if options.getfieldvalue('batch','no')=='yes':
-		print 'batch mode requested: not launching job interactively'
-		print 'launch solution sequence on remote cluster by hand'
+		print('batch mode requested: not launching job interactively')
+		print('launch solution sequence on remote cluster by hand')
 		return md
 
-	#Upload all required files: 
+	#Upload all required files:
 	modelname = md.miscellaneous.name
 	filelist  = [modelname+'.bin ',modelname+'.toolkits ',modelname+'.queue ']
@@ -138,5 +138,5 @@
 	if not restart:
 		cluster.UploadQueueJob(md.miscellaneous.name,md.private.runtimename,filelist)
-	
+
 	#Launch job
 	cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist,restart,batch)
@@ -147,8 +147,8 @@
 		islock=waitonlock(md)
 		if islock==0:    #no results to be loaded
-			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
+			print('The results must be loaded manually with md=loadresultsfromcluster(md).')
 		else:            #load results
 			if md.verbose.solution:
-				print 'loading results from cluster'
+				print('loading results from cluster')
 			md=loadresultsfromcluster(md)
 
Index: /issm/trunk-jpl/src/m/solve/waitonlock.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/waitonlock.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/solve/waitonlock.py	(revision 23716)
@@ -26,8 +26,8 @@
 	if not m.strcmpi(gethostname(),cluster):
 
-		print 'solution launched on remote cluster. log in to detect job completion.'
-		choice=raw_input('Is the job successfully completed? (y/n) ')
+		print('solution launched on remote cluster. log in to detect job completion.')
+		choice=eval(input('Is the job successfully completed? (y/n) '))
 		if not m.strcmp(choice,'y'): 
-			print 'Results not loaded... exiting' 
+			print('Results not loaded... exiting') 
 			flag=0
 		else:
@@ -44,5 +44,5 @@
 		etime=0
 		ispresent=0
-		print "waiting for '%s' hold on... (Ctrl+C to exit)" % filename
+		print(("waiting for '%s' hold on... (Ctrl+C to exit)" % filename))
 
 		#loop till file .lock exist or time is up
@@ -54,6 +54,6 @@
 		#build output
 		if etime>timelimit:
-			print 'Time limit exceeded. Increase md.settings.waitonlock'
-			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
+			print('Time limit exceeded. Increase md.settings.waitonlock')
+			print('The results must be loaded manually with md=loadresultsfromcluster(md).')
 			raise RuntimeError('waitonlock error message: time limit exceeded.')
 			flag=0
Index: /issm/trunk-jpl/src/m/solvers/mumpsoptions.py
===================================================================
--- /issm/trunk-jpl/src/m/solvers/mumpsoptions.py	(revision 23715)
+++ /issm/trunk-jpl/src/m/solvers/mumpsoptions.py	(revision 23716)
@@ -17,5 +17,5 @@
 	#default mumps options
 	PETSC_MAJOR=IssmConfig('_PETSC_MAJOR_')[0]
-        PETSC_MINOR=IssmConfig('_PETSC_MINOR_')[0]
+	PETSC_MINOR=IssmConfig('_PETSC_MINOR_')[0]
 	if PETSC_MAJOR==2.:
 		mumps['toolkit']='petsc'
@@ -29,10 +29,9 @@
 		mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
 		mumps['pc_type']=options.getfieldvalue('pc_type','lu')
-                if PETSC_MINOR>8.:
-                    mumps['pc_factor_mat_solver_type']=options.getfieldvalue('pc_factor_mat_solver_type','mumps')
-                else:
-                    mumps['pc_factor_mat_solver_package']=options.getfieldvalue('pc_factor_mat_solver_package','mumps')
+		if PETSC_MINOR>8.:
+			mumps['pc_factor_mat_solver_type']=options.getfieldvalue('pc_factor_mat_solver_type','mumps')
+		else:
+			mumps['pc_factor_mat_solver_package']=options.getfieldvalue('pc_factor_mat_solver_package','mumps')
 		mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
 
 	return mumps
-
