Index: /issm/trunk-jpl/src/m/classes/materials.js
===================================================================
--- /issm/trunk-jpl/src/m/classes/materials.js	(revision 26311)
+++ /issm/trunk-jpl/src/m/classes/materials.js	(revision 26312)
@@ -1,3 +1,3 @@
-class materials {//{{{
+class materials {
 	/**
 	 * MATERIALS class definition
@@ -11,7 +11,7 @@
 		let nargs = arguments.length;
 		if (nargs == 0) {
-			this.nature = ['ice'];
+			this.nature=['ice'];
 		} else {
-			this.nature = arguments;
+			this.nature=arguments;
 		}
 
@@ -24,147 +24,204 @@
 
 		// Start filling in the dynamic fields (not truly dynamic under JavaScript)
-		for (let i = 0; i < this.nature.length; ++i) {
-			let nat = this.nature[i];
-			if (nat == 'ice') {
-				this.rho_ice = 0;
-				this.rho_water = 0;
-				this.rho_freshwater = 0;
-				this.mu_water = 0;
-				this.heatcapacity = 0;
-				this.latentheat = 0;
-				this.thermalconductivity = 0;
-				this.temperateiceconductivity = 0;
-				this.effectiveconductivity_averaging = 0;
-				this.meltingpoint = 0;
-				this.beta = 0;
-				this.mixed_layer_capacity = 0;
-				this.thermal_exchange_velocity = 0;
-				this.rheology_B = 0;
-				this.rheology_n = 0;
-				this.rheology_law = 0;
-			} else if (nat == 'litho') {
-				this.numlayers = 0;
-				this.radius = 0;
-				this.viscosity = 0;
-				this.lame_lambda = 0;
-				this.lame_mu = 0;
-				this.burgers_viscosity = 0;
-				this.burgers_mu = 0;
-				this.ebm_alpha = 0;
-				this.ebm_delta = 0;
-				this.ebm_taul = 0;
-				this.ebm_tauh = 0;
-				this.rheologymodel = 0;
-				this.density = 0;
-				this.issolid = 0;
-			} else if (nat == 'hydro') {
-				this.rho_ice = 0;
-				this.rho_water = 0;
-				this.rho_freshwater = 0;
-			} else {
-				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
-			}
-		}
-		this.earth_density = 0;
-
-		// Set default parameters
-		this.setdefaultparameters();
-	} //}}}
-
+		for (let i = 0; i < length(this.nature); ++i) {
+			let nat = this.nature[i];
+			switch (nat) {
+				case 'ice':
+					this.rho_ice = 0;
+					this.rho_water = 0;
+					this.rho_freshwater = 0;
+					this.mu_water = 0;
+					this.heatcapacity = 0;
+					this.latentheat = 0;
+					this.thermalconductivity = 0;
+					this.temperateiceconductivity = 0;
+					this.effectiveconductivity_averaging = 0;
+					this.meltingpoint = 0;
+					this.beta = 0;
+					this.mixed_layer_capacity = 0;
+					this.thermal_exchange_velocity = 0;
+					this.rheology_B = 0;
+					this.rheology_n = 0;
+					this.rheology_law = 0;
+					break;
+				case 'litho':
+					this.numlayers = 0;
+					this.radius = 0;
+					this.viscosity = 0;
+					this.lame_lambda = 0;
+					this.lame_mu = 0;
+					this.burgers_viscosity = 0;
+					this.burgers_mu = 0;
+					this.ebm_alpha = 0;
+					this.ebm_delta = 0;
+					this.ebm_taul = 0;
+					this.ebm_tauh = 0;
+					this.rheologymodel = 0;
+					this.density = 0;
+					this.issolid = 0;
+					break;
+				case 'hydro':
+					this.rho_ice = 0;
+					this.rho_water = 0;
+					this.rho_freshwater = 0;
+					break;
+				default:
+					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+			}
+			this.earth_density = 0;
+
+			// Set default parameters
+			this.setdefaultparameters();
+		}
+	} //}}}
 	disp() {//{{{
-		console.log('WARNING: materials::disp is not yet implemented');
-	} //}}}
-
+		console.log(sprintf('   Materials:'));
+
+		for (let i = 0; i < length(this.nature); ++i) {
+			let nat = this.nature[i];
+			switch (nat) {
+				case 'ice':
+					console.log(sprintf('   \nIce:'));
+					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\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\'');
+					break;
+				case 'litho':
+					console.log(sprintf('   \nLitho:'));
+					fielddisplay(this,'numlayers','number of layers (default: 2)');
+					fielddisplay(this,'radius','array describing the radius for each interface (numlayers+1) [m]');
+					fielddisplay(this,'viscosity','array describing each layer\'s viscosity (numlayers) [Pa.s]');
+					fielddisplay(this,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]');
+					fielddisplay(this,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]');
+					fielddisplay(this,'burgers_viscosity','array describing each layer\'s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]');
+					fielddisplay(this,'burgers_mu','array describing each layer\'s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]');
+
+					fielddisplay(this,'ebm_alpha','array describing each layer\'s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)');
+					fielddisplay(this,'ebm_delta','array describing each layer\'s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)');
+					fielddisplay(this,'ebm_taul','array describing each layer\'s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]');
+					fielddisplay(this,'ebm_tauh','array describing each layer\'s array describing each layer\'s end period for transient relaxation, only for Burgers rheology (numlayers) [s]');
+
+					fielddisplay(this,'rheologymodel','array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)');
+					fielddisplay(this,'density','array describing each layer\'s density (numlayers) [kg/m^3]');
+					fielddisplay(this,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
+					break;
+				case 'hydro':
+					console.log(sprintf('   \nHydro:'));
+					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
+					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
+					fielddisplay(this,'earth_density','mantle density [kg/m^3]');
+					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
+					break;
+				default:
+					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+			}
+		}
+	} //}}}
 	setdefaultparameters() {//{{{
 		for (let i = 0; i < this.nature.length; ++i) {
 			let nat = this.nature[i];
-			if (nat == 'ice') {
-				// Ice density (kg/m^3)
-				this.rho_ice = 917;
-
-				// Ocean water density (kg/m^3)
-				this.rho_water = 1023
-
-				// Fresh water density (kg/m^3)
-				this.rho_freshwater = 1000;
-
-				// Water viscosity (N.s/m^2)
-				this.mu_water = 0.001787;
-
-				// Ice heat capacity cp (J/kg/K)
-				this.heatcapacity = 2093;
-
-				// Ice latent heat of fusion L (J/kg)
-				this.latentheat = 3.34 * 1e5;
-
-				// Ice thermal conductivity (W/m/K)
-				this.thermalconductivity = 2.4;
-
-				// Wet ice thermal conductivity (W/m/K)
-				this.temperateiceconductivity = 0.24;
-
-				// Computation of effective conductivity
-				this.effectiveconductivity_averaging = 1;
-
-				// The melting point of ice at 1 atmosphere of pressure in K
-				this.meltingpoint = 273.15;
-
-				// Rate of change of melting point with pressure (K/Pa)
-				this.beta = 9.8 * 1e-8;
-
-				// Mixed layer (ice-water interface) heat capacity (J/kg/K)
-				this.mixed_layer_capacity = 3974;
-
-				// Thermal exchange velocity (ice-water interface) (m/s)
-				this.thermal_exchange_velocity = 1.00 * 1e-4;
-
-				// Rheology law: what is the temperature dependence of B with T
-				// available: none, paterson and arrhenius
-				this.rheology_law = 'Paterson';
-
-				// Rheology fields default
-				this.rheology_B = 1 * 1e8;
-				this.rheology_n = 3;
-			} else if (nat == 'litho') {
-				// We default to a configuration that enables running GIA 
-				// solutions using giacaron and/or giaivins
-				this.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)
-				this.radius = [1e3, 6278 * 1e3, 6378 * 1e3];
-
-				this.viscosity = [1e21, 1e40]; // Mantle and lithosphere viscosity (respectively) [Pa.s]
-				this.lame_mu = [1.45 * 1e11, 6.7 * 1e10]; // (Pa) // Lithosphere and mantle shear modulus (respectively) [Pa]
-				this.lame_lambda = this.lame_mu; // (Pa) // Mantle and lithosphere lamba parameter (respectively) [Pa]
-				this.burgers_viscosity = [NaN, NaN];
-				this.burgers_mu = [NaN, NaN];
-
-				this.ebm_alpha = [NaN, NaN];
-				this.ebm_delta = [NaN, NaN];
-				this.ebm_taul = [NaN, NaN];
-				this.ebm_tauh = [NaN, NaN];
-				this.rheologymodel = [0, 0];
-				this.density = [5.51 * 1e3, 5.50 * 1e3]; // (Pa) // Mantle and lithosphere density [kg/m^3]
-				this.issolid = [1, 1]; // Is layer solid or liquid?
-			} else if (nat == 'hydro') {
-				// Ice density (kg/m^3)
-				this.rho_ice = 917;
-
-				// Ocean water density (kg/m^3)
-				this.rho_water = 1023;
-
-				// Fresh water density (kg/m^3)
-				this.rho_freshwater = 1000;
-			} else {
-				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+			switch (nat) {
+				case 'ice':
+					// Ice density (kg/m^3)
+					this.rho_ice = 917;
+
+					// Ocean water density (kg/m^3)
+					this.rho_water = 1023
+
+					// Fresh water density (kg/m^3)
+					this.rho_freshwater = 1000;
+
+					// Water viscosity (N.s/m^2)
+					this.mu_water = 0.001787;
+
+					// Ice heat capacity cp (J/kg/K)
+					this.heatcapacity = 2093;
+
+					// Ice latent heat of fusion L (J/kg)
+					this.latentheat = 3.34 * 1e5;
+
+					// Ice thermal conductivity (W/m/K)
+					this.thermalconductivity = 2.4;
+
+					// Wet ice thermal conductivity (W/m/K)
+					this.temperateiceconductivity = 0.24;
+
+					// Computation of effective conductivity
+					this.effectiveconductivity_averaging = 1;
+
+					// The melting point of ice at 1 atmosphere of pressure in K
+					this.meltingpoint = 273.15;
+
+					// Rate of change of melting point with pressure (K/Pa)
+					this.beta = 9.8 * 1e-8;
+
+					// Mixed layer (ice-water interface) heat capacity (J/kg/K)
+					this.mixed_layer_capacity = 3974;
+
+					// Thermal exchange velocity (ice-water interface) (m/s)
+					this.thermal_exchange_velocity = 1.00 * 1e-4;
+
+					// Rheology law: what is the temperature dependence of B with T
+					// available: none, paterson and arrhenius
+					this.rheology_law = 'Paterson';
+
+					// Rheology fields default
+					this.rheology_B = 1 * 1e8;
+					this.rheology_n = 3;
+					break;
+				case 'litho':
+					// We default to a configuration that enables running GIA 
+					// solutions using giacaron and/or giaivins
+					this.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)
+					this.radius = [1e3, 6278 * 1e3, 6378 * 1e3];
+
+					this.viscosity = [1e21, 1e40]; // Mantle and lithosphere viscosity (respectively) [Pa.s]
+					this.lame_mu = [1.45 * 1e11, 6.7 * 1e10]; // (Pa) // Lithosphere and mantle shear modulus (respectively) [Pa]
+					this.lame_lambda = this.lame_mu; // (Pa) // Mantle and lithosphere lamba parameter (respectively) [Pa]
+					this.burgers_viscosity = [NaN, NaN];
+					this.burgers_mu = [NaN, NaN];
+
+					this.ebm_alpha = [NaN, NaN];
+					this.ebm_delta = [NaN, NaN];
+					this.ebm_taul = [NaN, NaN];
+					this.ebm_tauh = [NaN, NaN];
+					this.rheologymodel = [0, 0];
+					this.density = [5.51 * 1e3, 5.50 * 1e3]; // (Pa) // Mantle and lithosphere density [kg/m^3]
+					this.issolid = [1, 1]; // Is layer solid or liquid?
+					break;
+				case 'hydro':
+					// Ice density (kg/m^3)
+					this.rho_ice = 917;
+
+					// Ocean water density (kg/m^3)
+					this.rho_water = 1023;
+
+					// Fresh water density (kg/m^3)
+					this.rho_freshwater = 1000;
+					break;
+				default:
+					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
 			}
 
 			// Average density of the Earth (kg/m^3)
-			this.earth_density=5512;
-		}
-	} //}}}
-
+			this.earth_density = 5512;
+		}
+	} //}}}
 	checkconsistency(md, solution, analyses) {//{{{
 		for (let i = 0; i < this.nature.length; ++i) {
@@ -225,5 +282,4 @@
 		return md;
 	} //}}}
-
 	marshall(md, prefix, fid) {//{{{
 		// 1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
@@ -281,5 +337,4 @@
 		}
 	} //}}}
-
 	extrude(md) {//{{{
 		for (let i = 0; i < this.nature.length; ++i) {
@@ -296,23 +351,30 @@
 	let intnat = zeros(strnat.length, 1);
 	for (let i = 0; i < strnat.length; ++i) {
-		let str_nat = strnat[i];
-		if (str_nat == 'damageice') {
-			intnat[i] = 1;
-		} else if (str_nat == 'estar') {
-			intnat[i] = 2;
-		} else if (str_nat == 'ice') {
-			intnat[i] = 3;
-		} else if (str_nat == 'enhancedice') {
-			intnat[i] = 4;
-		//} else if (str_nat == 'materials') { // This case will never happen, kept to ensure equivalent of codes between IoCodeToMaterialsEnum and IoCodeToNatureEnum
-		//	intnat[i] = 5;
-		} else if (str_nat == 'litho') {
-			intnat[i] = 6;
-		} else if (str_nat == 'hydro') {
-			intnat[i] = 7;
-		} else {
-			error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+		switch (strnat[i]) {
+			case 'damageice':
+				intnat[i] = 1;
+				break;
+			case 'estar':
+				intnat[i] = 2;
+				break;
+			case 'ice':
+				intnat[i] = 3;
+				break;
+			case 'enhancedice':
+				intnat[i] = 4;
+				break;
+			//case 'materials': // This case will never happen, kept to ensure equivalent of codes between IoCodeToMaterialsEnum and IoCodeToNatureEnum
+			//	intnat[i] = 5;
+			//	break;
+			case 'litho':
+				intnat[i] = 6;
+				break;
+			case 'hydro':
+				intnat[i] = 7;
+				break;
+			default:
+				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
 		}
 	}
 	return intnat;
-} //}}}
+}// }}}
