Index: /issm/trunk-jpl/src/py/README
===================================================================
--- /issm/trunk-jpl/src/py/README	(revision 11786)
+++ /issm/trunk-jpl/src/py/README	(revision 11787)
@@ -5,5 +5,5 @@
 # launch python
 
->>> md=mode();
+>>> md=model();
 >>> md
 >>> md.mesh
Index: /issm/trunk-jpl/src/py/classes/basalforcings.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/basalforcings.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/basalforcings.py	(revision 11787)
@@ -0,0 +1,20 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class basalforcings:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.melting_rate             = float('NaN')
+		self.melting_rate_correction  = float('NaN')
+		self.geothermalflux           = float('NaN')
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string="   basal forcings parameters:"
+
+		string="%s\n\n%s"%(string,fielddisplay(obj,"melting_rate","basal melting rate (positive if melting)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"melting_rate_correction","additional melting applied when the grounding line retreats"))
+		string="%s\n%s"%(string,fielddisplay(obj,"geothermalflux","geothermal heat flux [W/m^2]"))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/constants.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/constants.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/constants.py	(revision 11787)
@@ -0,0 +1,21 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class constants:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.g                    = 0
+		self.yts                  = 0
+		self.referencetemperature = 0
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string="   constants parameters:"
+		string="%s\n\n%s"%(string,fielddisplay(obj,"g","gravitational acceleration"))
+		string="%s\n%s"%(string,fielddisplay(obj,"yts","number of seconds in a year"))
+		string="%s\n%s"%(string,fielddisplay(obj,"referencetemperature","reference temperature used in the enthalpy model"))
+
+
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/debug.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/debug.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/debug.py	(revision 11787)
@@ -0,0 +1,18 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class debug:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.valgrind=False
+		self.gprof   = False
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string="   debug parameters:"
+
+		string="%s\n\n%s"%(string,fielddisplay(obj,"valgrind","use Valgrind to debug (0 or 1)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"gprof","use gnu-profiler to find out where the time is spent"))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/flowequation.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/flowequation.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/flowequation.py	(revision 11787)
@@ -0,0 +1,31 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class flowequation:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		
+		self.ismacayealpattyn     = 0;
+		self.ishutter             = 0;
+		self.isstokes             = 0;
+		self.vertex_equation      = float('NaN')
+		self.element_equation     = float('NaN')
+		self.bordermacayeal       = float('NaN')
+		self.borderpattyn         = float('NaN')
+		self.borderstokes         = float('NaN')
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string='   flow equation parameters:'
+
+		string="%s\n\n%s"%(string,fielddisplay(obj,'ismacayealpattyn','is the macayeal or pattyn approximation used ?'))
+		string="%s\n%s"%(string,fielddisplay(obj,'ishutter','is the shallow ice approximation used ?'))
+		string="%s\n%s"%(string,fielddisplay(obj,'isstokes','are the Full-Stokes equations used ?'))
+		string="%s\n%s"%(string,fielddisplay(obj,'vertex_equation','flow equation for each vertex'))
+		string="%s\n%s"%(string,fielddisplay(obj,'element_equation','flow equation for each element'))
+		string="%s\n%s"%(string,fielddisplay(obj,'bordermacayeal','vertices on MacAyeal''s border (for tiling)'))
+		string="%s\n%s"%(string,fielddisplay(obj,'borderpattyn','vertices on Pattyn''s border (for tiling)'))
+		string="%s\n%s"%(string,fielddisplay(obj,'borderstokes','vertices on Stokes'' border (for tiling)'))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/friction.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/friction.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/friction.py	(revision 11787)
@@ -0,0 +1,19 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class friction:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.coefficient = float('NaN')
+		self.p           = float('NaN')
+		self.q           = float('NaN')
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string="Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p"
+		string="%s\n\n%s"%(string,fielddisplay(obj,"coefficient","friction coefficient [SI]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"p","p exponent"))
+		string="%s\n%s"%(string,fielddisplay(obj,"q","q exponent"))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/geometry.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/geometry.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/geometry.py	(revision 11787)
@@ -0,0 +1,25 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class geometry:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.surface           = float('NaN')
+		self.thickness         = float('NaN')
+		self.bed               = float('NaN')
+		self.bathymetry        = float('NaN')
+		self.hydrostatic_ratio = float('NaN')
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+
+		string="   geometry parameters:"
+
+		string="%s\n\n%s"%(string,fielddisplay(obj,'surface','surface elevation'))
+		string="%s\n%s"%(string,fielddisplay(obj,'thickness','ice thickness'))
+		string="%s\n%s"%(string,fielddisplay(obj,'bed','bed elevation'))
+		string="%s\n%s"%(string,fielddisplay(obj,'bathymetry','bathymetry elevation'))
+		string="%s\n%s"%(string,fielddisplay(obj,'hydrostatic_ratio','coefficient for ice shelves'' thickness correction: hydrostatic_ratio H_obs+ (1-hydrostatic_ratio) H_hydro'))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/initialization.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/initialization.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/initialization.py	(revision 11787)
@@ -0,0 +1,32 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class initialization:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		
+		self.vx            = float('NaN')
+		self.vy            = float('NaN')
+		self.vz            = float('NaN')
+		self.vel           = float('NaN')
+		self.pressure      = float('NaN')
+		self.temperature   = float('NaN')
+		self.watercolumn   = float('NaN')
+		self.waterfraction = float('NaN')
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string='   initial field values:'
+
+		string="%s\n%s"%(string,fielddisplay(obj,'vx','x component of velocity'))
+		string="%s\n%s"%(string,fielddisplay(obj,'vy','y component of velocity'))
+		string="%s\n%s"%(string,fielddisplay(obj,'vz','z component of velocity'))
+		string="%s\n%s"%(string,fielddisplay(obj,'vel','velocity norm'))
+		string="%s\n%s"%(string,fielddisplay(obj,'pressure','pressure field'))
+		string="%s\n%s"%(string,fielddisplay(obj,'temperature','temperature in Kelvins'))
+		string="%s\n%s"%(string,fielddisplay(obj,'watercolumn','thickness of subglacial water'))
+		string="%s\n%s"%(string,fielddisplay(obj,'waterfraction','fraction of water in the ice'))
+
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/mask.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/mask.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/mask.py	(revision 11787)
@@ -0,0 +1,26 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class mask:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.elementonfloatingice = float('NaN')
+		self.elementongroundedice = float('NaN')
+		self.elementonwater       = float('NaN')
+		self.vertexonfloatingice  = float('NaN')
+		self.vertexongroundedice  = float('NaN')
+		self.vertexonwater        = float('NaN')
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+
+		string="";
+		string="%s\n%s"%(string,fielddisplay(obj,"elementonfloatingice","element on floating ice flags list"))
+		string="%s\n%s"%(string,fielddisplay(obj,"vertexonfloatingice","vertex on floating ice flags list"))
+		string="%s\n%s"%(string,fielddisplay(obj,"elementongroundedice","element on grounded ice  list"))
+		string="%s\n%s"%(string,fielddisplay(obj,"vertexongroundedice","vertex on grounded ice flags list"))
+		string="%s\n%s"%(string,fielddisplay(obj,"elementonwater","element on water flags list"))
+		string="%s\n%s"%(string,fielddisplay(obj,"vertexonwater","vertex on water flags list"))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/materials.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/materials.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/materials.py	(revision 11787)
@@ -0,0 +1,41 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class materials:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.rho_ice                    = 0;
+		self.rho_water                  = 0;
+		self.mu_water                   = 0;
+		self.heatcapacity               = 0;
+		self.latentheat                 = 0;
+		self.thermalconductivity        = 0;
+		self.meltingpoint               = 0;
+		self.beta                       = 0;
+		self.mixed_layer_capacity       = 0;
+		self.thermal_exchange_velocity  = 0;
+		self.rheology_B   = float('NaN')
+		self.rheology_n   = float('NaN')
+		self.rheology_law = "";
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string="   Materials:"
+
+		string="%s\n\n%s"%(string,fielddisplay(obj,"rho_ice","ice density [kg/m^3]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"rho_water","water density [kg/m^3]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"mu_water","water viscosity [N s/m^2]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"heatcapacity","heat capacity [J/kg/K]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"thermalconductivity","ice thermal conductivity [W/m/K]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"meltingpoint","melting point of ice at 1atm in K"))
+		string="%s\n%s"%(string,fielddisplay(obj,"latentheat","latent heat of fusion [J/m^3]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"beta","rate of change of melting point with pressure [K/Pa]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"rheology_B","flow law parameter [Pa/s^(1/n)]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"rheology_n","Glen""s flow law exponent"))
+		string="%s\n%s"%(string,fielddisplay(obj,"rheology_law","law for the temperature dependance of the rheology: ""None"", ""Paterson"" or ""Arrhenius"""))
+
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/mesh.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/mesh.py	(revision 11786)
+++ /issm/trunk-jpl/src/py/classes/mesh.py	(revision 11787)
@@ -1,9 +1,108 @@
+#module imports
+from fielddisplay import fielddisplay
+
 class mesh:
-	"""Python mesh class"""
-	x = []
-	y = []
-	elements = []
-	def __repr__(self):
-		return """x: X coordinates
-		        y: Y coordinates
-				  elements: indexing """
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.x                           = float('NaN');
+		self.y                           = float('NaN');
+		self.z                           = float('NaN');
+		self.elements                    = float('NaN');
+		self.dimension                   = 0;
+		self.numberoflayers              = 0;
+		self.numberofelements            = 0;
+		self.numberofvertices            = 0;
+		self.numberofedges               = 0;
+		
+		self.lat                         = float('NaN');
+		self.long                        = float('NaN');
+		self.hemisphere                  = float('NaN');
+
+		self.elementonbed                = float('NaN');
+		self.elementonsurface            = float('NaN');
+		self.vertexonbed                 = float('NaN');
+		self.vertexonsurface             = float('NaN');
+		self.lowerelements               = float('NaN');
+		self.lowervertex                 = float('NaN');
+		self.upperelements               = float('NaN');
+		self.uppervertex                 = float('NaN');
+		self.vertexonboundary            = float('NaN');
+
+		self.edges                       = float('NaN');
+		self.segments                    = float('NaN');
+		self.segmentmarkers              = float('NaN');
+		self.vertexconnectivity          = float('NaN');
+		self.elementconnectivity         = float('NaN');
+		self.average_vertex_connectivity = 0;
+
+		self.x2d                         = float('NaN');
+		self.y2d                         = float('NaN');
+		self.elements2d                  = float('NaN');
+		self.numberofvertices2d          = 0;
+		self.numberofelements2d          = 0;
+
+		self.extractedvertices           = float('NaN');
+		self.extractedelements           = float('NaN');
+
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+
+		if obj.dimension==3:
+			string="\n%s"%("      Elements and vertices of the original 2d mesh:")
+			
+			string="%s\n%s"%(string,fielddisplay(obj,"numberofelements2d","number of elements"))
+			string="%s\n%s"%(string,fielddisplay(obj,"numberofvertices2d","number of vertices"))
+			string="%s\n%s"%(string,fielddisplay(obj,"elements2d","index into (x,y,z), coordinates of the vertices"))
+			string="%s\n%s"%(string,fielddisplay(obj,"x2d","vertices x coordinate"))
+			string="%s\n%s"%(string,fielddisplay(obj,"y2d","vertices y coordinate"))
+
+			string="%s\n%s" %(string,"Elements and vertices of the extruded 3d mesh:")
+		else:
+			string="\n%s"%("      Elements and vertices:")
+
+		string="%s\n%s"%(string,fielddisplay(obj,"numberofelements","number of elements"))
+		
+
+
+
+		string="%s\n%s"%(string,fielddisplay(obj,"numberofvertices","number of vertices"))
+		string="%s\n%s"%(string,fielddisplay(obj,"elements","index into (x,y,z), coordinates of the vertices"))
+		string="%s\n%s"%(string,fielddisplay(obj,"x","vertices x coordinate"))
+		string="%s\n%s"%(string,fielddisplay(obj,"y","vertices y coordinate"))
+		string="%s\n%s"%(string,fielddisplay(obj,"z","vertices z coordinate"))
+		string="%s\n%s"%(string,fielddisplay(obj,"edges","edges of the 2d mesh (vertex1 vertex2 element1 element2)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"numberofedges","number of edges of the 2d mesh"))
+
+		string="%s%s"%(string,"\n      Properties:")
+		
+		string="%s\n%s"%(string,fielddisplay(obj,"dimension","mesh dimension (2d or 3d)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"numberoflayers","number of extrusion layers"))
+		string="%s\n%s"%(string,fielddisplay(obj,"vertexonbed","lower vertices flags list"))
+		string="%s\n%s"%(string,fielddisplay(obj,"elementonbed","lower elements flags list"))
+		string="%s\n%s"%(string,fielddisplay(obj,"vertexonsurface","upper vertices flags list"))
+		string="%s\n%s"%(string,fielddisplay(obj,"elementonsurface","upper elements flags list"))
+		string="%s\n%s"%(string,fielddisplay(obj,"uppervertex","upper vertex list (NaN for vertex on the upper surface)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"upperelements","upper element list (NaN for element on the upper layer)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"lowervertex","lower vertex list (NaN for vertex on the lower surface)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"lowerelements","lower element list (NaN for element on the lower layer"))
+		string="%s\n%s"%(string,fielddisplay(obj,"vertexonboundary","vertices on the boundary of the domain flag list"))
+		
+		string="%s\n%s"%(string,fielddisplay(obj,"segments","edges on domain boundary (vertex1 vertex2 element)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"segmentmarkers","number associated to each segment"))
+		string="%s\n%s"%(string,fielddisplay(obj,"vertexconnectivity","list of vertices connected to vertex_i"))
+		string="%s\n%s"%(string,fielddisplay(obj,"elementconnectivity","list of vertices connected to element_i"))
+		string="%s\n%s"%(string,fielddisplay(obj,"average_vertex_connectivity","average number of vertices connected to one vertex"))
+
+		string="%s%s"%(string,"\n      Extracted model:")
+
+		string="%s\n%s"%(string,fielddisplay(obj,"extractedvertices","vertices extracted from the model"))
+		string="%s\n%s"%(string,fielddisplay(obj,"extractedelements","elements extracted from the model"))
+
+		string="%s%s"%(string,"\n      Projection:")
+		string="%s\n%s"%(string,fielddisplay(obj,"lat","vertices latitude"))
+		string="%s\n%s"%(string,fielddisplay(obj,"long","vertices longitude"))
+		string="%s\n%s"%(string,fielddisplay(obj,"hemisphere","Indicate hemisphere ""n"" or ""s"" "))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/model.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/model.py	(revision 11786)
+++ /issm/trunk-jpl/src/py/classes/model.py	(revision 11787)
@@ -1,9 +1,98 @@
-from mesh import *
+#module imports {{{
+from mesh import mesh
+from mask import mask
+from geometry import geometry
+from constants import constants
+from surfaceforcings import surfaceforcings
+from basalforcings import basalforcings
+from materials import materials
+from friction import friction
+from flowequation import flowequation
+from timestepping import timestepping
+from initialization import initialization
+from rifts import rifts
+from debug import debug
+from verbose import verbose
+from settings import settings
+from solver import solver
+#}}}
+class model:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.mesh             = mesh()
+		self.mask             = mask()
+		self.geometry         = geometry()
+		self.constants        = constants()
+		self.surfaceforcings  = surfaceforcings()
+		self.basalforcings    = basalforcings()
+		self.materials        = materials()
+		self.friction         = friction()
+		self.flowequation     = flowequation()
+		self.timestepping     = timestepping()
+		self.initialization   = initialization()
+		self.rifts            = rifts()
 
-class model:
-	"""Python model class"""
-	mesh=mesh()
-	def __init__(self):
-		print 'new model created'
-	def __repr__(self):
-		return "   mesh: mesh properties"
+		self.debug            = debug()
+		self.verbose          = verbose()
+		self.settings         = settings()
+		self.solver           = solver()
+		self.cluster          = [];
+
+		self.balancethickness = [];
+		self.diagnostic       = [];
+		self.groundingline    = [];
+		self.hydrology        = [];
+		self.prognostic       = [];
+		self.thermal          = [];
+		self.steadystate      = [];
+		self.transient        = [];
+
+		self.autodiff         = [];
+		self.flaim            = [];
+		self.inversion        = [];
+		self.qmu              = [];
+
+		self.results          = [];
+		self.radaroverlay     = [];
+		self.miscellaneous    = [];
+		self.private          = [];
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+
+		#print "Here %s the number: %d" % ("is", 37)
+		string="%19s: %-22s -- %s" % ("mesh","[%s,%s]" % ("1x1",obj.mesh.__class__.__name__),"mesh properties")
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("mask","[%s,%s]" % ("1x1",obj.mask.__class__.__name__),"defines grounded and floating elements"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("geometry","[%s,%s]" % ("1x1",obj.geometry.__class__.__name__),"surface elevation, bedrock topography, ice thickness,..."))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("constants","[%s,%s]" % ("1x1",obj.constants.__class__.__name__),"physical constants"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("surfaceforcings","[%s,%s]" % ("1x1",obj.surfaceforcings.__class__.__name__),"surface forcings"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("basalforcings","[%s,%s]" % ("1x1",obj.basalforcings.__class__.__name__),"bed forcings"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("materials","[%s,%s]" % ("1x1",obj.materials.__class__.__name__),"material properties"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("friction","[%s,%s]" % ("1x1",obj.friction.__class__.__name__),"basal friction/drag properties"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flowequation","[%s,%s]" % ("1x1",obj.flowequation.__class__.__name__),"flow equations"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("timestepping","[%s,%s]" % ("1x1",obj.timestepping.__class__.__name__),"time stepping for transient models"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("initialization","[%s,%s]" % ("1x1",obj.initialization.__class__.__name__),"initial guess/state"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("rifts","[%s,%s]" % ("1x1",obj.rifts.__class__.__name__),"rifts properties'"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("debug","[%s,%s]" % ("1x1",obj.debug.__class__.__name__),"debugging tools (valgrind, gprof"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("verbose","[%s,%s]" % ("1x1",obj.verbose.__class__.__name__),"verbosity level in solve"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("settings","[%s,%s]" % ("1x1",obj.settings.__class__.__name__),"settings properties"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("solver","[%s,%s]" % ("1x1",obj.solver.__class__.__name__),"PETSc options for each solution'"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("cluster","[%s,%s]" % ("1x1",obj.cluster.__class__.__name__),"cluster parameters (number of cpus...)"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("balancethickness","[%s,%s]" % ("1x1",obj.balancethickness.__class__.__name__),"parameters for balancethickness solution"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("diagnostic","[%s,%s]" % ("1x1",obj.diagnostic.__class__.__name__),"parameters for diagnostic solution"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("groundingline","[%s,%s]" % ("1x1",obj.groundingline.__class__.__name__),"parameters for groundingline solution"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("hydrology","[%s,%s]" % ("1x1",obj.hydrology.__class__.__name__),"parameters for hydrology solution"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("prognostic","[%s,%s]" % ("1x1",obj.prognostic.__class__.__name__),"parameters for prognostic solution"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("thermal","[%s,%s]" % ("1x1",obj.thermal.__class__.__name__),"parameters for thermal solution"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("steadystate","[%s,%s]" % ("1x1",obj.steadystate.__class__.__name__),"parameters for steadystate solution"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("transient","[%s,%s]" % ("1x1",obj.transient.__class__.__name__),"parameters for transient solution"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("autodiff","[%s,%s]" % ("1x1",obj.autodiff.__class__.__name__),"automatic differentiation parameters"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flaim","[%s,%s]" % ("1x1",obj.flaim.__class__.__name__),"flaim parameters"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("inversion","[%s,%s]" % ("1x1",obj.inversion.__class__.__name__),"parameters for inverse methods"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("qmu","[%s,%s]" % ("1x1",obj.qmu.__class__.__name__),"dakota properties"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results'"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("radaroverlay","[%s,%s]" % ("1x1",obj.radaroverlay.__class__.__name__),"radar image for plot overlay"))
+		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("miscellaneous","[%s,%s]" % ("1x1",obj.miscellaneous.__class__.__name__),"miscellaneous fields"))
+		return string;
+		 #}}}
Index: /issm/trunk-jpl/src/py/classes/rifts.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/rifts.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/rifts.py	(revision 11787)
@@ -0,0 +1,18 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class rifts:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.riftstruct     = float('NaN')
+		self.riftproperties = float('NaN')
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string='   rifts parameters:'
+
+		string="%s\n\n%s"%(string,fielddisplay(obj,'riftstruct','structure containing all rift information (vertices coordinates, segments, type of melange, ...)'))
+		string="%s\n%s"%(string,fielddisplay(obj,'riftproperties',''))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/settings.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/settings.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/settings.py	(revision 11787)
@@ -0,0 +1,24 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class settings:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.io_gather           = 0;
+		self.lowmem              = 0;
+		self.results_as_patches  = 0;
+		self.output_frequency    = 0;
+		self.waitonlock          = 0;
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string="   general settings parameters:"
+
+		string="%s\n%s"%(string,fielddisplay(obj,"io_gather","I/O gathering strategy for result outputs (default 1)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"lowmem","is the memory limited ? (0 or 1)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"results_as_patches","provide results as patches for each element (0 or 1)"))
+		string="%s\n%s"%(string,fielddisplay(obj,"output_frequency","frequency at which results are saved in all solutions with multiple time_steps"))
+		string="%s\n%s"%(string,fielddisplay(obj,"waitonlock","maximum number of minutes to wait for batch results, or return 0"))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/solver.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/solver.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/solver.py	(revision 11787)
@@ -0,0 +1,42 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class solver:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.options           = [];
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		
+		string2="   solver parameters:"
+		for i in range(len(obj.options,1)):
+			option=obj.options[i]
+			analysis=option[0]
+			ioptions=option[1]
+
+			string=""
+			for i in range(len(ioptions)):
+				option=ioptions[i]
+				if not option:
+					#do nothing
+					pass
+				elif len(option)==1:
+					#this option has only one argument
+					string="%s%s%s"%(string," -",option[0])
+				elif len(option)==2:
+					#option with value. value can be string or scalar
+					if isinstance(option[1],float):
+						string="%s%s%s%s%s"%(string," -",option[0]," ","%g"%(option[1]))
+					elif isinstance(option[1],str):
+						string="%s%s%s%s%s"%(string," -",option[0]," ",option[1])
+					else:
+						print("%s%s%s"%("PetscString error: option #","%i"%(i)," is not well formatted"))
+						sys.exit();
+				else:
+					print("%s%s%s"%("PetscString error: option #","%i"%(i)," is not well formatted"))
+					sys.exit()
+			string2="%s\n%s"%(string2,"   %s -> '%s'"%(analysis,string))
+		return string2
+	#}}}
Index: /issm/trunk-jpl/src/py/classes/surfaceforcings.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/surfaceforcings.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/surfaceforcings.py	(revision 11787)
@@ -0,0 +1,19 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class surfaceforcings:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.precipitation = float('NaN')
+		self.mass_balance  = float('NaN')
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string="   surface forcings parameters:"
+
+		string="%s\n\n%s"%(string,fielddisplay(obj,'precipitation','surface precipitation [m/yr water eq]'))
+		string="%s\n%s"%(string,fielddisplay(obj,'mass_balance','surface mass balance [m/yr ice eq]'))
+
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/timestepping.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/timestepping.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/timestepping.py	(revision 11787)
@@ -0,0 +1,21 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class timestepping:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.time_step       = 0;
+		self.final_time      = 0;
+		self.time_adapt      = 0;
+		self.cfl_coefficient = 0;
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string="   timestepping parameters:"
+		string="%s\n\n%s"%(string,fielddisplay(obj,"time_step","length of time steps [yrs]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"final_time","final time to stop the simulation [yrs]"))
+		string="%s\n%s"%(string,fielddisplay(obj,"time_adapt","use cfl condition to define time step ? (0 or 1) "))
+		string="%s\n%s"%(string,fielddisplay(obj,"cfl_coefficient","coefficient applied to cfl condition"))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/classes/verbose.py
===================================================================
--- /issm/trunk-jpl/src/py/classes/verbose.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/classes/verbose.py	(revision 11787)
@@ -0,0 +1,27 @@
+#module imports
+from fielddisplay import fielddisplay
+
+class verbose:
+	#properties
+	def __init__(self):
+		# {{{ Properties
+		self.mprocessor  = False
+		self.module      = False
+		self.solution    = False
+		self.solver      = False
+		self.convergence = False
+		self.control     = False
+		self.qmu         = False
+		#}}}
+	def __repr__(obj):
+		# {{{ Display
+		string="%s%s%s\n\n"%("class '",obj.__class__.__name__,"'=")
+		string="%s%s\n"%(string,"   %15s : %s"%("mprocessor",obj.mprocessor))
+		string="%s%s\n"%(string,"   %15s : %s"%("module",obj.module))
+		string="%s%s\n"%(string,"   %15s : %s"%("solution",obj.solution))
+		string="%s%s\n"%(string,"   %15s : %s"%("solver",obj.solver))
+		string="%s%s\n"%(string,"   %15s : %s"%("convergence",obj.convergence))
+		string="%s%s\n"%(string,"   %15s : %s"%("control",obj.control))
+		string="%s%s\n"%(string,"   %15s : %s"%("qmu",obj.qmu))
+		return string
+		#}}}
Index: /issm/trunk-jpl/src/py/model/display/fielddisplay.py
===================================================================
--- /issm/trunk-jpl/src/py/model/display/fielddisplay.py	(revision 11787)
+++ /issm/trunk-jpl/src/py/model/display/fielddisplay.py	(revision 11787)
@@ -0,0 +1,98 @@
+#Module import 
+from math import isnan
+
+
+def fielddisplay(md,name,comment):
+#FIELDDISPLAY - display model field
+#
+#   Usage:
+#      fielddisplay(md,name,comment)
+
+	#get field
+	field=getattr(md,name)
+
+	#disp corresponding line as a function of field type (offset set as 9 spaces)
+	return parsedisplay("         ",name,field,comment);
+
+#parsedisplay{{{ 
+def  parsedisplay(offset,name,field,comment):
+
+	#string
+	if isinstance(field,str):
+
+		if len(field)>30:
+			string=displayunit(offset,name,"not displayed",comment)
+		else:
+			string=displayunit(offset,name,field,comment)
+
+	#numeric
+	elif isinstance(field, int):
+		string=displayunit(offset,name,"%i" % (field),comment) 
+
+	elif isinstance(field, complex):
+		print("fielddisplay cannot handle complex numbers")
+		sys.exit()
+
+	elif isinstance(field, float):
+		string=displayunit(offset,name,"%g"%(field),comment)
+
+	#logical
+	elif isinstance(field,bool):
+		if field:
+			string=displayunit(offset,name,"true",comment)
+		else:
+			string=displayunit(offset,name,"false",comment)
+		
+	#elif isstruct(field),
+	#	if ~isempty(fields(field))
+	#		displayunit(offset,name,'(structure)',comment),
+	#		struct_display(field,[offset '   ']),
+	#	else
+	#		displayunit(offset,name,'N/A',comment),
+	#	end
+
+	#cell
+	#elif  iscell(field):
+	#	cell_display(offset,name,field,comment),
+
+	else:
+		string=displayunit(offset,name,"not displayed",comment)
+
+	#return string
+	return string
+
+#}}}
+#displayunit {{{
+def  displayunit(offset,name,characterization,comment):
+
+	#take care of name
+	if len(name)>23:
+		name="%s..." % (name[:19])
+	
+	#take care of characterization
+	if characterization=="":
+		characterization="N/A"
+	
+	if characterization=="nan":
+		characterization="N/A"
+	
+	if len(characterization)>15:
+		characterization="%s%s" % (characterization[:11],"...")
+	
+	#print
+	if not comment:
+		string="%s%-23s: %-15s" % (offset,name,characterization)
+	else:
+		if isinstance(comment,str):
+			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment)
+		elif isinstance(comment,list):
+			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment[0])
+			for i in range(2,len(comment)):
+				string2="%s%-23s  %-15s    %s" %(offset,"","",comment[i])
+				string="%s%s"%(string,string2)
+		else:
+			print("fielddisplay error message: format for comment not supportet yet")
+			sys.exit()
+
+	return string
+#}}}
Index: /issm/trunk-jpl/src/py/model/display/fielddisplay.rest
===================================================================
--- /issm/trunk-jpl/src/py/model/display/fielddisplay.rest	(revision 11787)
+++ /issm/trunk-jpl/src/py/model/display/fielddisplay.rest	(revision 11787)
@@ -0,0 +1,154 @@
+def fielddisplay(md,name,comment):
+#FIELDDISPLAY - display model field
+#
+#   Usage:
+#      fielddisplay(md,offset,name,comment)
+
+	#get field
+	field=getattr(md,name)
+
+	#disp corresponding line as a function of field type (offset set as 9 spaces)
+	#parsedisplay('         ',name,field,comment);
+
+	return 
+
+function parsedisplay(offset,name,field,comment); %{{{
+
+	%string
+	if ischar(field),
+
+		if length(field)>30;
+			displayunit(offset,name,'not displayed',comment),
+		else
+			displayunit(offset,name,['''' field ''''],comment),
+		end
+
+	%numeric
+	elseif isnumeric(field)
+
+		%get size
+		fieldsize=size(field);
+
+		%double
+		if max(fieldsize)==1,
+			displayunit(offset,name,num2str(field),comment),
+		%matrix
+		else
+			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
+		end
+
+	%logical
+	elseif islogical(field)
+
+		%get size
+		fieldsize=size(field);
+
+		%single value
+		if max(fieldsize)==1,
+			if (field)
+				displayunit(offset,name,'true',comment),
+			else
+				displayunit(offset,name,'false',comment),
+			end
+		%matrix
+		else
+			displayunit(offset,name,['(' num2str(fieldsize(1)) 'x' num2str(fieldsize(2)) ')'],comment),
+		end
+
+		%structure
+	elseif isstruct(field),
+		if ~isempty(fields(field))
+			displayunit(offset,name,'(structure)',comment),
+			struct_display(field,[offset '   ']),
+		else
+			displayunit(offset,name,'N/A',comment),
+		end
+
+	%cell
+	elseif iscell(field),
+		cell_display(offset,name,field,comment),
+
+	else
+		displayunit(offset,name,'not displayed',comment),
+
+	end
+end%}}}
+
+function struct_display(structure,offset) % {{{
+
+	structure_fields=fields(structure);
+
+	for i=1:length(structure_fields),
+
+		%get current field
+		field=structure.(structure_fields{i});
+
+		%recursive call if necessary
+		if isstruct(field),
+			displayunit(offset,structure_fields{i},'(structure)',''),
+			struct_display(field,[offset '   ']);
+
+		%display value
+		else
+			parsedisplay(offset,structure_fields{i},field,'');
+		end
+	end
+end% }}}
+function cell_display(offset,name,field,comment) % {{{
+
+	%initialization
+	string='{';
+
+	%go through the cell and fill string
+	if length(field)<5;
+		for i=1:length(field),
+			if ischar(field{i}),
+				string=[string ''''  field{i} ''','];
+			elseif (isnumeric(field{i}) & length(field{i})==1)
+				string=[string num2str(field{i}) ',' ];
+			else
+				string='{';
+				break
+			end
+		end
+	end
+	if strcmp(string,'{'),
+		string=['(' num2str(size(field,1)) 'x' num2str(size(field,2)) ')'];
+	else
+		string=[string(1:end-1) '}'];
+	end
+
+	%call displayunit
+	displayunit(offset,name,string,comment);
+end% }}}
+function displayunit(offset,name,characterization,comment),% {{{
+
+	%take care of name
+	if length(name)>23,
+		name=[name(1:20) '...'];
+	end
+
+	%take care of characterization
+	if (strcmp(characterization,['''' '''']) | strcmp(characterization,'NaN')),
+		characterization='N/A';
+	end
+	if length(characterization)>15,
+		characterization=[characterization(1:12) '...'];
+	end
+
+	%print
+	if isempty(comment)
+		disp(sprintf('%s%-23s: %-15s',offset,name,characterization));
+	else
+		if ischar(comment),
+			disp(sprintf('%s%-23s: %-15s -- %s',offset,name,characterization,comment));
+		elseif iscell(comment),
+			disp(sprintf('%s%-23s: %-15s -- %s',offset,name,characterization,comment{1}));
+			for i=2:length(comment),
+				disp(sprintf('%s%-23s  %-15s    %s',offset,'','',comment{i}));
+			end
+		else
+			error('fielddisplay error message: format for comment not supportet yet');
+		end
+	end
+end% }}}
Index: /issm/trunk-jpl/src/py/modules/TriMesh/Makefile
===================================================================
--- /issm/trunk-jpl/src/py/modules/TriMesh/Makefile	(revision 11786)
+++ /issm/trunk-jpl/src/py/modules/TriMesh/Makefile	(revision 11787)
@@ -1,18 +1,11 @@
-all: ogive
+all: ice
 
 ice:
 	g++ -bundle  -bind \
 		-I$(ISSM_TIER)/externalpackages/boost/install/include \
+		-I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m\
 		-L$(ISSM_TIER)/externalpackages/boost/install/lib -lboost_python \
-		-L/usr/lib/python2.6/config/ -lpython2.6 \
+		-L/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m/ -lpython3.2 \
 		TriMeshmodule.cpp -o TriMesh.so
-
-ogive:
-	g++ \
-		-I$(ISSM_TIER)/externalpackages/boost/install/include \
-		-I/opt/local/include/python2.5/ \
-		-L$(ISSM_TIER)/externalpackages/boost/install/lib -lboost_python \
-		-L/usr/lib/ -lpython2.5 \
-		TriMeshmodule.cpp -o TriMesh.so -bundle
 
 clean:
Index: /issm/trunk-jpl/src/py/modules/hello/Makefile
===================================================================
--- /issm/trunk-jpl/src/py/modules/hello/Makefile	(revision 11786)
+++ /issm/trunk-jpl/src/py/modules/hello/Makefile	(revision 11787)
@@ -1,19 +1,13 @@
-all: ogive
+all: ice
 
 ice:
 	g++ -bundle  -bind \
 		-I$(ISSM_TIER)/externalpackages/boost/install/include \
-		-I/usr/include/python2.6/ \
+		-I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m\
 		-L$(ISSM_TIER)/externalpackages/boost/install/lib -lboost_python \
-		-L/usr/lib/python2.6/config/ -lpython2.6 \
+		-L/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m/ -lpython3.2 \
 		hellomodule.cpp -o hello.so
 
-ogive:
-	g++ \
-		-I$(ISSM_TIER)/externalpackages/boost/install/include \
-		-I/usr/include/python2.5/ \
-		-L$(ISSM_TIER)/externalpackages/boost/install/lib -lboost_python \
-		-L/usr/lib/python2.5/config/ -lpython2.5 \
-		hellomodule.cpp -o hello.so -bundle
+
 
 clean:
Index: /issm/trunk-jpl/startup.py
===================================================================
--- /issm/trunk-jpl/startup.py	(revision 11786)
+++ /issm/trunk-jpl/startup.py	(revision 11787)
@@ -10,4 +10,10 @@
 import os,sys
 
+ 
+#First check we are running python 3 at least 
+if sys.version_info[0] < 3:
+	print("ISSM can only work in Python 3. Exiting python")
+	sys.exit(1)
+
 #Recover ISSM_TIER, ISSM_DIR  and USERNAME
 ISSM_TIER=os.getenv('ISSM_TIER')
@@ -20,10 +26,38 @@
 #the variable ISSM_TIER in this file, in case it is not correctly setup. 
 
-#ISSM path
-sys.path.append(ISSM_TIER+'/src/py')
-sys.path.append(ISSM_TIER+'/src/py/classes')
-sys.path.append(ISSM_TIER+'/src/py/modules/TriMesh')
-sys.path.append(ISSM_TIER+'/src/py/modules/hello')
+#ISSM path. Go through src/py and load everything we find  that looks like a python file
+for root,dirs,files in os.walk(ISSM_TIER+ '/src/py'):
+	for file in files:
+		if file.find(".py") != -1:
+			if file.find(".pyc") == -1:
+				#add to path 
+				sys.path.append(root)
+				file=os.path.splitext(file)[0]
+				#__import__(file)
+
+#Deal with scipy import: 
+import scipy 
+import numpy
+import nose
+
+#Import modules that are absolutely needed in ISSM {{{
 from model import *
+from mesh import *
+from mask import *
+from geometry import *
+from constants import *
+from surfaceforcings import *
+from basalforcings import *
+from materials import *
+from friction import *
+from flowequation import *
+from fielddisplay import *
+from timestepping import *
+from initialization import *
+from rifts import *
+from debug import *
+from settings import *
+from solver import *
+#}}}
 
-print "\n  To get started with ISSM, type issmdoc at the command prompt.\n\n"
+print("\n  To get started with ISSM, type issmdoc at the command prompt.\n\n")
