Index: /issm/trunk-jpl/src/m/classes/matdamageice.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/matdamageice.py	(revision 26927)
+++ /issm/trunk-jpl/src/m/classes/matdamageice.py	(revision 26928)
@@ -57,5 +57,5 @@
         s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\' or \'LliboutryDuval\''))
         s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg m^-3]'))
-        return string
+        return s
     #}}}
 
@@ -93,5 +93,5 @@
         # Thermal exchange velocity (ice-water interface) (m/s)
         self.thermal_exchange_velocity = 1.00e-4
-        # Rheology law: what is the temperature dependence of B with T 
+        # Rheology law: what is the temperature dependence of B with T
         # available: none, paterson and arrhenius
         self.rheology_law = 'Paterson'
Index: /issm/trunk-jpl/src/m/classes/materials.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/materials.py	(revision 26927)
+++ /issm/trunk-jpl/src/m/classes/materials.py	(revision 26928)
@@ -1,4 +1,3 @@
 import numpy as np
-
 from checkfield import checkfield
 from fielddisplay import fielddisplay
@@ -173,9 +172,9 @@
                 self.rheology_n = 3
             elif nat == 'litho':
-                # We default to a configuration that enables running GIA 
+                # 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 
+                # Center of the earth (approximation, must not be 0), then the
                 # lab (lithosphere/asthenosphere boundary) then the surface
                 # (with 1d3 to avoid numerical singularities)
@@ -295,5 +294,5 @@
                 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', 'rheologymodel', 'format', 'DoubleMat', 'mattype', 3) 
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheologymodel', '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)
Index: /issm/trunk-jpl/src/m/classes/model.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/model.py	(revision 26927)
+++ /issm/trunk-jpl/src/m/classes/model.py	(revision 26928)
@@ -823,7 +823,7 @@
             md.inversion.max_parameters = project2d(md, md.inversion.max_parameters, md.mesh.numberoflayers)
         if md.smb.__class__.__name__ == 'SMBforcing' and not np.isnan(md.smb.mass_balance).all():
-                md.smb.mass_balance = project2d(md, md.smb.mass_balance, md.mesh.numberoflayers)
+            md.smb.mass_balance = project2d(md, md.smb.mass_balance, md.mesh.numberoflayers)
         elif md.smb.__class__.__name__ == 'SMBhenning' and not np.isnan(md.smb.smbref).all():
-                md.smb.smbref = project2d(md, md.smb.smbref, md.mesh.numberoflayers)
+            md.smb.smbref = project2d(md, md.smb.smbref, md.mesh.numberoflayers)
 
         # Results
Index: /issm/trunk-jpl/src/m/classes/solidearth.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/solidearth.py	(revision 26927)
+++ /issm/trunk-jpl/src/m/classes/solidearth.py	(revision 26928)
@@ -1,4 +1,3 @@
 import numpy as np
-
 from checkfield import checkfield
 from fielddisplay import fielddisplay
@@ -6,5 +5,4 @@
 from MatlabFuncs import *
 from planetradius import planetradius
-from project3d import project3d
 from rotational import rotational
 from solidearthsettings import solidearthsettings
@@ -25,14 +23,14 @@
 
     def __init__(self, *args):  # {{{
-        self.settings           = solidearthsettings()
-        self.external           = None
-        self.lovenumbers        = lovenumbers()
-        self.rotational         = rotational()
-        self.planetradius       = planetradius('earth')
-        self.requested_outputs  = []
-        self.transitions        = []
-        self.partitionice       = []
-        self.partitionhydro     = []
-        self.partitionocean     = []
+        self.settings  = solidearthsettings()
+        self.external  = None
+        self.lovenumbers = lovenumbers()
+        self.rotational = rotational()
+        self.planetradius = planetradius('earth')
+        self.requested_outputs = []
+        self.transitions = []
+        self.partitionice = []
+        self.partitionhydro = []
+        self.partitionocean = []
 
         nargs = len(args)
@@ -44,4 +42,5 @@
             raise Exception('solidearth constructor error message: zero or one argument only!')
     # }}}
+
     def __repr__(self):  # {{{
         s = '   solidearthinputs, forcings and settings:\n'
@@ -57,8 +56,11 @@
         print(self.lovenumbers)
         print(self.rotational)
-        if len(self.external):
+        try:
             print(self.external)
+        except TypeError:
+            pass
         return s
     # }}}
+
     def setdefaultparameters(self, planet):  # {{{
         # Output default
@@ -79,4 +81,5 @@
         self.planetradius = planetradius(planet)
     # }}}
