Index: /issm/trunk-jpl/src/m/classes/issmsettings.js
===================================================================
--- /issm/trunk-jpl/src/m/classes/issmsettings.js	(revision 22298)
+++ /issm/trunk-jpl/src/m/classes/issmsettings.js	(revision 22298)
@@ -0,0 +1,94 @@
+//ISSMSETTINGS class definition
+//
+//   Usage:
+//      issmsettings=new issmsettings();
+
+function issmsettings (){
+	//methods
+	this.setdefaultparameters = function(){// {{{
+		//are we short in memory ? (0 faster but requires more memory)
+		this.lowmem=0;
+
+		//i/o:
+		this.io_gather=1;
+
+		//results frequency by default every step
+		this.output_frequency=1;
+
+		//checkpoints frequency, by default never: 
+		this.recording_frequency=0;
+
+		//this option can be activated to load automatically the results
+		//onto the model after a parallel run by waiting for the lock file
+		//N minutes that is generated once the solution has converged
+		//0 to deactivate
+		this.waitonlock=Infinity;
+
+		//upload options: 
+		upload_port         = 0;
+		
+		//throw an error if solver residue exceeds this value
+		this.solver_residue_threshold=1e-6;
+
+	}// }}}
+	this.disp= function(){// {{{
+		console.log(sprintf('   issmsettings class echo:'));
+		
+		fielddisplay(this,'results_on_nodes','results are output for all the nodes of each element');
+		fielddisplay(this,'io_gather','I/O gathering strategy for result outputs (default 1)');
+		fielddisplay(this,'lowmem','is the memory limited ? (0 or 1)');
+		fielddisplay(this,'output_frequency','frequency at which results are saved in all solutions with multiple time_steps');
+		fielddisplay(this,'recording_frequency','frequency at which the runs are being recorded, allowing for a restart');
+		fielddisplay(this,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)');
+		fielddisplay(this,'upload_server','server hostname where model should be uploaded');
+		fielddisplay(this,'upload_path','path on server where model should be uploaded');
+		fielddisplay(this,'upload_login','server login');
+		fielddisplay(this,'upload_port','port login (default is 0)');
+		fielddisplay(this,'upload_filename','unique id generated when uploading the file to server');
+		fielddisplay(this,'solver_residue_threshold','throw an error if solver residue exceeds this value');
+
+
+	}// }}}
+	this.classname= function(){// {{{
+		return "issmsettings";
+
+	}// }}}
+		this.checkconsistency = function(md,solution,analyses) { // {{{
+
+			checkfield(md,'fieldname','settings.results_on_nodes','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1);
+			checkfield(md,'fieldname','settings.recording_frequency','numel',[1],'>=',0);
+			checkfield(md,'fieldname','settings.waitonlock','numel',[1]);
+			checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0);
+		} // }}}
+		this.marshall=function(md,prefix,fid) { //{{{
+			WriteData(fid,prefix,'object',this,'class','settings','fieldname','results_on_nodes','format','Boolean');
+			WriteData(fid,prefix,'object',this,'class','settings','fieldname','io_gather','format','Boolean');
+			WriteData(fid,prefix,'object',this,'class','settings','fieldname','lowmem','format','Boolean');
+			WriteData(fid,prefix,'object',this,'class','settings','fieldname','output_frequency','format','Integer');
+			WriteData(fid,prefix,'object',this,'class','settings','fieldname','recording_frequency','format','Integer');
+			WriteData(fid,prefix,'object',this,'class','settings','fieldname','solver_residue_threshold','format','Double');
+			if (this.waitonlock>0) WriteData(fid,prefix,'name','md.settings.waitonlock','data',true,'format','Boolean');
+			else WriteData(fid,prefix,'name','md.settings.waitonlock','data',false,'format','Boolean');
+		}//}}}
+		this.fix=function() { //{{{
+		}//}}}
+	//properties 
+	// {{{
+	this.results_on_nodes    = 0;
+	this.io_gather           = 0;
+	this.lowmem              = 0;
+	this.output_frequency    = 0;
+	this.recording_frequency   = 0;
+	this.waitonlock          = 0;
+	this.upload_server       = '';
+	this.upload_path         = '';
+	this.upload_login        = '';
+	this.upload_port         = 0;
+	this.upload_filename     = '';
+	this.solver_residue_threshold = 0;
+	this.setdefaultparameters();
+	//}}}
+}
Index: /issm/trunk-jpl/src/m/classes/issmsettings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/issmsettings.py	(revision 22298)
+++ /issm/trunk-jpl/src/m/classes/issmsettings.py	(revision 22298)
@@ -0,0 +1,87 @@
+from fielddisplay import fielddisplay
+from checkfield import checkfield
+from WriteData import WriteData
+
+class issmsettings(object):
+	"""
+	ISSMSETTINGS class definition
+
+	   Usage:
+	      issmsettings=issmsettings();
+	"""
+
+	def __init__(self): # {{{
+		self.results_on_nodes    = 0
+		self.io_gather           = 0
+		self.lowmem              = 0
+		self.output_frequency    = 0
+		self.recording_frequency = 0
+		self.waitonlock          = 0
+		self.solver_residue_threshold = 0
+
+		#set defaults
+		self.setdefaultparameters()
+
+		#}}}
+	def __repr__(self): # {{{
+		string="   general issmsettings parameters:"
+
+		string="%s\n%s"%(string,fielddisplay(self,"results_on_nodes","results are output for all the nodes of each element"))
+		string="%s\n%s"%(string,fielddisplay(self,"io_gather","I/O gathering strategy for result outputs (default 1)"))
+		string="%s\n%s"%(string,fielddisplay(self,"lowmem","is the memory limited ? (0 or 1)"))
+		string="%s\n%s"%(string,fielddisplay(self,"output_frequency","frequency at which results are saved in all solutions with multiple time_steps"))
+		string="%s\n%s"%(string,fielddisplay(self,"recording_frequency","frequency at which the runs are being recorded, allowing for a restart"))
+		string="%s\n%s"%(string,fielddisplay(self,"waitonlock","maximum number of minutes to wait for batch results, or return 0"))
+		string="%s\n%s"%(string,fielddisplay(self,"solver_residue_threshold","throw an error if solver residue exceeds this value (NaN to deactivate)"))
+		return string
+		#}}}
+	def setdefaultparameters(self): # {{{
+		
+		#are we short in memory ? (0 faster but requires more memory)
+		self.lowmem=0
+
+		#i/o:
+		self.io_gather=1
+
+		#results frequency by default every step
+		self.output_frequency=1
+
+		#checkpoints frequency, by default never: 
+		self.recording_frequency=0
+
+
+		#this option can be activated to load automatically the results
+		#onto the model after a parallel run by waiting for the lock file
+		#N minutes that is generated once the solution has converged
+		#0 to deactivate
+		self.waitonlock=2**31-1
+
+      #throw an error if solver residue exceeds this value
+		self.solver_residue_threshold=1e-6;
+
+		return self
+	#}}}
+	def checkconsistency(self,md,solution,analyses):    # {{{
+		md = checkfield(md,'fieldname','settings.results_on_nodes','numel',[1],'values',[0,1])
+		md = checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0,1])
+		md = checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0,1])
+		md = checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1)
+		md = checkfield(md,'fieldname','settings.recording_frequency','numel',[1],'>=',0)
+		md = checkfield(md,'fieldname','settings.waitonlock','numel',[1])
+		md = checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0)
+
+		return md
+	# }}}
+	def marshall(self,prefix,md,fid):    # {{{
+		WriteData(fid,prefix,'object',self,'class','settings','fieldname','results_on_nodes','format','Boolean')
+		WriteData(fid,prefix,'object',self,'class','settings','fieldname','io_gather','format','Boolean')
+		WriteData(fid,prefix,'object',self,'class','settings','fieldname','lowmem','format','Boolean')
+		WriteData(fid,prefix,'object',self,'class','settings','fieldname','output_frequency','format','Integer')
+		WriteData(fid,prefix,'object',self,'class','settings','fieldname','recording_frequency','format','Integer')
+		
+		if self.waitonlock>0:
+			WriteData(fid,prefix,'name','md.settings.waitonlock','data',True,'format','Boolean')
+		else:
+			WriteData(fid,prefix,'name','md.settings.waitonlock','data',False,'format','Boolean')
+		WriteData(fid,prefix,'object',self,'fieldname','solver_residue_threshold','format','Double')
+	# }}}
Index: /issm/trunk-jpl/src/m/classes/matice.js
===================================================================
--- /issm/trunk-jpl/src/m/classes/matice.js	(revision 22297)
+++ /issm/trunk-jpl/src/m/classes/matice.js	(revision 22298)
@@ -6,137 +6,137 @@
 function matice(){
 	//methods
-		this.setdefaultparameters = function(){ // {{{
+	this.setdefaultparameters = function(){ // {{{
 
-			//ice density (kg/m^3)
-			this.rho_ice=917.;
+		//ice density (kg/m^3)
+		this.rho_ice=917.;
 
-			//ocean water density (kg/m^3)
-			this.rho_water=1023.;
+		//ocean water density (kg/m^3)
+		this.rho_water=1023.;
 
-			//fresh water density (kg/m^3)
-			this.rho_freshwater=1000.;
+		//fresh water density (kg/m^3)
+		this.rho_freshwater=1000.;
 
-			//water viscosity (N.s/m^2)
-			this.mu_water=0.001787;  
+		//water viscosity (N.s/m^2)
+		this.mu_water=0.001787;  
 
-			//ice heat capacity cp (J/kg/K)
-			this.heatcapacity=2093.;
+		//ice heat capacity cp (J/kg/K)
+		this.heatcapacity=2093.;
 
-			//ice latent heat of fusion L (J/kg)
-			this.latentheat=3.34*Math.pow(10,5);
+		//ice latent heat of fusion L (J/kg)
+		this.latentheat=3.34*Math.pow(10,5);
 
-			//ice thermal conductivity (W/m/K)
-			this.thermalconductivity=2.4;
-			
-			//wet ice thermal conductivity (W/m/K)
-			this.temperateiceconductivity=.24;
+		//ice thermal conductivity (W/m/K)
+		this.thermalconductivity=2.4;
 
-			//the melting point of ice at 1 atmosphere of pressure in K
-			this.meltingpoint=273.15;
+		//wet ice thermal conductivity (W/m/K)
+		this.temperateiceconductivity=.24;
 
-			//rate of change of melting point with pressure (K/Pa)
-			this.beta=9.8*Math.pow(10,-8);
+		//the melting point of ice at 1 atmosphere of pressure in K
+		this.meltingpoint=273.15;
 
-			//mixed layer (ice-water interface) heat capacity (J/kg/K)
-			this.mixed_layer_capacity=3974.;
+		//rate of change of melting point with pressure (K/Pa)
+		this.beta=9.8*Math.pow(10,-8);
 
-			//thermal exchange velocity (ice-water interface) (m/s)
-			this.thermal_exchange_velocity=1.00*Math.pow(10,-4);
+		//mixed layer (ice-water interface) heat capacity (J/kg/K)
+		this.mixed_layer_capacity=3974.;
 
-			//Rheology law: what is the temperature dependence of B with T
-			//available: none, paterson and arrhenius
-			this.rheology_law='Paterson';
+		//thermal exchange velocity (ice-water interface) (m/s)
+		this.thermal_exchange_velocity=1.00*Math.pow(10,-4);
 
-			// GIA:
-			this.lithosphere_shear_modulus  = 6.7*Math.pow(10,10);  // (Pa)
-			this.lithosphere_density        = 3.32;       // (g/cm^-3)
-			this.mantle_shear_modulus       = 1.45*Math.pow(10,11); // (Pa)
-			this.mantle_density             = 3.34;       // (g/cm^-3)
-			
-			//SLR
-			this.earth_density= 5512;  // average density of the Earth, (kg/m^3)
+		//Rheology law: what is the temperature dependence of B with T
+		//available: none, paterson and arrhenius
+		this.rheology_law='Paterson';
+
+		// GIA:
+		this.lithosphere_shear_modulus  = 6.7*Math.pow(10,10);  // (Pa)
+		this.lithosphere_density        = 3.32;       // (g/cm^-3)
+		this.mantle_shear_modulus       = 1.45*Math.pow(10,11); // (Pa)
+		this.mantle_density             = 3.34;       // (g/cm^-3)
+
+		//SLR
+		this.earth_density= 5512;  // average density of the Earth, (kg/m^3)
 
 
-		} //}}}
-		this.disp = function() {// {{{
-			console.log(sprintf('   Materials:'));
+	} //}}}
+	this.disp = function() {// {{{
+		console.log(sprintf('   Materials:'));
 
-			fielddisplay(this,'rho_ice','ice density [kg/m^3]');
-			fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
-			fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
-			fielddisplay(this,'mu_water','water viscosity [N s/m^2]');
-			fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
-			fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
-			fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
-			fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
-			fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
-			fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
-			fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
-			fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
-			fielddisplay(this,'rheology_B','flow law parameter [Pa/s^(1/n)]');
-			fielddisplay(this,'rheology_n',"Glen's flow law exponent");
-			fielddisplay(this,'rheology_law',"law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'");
-			fielddisplay(this,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
-			fielddisplay(this,'lithosphere_density','Lithosphere density [g/cm^-3]');
-			fielddisplay(this,'mantle_shear_modulus','Mantle shear modulus [Pa]');
-			fielddisplay(this,'mantle_density','Mantle density [g/cm^-3]');
-			fielddisplay(this,'earth_density','Mantle density [kg/m^-3]');
+		fielddisplay(this,'rho_ice','ice density [kg/m^3]');
+		fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
+		fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
+		fielddisplay(this,'mu_water','water viscosity [N s/m^2]');
+		fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
+		fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
+		fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
+		fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
+		fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
+		fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
+		fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
+		fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
+		fielddisplay(this,'rheology_B','flow law parameter [Pa/s^(1/n)]');
+		fielddisplay(this,'rheology_n',"Glen's flow law exponent");
+		fielddisplay(this,'rheology_law',"law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'");
+		fielddisplay(this,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
+		fielddisplay(this,'lithosphere_density','Lithosphere density [g/cm^-3]');
+		fielddisplay(this,'mantle_shear_modulus','Mantle shear modulus [Pa]');
+		fielddisplay(this,'mantle_density','Mantle density [g/cm^-3]');
+		fielddisplay(this,'earth_density','Mantle density [kg/m^-3]');
 
-		} // }}}
-        this.extrude = function(md) {//{{{
-            this.rheology_B=project3d(md,'vector',this.rheology_B,'type','node');
-            this.rheology_n=project3d(md,'vector',this.rheology_n,'type','element');
-            return this;
-        }//}}}
-		this.classname = function() {// {{{
-			return "matice";
-		} // }}}
-		this.checkconsistency = function(md,solution,analyses) { // {{{
-			checkfield(md,'fieldname','materials.rho_ice','>',0);
-			checkfield(md,'fieldname','materials.rho_water','>',0);
-			checkfield(md,'fieldname','materials.rho_freshwater','>',0);
-			checkfield(md,'fieldname','materials.mu_water','>',0);
-			checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
-			checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements,1]);
-			checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval']);
+	} // }}}
+	this.extrude = function(md) {//{{{
+		this.rheology_B=project3d(md,'vector',this.rheology_B,'type','node');
+		this.rheology_n=project3d(md,'vector',this.rheology_n,'type','element');
+		return this;
+	}//}}}
+	this.classname = function() {// {{{
+		return "matice";
+	} // }}}
+	this.checkconsistency = function(md,solution,analyses) { // {{{
+		checkfield(md,'fieldname','materials.rho_ice','>',0);
+		checkfield(md,'fieldname','materials.rho_water','>',0);
+		checkfield(md,'fieldname','materials.rho_freshwater','>',0);
+		checkfield(md,'fieldname','materials.mu_water','>',0);
+		checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
+		checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements,1]);
+		checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval']);
 
-			if(ArrayAnyEqual(ArrayIsMember('GiaAnalysis',analyses),1)){
-				checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
-				checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
-				checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
-				checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
-			}
-			if (ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),1)){
-				checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
-			}
+		if(ArrayAnyEqual(ArrayIsMember('GiaAnalysis',analyses),1)){
+			checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
+			checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
+			checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
+			checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
+		}
+		if (ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),1)){
+			checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+		}
 
 
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_ice','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_water','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_freshwater','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','mu_water','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','heatcapacity','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','latentheat','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermalconductivity','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','meltingpoint','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','beta','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'data',this.rheology_law,'name','md.materials.rheology_law','format','String');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_density','format','Double','scale',Math.pow(10,3));
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_shear_modulus','format','Double');
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_density','format','Double','scale',Math.pow(10,3));
-			WriteData(fid,prefix,'object',this,'class','materials','fieldname','earth_density','format','Double');
+	} // }}}
+	this.marshall=function(md,prefix,fid) { //{{{
+		WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_ice','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_water','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_freshwater','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mu_water','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','heatcapacity','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','latentheat','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermalconductivity','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','meltingpoint','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','beta','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
+		WriteData(fid,prefix,'data',this.rheology_law,'name','md.materials.rheology_law','format','String');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_density','format','Double','scale',Math.pow(10,3));
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_shear_modulus','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_density','format','Double','scale',Math.pow(10,3));
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','earth_density','format','Double');
 
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
+	}//}}}
+	this.fix=function() { //{{{
+	}//}}}
 	//properties 
 	// {{{
Index: /issm/trunk-jpl/src/m/classes/model.js
===================================================================
--- /issm/trunk-jpl/src/m/classes/model.js	(revision 22297)
+++ /issm/trunk-jpl/src/m/classes/model.js	(revision 22298)
@@ -69,5 +69,5 @@
 			this.debug            = new debug();
 			this.verbose          = new verbose();
-			this.settings         = new settings();
+			this.settings         = new issmsettings();
 			this.toolkits         = new toolkits();
 			this.cluster          = new local();
Index: /issm/trunk-jpl/src/m/classes/model.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/model.py	(revision 22297)
+++ /issm/trunk-jpl/src/m/classes/model.py	(revision 22298)
@@ -31,5 +31,5 @@
 from debug import debug
 from verbose import verbose
-from settings import settings
+from issmsettings import issmsettings
 from toolkits import toolkits
 from generic import generic
@@ -97,5 +97,5 @@
 		self.debug            = debug()
 		self.verbose          = verbose()
-		self.settings         = settings()
+		self.settings         = issmsettings()
 		self.toolkits         = toolkits()
 		self.cluster          = generic()
Index: sm/trunk-jpl/src/m/classes/settings.js
===================================================================
--- /issm/trunk-jpl/src/m/classes/settings.js	(revision 22297)
+++ 	(revision )
@@ -1,94 +1,0 @@
-//SETTINGS class definition
-//
-//   Usage:
-//      settings=new settings();
-
-function settings (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-		//are we short in memory ? (0 faster but requires more memory)
-		this.lowmem=0;
-
-		//i/o:
-		this.io_gather=1;
-
-		//results frequency by default every step
-		this.output_frequency=1;
-
-		//checkpoints frequency, by default never: 
-		this.recording_frequency=0;
-
-		//this option can be activated to load automatically the results
-		//onto the model after a parallel run by waiting for the lock file
-		//N minutes that is generated once the solution has converged
-		//0 to deactivate
-		this.waitonlock=Infinity;
-
-		//upload options: 
-		upload_port         = 0;
-		
-		//throw an error if solver residue exceeds this value
-		this.solver_residue_threshold=1e-6;
-
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   settings class echo:'));
-		
-		fielddisplay(this,'results_on_nodes','results are output for all the nodes of each element');
-		fielddisplay(this,'io_gather','I/O gathering strategy for result outputs (default 1)');
-		fielddisplay(this,'lowmem','is the memory limited ? (0 or 1)');
-		fielddisplay(this,'output_frequency','frequency at which results are saved in all solutions with multiple time_steps');
-		fielddisplay(this,'recording_frequency','frequency at which the runs are being recorded, allowing for a restart');
-		fielddisplay(this,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)');
-		fielddisplay(this,'upload_server','server hostname where model should be uploaded');
-		fielddisplay(this,'upload_path','path on server where model should be uploaded');
-		fielddisplay(this,'upload_login','server login');
-		fielddisplay(this,'upload_port','port login (default is 0)');
-		fielddisplay(this,'upload_filename','unique id generated when uploading the file to server');
-		fielddisplay(this,'solver_residue_threshold','throw an error if solver residue exceeds this value');
-
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "settings";
-
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) { // {{{
-
-			checkfield(md,'fieldname','settings.results_on_nodes','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1);
-			checkfield(md,'fieldname','settings.recording_frequency','numel',[1],'>=',0);
-			checkfield(md,'fieldname','settings.waitonlock','numel',[1]);
-			checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0);
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'object',this,'fieldname','results_on_nodes','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','io_gather','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','lowmem','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','output_frequency','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','recording_frequency','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','solver_residue_threshold','format','Double');
-			if (this.waitonlock>0) WriteData(fid,prefix,'name','md.settings.waitonlock','data',true,'format','Boolean');
-			else WriteData(fid,prefix,'name','md.settings.waitonlock','data',false,'format','Boolean');
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-	this.results_on_nodes    = 0;
-	this.io_gather           = 0;
-	this.lowmem              = 0;
-	this.output_frequency    = 0;
-	this.recording_frequency   = 0;
-	this.waitonlock          = 0;
-	this.upload_server       = '';
-	this.upload_path         = '';
-	this.upload_login        = '';
-	this.upload_port         = 0;
-	this.upload_filename     = '';
-	this.solver_residue_threshold = 0;
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk-jpl/src/m/classes/settings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/settings.py	(revision 22297)
+++ 	(revision )
@@ -1,87 +1,0 @@
-from fielddisplay import fielddisplay
-from checkfield import checkfield
-from WriteData import WriteData
-
-class settings(object):
-	"""
-	SETTINGS class definition
-
-	   Usage:
-	      settings=settings();
-	"""
-
-	def __init__(self): # {{{
-		self.results_on_nodes    = 0
-		self.io_gather           = 0
-		self.lowmem              = 0
-		self.output_frequency    = 0
-		self.recording_frequency = 0
-		self.waitonlock          = 0
-		self.solver_residue_threshold = 0
-
-		#set defaults
-		self.setdefaultparameters()
-
-		#}}}
-	def __repr__(self): # {{{
-		string="   general settings parameters:"
-
-		string="%s\n%s"%(string,fielddisplay(self,"results_on_nodes","results are output for all the nodes of each element"))
-		string="%s\n%s"%(string,fielddisplay(self,"io_gather","I/O gathering strategy for result outputs (default 1)"))
-		string="%s\n%s"%(string,fielddisplay(self,"lowmem","is the memory limited ? (0 or 1)"))
-		string="%s\n%s"%(string,fielddisplay(self,"output_frequency","frequency at which results are saved in all solutions with multiple time_steps"))
-		string="%s\n%s"%(string,fielddisplay(self,"recording_frequency","frequency at which the runs are being recorded, allowing for a restart"))
-		string="%s\n%s"%(string,fielddisplay(self,"waitonlock","maximum number of minutes to wait for batch results, or return 0"))
-		string="%s\n%s"%(string,fielddisplay(self,"solver_residue_threshold","throw an error if solver residue exceeds this value (NaN to deactivate)"))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#are we short in memory ? (0 faster but requires more memory)
-		self.lowmem=0
-
-		#i/o:
-		self.io_gather=1
-
-		#results frequency by default every step
-		self.output_frequency=1
-
-		#checkpoints frequency, by default never: 
-		self.recording_frequency=0
-
-
-		#this option can be activated to load automatically the results
-		#onto the model after a parallel run by waiting for the lock file
-		#N minutes that is generated once the solution has converged
-		#0 to deactivate
-		self.waitonlock=2**31-1
-
-      #throw an error if solver residue exceeds this value
-		self.solver_residue_threshold=1e-6;
-
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		md = checkfield(md,'fieldname','settings.results_on_nodes','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1)
-		md = checkfield(md,'fieldname','settings.recording_frequency','numel',[1],'>=',0)
-		md = checkfield(md,'fieldname','settings.waitonlock','numel',[1])
-		md = checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0)
-
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','results_on_nodes','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','io_gather','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','lowmem','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','output_frequency','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','recording_frequency','format','Integer')
-		
-		if self.waitonlock>0:
-			WriteData(fid,prefix,'name','md.settings.waitonlock','data',True,'format','Boolean')
-		else:
-			WriteData(fid,prefix,'name','md.settings.waitonlock','data',False,'format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','solver_residue_threshold','format','Double')
-	# }}}