+
     def checkconsistency(self, md, solution, analyses):  # {{{
         if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
@@ -94,7 +97,9 @@
         return md
     # }}}
+
     def defaultoutputs(self, md):  # {{{
         return ['Sealevel']
     # }}}
+
     def marshall(self, prefix, md, fid):  # {{{
         WriteData(fid, prefix, 'object', self, 'fieldname', 'planetradius', 'format', 'Double')
@@ -140,4 +145,5 @@
         WriteData(fid, prefix, 'data', outputs, 'name', 'md.solidearth.requested_outputs', 'format', 'StringArray')
     # }}}
+
     def extrude(self, md):  # {{{
         return self
Index: /issm/trunk-jpl/src/m/mesh/ExportGmsh.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/ExportGmsh.py	(revision 26928)
+++ /issm/trunk-jpl/src/m/mesh/ExportGmsh.py	(revision 26928)
@@ -0,0 +1,51 @@
+import numpy as np
+"""
+EXPORTGMSH - export mesh to gmsh format
+
+   Usage:
+      ExportGmsh(md,filename)
+"""
+
+
+def ExportGmsh(md, filename):
+
+    print('writing gmsh mesh file')
+    with open(filename, 'w+') as GmshFile:
+
+        #initialization
+        GmshFile.write('$MeshFormat \n')
+        GmshFile.write('2.2 0 8 \n')
+        GmshFile.write('$EndMeshFormat \n')
+        GmshFile.write('$Nodes \n')
+        GmshFile.write('{} \n'.format(md.mesh.numberofvertices))
+
+        #printing point positions
+        for j, eX in enumerate(md.mesh.x):
+            GmshFile.write('{:g} {:14.7e} {:14.7e} 0.0 \n'.format(j + 1, eX, md.mesh.y[j]))
+
+        GmshFile.write('$EndNodes \n')
+        GmshFile.write('$Elements \n')
+        GmshFile.write('{:d} \n'.format(md.mesh.numberofelements + np.shape(md.mesh.segments)[0]))
+
+        #printing elements caracteristics for boundaries
+        for ind, segment in enumerate(md.mesh.segments):
+            if md.mesh.x[segment[0]] == np.nanmax(md.mesh.x) and md.mesh.x[segment[1]] == np.nanmax(md.mesh.x):
+                bc_id = 1
+            elif md.mesh.y[segment[0]] == np.nanmax(md.mesh.y) and md.mesh.y[segment[1]] == np.nanmax(md.mesh.y):
+                bc_id = 2
+            elif md.mesh.x[segment[0]] == np.nanmin(md.mesh.x) and md.mesh.x[segment[1]] == np.nanmin(md.mesh.x):
+                bc_id = 3
+            elif md.mesh.y[segment[0]] == np.nanmin(md.mesh.y) and md.mesh.y[segment[1]] == np.nanmin(md.mesh.y):
+                bc_id = 4
+            else:
+                bc_id = 0
+
+            GmshFile.write('{:g} 1 2 {:g} 1 {:g} {:g} \n'.format(ind + 1, bc_id, segment[0], segment[1]))
+
+        #and for the body
+        body_id = 1
+        for elt, element in enumerate(md.mesh.elements):
+            GmshFile.write('{:g} 2 2 {:g} 3 {:g} {:g} {:g} \n'.format(elt + 1, body_id, element[0], element[1], element[2]))
+        GmshFile.write('$EndElements \n')
+        #close
+        GmshFile.close()
Index: /issm/trunk-jpl/src/m/plot/applyoptions.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/applyoptions.py	(revision 26927)
+++ /issm/trunk-jpl/src/m/plot/applyoptions.py	(revision 26928)
@@ -53,6 +53,6 @@
     #title font
         titlefont = font.copy()
-        titlefont['size'] = titlefontsize
-        titlefont['weight'] = titlefontweight
+        titlefont['fontsize'] = titlefontsize
+        titlefont['fontweight'] = titlefontweight
         ax.set_title(title, **titlefont)
     # }}}
Index: /issm/trunk-jpl/test/NightlyRun/runme.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/runme.m	(revision 26927)
+++ /issm/trunk-jpl/test/NightlyRun/runme.m	(revision 26928)
@@ -218,5 +218,5 @@
 			end
 
-		%CHECK for memory leaks?
+		%PRODUCE nc files?
 		elseif strcmpi(procedure,'ncExport'),
 			export_netCDF(md, ['test' num2str(id) 'ma.nc'])
