Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 23643)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 23644)
@@ -114,5 +114,4 @@
 					./classes/Materials/Matlitho.cpp\
 					./classes/Materials/Matestar.cpp\
-					./classes/Materials/Matpar.cpp\
 					./classes/Constraints/Constraints.cpp\
 					./classes/Constraints/SpcStatic.cpp\
Index: /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 23644)
@@ -390,8 +390,8 @@
 	else enthalpy_enum=EnthalpyEnum;
 
-	IssmDouble latentheat = element->GetMaterialParameter(MaterialsLatentheatEnum);
-	IssmDouble rho_ice    = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble rho_water  = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	IssmDouble beta		 = element->GetMaterialParameter(MaterialsBetaEnum);
+	IssmDouble latentheat = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble rho_ice    = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water  = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble beta		 = element->FindParam(MaterialsBetaEnum);
 	IssmDouble kappa		 = EnthalpyDiffusionParameterVolume(element,enthalpy_enum);     _assert_(kappa>=0.);
 	IssmDouble kappa_mix;
@@ -584,9 +584,9 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	element->FindParam(&stabilization,ThermalStabilizationEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  thermalconductivity = element->FindParam(MaterialsThermalconductivityEnum);
 	Input* vx_input  = element->GetInput(VxEnum);     _assert_(vx_input);
 	Input* vy_input  = element->GetInput(VyEnum);     _assert_(vy_input);
@@ -710,10 +710,10 @@
 	element->GetVerticesCoordinatesBase(&xyz_list_base);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  mixed_layer_capacity= element->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
-	IssmDouble  thermal_exchange_vel= element->GetMaterialParameter(MaterialsThermalExchangeVelocityEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  mixed_layer_capacity= element->FindParam(MaterialsMixedLayerCapacityEnum);
+	IssmDouble  thermal_exchange_vel= element->FindParam(MaterialsThermalExchangeVelocityEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -786,10 +786,10 @@
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
-	IssmDouble  temperateiceconductivity = element->GetMaterialParameter(MaterialsTemperateiceconductivityEnum);
-	IssmDouble  beta                = element->GetMaterialParameter(MaterialsBetaEnum);
-	IssmDouble  latentheat          = element->GetMaterialParameter(MaterialsLatentheatEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  thermalconductivity = element->FindParam(MaterialsThermalconductivityEnum);
+	IssmDouble  temperateiceconductivity = element->FindParam(MaterialsTemperateiceconductivityEnum);
+	IssmDouble  beta                = element->FindParam(MaterialsBetaEnum);
+	IssmDouble  latentheat          = element->FindParam(MaterialsLatentheatEnum);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	element->FindParam(&stabilization,ThermalStabilizationEnum);
@@ -912,5 +912,5 @@
 	Input* meltingrate_input	 = element->GetInput(BasalforcingsGroundediceMeltingRateEnum);							 _assert_(meltingrate_input);
 	Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
-	IssmDouble  rho_ice			 = element->GetMaterialParameter(MaterialsRhoIceEnum);
+	IssmDouble  rho_ice			 = element->FindParam(MaterialsRhoIceEnum);
 
 	/*Build friction element, needed later: */
@@ -998,10 +998,10 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	Input*      pressure_input=element->GetInput(PressureEnum); _assert_(pressure_input);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  mixed_layer_capacity= element->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
-	IssmDouble  thermal_exchange_vel= element->GetMaterialParameter(MaterialsThermalExchangeVelocityEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  mixed_layer_capacity= element->FindParam(MaterialsMixedLayerCapacityEnum);
+	IssmDouble  thermal_exchange_vel= element->FindParam(MaterialsThermalExchangeVelocityEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -1152,7 +1152,7 @@
 IssmDouble     EnthalpyAnalysis::EnthalpyDiffusionParameter(Element* element,IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
 
-	IssmDouble heatcapacity             = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble temperateiceconductivity = element->GetMaterialParameter(MaterialsTemperateiceconductivityEnum);
-	IssmDouble thermalconductivity      = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
+	IssmDouble heatcapacity             = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble temperateiceconductivity = element->FindParam(MaterialsTemperateiceconductivityEnum);
+	IssmDouble thermalconductivity      = element->FindParam(MaterialsThermalconductivityEnum);
 
 	if(enthalpy < PureIceEnthalpy(element,pressure)){
@@ -1507,5 +1507,5 @@
 	IssmDouble temperature, waterfraction;
 	IssmDouble kappa_w = 0.6; // thermal conductivity of water (in W/m/K)
-	IssmDouble kappa_i = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
+	IssmDouble kappa_i = element->FindParam(MaterialsThermalconductivityEnum);
 	element->EnthalpyToThermal(&temperature, &waterfraction, enthalpy, pressure);
 
@@ -1520,5 +1520,4 @@
 	int         i,rheology_law;
 	IssmDouble  B_average,s_average,T_average=0.,P_average=0.;
-	IssmDouble  n=3.0;
 	int        *doflist   = NULL;
 	IssmDouble *xyz_list  = NULL;
@@ -1546,5 +1545,4 @@
 
 	/*Get all inputs and parameters*/
-	if(element->material->ObjectEnum()!=MatestarEnum) n=element->GetMaterialParameter(MaterialsRheologyNEnum);
 	element->GetInputValue(&converged,ConvergedEnum);
 	element->GetInputListOnNodes(&pressure[0],PressureEnum);
@@ -1559,7 +1557,15 @@
 		element->AddInput(TemperatureEnum,temperature,element->GetElementType());
 
+		IssmDouble* n = xNew<IssmDouble>(numnodes);
+		if(element->material->ObjectEnum()!=MatestarEnum){
+			for(i=0;i<numnodes;i++) n[i]=3.;
+		}
+		else{
+			element->GetInputListOnNodes(&n[0],MaterialsRheologyNEnum);
+		}
+
 		/*Update Rheology only if converged (we must make sure that the temperature is below melting point
 		 * otherwise the rheology could be negative*/
-		rheology_law=element->GetIntegerMaterialParameter(MaterialsRheologyLawEnum);
+		element->FindParam(&rheology_law,MaterialsRheologyLawEnum);
 		element->GetInputListOnNodes(&surface[0],SurfaceEnum);
 		switch(rheology_law){
@@ -1576,5 +1582,5 @@
 				break;
 			case CuffeyTemperateEnum:
-				for(i=0;i<numnodes;i++) B[i]=CuffeyTemperate(temperature[i], waterfraction[i],n);
+				for(i=0;i<numnodes;i++) B[i]=CuffeyTemperate(temperature[i], waterfraction[i],n[i]);
 				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
 				break;
@@ -1583,15 +1589,18 @@
 				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
 				break;
-			case ArrheniusEnum:
+			case ArrheniusEnum:{
 				element->GetVerticesCoordinates(&xyz_list);
-				for(i=0;i<numnodes;i++) B[i]=Arrhenius(temperature[i],surface[i]-xyz_list[i*3+2],n);
+				for(i=0;i<numnodes;i++) B[i]=Arrhenius(temperature[i],surface[i]-xyz_list[i*3+2],n[i]);
 				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
 				break;
-			case LliboutryDuvalEnum:
-				for(i=0;i<numnodes;i++) B[i]=LliboutryDuval(values[i],pressure[i],n,element->GetMaterialParameter(MaterialsBetaEnum),element->GetMaterialParameter(ConstantsReferencetemperatureEnum),element->GetMaterialParameter(MaterialsHeatcapacityEnum),element->GetMaterialParameter(MaterialsLatentheatEnum)); 
+				}
+			case LliboutryDuvalEnum:{
+				for(i=0;i<numnodes;i++) B[i]=LliboutryDuval(values[i],pressure[i],n[i],element->FindParam(MaterialsBetaEnum),element->FindParam(ConstantsReferencetemperatureEnum),element->FindParam(MaterialsHeatcapacityEnum),element->FindParam(MaterialsLatentheatEnum)); 
 				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType()); 
 				break; 
+				}
 			default: _error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
 		}
+		xDelete<IssmDouble>(n);
 	}
 	else{
@@ -1624,6 +1633,6 @@
 IssmDouble     EnthalpyAnalysis::PureIceEnthalpy(Element* element,IssmDouble pressure){/*{{{*/
 
-	IssmDouble heatcapacity         = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble referencetemperature = element->GetMaterialParameter(ConstantsReferencetemperatureEnum);
+	IssmDouble heatcapacity         = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble referencetemperature = element->FindParam(ConstantsReferencetemperatureEnum);
 
 	return heatcapacity*(TMeltingPoint(element,pressure)-referencetemperature);
@@ -1631,6 +1640,6 @@
 IssmDouble     EnthalpyAnalysis::TMeltingPoint(Element* element,IssmDouble pressure){/*{{{*/
 
-	IssmDouble meltingpoint = element->GetMaterialParameter(MaterialsMeltingpointEnum);
-	IssmDouble beta         = element->GetMaterialParameter(MaterialsBetaEnum);
+	IssmDouble meltingpoint = element->FindParam(MaterialsMeltingpointEnum);
+	IssmDouble beta         = element->FindParam(MaterialsBetaEnum);
 
 	return meltingpoint-beta*pressure;
Index: /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 23644)
@@ -546,4 +546,5 @@
 		IssmDouble* thickness     = xNew<IssmDouble>(numnodes);
 		IssmDouble* B             = xNew<IssmDouble>(numnodes);
+		IssmDouble* n             = xNew<IssmDouble>(numnodes);
 		IssmDouble* eplhead       = xNew<IssmDouble>(numnodes);
 		IssmDouble* epl_slopeX    = xNew<IssmDouble>(numnodes);
@@ -559,12 +560,11 @@
 
 		/*For now, assuming just one way to compute EPL thickness*/
-		IssmDouble gravity          = element->GetMaterialParameter(ConstantsGEnum);
-		IssmDouble rho_water        = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-		IssmDouble rho_ice          = element->GetMaterialParameter(MaterialsRhoIceEnum);
-		IssmDouble n                =	element->GetMaterialParameter(MaterialsRheologyNEnum);
-		IssmDouble latentheat       = element->GetMaterialParameter(MaterialsLatentheatEnum);
-		IssmDouble epl_conductivity = element->GetMaterialParameter(HydrologydcEplConductivityEnum);
-		IssmDouble init_thick       =	element->GetMaterialParameter(HydrologydcEplInitialThicknessEnum);
-		IssmDouble max_thick        =	element->GetMaterialParameter(HydrologydcEplMaxThicknessEnum);
+		IssmDouble gravity          = element->FindParam(ConstantsGEnum);
+		IssmDouble rho_water        = element->FindParam(MaterialsRhoFreshwaterEnum);
+		IssmDouble rho_ice          = element->FindParam(MaterialsRhoIceEnum);
+		IssmDouble latentheat       = element->FindParam(MaterialsLatentheatEnum);
+		IssmDouble epl_conductivity = element->FindParam(HydrologydcEplConductivityEnum);
+		IssmDouble init_thick       =	element->FindParam(HydrologydcEplInitialThicknessEnum);
+		IssmDouble max_thick        =	element->FindParam(HydrologydcEplMaxThicknessEnum);
 
 		switch(domaintype){
@@ -580,4 +580,5 @@
 		element->GetInputListOnVertices(&ice_thickness[0],ThicknessEnum);
 		element->GetInputListOnVertices(&bed[0],BaseEnum);
+		element->GetInputListOnVertices(&n[0],MaterialsRheologyNEnum);
 
 		if(!active_element){
@@ -589,5 +590,5 @@
 		else{
 			for(int i=0;i<numnodes;i++){
-				A=pow(B[i],-n);
+				A=pow(B[i],-n[i]);
 				/*Compute first the effective pressure in the EPL*/
 				EPL_N=gravity*((rho_ice*ice_thickness[i])-(rho_water*(eplhead[i]-bed[i])));
@@ -597,5 +598,5 @@
 				/*And proceed to the real thing*/
 				opening=(rho_water*gravity*epl_conductivity*EPLgrad2*dt)/(rho_ice*latentheat);
-				closing=(2.0*A*dt*pow(EPL_N,n))/(pow(n,n));
+				closing=(2.0*A*dt*pow(EPL_N,n[i]))/(pow(n[i],n[i]));
 				/*implicit*/
 				thickness[i] = old_thickness[i]/(1.0-opening+closing);
@@ -619,4 +620,5 @@
 		xDelete<IssmDouble>(bed);
 		xDelete<IssmDouble>(B);
+		xDelete<IssmDouble>(n);
 	}
 }/*}}}*/
@@ -679,6 +681,6 @@
 	IssmDouble* base          =xNew<IssmDouble>(numnodes);
 
-	IssmDouble init_thick    =basalelement->GetMaterialParameter(HydrologydcEplInitialThicknessEnum);
-	IssmDouble colapse_thick =basalelement->GetMaterialParameter(HydrologydcEplColapseThicknessEnum);
+	IssmDouble init_thick    =basalelement->FindParam(HydrologydcEplInitialThicknessEnum);
+	IssmDouble colapse_thick =basalelement->FindParam(HydrologydcEplColapseThicknessEnum);
 
 	Input* active_element_input=basalelement->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input);
@@ -749,9 +751,9 @@
 	IssmDouble water_sheet,storing;
 	IssmDouble epl_thickness,prestep_head,base_elev;
-	IssmDouble rho_freshwater        = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	IssmDouble g                     = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble epl_porosity					 = element->GetMaterialParameter(HydrologydcEplPorosityEnum);
-	IssmDouble epl_compressibility	 = element->GetMaterialParameter(HydrologydcEplCompressibilityEnum);
-	IssmDouble water_compressibility = element->GetMaterialParameter(HydrologydcWaterCompressibilityEnum);
+	IssmDouble rho_freshwater        = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble g                     = element->FindParam(ConstantsGEnum);
+	IssmDouble epl_porosity					 = element->FindParam(HydrologydcEplPorosityEnum);
+	IssmDouble epl_compressibility	 = element->FindParam(HydrologydcEplCompressibilityEnum);
+	IssmDouble water_compressibility = element->FindParam(HydrologydcWaterCompressibilityEnum);
 
 	epl_thick_input->GetInputValue(&epl_thickness,gauss);
@@ -781,5 +783,5 @@
 	IssmDouble water_sheet;
 	IssmDouble epl_thickness,base_elev,prestep_head;
-	IssmDouble epl_conductivity      = element->GetMaterialParameter(HydrologydcEplConductivityEnum);
+	IssmDouble epl_conductivity      = element->FindParam(HydrologydcEplConductivityEnum);
 	epl_thick_input->GetInputValue(&epl_thickness,gauss);
 	epl_head_input->GetInputValue(&prestep_head,gauss);
@@ -861,6 +863,6 @@
 	case 2:
 		/*Compute max*/
-		rho_water = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-		rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
+		rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+		rho_ice   = element->FindParam(MaterialsRhoIceEnum);
 		element-> GetInputValue(&thickness,innode,ThicknessEnum);
 		element-> GetInputValue(&bed,innode,BaseEnum);
Index: /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 23644)
@@ -536,7 +536,7 @@
 		basalelement->FindParam(&kmax,HydrologySedimentKmaxEnum);
 		basalelement->FindParam(&penalty_factor,HydrologydcPenaltyFactorEnum);
-		IssmDouble rho_freshwater = basalelement->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-		IssmDouble rho_ice        = basalelement->GetMaterialParameter(MaterialsRhoIceEnum);
-		IssmDouble g              = basalelement->GetMaterialParameter(ConstantsGEnum);
+		IssmDouble rho_freshwater = basalelement->FindParam(MaterialsRhoFreshwaterEnum);
+		IssmDouble rho_ice        = basalelement->FindParam(MaterialsRhoIceEnum);
+		IssmDouble g              = basalelement->FindParam(ConstantsGEnum);
 
 		basalelement->GetInputListOnVertices(thickness,ThicknessEnum);
@@ -595,10 +595,10 @@
 	IssmDouble storing,yield;
 	IssmDouble base_elev,prestep_head,water_sheet;
-	IssmDouble rho_freshwater           = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	IssmDouble g                        = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble sediment_porosity        = element->GetMaterialParameter(HydrologydcSedimentPorosityEnum);
-	IssmDouble sediment_thickness       = element->GetMaterialParameter(HydrologydcSedimentThicknessEnum);
-	IssmDouble sediment_compressibility = element->GetMaterialParameter(HydrologydcSedimentCompressibilityEnum);
-	IssmDouble water_compressibility    = element->GetMaterialParameter(HydrologydcWaterCompressibilityEnum);
+	IssmDouble rho_freshwater           = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble g                        = element->FindParam(ConstantsGEnum);
+	IssmDouble sediment_porosity        = element->FindParam(HydrologydcSedimentPorosityEnum);
+	IssmDouble sediment_thickness       = element->FindParam(HydrologydcSedimentThicknessEnum);
+	IssmDouble sediment_compressibility = element->FindParam(HydrologydcSedimentCompressibilityEnum);
+	IssmDouble water_compressibility    = element->FindParam(HydrologydcWaterCompressibilityEnum);
 	element->FindParam(&unconf_scheme,HydrologydcUnconfinedFlagEnum);
 	switch(unconf_scheme){
@@ -636,5 +636,5 @@
 	IssmDouble groundedice;
 	IssmDouble base_elev,prestep_head,water_sheet;
-	IssmDouble sediment_thickness       = element->GetMaterialParameter(HydrologydcSedimentThicknessEnum);
+	IssmDouble sediment_thickness       = element->FindParam(HydrologydcSedimentThicknessEnum);
 
 	element->FindParam(&unconf_scheme,HydrologydcUnconfinedFlagEnum);
@@ -681,6 +681,6 @@
 	case 2:
 		/*Compute max*/
-		rho_water = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-		rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
+		rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+		rho_ice   = element->FindParam(MaterialsRhoIceEnum);
 		element->GetInputValue(&thickness,innode,ThicknessEnum);
 		element->GetInputValue(&bed,innode,BaseEnum);
Index: /issm/trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp	(revision 23644)
@@ -108,6 +108,6 @@
 	/*Retrieve all inputs and parameters*/
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
-	IssmDouble  rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  rho_water = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+	IssmDouble  rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
 
 	/*Get water column and drainage rate*/
Index: /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 23644)
@@ -241,8 +241,8 @@
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	IssmDouble  latentheat      = element->GetMaterialParameter(MaterialsLatentheatEnum);
-	IssmDouble  g               = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_ice         = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  rho_water       = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+	IssmDouble  latentheat      = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble  g               = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_ice         = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water       = element->FindParam(MaterialsRhoFreshwaterEnum);
 	Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum);_assert_(geothermalflux_input);
 	Input* head_input           = element->GetInput(HydrologyHeadEnum);              _assert_(head_input);
@@ -355,5 +355,5 @@
 
 	/*Get gravity from parameters*/
-	   IssmDouble  g = element->GetMaterialParameter(ConstantsGEnum);
+	   IssmDouble  g = element->FindParam(ConstantsGEnum);
 
 	/*Fetch number of nodes for this finite element*/
@@ -368,6 +368,6 @@
 	IssmDouble* thickness = xNew<IssmDouble>(numnodes);
 	IssmDouble* bed       = xNew<IssmDouble>(numnodes);
-	IssmDouble  rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  rho_water = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+	IssmDouble  rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
 	element->GetInputListOnNodes(&thickness[0],ThicknessEnum);
 	element->GetInputListOnNodes(&bed[0],BaseEnum);
@@ -437,5 +437,5 @@
 
 	/*Get gravity from parameters*/
-	IssmDouble  g = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  g = element->FindParam(ConstantsGEnum);
 
 	/*Get Reynolds and gap average values*/
@@ -479,8 +479,8 @@
 	element->GetVerticesCoordinates(&xyz_list);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
-	IssmDouble  latentheat      = element->GetMaterialParameter(MaterialsLatentheatEnum);
-	IssmDouble  g               = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_ice         = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  rho_water       = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+	IssmDouble  latentheat      = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble  g               = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_ice         = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water       = element->FindParam(MaterialsRhoFreshwaterEnum);
 	Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum);_assert_(geothermalflux_input);
 	Input* head_input           = element->GetInput(HydrologyHeadEnum);              _assert_(head_input);
Index: /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 23644)
@@ -105,8 +105,8 @@
 
 	/*Retrieve all inputs and parameters*/
-	IssmDouble  rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  g         = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  mu_water  = element->GetMaterialParameter(MaterialsMuWaterEnum);
+	IssmDouble  rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  g         = element->FindParam(ConstantsGEnum);
+	IssmDouble  mu_water  = element->FindParam(MaterialsMuWaterEnum);
 	Input* surfaceslopex_input = element->GetInput(SurfaceSlopeXEnum); _assert_(surfaceslopex_input);
 	Input* surfaceslopey_input = element->GetInput(SurfaceSlopeYEnum); _assert_(surfaceslopey_input);
Index: /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 23644)
@@ -719,6 +719,6 @@
 			Element* element  = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
 
-			rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
-			rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+			rho_ice = element->FindParam(MaterialsRhoIceEnum);
+			rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
 
 			int      numnodes           = element->GetNumberOfNodes();
Index: /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 23644)
@@ -750,6 +750,6 @@
 	/*Find MasstransportHydrostaticAdjustment to figure out how to update the geometry:*/
 	basalelement->FindParam(&hydroadjustment,MasstransportHydrostaticAdjustmentEnum);
-	rho_ice   = basalelement->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water = basalelement->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+	rho_ice   = basalelement->FindParam(MaterialsRhoIceEnum);
+	rho_water = basalelement->FindParam(MaterialsRhoSeawaterEnum);
 
 	for(i=0;i<numnodes;i++) {
Index: /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 23644)
@@ -97,6 +97,6 @@
 	/*Retrieve all inputs and parameters*/
 	basalelement->GetVerticesCoordinates(&xyz_list);
-	IssmDouble latentheat   = element->GetMaterialParameter(MaterialsLatentheatEnum);
-	IssmDouble heatcapacity = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
+	IssmDouble latentheat   = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble heatcapacity = element->FindParam(MaterialsHeatcapacityEnum);
 
 	/* Start  looping on the number of gaussian points: */
Index: /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.cpp	(revision 23644)
@@ -137,6 +137,6 @@
 		case DrivingStressXEnum:
 		case DrivingStressYEnum:{
-			rho_ice       = element->GetMaterialParameter(MaterialsRhoIceEnum);
-			gravity       = element->GetMaterialParameter(ConstantsGEnum);
+			rho_ice       = element->FindParam(MaterialsRhoIceEnum);
+			gravity       = element->FindParam(ConstantsGEnum);
 			H_input       = element->GetInput(ThicknessEnum); _assert_(H_input);
 			surface_input = element->GetInput(SurfaceEnum);   _assert_(surface_input);
Index: /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 23644)
@@ -1634,5 +1634,5 @@
 	Input*     thickness_input=element->GetInput(ThicknessEnum); _assert_(thickness_input);
 	Input*     surface_input  =element->GetInput(SurfaceEnum);   _assert_(surface_input);
-	IssmDouble rhog = element->GetMaterialParameter(MaterialsRhoIceEnum)*element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rhog = element->FindParam(MaterialsRhoIceEnum)*element->FindParam(ConstantsGEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -1699,7 +1699,7 @@
 	Input* base_input       = element->GetInput(BaseEnum);       _assert_(base_input);
 	Input* sealevel_input       = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
-	IssmDouble rho_water   = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_ice     = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity     = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water   = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice     = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity     = element->FindParam(ConstantsGEnum);
 	element->GetVerticesCoordinates(&xyz_list);
 	element->GetIcefrontCoordinates(&xyz_list_front,xyz_list,MaskIceLevelsetEnum);
@@ -1871,6 +1871,6 @@
 
 	element->FindParam(&domaintype,DomainTypeEnum);
-	rho_ice =element->GetMaterialParameter(MaterialsRhoIceEnum);
-	g       =element->GetMaterialParameter(ConstantsGEnum);
+	rho_ice =element->FindParam(MaterialsRhoIceEnum);
+	g       =element->FindParam(ConstantsGEnum);
 	switch(domaintype){
 		case Domain2DhorizontalEnum:
@@ -2103,5 +2103,5 @@
 	Input*     thickness_input=element->GetInput(ThicknessEnum); _assert_(thickness_input);
 	Input*     surface_input  =element->GetInput(SurfaceEnum);   _assert_(surface_input);
-	IssmDouble rhog = element->GetMaterialParameter(MaterialsRhoIceEnum)*element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rhog = element->FindParam(MaterialsRhoIceEnum)*element->FindParam(ConstantsGEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2155,7 +2155,7 @@
 	Input* base_input       = element->GetInput(BaseEnum);       _assert_(base_input);
 	Input* sealevel_input       = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
-	IssmDouble rho_water   = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_ice     = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity     = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water   = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice     = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity     = element->FindParam(ConstantsGEnum);
 	element->GetVerticesCoordinates(&xyz_list);
 	element->GetIcefrontCoordinates(&xyz_list_front,xyz_list,MaskIceLevelsetEnum);
@@ -2211,6 +2211,6 @@
 	element->FindParam(&dim,DomainDimensionEnum);
 	element->FindParam(&domaintype,DomainTypeEnum);
-	rho_ice =element->GetMaterialParameter(MaterialsRhoIceEnum);
-	g       =element->GetMaterialParameter(ConstantsGEnum);
+	rho_ice =element->FindParam(MaterialsRhoIceEnum);
+	g       =element->FindParam(ConstantsGEnum);
 	if(dim==2){
 		element->GetInputListOnVertices(thickness,ThicknessEnum);
@@ -2630,5 +2630,5 @@
 	element->GetVerticesCoordinates(&xyz_list);
 	Input*     surface_input = element->GetInput(SurfaceEnum);   _assert_(surface_input);
-	IssmDouble rhog = element->GetMaterialParameter(MaterialsRhoIceEnum)*element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rhog = element->FindParam(MaterialsRhoIceEnum)*element->FindParam(ConstantsGEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2687,7 +2687,7 @@
 	Input* surface_input = element->GetInput(SurfaceEnum); _assert_(surface_input);
 	Input* sealevel_input       = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
-	IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 	element->GetVerticesCoordinates(&xyz_list);
 	element->GetIcefrontCoordinates(&xyz_list_front,xyz_list,MaskIceLevelsetEnum);
@@ -2873,6 +2873,6 @@
 
 	element->FindParam(&domaintype,DomainTypeEnum);
-	IssmDouble rho_ice =element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble g       =element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_ice =element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble g       =element->FindParam(ConstantsGEnum);
 	switch(domaintype){
 		case Domain3DEnum:
@@ -3124,6 +3124,6 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	if(dt==0)   dt=1.e+5;
-	IssmDouble  rho_water     = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  gravity       = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  rho_water     = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  gravity       = element->FindParam(ConstantsGEnum);
 	Input*      base_input = element->GetInput(BaseEnum); _assert_(base_input);
 
@@ -4018,6 +4018,6 @@
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	IssmDouble  rho_ice =element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  gravity =element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  rho_ice =element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  gravity =element->FindParam(ConstantsGEnum);
 	Input*      loadingforcex_input=element->GetInput(LoadingforceXEnum);  _assert_(loadingforcex_input);
 	Input*      loadingforcey_input=element->GetInput(LoadingforceYEnum);  _assert_(loadingforcey_input);
@@ -4100,6 +4100,6 @@
 	Input* surface_input  = element->GetInput(SurfaceEnum); _assert_(surface_input);
 	Input* sealevel_input       = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
-	IssmDouble  rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  gravity   = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  gravity   = element->FindParam(ConstantsGEnum);
 
 	/*Initialize gauss points*/
@@ -4168,6 +4168,6 @@
 	element->GetVerticesCoordinatesBase(&xyz_list_base);
 	Input*      base_input=element->GetInput(BaseEnum); _assert_(base_input);
-	IssmDouble  rho_water=element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  gravity  =element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  rho_water=element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  gravity  =element->FindParam(ConstantsGEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -7324,6 +7324,6 @@
 	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D,
 	 *so the pressure is just the pressure at the bedrock: */
-	rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	g       = element->GetMaterialParameter(ConstantsGEnum);
+	rho_ice = element->FindParam(MaterialsRhoIceEnum);
+	g       = element->FindParam(ConstantsGEnum);
 	element->GetVerticesCoordinates(&xyz_list);
 	element->GetInputListOnNodes(&surface[0],SurfaceEnum);
Index: /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 23644)
@@ -318,9 +318,9 @@
 
 	/*Retrieve all inputs and parameters*/
-	IssmDouble  rho_ice    = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  gravity    = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  n          = element->GetMaterialParameter(MaterialsRheologyNEnum);
-	IssmDouble B;
+	IssmDouble  rho_ice    = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  gravity    = element->FindParam(ConstantsGEnum);
+	IssmDouble  B,n;
 	Input* B_input         = element->GetInput(MaterialsRheologyBbarEnum);_assert_(B_input);
+	Input* n_input         = element->GetInput(MaterialsRheologyNEnum);   _assert_(n_input);
 	Input* slopex_input    = element->GetInput(SurfaceSlopeXEnum);        _assert_(slopex_input);
 	Input* slopey_input    = element->GetInput(SurfaceSlopeYEnum);        _assert_(slopey_input);
@@ -339,4 +339,5 @@
 
 		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
 		thickness_input->GetInputValue(&thickness,gauss);
 		surface_input->GetInputValue(&surface,gauss);
@@ -407,9 +408,9 @@
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	IssmDouble  rho_ice    = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  gravity    = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  n          = element->GetMaterialParameter(MaterialsRheologyNEnum);
-	IssmDouble B;
+	IssmDouble  rho_ice    = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  gravity    = element->FindParam(ConstantsGEnum);
+	IssmDouble B,n;
 	Input* B_input         = element->GetInput(MaterialsRheologyBEnum);   _assert_(B_input);
+	Input* n_input         = element->GetInput(MaterialsRheologyNEnum);   _assert_(n_input);
 	Input* surface_input   = element->GetInput(SurfaceEnum);              _assert_(surface_input);
 	Input* slopex_input    = element->GetInput(SurfaceSlopeXEnum);        _assert_(slopex_input);
@@ -442,4 +443,5 @@
 
 			B_input->GetInputValue(&B,gauss);
+			n_input->GetInputValue(&n,gauss);
 			slopex_input->GetInputValue(&slope[0],gauss);
 			slopey_input->GetInputValue(&slope[1],gauss);
@@ -598,6 +600,6 @@
 	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D, 
 	 *so the pressure is just the pressure at the bedrock: */
-	rho_ice  = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	g        = element->GetMaterialParameter(ConstantsGEnum);
+	rho_ice  = element->FindParam(MaterialsRhoIceEnum);
+	g        = element->FindParam(ConstantsGEnum);
 	element->FindParam(&domaintype,DomainTypeEnum);
 	switch(domaintype){
Index: /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 23644)
@@ -584,6 +584,6 @@
 	 *so the pressure is just the pressure at the z elevation: except it this is a HOFS element */
 	if(approximation!=HOFSApproximationEnum &&  approximation!=SSAFSApproximationEnum){
-		rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
-		g       = element->GetMaterialParameter(ConstantsGEnum);
+		rho_ice = element->FindParam(MaterialsRhoIceEnum);
+		g       = element->FindParam(ConstantsGEnum);
 		element->GetInputListOnNodes(&surface[0],SurfaceEnum,0.);
 		for(i=0;i<numnodes;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i*3+2]);
Index: /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 23644)
@@ -338,10 +338,10 @@
 	element->GetVerticesCoordinatesBase(&xyz_list_base);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  mixed_layer_capacity= element->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
-	IssmDouble  thermal_exchange_vel= element->GetMaterialParameter(MaterialsThermalExchangeVelocityEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  mixed_layer_capacity= element->FindParam(MaterialsMixedLayerCapacityEnum);
+	IssmDouble  thermal_exchange_vel= element->FindParam(MaterialsThermalExchangeVelocityEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -394,9 +394,9 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	element->FindParam(&stabilization,ThermalStabilizationEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  thermalconductivity = element->FindParam(MaterialsThermalconductivityEnum);
 	IssmDouble  kappa = thermalconductivity/(rho_ice*heatcapacity);
 	Input* vx_input  = element->GetInput(VxEnum);     _assert_(vx_input);
@@ -538,6 +538,6 @@
 	Input* vz_input             = element->GetInput(VzEnum);                          _assert_(vz_input);
 	Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
 
 	/*Build friction element, needed later: */
@@ -596,10 +596,10 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	Input*      pressure_input=element->GetInput(PressureEnum); _assert_(pressure_input);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  mixed_layer_capacity= element->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
-	IssmDouble  thermal_exchange_vel= element->GetMaterialParameter(MaterialsThermalExchangeVelocityEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  mixed_layer_capacity= element->FindParam(MaterialsMixedLayerCapacityEnum);
+	IssmDouble  thermal_exchange_vel= element->FindParam(MaterialsThermalExchangeVelocityEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -650,7 +650,7 @@
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  thermalconductivity = element->FindParam(MaterialsThermalconductivityEnum);
 	IssmDouble  kappa = thermalconductivity/(rho_ice*heatcapacity);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
@@ -807,5 +807,4 @@
 	int        *doflist   = NULL;
 	IssmDouble *xyz_list  = NULL;
-	IssmDouble  n=3.0;
 	bool        hack      = false;
 
@@ -842,13 +841,21 @@
 
 	/*Get all inputs and parameters*/
-	if(element->material->ObjectEnum()!=MatestarEnum) n=element->GetMaterialParameter(MaterialsRheologyNEnum);
 	element->GetInputValue(&converged,ConvergedEnum);
 	if(converged){
 		element->AddInput(TemperatureEnum,values,element->GetElementType());
 
+		IssmDouble* n = xNew<IssmDouble>(numnodes);
+		if(element->material->ObjectEnum()!=MatestarEnum){
+			for(i=0;i<numnodes;i++) n[i]=3.;
+		}
+		else{
+			element->GetInputListOnNodes(&n[0],MaterialsRheologyNEnum);
+		}
+
 		/*Update Rheology only if converged (we must make sure that the temperature is below melting point
 		 * otherwise the rheology could be negative*/
-		rheology_law=element->GetIntegerMaterialParameter(MaterialsRheologyLawEnum);
+		element->FindParam(&rheology_law,MaterialsRheologyLawEnum);
 		element->GetInputListOnNodes(&surface[0],SurfaceEnum);
+
 		switch(rheology_law){
 			case NoneEnum:
@@ -869,5 +876,5 @@
 			case ArrheniusEnum:{
 				element->GetVerticesCoordinates(&xyz_list);
-				for(i=0;i<numnodes;i++) B[i]=Arrhenius(values[i],surface[i]-xyz_list[i*3+2],n);
+				for(i=0;i<numnodes;i++) B[i]=Arrhenius(values[i],surface[i]-xyz_list[i*3+2],n[i]);
 				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
 				break;
@@ -876,4 +883,5 @@
 				_error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
 		}
+		xDelete<IssmDouble>(n);
 	}
 	else{
Index: /issm/trunk-jpl/src/c/classes/Elements/Element.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 23644)
@@ -32,5 +32,4 @@
 	this->vertices   = NULL;
 	this->material   = NULL;
-	this->matpar     = NULL;
 	this->parameters = NULL;
 	this->element_type_list=NULL;
@@ -403,7 +402,4 @@
 	else _printf_("material = NULL\n");
 
-	if (matpar) matpar->DeepEcho();
-	else _printf_("matpar = NULL\n");
-
 	_printf_("   parameters\n");
 	if (parameters) parameters->DeepEcho();
@@ -558,5 +554,5 @@
 
 	/*Get some pdd parameters*/
-	dpermil=this->matpar->GetMaterialParameter(SmbDpermilEnum);
+	dpermil=this->FindParam(SmbDpermilEnum);
 
 	this->parameters->FindParam(&isTemperatureScaled,SmbIstemperaturescaledEnum);
@@ -681,6 +677,6 @@
 
 	/*Get material parameters :*/
-	rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=this->FindParam(MaterialsRhoIceEnum);
 
 	/*Recover parameters*/
@@ -935,7 +931,4 @@
 	else _printf_("material = NULL\n");
 
-	if (matpar) matpar->Echo();
-	else _printf_("matpar = NULL\n");
-
 	_printf_("   parameters\n");
 	if (parameters) parameters->Echo();
@@ -947,13 +940,4 @@
 }
 /*}}}*/
-IssmDouble Element::EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
-	return matpar->GetEnthalpyDiffusionParameter(enthalpy,pressure);
-}/*}}}*/
-IssmDouble Element::EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){/*{{{*/
-	return matpar->GetEnthalpyDiffusionParameterVolume(numvertices,enthalpy,pressure);
-}/*}}}*/
-void       Element::EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
-	matpar->EnthalpyToThermal(ptemperature,pwaterfraction,enthalpy,pressure);
-}/*}}}*/
 void       Element::FindParam(bool* pvalue,int paramenum){/*{{{*/
 	this->parameters->FindParam(pvalue,paramenum);
@@ -964,4 +948,7 @@
 void       Element::FindParam(IssmDouble* pvalue,int paramenum){/*{{{*/
 	this->parameters->FindParam(pvalue,paramenum);
+}/*}}}*/
+IssmDouble Element::FindParam(int paramenum){/*{{{*/
+	return this->parameters->FindParam(paramenum);
 }/*}}}*/
 void       Element::FindParam(int** pvalues,int* psize,int paramenum){/*{{{*/
@@ -1326,18 +1313,4 @@
 	}
 
-}/*}}}*/
-IssmDouble Element::GetMaterialParameter(int enum_in){/*{{{*/
-
-	_assert_(this->matpar);
-	switch(enum_in){ // FIXME: change this to material
-		case MaterialsRheologyNEnum:
-			return this->material->GetN();
-		default:
-			return this->matpar->GetMaterialParameter(enum_in);
-	}
-}/*}}}*/
-int         Element::GetIntegerMaterialParameter(int enum_in){/*{{{*/
-
-	return this->matpar->GetIntegerMaterialParameter(enum_in);
 }/*}}}*/
 void       Element::GetNodesLidList(int* lidlist){/*{{{*/
@@ -1678,5 +1651,5 @@
 
 	/*recover ice density: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	return rho_ice*this->IceVolume(scaled);
@@ -2313,6 +2286,6 @@
 	GetInputListOnVertices(&sl[0],SealevelEnum);
 	GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum);
-	rho_water   = matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice     = matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water   = FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice     = FindParam(MaterialsRhoIceEnum);
 	density     = rho_ice/rho_water;
 
@@ -2546,11 +2519,11 @@
 
 	/*Get material parameters :*/
-	rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=this->FindParam(MaterialsRhoIceEnum);
 
 	/*Get some pdd parameters*/
-	desfac=this->matpar->GetMaterialParameter(SmbDesfacEnum);
-	rlaps=this->matpar->GetMaterialParameter(SmbRlapsEnum);
-	rlapslgm=this->matpar->GetMaterialParameter(SmbRlapslgmEnum);
+	desfac=this->FindParam(SmbDesfacEnum);
+	rlaps=this->FindParam(SmbRlapsEnum);
+	rlapslgm=this->FindParam(SmbRlapslgmEnum);
 
 	/*Recover monthly temperatures and precipitation and compute the yearly mean temperatures*/
@@ -2733,10 +2706,10 @@
 
 	/*Get material parameters :*/
-	rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=this->FindParam(MaterialsRhoIceEnum);
 
 	/*Get parameters for height corrections*/
-	desfac=this->matpar->GetMaterialParameter(SmbDesfacEnum);
-	rlaps=this->matpar->GetMaterialParameter(SmbRlapsEnum);
+	desfac=this->FindParam(SmbDesfacEnum);
+	rlaps=this->FindParam(SmbRlapsEnum);
 
 	/*Recover monthly temperatures and precipitation*/
@@ -2873,7 +2846,4 @@
 }
 /*}}}*/
-IssmDouble Element::PureIceEnthalpy(IssmDouble pressure){/*{{{*/
-	return this->matpar->PureIceEnthalpy(pressure);
-}/*}}}*/
 void       Element::ResultInterpolation(int* pinterpolation,int* pnodesperelement,int* parray_size, int output_enum){/*{{{*/
 
@@ -3123,9 +3093,9 @@
 
 	/*Get material parameters :*/
-	rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	desfac=this->matpar->GetMaterialParameter(SmbDesfacEnum);
-	rlaps=this->matpar->GetMaterialParameter(SmbRlapsEnum);
-	rdl=this->matpar->GetMaterialParameter(SmbRdlEnum);
+	rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=this->FindParam(MaterialsRhoIceEnum);
+	desfac=this->FindParam(SmbDesfacEnum);
+	rlaps=this->FindParam(SmbRlapsEnum);
+	rdl=this->FindParam(SmbRdlEnum);
 
 	/* Retrieve inputs: */
@@ -3319,6 +3289,6 @@
 
 	/*Retrieve material properties and parameters:{{{ */
-	rho_ice = matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water = matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+	rho_ice = FindParam(MaterialsRhoIceEnum);
+	rho_water = FindParam(MaterialsRhoFreshwaterEnum);
 	parameters->FindParam(&aSnow,SmbASnowEnum);
 	parameters->FindParam(&aIce,SmbAIceEnum);
@@ -3872,11 +3842,4 @@
 }
 /*}}}*/
-void       Element::ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){/*{{{*/
-	matpar->ThermalToEnthalpy(penthalpy,temperature,waterfraction,pressure);
-}/*}}}*/
-IssmDouble Element::TMeltingPoint(IssmDouble pressure){/*{{{*/
-	_assert_(matpar);
-	return this->matpar->TMeltingPoint(pressure);
-}/*}}}*/
 IssmDouble Element::TotalFloatingBmb(IssmDouble* mask, bool scaled){/*{{{*/
 
@@ -4177,2 +4140,134 @@
 }
 /*}}}*/
+
+/*Enthalpy*/
+void       Element::ThermalToEnthalpy(IssmDouble * penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){/*{{{*/
+
+	/*Ouput*/
+	IssmDouble enthalpy;
+
+	/*Get necessary parameters*/
+	IssmDouble latentheat,referencetemperature,heatcapacity;
+	parameters->FindParam(&latentheat,MaterialsLatentheatEnum);
+	parameters->FindParam(&referencetemperature,ConstantsReferencetemperatureEnum);
+	parameters->FindParam(&heatcapacity,MaterialsHeatcapacityEnum);
+
+	if(temperature<TMeltingPoint(pressure)){
+		enthalpy=heatcapacity*(temperature-referencetemperature);
+	}
+	else{
+		enthalpy=PureIceEnthalpy(pressure)+latentheat*waterfraction;
+	}
+
+	/*Assign output pointers:*/
+	*penthalpy=enthalpy;
+}
+/*}}}*/
+IssmDouble Element::TMeltingPoint(IssmDouble pressure){/*{{{*/
+
+	/*Get necessary parameters*/
+	IssmDouble beta,meltingpoint;
+	parameters->FindParam(&beta,MaterialsBetaEnum);
+	parameters->FindParam(&meltingpoint,MaterialsMeltingpointEnum);
+
+	return meltingpoint-beta*pressure;
+}
+/*}}}*/
+void       Element::EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
+
+	/*Ouput*/
+	IssmDouble temperature,waterfraction;
+
+	/*Get necessary parameters*/
+	IssmDouble latentheat,referencetemperature,heatcapacity;
+	parameters->FindParam(&latentheat,MaterialsLatentheatEnum);
+	parameters->FindParam(&referencetemperature,ConstantsReferencetemperatureEnum);
+	parameters->FindParam(&heatcapacity,MaterialsHeatcapacityEnum);
+
+	if(enthalpy<PureIceEnthalpy(pressure)){
+		temperature=referencetemperature+enthalpy/heatcapacity;
+		waterfraction=0.;
+	}
+	else{
+		temperature=TMeltingPoint(pressure);
+		waterfraction=(enthalpy-PureIceEnthalpy(pressure))/latentheat;
+	}
+
+	/*Assign output pointers:*/
+	*pwaterfraction=waterfraction;
+	*ptemperature=temperature;
+}
+/*}}}*/
+IssmDouble Element::EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
+
+	/*Get necessary parameters*/
+	IssmDouble heatcapacity,thermalconductivity,temperateiceconductivity;
+	parameters->FindParam(&heatcapacity,MaterialsHeatcapacityEnum);
+	parameters->FindParam(&thermalconductivity,MaterialsThermalconductivityEnum);
+	parameters->FindParam(&temperateiceconductivity,MaterialsTemperateiceconductivityEnum);
+
+	if(enthalpy<PureIceEnthalpy(pressure)){
+		return thermalconductivity/heatcapacity;
+	}
+	else{
+		return temperateiceconductivity/heatcapacity;
+	}
+}
+/*}}}*/
+IssmDouble Element::EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){/*{{{*/
+
+	IssmDouble  lambda;                 // fraction of cold ice
+	IssmDouble  kappa,kappa_c,kappa_t;  //enthalpy conductivities
+	IssmDouble  Hc,Ht;
+	IssmDouble* PIE   = xNew<IssmDouble>(numvertices);
+	IssmDouble* dHpmp = xNew<IssmDouble>(numvertices);
+
+	for(int iv=0; iv<numvertices; iv++){
+		PIE[iv]=PureIceEnthalpy(pressure[iv]);
+		dHpmp[iv]=enthalpy[iv]-PIE[iv];
+	}
+
+	bool allequalsign=true;
+	if(dHpmp[0]<0){
+		for(int iv=1; iv<numvertices;iv++) allequalsign=(allequalsign && (dHpmp[iv]<0));
+	}
+	else{
+		for(int iv=1; iv<numvertices;iv++) allequalsign=(allequalsign && (dHpmp[iv]>=0));
+	}
+
+	if(allequalsign){
+		kappa=EnthalpyDiffusionParameter(enthalpy[0], pressure[0]);
+	}
+	else {
+		/* return harmonic mean of thermal conductivities, weighted by fraction of cold/temperate ice,
+			cf Patankar 1980, pp44 */
+		kappa_c=EnthalpyDiffusionParameter(PureIceEnthalpy(0.)-1.,0.);
+		kappa_t=EnthalpyDiffusionParameter(PureIceEnthalpy(0.)+1.,0.);
+		Hc=0.; Ht=0.;
+		for(int iv=0; iv<numvertices;iv++){
+			if(enthalpy[iv]<PIE[iv])
+			 Hc+=(PIE[iv]-enthalpy[iv]);
+			else
+			 Ht+=(enthalpy[iv]-PIE[iv]);
+		}
+		_assert_((Hc+Ht)>0.);
+		lambda = Hc/(Hc+Ht);
+		kappa  = 1./(lambda/kappa_c + (1.-lambda)/kappa_t);
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(PIE);
+	xDelete<IssmDouble>(dHpmp);
+	return kappa;
+}
+/*}}}*/
+IssmDouble Element::PureIceEnthalpy(IssmDouble pressure){/*{{{*/
+
+	/*Get necessary parameters*/
+	IssmDouble referencetemperature,heatcapacity;
+	parameters->FindParam(&referencetemperature,ConstantsReferencetemperatureEnum);
+	parameters->FindParam(&heatcapacity,MaterialsHeatcapacityEnum);
+
+	return heatcapacity*(TMeltingPoint(pressure)-referencetemperature);
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Element.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Element.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/Element.h	(revision 23644)
@@ -23,5 +23,4 @@
 class Materials;
 class Material;
-class Matpar;
 class Inputs;
 class Input;
@@ -44,5 +43,4 @@
 		Vertex     **vertices;
 		Material    *material;
-		Matpar      *matpar;
 		Parameters  *parameters;
 
@@ -75,10 +73,8 @@
 		void               dViscositydDSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
 		void               Echo();
-		IssmDouble         EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure);
-		IssmDouble         EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure);
-		void               EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
 		void               FindParam(bool* pvalue,int paramenum);
 		void               FindParam(int* pvalue,int paramenum);
 		void               FindParam(IssmDouble* pvalue,int paramenum);
+		IssmDouble         FindParam(int paramenum);
 		void               FindParam(int** pvalues,int* psize,int paramenum);
 		IssmDouble         FloatingArea(IssmDouble* mask, bool scaled);
@@ -102,6 +98,4 @@
 		void               GetInputValue(IssmDouble* pvalue,Gauss* gauss,int enum_type);
 		void               GetInputsInterpolations(Vector<IssmDouble>* interps);
-		IssmDouble         GetMaterialParameter(int enum_in);
-		int                GetIntegerMaterialParameter(int enum_in);
 		void               GetNodesLidList(int* lidlist);
 		void               GetNodesSidList(int* sidlist);
@@ -151,5 +145,4 @@
 		void               PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm,bool issetpddfac);
 		void               PositiveDegreeDaySicopolis(bool isfirnwarming);
-		IssmDouble         PureIceEnthalpy(IssmDouble pressure);
 		void               ResultInterpolation(int* pinterpolation,int*nodesperelement,int* parray_size, int output_enum);
 		void               ResultToPatch(IssmDouble* values,int nodesperelement,int output_enum);
@@ -167,6 +160,4 @@
 		void               StrainRateSSA1d(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input);
 		void               StressMaxPrincipalCreateInput(void);
-		void               ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
-		IssmDouble         TMeltingPoint(IssmDouble pressure);
 		IssmDouble         TotalFloatingBmb(IssmDouble* mask, bool scaled);
 		IssmDouble         TotalGroundedBmb(IssmDouble* mask, bool scaled);
@@ -193,4 +184,10 @@
 		void               TransformStiffnessMatrixCoord(ElementMatrix* Ke,int numnodes,int* transformenum_list){_error_("not implemented yet");};/*Tiling only*/
 		void               ViscousHeatingCreateInput(void);
+		void               ThermalToEnthalpy(IssmDouble * penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
+		IssmDouble         TMeltingPoint(IssmDouble pressure);
+		void               EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
+		IssmDouble         EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure);
+		IssmDouble         EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure);
+		IssmDouble         PureIceEnthalpy(IssmDouble pressure);
 
 
Index: /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp	(revision 23644)
@@ -21,5 +21,4 @@
 	this->hvertices  = NULL;
 	this->hmaterial  = NULL;
-	this->hmatpar    = NULL;
 	this->hneighbors = NULL;
 }
@@ -35,5 +34,4 @@
 	delete hvertices;
 	delete hmaterial;
-	delete hmatpar;
 	delete hneighbors;
 }
@@ -41,12 +39,6 @@
 ElementHook::ElementHook(int in_numanalyses,int element_id,int numvertices,IoModel* iomodel){/*{{{*/
 
-	/*intermediary: */
-	int matpar_id;
+	/*retrieve material_id*/
 	int material_id;
-
-	/*retrieve material_id: */
-	matpar_id = iomodel->numberofelements+1;
-
-	/*retrieve material_id*/
 	material_id = element_id;
 
@@ -61,5 +53,4 @@
 	this->hvertices   = new Hook(&vertex_ids[0],numvertices);
 	this->hmaterial   = new Hook(&material_id,1);
-	this->hmatpar     = new Hook(&matpar_id,1);
 	this->hneighbors  = NULL;
 
@@ -109,5 +100,4 @@
 		this->hvertices   = new Hook();
 		this->hmaterial   = new Hook();
-		this->hmatpar     = new Hook();
 		if(!hneighbors_null)this->hneighbors  = new Hook();
 		else this->hneighbors=NULL;
@@ -127,5 +117,4 @@
 	this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->hmaterial->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	if(this->hneighbors)this->hneighbors->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 
@@ -158,8 +147,4 @@
    else _printf_("  hmaterial = NULL\n");
 
-	_printf_("  hmatpar:\n");
-	if(hmatpar) hmatpar->DeepEcho();
-   else _printf_("  hmatpar = NULL\n");
-
 	_printf_("  hneighbors:\n");
 	if(hneighbors) hneighbors->DeepEcho();
@@ -189,8 +174,4 @@
 	if(hmaterial) hmaterial->Echo();
    else _printf_("  hmaterial = NULL\n");
-
-	_printf_("  hmatpar:\n");
-	if(hmatpar) hmatpar->Echo();
-   else _printf_("  hmatpar = NULL\n");
 
 	_printf_("  hneighbors:\n");
@@ -232,5 +213,4 @@
 	triahook->hmaterial=NULL;
 	triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,2);
-	triahook->hmatpar=(Hook*)this->hmatpar->copy();
 }
 /*}}}*/
@@ -260,5 +240,4 @@
 	triahook->hmaterial=NULL;
 	triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,3);
-	triahook->hmatpar=(Hook*)this->hmatpar->copy();
-}
-/*}}}*/
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Elements/ElementHook.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/ElementHook.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/ElementHook.h	(revision 23644)
@@ -16,5 +16,4 @@
 		Hook  *hvertices;     // vertices
 		Hook  *hmaterial;     // 1 ice material
-		Hook  *hmatpar;       // 1 material parameter
 		Hook  *hneighbors;    // 2 elements, first down, second up in 3d only
 
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 23644)
@@ -54,5 +54,4 @@
 	this->vertices          = NULL;
 	this->material          = NULL;
-	this->matpar            = NULL;
 	this->verticalneighbors = NULL;
 
@@ -93,5 +92,4 @@
 	penta->hvertices = (Hook*)this->hvertices->copy();
 	penta->hmaterial = (Hook*)this->hmaterial->copy();
-	penta->hmatpar   = (Hook*)this->hmatpar->copy();
 	if (this->hneighbors) penta->hneighbors = (Hook*)(this->hneighbors->copy());
 	else penta->hneighbors = NULL;
@@ -116,5 +114,4 @@
 	penta->vertices = (Vertex**)this->hvertices->deliverp();
 	penta->material = (Material*)this->hmaterial->delivers();
-	penta->matpar   = (Matpar*)this->hmatpar->delivers();
 	penta->verticalneighbors = (Penta**)this->hneighbors->deliverp();
 
@@ -134,5 +131,4 @@
 	vertices = (Vertex**)this->hvertices->deliverp();
 	material = (Material*)this->hmaterial->delivers();
-	matpar   = (Matpar*)this->hmatpar->delivers();
 	verticalneighbors = (Penta**)this->hneighbors->deliverp();
 
@@ -192,5 +188,5 @@
 	IssmDouble  calvingrate[NUMVERTICES];
 	IssmDouble  lambda1,lambda2,ex,ey,vx,vy,vel;
-	IssmDouble  B,sigma_vm,sigma_max,sigma_max_floating,sigma_max_grounded;
+	IssmDouble  B,sigma_vm,sigma_max,sigma_max_floating,sigma_max_grounded,n;
 	IssmDouble  epse_2,groundedice,bed;
 
@@ -209,7 +205,7 @@
 	Input* bs_input = inputs->GetInput(BaseEnum);                    _assert_(bs_input);
 	Input* B_input  = inputs->GetInput(MaterialsRheologyBbarEnum);   _assert_(B_input);
+	Input* n_input  = inputs->GetInput(MaterialsRheologyNEnum);   _assert_(n_input);
 	Input* smax_fl_input = inputs->GetInput(CalvingStressThresholdFloatingiceEnum); _assert_(smax_fl_input);
 	Input* smax_gr_input = inputs->GetInput(CalvingStressThresholdGroundediceEnum); _assert_(smax_gr_input);
-	IssmDouble  n   = this->GetMaterialParameter(MaterialsRheologyNEnum);
 
 	/* Start looping on the number of vertices: */
@@ -220,4 +216,5 @@
 		/*Get velocity components and thickness*/
 		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
 		vx_input->GetInputValue(&vx,gauss);
 		vy_input->GetInputValue(&vy,gauss);
@@ -366,6 +363,6 @@
 
 	/*recovre material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	gravity=matpar->GetMaterialParameter(ConstantsGEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	gravity=FindParam(ConstantsGEnum);
 
 	/* Get node coordinates and dof list: */
@@ -542,5 +539,4 @@
 	this->hvertices->configure(verticesin);
 	this->hmaterial->configure(materialsin);
-	this->hmatpar->configure(materialsin);
 	this->hneighbors->configure(elementsin);
 
@@ -550,5 +546,4 @@
 	this->vertices          = (Vertex**)this->hvertices->deliverp();
 	this->material          = (Material*)this->hmaterial->delivers();
-	this->matpar            = (Matpar*)this->hmatpar->delivers();
 	this->verticalneighbors = (Penta**)this->hneighbors->deliverp();
 
@@ -762,7 +757,7 @@
 	GetInputListOnVertices(&pressure[0],PressureEnum);
 	GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum);
-	IssmDouble rho_ice   = matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble rho_water = matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble gravity   = matpar->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_ice   = FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble gravity   = FindParam(ConstantsGEnum);
 
 	/* Get node coordinates and dof list: */
@@ -1331,6 +1326,6 @@
 	if(!IsIceInElement() || IsFloating() || !IsOnBase())return 0;
 
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoSeawaterEnum);
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
 
@@ -2129,6 +2124,6 @@
 
 	/*material parameters: */
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 	density=rho_ice/rho_water;
 	GetInputListOnVertices(&h[0],ThicknessEnum);
@@ -2277,5 +2272,4 @@
 	this->vertices=NULL;
 	this->material=NULL;
-	this->matpar=NULL;
 	this->verticalneighbors=NULL;
 	this->parameters=NULL;
@@ -2285,5 +2279,4 @@
 	this->hvertices->reset();
 	this->hmaterial->reset();
-	this->hmatpar->reset();
 	if(this->hneighbors) this->hneighbors->reset();
 
@@ -2461,8 +2454,7 @@
 	tria->material=(Material*)this->material->copy2(tria);
 
-	/*recover nodes, material and matpar: */
+	/*recover nodes, material*/
 	tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp();
 	tria->vertices=(Vertex**)tria->hvertices->deliverp();
-	tria->matpar=(Matpar*)tria->hmatpar->delivers();
 
 	/*Return new Tria*/
@@ -2751,5 +2743,5 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 	Input* floatingmelt_input = this->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(floatingmelt_input); 
 	Input* gllevelset_input = this->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input);
@@ -2796,5 +2788,5 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 	Input* groundedmelt_input = this->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedmelt_input); 
 	Input* gllevelset_input = this->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input);
@@ -2835,5 +2827,5 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	if(!IsIceInElement() || !IsOnSurface()) return 0.;
@@ -3492,6 +3484,6 @@
 						/*hydrostatic equilibrium: */
 						IssmDouble rho_ice,rho_water,di;
-						rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-						rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+						rho_ice=this->FindParam(MaterialsRhoIceEnum);
+						rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
 
 						di=rho_ice/rho_water;
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 23644)
@@ -19,5 +19,4 @@
 class Node;
 class Material;
-class Matpar;
 class Tria;
 class ElementMatrix;
Index: /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 23644)
@@ -36,5 +36,4 @@
 			this->vertices = NULL;
 			this->material = NULL;
-			this->matpar   = NULL;
 
 			/*Only allocate pointer*/
@@ -78,5 +77,4 @@
 	seg->hvertices = (Hook*)this->hvertices->copy();
 	seg->hmaterial = (Hook*)this->hmaterial->copy();
-	seg->hmatpar   = (Hook*)this->hmatpar->copy();
 	seg->hneighbors = NULL;
 
@@ -100,5 +98,4 @@
 	seg->vertices = (Vertex**)this->hvertices->deliverp();
 	seg->material = (Material*)this->hmaterial->delivers();
-	seg->matpar   = (Matpar*)this->hmatpar->delivers();
 
 	return seg;
@@ -117,5 +114,4 @@
 	vertices = (Vertex**)this->hvertices->deliverp();
 	material = (Material*)this->hmaterial->delivers();
-	matpar   = (Matpar*)this->hmatpar->delivers();
 
 }
Index: /issm/trunk-jpl/src/c/classes/Elements/Seg.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 23644)
@@ -17,5 +17,4 @@
 class Node;
 class Material;
-class Matpar;
 class ElementMatrix;
 class ElementVector;
Index: /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 23644)
@@ -37,5 +37,4 @@
 			this->vertices = NULL;
 			this->material = NULL;
-			this->matpar   = NULL;
 
 			/*Only allocate pointer*/
@@ -79,5 +78,4 @@
 	tetra->hvertices = (Hook*)this->hvertices->copy();
 	tetra->hmaterial = (Hook*)this->hmaterial->copy();
-	tetra->hmatpar   = (Hook*)this->hmatpar->copy();
 	tetra->hneighbors = NULL;
 
@@ -98,5 +96,4 @@
 	tetra->vertices = (Vertex**)this->hvertices->deliverp();
 	tetra->material = (Material*)this->hmaterial->delivers();
-	tetra->matpar   = (Matpar*)this->hmatpar->delivers();
 
 	return tetra;
@@ -114,5 +111,4 @@
 	vertices = (Vertex**)this->hvertices->deliverp();
 	material = (Material*)this->hmaterial->delivers();
-	matpar   = (Matpar*)this->hmatpar->delivers();
 
 }
@@ -141,5 +137,4 @@
 	this->hvertices->configure(verticesin);
 	this->hmaterial->configure(materialsin);
-	this->hmatpar->configure(materialsin);
 
 	/*Now, go pick up the objects inside the hooks: */
@@ -148,5 +143,4 @@
 	this->vertices          = (Vertex**)this->hvertices->deliverp();
 	this->material          = (Material*)this->hmaterial->delivers();
-	this->matpar            = (Matpar*)this->hmatpar->delivers();
 
 	/*point parameters to real dataset: */
@@ -812,5 +806,4 @@
 	this->vertices=NULL;
 	this->material=NULL;
-	this->matpar=NULL;
 	this->parameters=NULL;
 
@@ -819,5 +812,4 @@
 	this->hvertices->reset();
 	this->hmaterial->reset();
-	this->hmatpar->reset();
 	if(this->hneighbors) this->hneighbors->reset();
 }
@@ -872,8 +864,7 @@
 	tria->material=(Material*)this->material->copy2(tria);
 
-	/*recover nodes, material and matpar: */
+	/*recover nodes, material*/
 	tria->nodes    = (Node**)tria->hnodes[analysis_counter]->deliverp();
 	tria->vertices = (Vertex**)tria->hvertices->deliverp();
-	tria->matpar   = (Matpar*)tria->hmatpar->delivers();
 
 	/*Return new Tria*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Tetra.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 23644)
@@ -17,5 +17,4 @@
 class Node;
 class Material;
-class Matpar;
 class ElementMatrix;
 class ElementVector;
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 23644)
@@ -42,5 +42,4 @@
 		this->vertices = NULL;
 		this->material = NULL;
-		this->matpar   = NULL;
 		if(nummodels>0){
 			this->element_type_list=xNew<int>(nummodels);
@@ -87,5 +86,4 @@
 	tria->hvertices = (Hook*)this->hvertices->copy();
 	tria->hmaterial = (Hook*)this->hmaterial->copy();
-	tria->hmatpar   = (Hook*)this->hmatpar->copy();
 	tria->hneighbors = NULL;
 
@@ -109,5 +107,4 @@
 	tria->vertices = (Vertex**)this->hvertices->deliverp();
 	tria->material = (Material*)this->hmaterial->delivers();
-	tria->matpar   = (Matpar*)this->hmatpar->delivers();
 
 	return tria;
@@ -125,5 +122,4 @@
 	vertices = (Vertex**)this->hvertices->deliverp();
 	material = (Material*)this->hmaterial->delivers();
-	matpar   = (Matpar*)this->hmatpar->delivers();
 
 }
@@ -247,5 +243,5 @@
 	IssmDouble  lambda1,lambda2,ex,ey,vx,vy,vel;
 	IssmDouble  sigma_vm[NUMVERTICES];
-	IssmDouble  B,sigma_max,sigma_max_floating,sigma_max_grounded;
+	IssmDouble  B,sigma_max,sigma_max_floating,sigma_max_grounded,n;
 	IssmDouble  epse_2,groundedice,bed;
 
@@ -261,5 +257,5 @@
 	Input* smax_fl_input = inputs->GetInput(CalvingStressThresholdFloatingiceEnum); _assert_(smax_fl_input);
 	Input* smax_gr_input = inputs->GetInput(CalvingStressThresholdGroundediceEnum); _assert_(smax_gr_input);
-	IssmDouble  n   = this->GetMaterialParameter(MaterialsRheologyNEnum);
+	Input* n_input  = inputs->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
 
 	/* Start looping on the number of vertices: */
@@ -270,4 +266,5 @@
 		/*Get velocity components and thickness*/
 		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
 		vx_input->GetInputValue(&vx,gauss);
 		vy_input->GetInputValue(&vy,gauss);
@@ -334,5 +331,5 @@
 	IssmDouble  water_height, bed,Ho,thickness,surface;
 	IssmDouble  surface_crevasse[NUMVERTICES], basal_crevasse[NUMVERTICES], crevasse_depth[NUMVERTICES], H_surf, H_surfbasal;
-	IssmDouble  B, strainparallel, straineffective;
+	IssmDouble  B, strainparallel, straineffective,n;
 	IssmDouble  s_xx,s_xy,s_yy,s1,s2,stmp;
 	int crevasse_opening_stress;
@@ -344,9 +341,8 @@
 	this->parameters->FindParam(&crevasse_opening_stress,CalvingCrevasseDepthEnum);
 
-	IssmDouble rho_ice        = this->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble rho_seawater   = this->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_freshwater = this->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	IssmDouble constant_g     = this->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble rheology_n     = this->GetMaterialParameter(MaterialsRheologyNEnum);
+	IssmDouble rho_ice        = this->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_seawater   = this->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_freshwater = this->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble constant_g     = this->FindParam(ConstantsGEnum);
 
 	Input*   H_input                 = inputs->GetInput(ThicknessEnum); _assert_(H_input);
@@ -362,4 +358,5 @@
 	Input*   s_yy_input              = inputs->GetInput(DeviatoricStressyyEnum);     _assert_(s_yy_input);
 	Input*	B_input  = inputs->GetInput(MaterialsRheologyBbarEnum);   _assert_(B_input);
+	Input*	n_input  = inputs->GetInput(MaterialsRheologyNEnum);   _assert_(n_input);
 
 	/*Loop over all elements of this partition*/
@@ -380,4 +377,5 @@
 		s_yy_input->GetInputValue(&s_yy,gauss);
 		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
 
 		vel=sqrt(vx*vx+vy*vy)+1.e-14;
@@ -391,6 +389,6 @@
 
 		if(crevasse_opening_stress==0){		/*Otero2010: balance between the tensile deviatoric stress and ice overburden pressure*/
-			surface_crevasse[iv] = B * strainparallel * pow(straineffective, ((1 / rheology_n)-1)) / (rho_ice * constant_g);
-			basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (B * strainparallel * pow(straineffective,((1/rheology_n)-1)) / (rho_ice*constant_g) - Ho);
+			surface_crevasse[iv] = B * strainparallel * pow(straineffective, ((1 / n)-1)) / (rho_ice * constant_g);
+			basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (B * strainparallel * pow(straineffective,((1/n)-1)) / (rho_ice*constant_g) - Ho);
 		}
 		else if(crevasse_opening_stress==1){	 /*Benn2017,Todd2018: maximum principal stress */	
@@ -730,5 +728,4 @@
 	this->hvertices->configure(verticesin);
 	this->hmaterial->configure(materialsin);
-	this->hmatpar->configure(materialsin);
 
 	/*Now, go pick up the objects inside the hooks: */
@@ -737,5 +734,4 @@
 	this->vertices = (Vertex**)this->hvertices->deliverp();
 	this->material = (Material*)this->hmaterial->delivers();
-	this->matpar   = (Matpar*)this->hmatpar->delivers();
 
 	/*point parameters to real dataset: */
@@ -1029,7 +1025,7 @@
 	GetInputListOnVertices(&pressure[0],PressureEnum);
 	GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum);
-	IssmDouble rho_ice   = matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble rho_water = matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble gravity   = matpar->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_ice   = FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble gravity   = FindParam(ConstantsGEnum);
 
 	/* Get node coordinates and dof list: */
@@ -1965,6 +1961,6 @@
 	if(!IsIceInElement() || IsFloating())return 0;
 
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoSeawaterEnum);
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
 
@@ -2419,5 +2415,5 @@
 
 	/*Retrieve material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	/*Retrieve values of the levelset defining the masscon: */
@@ -2462,5 +2458,5 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	/*First off, check that this segment belongs to this element: */
@@ -2525,5 +2521,5 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	/*First off, check that this segment belongs to this element: */
@@ -2914,14 +2910,14 @@
 
 	/*Get variables*/
-	IssmDouble rhoi       = this->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble rhow       = this->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble earth_grav = this->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rhoi       = this->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rhow       = this->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble earth_grav = this->FindParam(ConstantsGEnum);
 	IssmDouble rho_star   = 1033.;             // kg/m^3
 	IssmDouble nu         = rhoi/rhow;
-	IssmDouble latentheat = this->GetMaterialParameter(MaterialsLatentheatEnum);
-	IssmDouble c_p_ocean  = this->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
+	IssmDouble latentheat = this->FindParam(MaterialsLatentheatEnum);
+	IssmDouble c_p_ocean  = this->FindParam(MaterialsMixedLayerCapacityEnum);
 	IssmDouble lambda     = latentheat/c_p_ocean;
 	IssmDouble a          = -0.0572;          // K/psu
-	IssmDouble b          = 0.0788 + this->GetMaterialParameter(MaterialsMeltingpointEnum);  //K
+	IssmDouble b          = 0.0788 + this->FindParam(MaterialsMeltingpointEnum);  //K
 	IssmDouble c          = 7.77e-4;
 	IssmDouble alpha      = 7.5e-5;           // 1/K
@@ -3139,6 +3135,6 @@
 
 	/*material parameters: */
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 	density=rho_ice/rho_water;
 	GetInputListOnVertices(&h[0],ThicknessEnum);
@@ -3256,5 +3252,4 @@
 	this->vertices=NULL;
 	this->material=NULL;
-	this->matpar=NULL;
 	this->parameters=NULL;
 
@@ -3263,5 +3258,4 @@
 	this->hvertices->reset();
 	this->hmaterial->reset();
-	this->hmatpar->reset();
 	if(this->hneighbors) this->hneighbors->reset();
 
@@ -3413,8 +3407,7 @@
 	seg->material=(Material*)this->material->copy2(seg);
 
-	/*recover nodes, material and matpar: */
+	/*recover nodes, material*/
 	seg->nodes    = (Node**)seg->hnodes[analysis_counter]->deliverp();
 	seg->vertices = (Vertex**)seg->hvertices->deliverp();
-	seg->matpar   = (Matpar*)seg->hmatpar->delivers();
 
 	/*Return new Seg*/
@@ -3618,5 +3611,5 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 	Input* floatingmelt_input = this->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(floatingmelt_input); 
 	Input* gllevelset_input = this->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input);
@@ -3663,5 +3656,5 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 	Input* groundedmelt_input = this->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedmelt_input); 
 	Input* gllevelset_input = this->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input);
@@ -3702,5 +3695,5 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
    if(!IsIceInElement())return 0;
@@ -4076,9 +4069,9 @@
 
 	/*recover material parameters: */
-	lithosphere_shear_modulus=matpar->GetMaterialParameter(MaterialsLithosphereShearModulusEnum);
-	lithosphere_density=matpar->GetMaterialParameter(MaterialsLithosphereDensityEnum);
-	mantle_shear_modulus=matpar->GetMaterialParameter(MaterialsMantleShearModulusEnum);
-	mantle_density=matpar->GetMaterialParameter(MaterialsMantleDensityEnum);
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	lithosphere_shear_modulus=FindParam(MaterialsLithosphereShearModulusEnum);
+	lithosphere_density=FindParam(MaterialsLithosphereDensityEnum);
+	mantle_shear_modulus=FindParam(MaterialsMantleShearModulusEnum);
+	mantle_density=FindParam(MaterialsMantleDensityEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	/*pull thickness averages: */
@@ -4185,6 +4178,6 @@
 
 	/*recover material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_earth=matpar->GetMaterialParameter(MaterialsEarthDensityEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
 
 	/*how many dofs are we working with here? */
@@ -4323,6 +4316,6 @@
 
 	/*recover material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_earth=matpar->GetMaterialParameter(MaterialsEarthDensityEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
 
 	/*how many dofs are we working with here? */
@@ -4528,5 +4521,5 @@
 
 		/*recover material parameters: */
-		rho_water=matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+		rho_water=FindParam(MaterialsRhoFreshwaterEnum);
 
 		/*From Sg_old, recover water sea level rise:*/
@@ -4546,5 +4539,5 @@
 
 		/*recover material parameters: */
-		rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+		rho_ice=FindParam(MaterialsRhoIceEnum);
 
 		/*Compute ice thickness change: */
@@ -4614,7 +4607,7 @@
 
 	/*recover material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	rho_earth=matpar->GetMaterialParameter(MaterialsEarthDensityEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoFreshwaterEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
 
 	/*recover love numbers and computational flags: */
@@ -4808,6 +4801,6 @@
 
 	/*recover material parameters: */
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	rho_earth=matpar->GetMaterialParameter(MaterialsEarthDensityEnum);
+	rho_water=FindParam(MaterialsRhoFreshwaterEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
 
 	/*how many dofs are we working with here? */
@@ -4960,7 +4953,7 @@
 
 	/*recover material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	rho_earth=matpar->GetMaterialParameter(MaterialsEarthDensityEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoFreshwaterEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
 
 	/*how many dofs are we working with here? */
@@ -5193,6 +5186,6 @@
 						/*hydrostatic equilibrium: */
 						IssmDouble rho_ice,rho_water,di;
-						rho_ice   = this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-						rho_water = this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+						rho_ice   = this->FindParam(MaterialsRhoIceEnum);
+						rho_water = this->FindParam(MaterialsRhoSeawaterEnum);
 						di        = rho_ice/rho_water;
 
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 23644)
@@ -17,5 +17,4 @@
 class Node;
 class Material;
-class Matpar;
 class Seg;
 class ElementMatrix;
Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 23644)
@@ -2993,6 +2993,6 @@
 		element->GetInputListOnVertices(&r[0],BedEnum);
 		element->GetInputListOnVertices(&sl[0],SealevelEnum);
-		rho_water   = element->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-		rho_ice     = element->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+		rho_water   = element->FindParam(MaterialsRhoSeawaterEnum);
+		rho_ice     = element->FindParam(MaterialsRhoIceEnum);
 		density     = rho_ice/rho_water;
 
@@ -3370,5 +3370,4 @@
 			newtria->vertices=NULL;
 			newtria->material=NULL;
-			newtria->matpar=NULL;
 			if(this->nummodels>0){
 				newtria->element_type_list=xNew<int>(this->nummodels);
@@ -3378,5 +3377,4 @@
 
 			/*Element hook*/
-			int matpar_id=newnumberofelements+1; //retrieve material parameter id (last pointer in femodel->materials)
 			int material_id=i+1; // retrieve material_id = i+1;
 			/*retrieve vertices ids*/
@@ -3388,5 +3386,4 @@
 			newtria->hvertices   =new Hook(&vertex_ids[0],elementswidth);
 			newtria->hmaterial   =new Hook(&material_id,1);
-			newtria->hmatpar     =new Hook(&matpar_id,1);
 			newtria->hneighbors  =NULL;
 			/*Initialize hnodes as NULL*/
@@ -3408,9 +3405,4 @@
 		}
 	}
-
-	/*Add new constant material property to materials, at the end: */
-	Matpar *newmatpar=static_cast<Matpar*>(this->materials->GetObjectByOffset(this->materials->Size()-1)->copy());
-	newmatpar->SetMid(newnumberofelements+1);
-	materials->AddObject(newmatpar);//put it at the end of the materials
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 23644)
@@ -263,7 +263,7 @@
 	element->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
 	element->GetInputValue(&drag_coefficient_coulomb, gauss,FrictionCoefficientcoulombEnum);
-	IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 
 	//compute r and q coefficients: */
@@ -398,7 +398,7 @@
 	element->GetInputValue(&sealevel, gauss,SealevelEnum);
 	element->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
-	IssmDouble rho_water   = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	IssmDouble rho_ice     = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity     = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water   = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble rho_ice     = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity     = element->FindParam(ConstantsGEnum);
 
 	//From base and thickness, compute effective pressure when drag is viscous:
@@ -564,7 +564,7 @@
 	element->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
 	element->GetInputValue(&water_layer, gauss,FrictionWaterLayerEnum);
-	IssmDouble rho_water   = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_ice     = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity     = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water   = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice     = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity     = element->FindParam(ConstantsGEnum);
 
 	//compute r and q coefficients: */
@@ -700,6 +700,6 @@
 	element->GetInputValue(&base, gauss,BaseEnum);
 	//element->GetInputValue(&sealevel, gauss,SealevelEnum);
-	IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 	P0 = gravity*rho_ice*thickness;
 
@@ -764,7 +764,7 @@
 					 element->GetInputValue(&base, gauss,BaseEnum);
 					 element->GetInputValue(&sealevel, gauss,SealevelEnum);
-					 IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-					 IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-					 IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+					 IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+					 IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+					 IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 					 p_ice   = gravity*rho_ice*thickness;
 					 p_water = rho_water*gravity*(sealevel-base);
@@ -774,6 +774,6 @@
 		case 1:{
 					 element->GetInputValue(&thickness, gauss,ThicknessEnum);
-					 IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-					 IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+					 IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+					 IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 					 p_ice   = gravity*rho_ice*thickness;
 					 p_water = 0.;
@@ -785,7 +785,7 @@
 					 element->GetInputValue(&base, gauss,BaseEnum);
 					 element->GetInputValue(&sealevel, gauss,SealevelEnum);
-					 IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-					 IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-					 IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+					 IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+					 IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+					 IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 					 p_ice   = gravity*rho_ice*thickness;
 					 p_water = max(0.,rho_water*gravity*(sealevel-base));
Index: /issm/trunk-jpl/src/c/classes/Loads/Friction.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Friction.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Loads/Friction.h	(revision 23644)
@@ -7,10 +7,7 @@
 
 /*Headers:*/
-/*{{{*/
 class Inputs;
-class Matpar;
 class GaussPenta;
 class GaussTria;
-/*}}}*/
 
 class Friction{
Index: /issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp	(revision 23644)
@@ -26,6 +26,4 @@
 	this->helement=NULL;
 	this->element=NULL;
-	this->hmatpar=NULL;
-	this->matpar=NULL;
 }
 /*}}}*/
@@ -33,5 +31,4 @@
 
 	int pengrid_node_id;
-	int pengrid_matpar_id;
 	int pengrid_element_id;
 
@@ -49,9 +46,7 @@
 	pengrid_element_id=iomodel->singlenodetoelementconnectivity[index];
 	_assert_(pengrid_element_id);
-	pengrid_matpar_id=iomodel->numberofelements+1; //refers to the constant material parameters object
 
 	this->hnode=new Hook(&pengrid_node_id,1);
 	this->helement=new Hook(&pengrid_element_id,1);
-	this->hmatpar=new Hook(&pengrid_matpar_id,1);
 
 	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
@@ -59,5 +54,4 @@
 	this->node=NULL;
 	this->element=NULL;
-	this->matpar=NULL;
 }
 /*}}}*/
@@ -65,5 +59,4 @@
 	delete hnode;
 	delete helement;
-	delete hmatpar;
 	return;
 }
@@ -86,10 +79,8 @@
 	/*now deal with hooks and objects: */
 	pengrid->hnode=(Hook*)this->hnode->copy();
-	pengrid->hmatpar=(Hook*)this->hmatpar->copy();
 	pengrid->helement=(Hook*)this->helement->copy();
 
 	/*corresponding fields*/
 	pengrid->node  =(Node*)pengrid->hnode->delivers();
-	pengrid->matpar =(Matpar*)pengrid->hmatpar->delivers();
 	pengrid->element=(Element*)pengrid->helement->delivers();
 
@@ -104,5 +95,4 @@
 	hnode->DeepEcho();
 	helement->DeepEcho();
-	hmatpar->DeepEcho();
 	_printf_("   parameters\n");
 	parameters->DeepEcho();
@@ -127,14 +117,11 @@
 		this->hnode      = new Hook();
 		this->helement   = new Hook();
-		this->hmatpar    = new Hook();
 	}
 
 	this->hnode->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 
 	/*corresponding fields*/
 	node   =(Node*)this->hnode->delivers();
-	matpar =(Matpar*)this->hmatpar->delivers();
 	element=(Element*)this->helement->delivers();
 }
@@ -153,10 +140,8 @@
 	hnode->configure(nodesin);
 	helement->configure(elementsin);
-	hmatpar->configure(materialsin);
 
 	/*Get corresponding fields*/
 	node=(Node*)hnode->delivers();
 	element=(Element*)helement->delivers();
-	matpar=(Matpar*)hmatpar->delivers();
 
 	/*point parameters to real dataset: */
@@ -240,5 +225,4 @@
 	this->node=NULL;
 	this->element=NULL;
-	this->matpar=NULL;
 	this->parameters=NULL;
 
@@ -246,5 +230,4 @@
 	this->hnode->reset();
 	this->helement->reset();
-	this->hmatpar->reset();
 
 }
Index: /issm/trunk-jpl/src/c/classes/Loads/Moulin.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Moulin.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Loads/Moulin.h	(revision 23644)
@@ -29,10 +29,8 @@
 		Hook* hnode;  //hook to 1 node
 		Hook* helement;  //hook to 1 element
-		Hook* hmatpar; //hook to 1 matpar
 
 		/*Corresponding fields*/
 		Node    *node;
 		Element *element;
-		Matpar  *matpar;
 
 		Parameters* parameters; //pointer to solution parameters
Index: /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 23644)
@@ -26,6 +26,4 @@
 	this->helement=NULL;
 	this->element=NULL;
-	this->hmatpar=NULL;
-	this->matpar=NULL;
 
 	/*not active, not zigzagging: */
@@ -38,5 +36,4 @@
 
 	int pengrid_node_id;
-	int pengrid_matpar_id;
 	int pengrid_element_id;
 
@@ -54,9 +51,7 @@
 	pengrid_element_id=iomodel->singlenodetoelementconnectivity[index];
 	_assert_(pengrid_element_id);
-	pengrid_matpar_id=iomodel->numberofelements+1; //refers to the constant material parameters object
 
 	this->hnode=new Hook(&pengrid_node_id,1);
 	this->helement=new Hook(&pengrid_element_id,1);
-	this->hmatpar=new Hook(&pengrid_matpar_id,1);
 
 	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
@@ -64,5 +59,4 @@
 	this->node=NULL;
 	this->element=NULL;
-	this->matpar=NULL;
 
 	//let's not forget internals
@@ -75,5 +69,4 @@
 	delete hnode;
 	delete helement;
-	delete hmatpar;
 	return;
 }
@@ -96,10 +89,8 @@
 	/*now deal with hooks and objects: */
 	pengrid->hnode=(Hook*)this->hnode->copy();
-	pengrid->hmatpar=(Hook*)this->hmatpar->copy();
 	pengrid->helement=(Hook*)this->helement->copy();
 
 	/*corresponding fields*/
 	pengrid->node  =(Node*)pengrid->hnode->delivers();
-	pengrid->matpar =(Matpar*)pengrid->hmatpar->delivers();
 	pengrid->element=(Element*)pengrid->helement->delivers();
 
@@ -119,5 +110,4 @@
 	hnode->DeepEcho();
 	helement->DeepEcho();
-	hmatpar->DeepEcho();
 	_printf_("   active " << this->active << "\n");
 	_printf_("   zigzag_counter " << this->zigzag_counter << "\n");
@@ -144,14 +134,11 @@
 		this->hnode      = new Hook();
 		this->helement   = new Hook();
-		this->hmatpar    = new Hook();
 	}
 
 	this->hnode->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 
 	/*corresponding fields*/
 	node   =(Node*)this->hnode->delivers();
-	matpar =(Matpar*)this->hmatpar->delivers();
 	element=(Element*)this->helement->delivers();
 
@@ -174,10 +161,8 @@
 	hnode->configure(nodesin);
 	helement->configure(elementsin);
-	hmatpar->configure(materialsin);
 
 	/*Get corresponding fields*/
 	node=(Node*)hnode->delivers();
 	element=(Element*)helement->delivers();
-	matpar=(Matpar*)hmatpar->delivers();
 
 	/*point parameters to real dataset: */
@@ -285,5 +270,4 @@
 	this->node=NULL;
 	this->element=NULL;
-	this->matpar=NULL;
 	this->parameters=NULL;
 
@@ -291,5 +275,4 @@
 	this->hnode->reset();
 	this->helement->reset();
-	this->hmatpar->reset();
 
 }
@@ -464,5 +447,5 @@
 
 	//Compute pressure melting point
-	t_pmp=matpar->TMeltingPoint(pressure);
+	t_pmp=element->TMeltingPoint(pressure);
 
 	//Figure out if temperature is over melting_point, in which case, this penalty needs to be activated.
@@ -532,5 +515,5 @@
 
 	/*Compute pressure melting point*/
-	t_pmp=matpar->GetMaterialParameter(MaterialsMeltingpointEnum)-matpar->GetMaterialParameter(MaterialsBetaEnum)*pressure;
+	t_pmp=parameters->FindParam(MaterialsMeltingpointEnum)-parameters->FindParam(MaterialsBetaEnum)*pressure;
 
 	/*Add penalty load*/
@@ -607,5 +590,5 @@
 
 	/*Compute pressure melting point*/
-	t_pmp=matpar->GetMaterialParameter(MaterialsMeltingpointEnum)-matpar->GetMaterialParameter(MaterialsBetaEnum)*pressure;
+	t_pmp=parameters->FindParam(MaterialsMeltingpointEnum)-parameters->FindParam(MaterialsBetaEnum)*pressure;
 
 	/*Add penalty load
@@ -642,5 +625,5 @@
 
 	/*Compute pressure melting point*/
-	t_pmp=matpar->GetMaterialParameter(MaterialsMeltingpointEnum)-matpar->GetMaterialParameter(MaterialsBetaEnum)*pressure;
+	t_pmp=parameters->FindParam(MaterialsMeltingpointEnum)-parameters->FindParam(MaterialsBetaEnum)*pressure;
 
 	pe->values[0]=kmax*pow(10.,penalty_factor)*t_pmp;
Index: /issm/trunk-jpl/src/c/classes/Loads/Pengrid.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Pengrid.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Loads/Pengrid.h	(revision 23644)
@@ -29,10 +29,8 @@
 		Hook* hnode;  //hook to 1 node
 		Hook* helement;  //hook to 1 element
-		Hook* hmatpar; //hook to 1 matpar
 
 		/*Corresponding fields*/
 		Node    *node;
 		Element *element;
-		Matpar  *matpar;
 
 		Parameters* parameters; //pointer to solution parameters
Index: /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 23644)
@@ -24,8 +24,6 @@
 	this->hnodes=NULL;
 	this->helements=NULL;
-	this->hmatpar=NULL;
 	this->nodes=NULL;
 	this->elements=NULL;
-	this->matpar=NULL;
 }
 /*}}}*/
@@ -36,5 +34,4 @@
 	int    riftfront_node_ids[2];
 	int    riftfront_elem_ids[2];
-	int    riftfront_matpar_id;
 	IssmDouble riftfront_friction;
 	IssmDouble riftfront_fractionincrement;
@@ -64,10 +61,8 @@
 	riftfront_elem_ids[0]=el1;
 	riftfront_elem_ids[1]=el2;
-	riftfront_matpar_id=iomodel->numberofelements+1; //matlab indexing
 
 	/*Hooks: */
 	this->hnodes=new Hook(riftfront_node_ids,2);
 	this->helements=new Hook(riftfront_elem_ids,2);
-	this->hmatpar=new Hook(&riftfront_matpar_id,1);
 
 	/*computational parameters: */
@@ -95,5 +90,4 @@
 	this->nodes= NULL;
 	this->elements= NULL;
-	this->matpar= NULL;
 
 }
@@ -103,5 +97,4 @@
 	delete hnodes;
 	delete helements;
-	delete hmatpar;
 }
 /*}}}*/
@@ -129,10 +122,8 @@
 	riftfront->hnodes=(Hook*)this->hnodes->copy();
 	riftfront->helements=(Hook*)this->helements->copy();
-	riftfront->hmatpar=(Hook*)this->hmatpar->copy();
 
 	/*corresponding fields*/
 	riftfront->nodes   =(Node**)riftfront->hnodes->deliverp();
 	riftfront->elements=(Element**)riftfront->helements->deliverp();
-	riftfront->matpar  =(Matpar*)riftfront->hmatpar->delivers();
 
 	/*internal data: */
@@ -160,5 +151,4 @@
 	hnodes->DeepEcho();
 	helements->DeepEcho();
-	hmatpar->DeepEcho();
 	_printf_("   parameters\n");
 	if(parameters)parameters->DeepEcho();
@@ -172,5 +162,4 @@
 	_printf_("   hnodes: " << hnodes << "\n");
 	_printf_("   helements: " << helements << "\n");
-	_printf_("   hmatpar: " << hmatpar << "\n");
 	_printf_("   parameters: " << parameters << "\n");
 	_printf_("   internal parameters: \n");
@@ -209,15 +198,12 @@
 	if(marshall_direction==MARSHALLING_BACKWARD){
 		this->hnodes      = new Hook();
-		this->hmatpar     = new Hook();
 		this->helements   = new Hook();
 	}
 
 	this->hnodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->helements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 
 	/*corresponding fields*/
 	nodes     =(Node**)this->hnodes->deliverp();
-	matpar    =(Matpar*)this->hmatpar->delivers();
 	elements  =(Element**)this->helements->deliverp();
 
@@ -265,10 +251,8 @@
 	hnodes->configure(nodesin);
 	helements->configure(elementsin);
-	hmatpar->configure(materialsin);
 
 	/*Initialize hooked fields*/
 	this->nodes   =(Node**)hnodes->deliverp();
 	this->elements=(Element**)helements->deliverp();
-	this->matpar  =(Matpar*)hmatpar->delivers();
 
 	/*point parameters to real dataset: */
@@ -366,5 +350,4 @@
 	this->nodes=NULL;
 	this->elements=NULL;
-	this->matpar=NULL;
 	this->parameters=NULL;
 
@@ -372,5 +355,4 @@
 	this->hnodes->reset();
 	this->helements->reset();
-	this->hmatpar->reset();
 
 }
@@ -543,7 +525,7 @@
 
 	/*Get some inputs: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	gravity=matpar->GetMaterialParameter(ConstantsGEnum);
+	rho_ice=tria1->FindParam(MaterialsRhoIceEnum);
+	rho_water=tria1->FindParam(MaterialsRhoSeawaterEnum);
+	gravity=tria1->FindParam(ConstantsGEnum);
 	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
 	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
Index: /issm/trunk-jpl/src/c/classes/Loads/Riftfront.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Riftfront.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Loads/Riftfront.h	(revision 23644)
@@ -30,8 +30,6 @@
 		Hook* hnodes;
 		Hook* helements;
-		Hook* hmatpar;
 
 		/*Corresponding fields*/
-		Matpar   *matpar;
 		Node    **nodes;
 		Element **elements;
Index: /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 23644)
@@ -768,5 +768,5 @@
 	surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
 	z=this->element->GetZcoord(xyz_list,gauss);
-	tau_perp = element->matpar->GetMaterialParameter(MaterialsRhoIceEnum) * element->matpar->GetMaterialParameter(ConstantsGEnum) * fabs(s-z)*sqrt(slope[0]*slope[0]+slope[1]*slope[1]);
+	tau_perp = element->FindParam(MaterialsRhoIceEnum) * element->FindParam(ConstantsGEnum) * fabs(s-z)*sqrt(slope[0]*slope[0]+slope[1]*slope[1]);
 
 	/* Get eps_b*/
Index: /issm/trunk-jpl/src/c/classes/Materials/Matlitho.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Materials/Matlitho.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Materials/Matlitho.h	(revision 23644)
@@ -74,13 +74,4 @@
 
 		/*}}}*/
-		/*Numerics: {{{*/
-		void       EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){_error_("not supported");};
-		IssmDouble GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){_error_("not supported");};
-		IssmDouble GetEnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){_error_("not supported");};
-		IssmDouble GetMaterialParameter(int in_enum){_error_("not supported");}; 
-		IssmDouble PureIceEnthalpy(IssmDouble pressure){_error_("not supported");};
-		void       ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){_error_("not supported");};
-		IssmDouble TMeltingPoint(IssmDouble pressure){_error_("not supported");};
-		/*}}}*/
 
 };
Index: sm/trunk-jpl/src/c/classes/Materials/Matpar.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 23643)
+++ 	(revision )
@@ -1,700 +1,0 @@
-/*!\file Matpar.c
- * \brief: implementation of the Matpar object
- */
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "../classes.h"
-#include "../../shared/shared.h"
-
-/*Matpar constructors and destructor*/
-Matpar::Matpar(){/*{{{*/
-	return;
-}
-/*}}}*/
-Matpar::Matpar(IoModel* iomodel){/*{{{*/
-
-	rho_ice                   = 0;
-	rho_water                 = 0;
-	rho_freshwater            = 0;
-	mu_water                  = 0;
-	heatcapacity              = 0;
-	thermalconductivity       = 0;
-	temperateiceconductivity  = 0;
-	latentheat                = 0;
-	beta                      = 0;
-	meltingpoint              = 0;
-	referencetemperature      = 0;
-	mixed_layer_capacity      = 0;
-	thermal_exchange_velocity = 0;
-	g                         = 0;
-	omega                     = 0;
-	desfac                    = 0;
-	rlaps                     = 0;
-	rlapslgm                  = 0;
-	rdl							  = 0;
-	dpermil                   = 0;
-	rheology_law              = 0;
-
-	albedo_snow               = 0;
-	albedo_ice                = 0;
-
-	sediment_compressibility  = 0;
-	sediment_porosity         = 0;
-	sediment_thickness        = 0;
-	water_compressibility     = 0;
-
-	epl_compressibility       = 0;
-	epl_porosity              = 0;
-	epl_init_thickness        = 0;
-	epl_colapse_thickness     = 0;
-	epl_max_thickness         = 0;
-	epl_conductivity          = 0;
-
-	lithosphere_shear_modulus = 0;
-	lithosphere_density       = 0;
-	mantle_shear_modulus      = 0;
-	mantle_density            = 0;
-
-	earth_density             = 0;
-
-	int nnat,dummy;
-	int* nature=NULL;
-
-	bool isefficientlayer;
-	int  hydrology_model,smb_model,materials_type;
-	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
-	iomodel->FindConstant(&smb_model,"md.smb.model");
-	iomodel->FindConstant(&materials_type,"md.materials.type");
-
-	this->mid = iomodel->numberofelements+1;
-
-	switch(materials_type){
-		case MaticeEnum:
-		case MatdamageiceEnum:
-		case MatenhancediceEnum:
-		case MatestarEnum:
-			iomodel->FindConstant(&this->rho_ice,"md.materials.rho_ice");
-			iomodel->FindConstant(&this->rho_water,"md.materials.rho_water");
-			iomodel->FindConstant(&this->rho_freshwater,"md.materials.rho_freshwater");
-			iomodel->FindConstant(&this->mu_water,"md.materials.mu_water");
-			iomodel->FindConstant(&this->heatcapacity,"md.materials.heatcapacity");
-			iomodel->FindConstant(&this->thermalconductivity,"md.materials.thermalconductivity");
-			iomodel->FindConstant(&this->temperateiceconductivity,"md.materials.temperateiceconductivity");
-			iomodel->FindConstant(&this->latentheat,"md.materials.latentheat");
-			iomodel->FindConstant(&this->beta,"md.materials.beta");
-			iomodel->FindConstant(&this->meltingpoint,"md.materials.meltingpoint");
-			iomodel->FindConstant(&this->referencetemperature,"md.constants.referencetemperature");
-			iomodel->FindConstant(&this->mixed_layer_capacity,"md.materials.mixed_layer_capacity");
-			iomodel->FindConstant(&this->thermal_exchange_velocity,"md.materials.thermal_exchange_velocity");
-			iomodel->FindConstant(&this->g,"md.constants.g");
-			iomodel->FindConstant(&this->rheology_law,"md.materials.rheology_law");
-
-			switch(smb_model){
-				case SMBforcingEnum:
-					/*Nothing to add*/
-					break;
-				case SMBgembEnum:
-					iomodel->FindConstant(&this->albedo_ice,"md.smb.aIce");
-					iomodel->FindConstant(&this->albedo_snow,"md.smb.aSnow");
-					break;
-				case SMBpddEnum:
-					iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-					iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
-					break;
-				case SMBpddSicopolisEnum:
-					iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-					break;
-				case SMBd18opddEnum:
-					iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-					iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
-					iomodel->FindConstant(&this->dpermil,"md.smb.dpermil");
-				case SMBgradientsEnum:
-					/*Nothing to add*/
-					break;
-				case SMBgradientselaEnum:
-					/*Nothing to add*/
-					break;
-				case SMBhenningEnum:
-					/*Nothing to add*/
-					break;
-				case SMBcomponentsEnum:
-					/*Nothing to add*/
-					break;
-				case SMBmeltcomponentsEnum:
-					/*Nothing to add*/
-					break;
-				case SMBgradientscomponentsEnum:
-					/*Nothing to add*/
-					break;
-				case SMBsemicEnum:
-					iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-					iomodel->FindConstant(&this->rdl,"md.smb.rdl");
-					break;
-				default:
-					_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
-			}
-			if(hydrology_model==HydrologydcEnum){
-				iomodel->FindConstant(&this->sediment_compressibility,"md.hydrology.sediment_compressibility");
-				iomodel->FindConstant(&this->sediment_porosity,"md.hydrology.sediment_porosity");
-				iomodel->FindConstant(&this->sediment_thickness,"md.hydrology.sediment_thickness");
-				iomodel->FindConstant(&this->water_compressibility,"md.hydrology.water_compressibility");
-				iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer");
-
-				if(isefficientlayer){
-					iomodel->FindConstant(&this->epl_compressibility,"md.hydrology.epl_compressibility");
-					iomodel->FindConstant(&this->epl_porosity,"md.hydrology.epl_porosity");
-					iomodel->FindConstant(&this->epl_init_thickness,"md.hydrology.epl_initial_thickness");
-					iomodel->FindConstant(&this->epl_colapse_thickness,"md.hydrology.epl_colapse_thickness");
-					iomodel->FindConstant(&this->epl_max_thickness,"md.hydrology.epl_max_thickness");
-					iomodel->FindConstant(&this->epl_conductivity,"md.hydrology.epl_conductivity");
-				}
-			}
-			else if(hydrology_model==HydrologyshreveEnum){
-				/*Nothing to add*/
-			}
-			else if(hydrology_model==HydrologyshaktiEnum){
-				/*Nothing to add*/
-			}
-			else if(hydrology_model==HydrologypismEnum){
-				/*Nothing to add*/
-			}
-			else{
-				_error_("Hydrology model "<<EnumToStringx(hydrology_model)<<" not supported yet");
-			}
-
-			/*gia: */
-			iomodel->FindConstant(&this->lithosphere_shear_modulus,"md.materials.lithosphere_shear_modulus");
-			iomodel->FindConstant(&this->lithosphere_density,"md.materials.lithosphere_density");
-			iomodel->FindConstant(&this->mantle_shear_modulus,"md.materials.mantle_shear_modulus");
-			iomodel->FindConstant(&this->mantle_density,"md.materials.mantle_density");
-
-			/*slr:*/
-			iomodel->FindConstant(&this->earth_density,"md.materials.earth_density");
-
-			break;
-		case MaterialsEnum:
-			//we have several types of materials. Retrieve this info first:
-			iomodel->FetchData(&nature,&nnat,&dummy,"md.materials.nature");
-
-			//go through list of materials, and create constant parameters accordingly:
-			for(int i=0;i<nnat;i++){
-				switch(IoCodeToEnumMaterials(nature[i])){ //{{{
-					case MatlithoEnum:
-						break;
-					case MaticeEnum:
-					case MatdamageiceEnum:
-					case MatenhancediceEnum:
-					case MatestarEnum:
-						iomodel->FindConstant(&this->rho_ice,"md.materials.rho_ice");
-						iomodel->FindConstant(&this->rho_water,"md.materials.rho_water");
-						iomodel->FindConstant(&this->rho_freshwater,"md.materials.rho_freshwater");
-						iomodel->FindConstant(&this->mu_water,"md.materials.mu_water");
-						iomodel->FindConstant(&this->heatcapacity,"md.materials.heatcapacity");
-						iomodel->FindConstant(&this->thermalconductivity,"md.materials.thermalconductivity");
-						iomodel->FindConstant(&this->temperateiceconductivity,"md.materials.temperateiceconductivity");
-						iomodel->FindConstant(&this->latentheat,"md.materials.latentheat");
-						iomodel->FindConstant(&this->beta,"md.materials.beta");
-						iomodel->FindConstant(&this->meltingpoint,"md.materials.meltingpoint");
-						iomodel->FindConstant(&this->referencetemperature,"md.constants.referencetemperature");
-						iomodel->FindConstant(&this->mixed_layer_capacity,"md.materials.mixed_layer_capacity");
-						iomodel->FindConstant(&this->thermal_exchange_velocity,"md.materials.thermal_exchange_velocity");
-						iomodel->FindConstant(&this->g,"md.constants.g");
-						iomodel->FindConstant(&this->rheology_law,"md.materials.rheology_law");
-
-						switch(smb_model){ //{{{
-							case SMBforcingEnum:
-								/*Nothing to add*/
-								break;
-							case SMBgembEnum:
-								iomodel->FindConstant(&this->albedo_ice,"md.smb.aIce");
-								iomodel->FindConstant(&this->albedo_snow,"md.smb.aSnow");
-								break;
-							case SMBpddEnum:
-								iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-								iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-								iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
-								break;
-							case SMBpddSicopolisEnum:
-								iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-								iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-								break;
-							case SMBd18opddEnum:
-								iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-								iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-								iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
-								iomodel->FindConstant(&this->dpermil,"md.smb.dpermil");
-							case SMBgradientsEnum:
-								/*Nothing to add*/
-								break;
-							case SMBgradientselaEnum:
-								/*Nothing to add*/
-								break;
-							case SMBhenningEnum:
-								/*Nothing to add*/
-								break;
-							case SMBcomponentsEnum:
-								/*Nothing to add*/
-								break;
-							case SMBmeltcomponentsEnum:
-								/*Nothing to add*/
-								break;
-							default:
-								_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
-						}
-						if(hydrology_model==HydrologydcEnum){
-							iomodel->FindConstant(&this->sediment_compressibility,"md.hydrology.sediment_compressibility");
-							iomodel->FindConstant(&this->sediment_porosity,"md.hydrology.sediment_porosity");
-							iomodel->FindConstant(&this->sediment_thickness,"md.hydrology.sediment_thickness");
-							iomodel->FindConstant(&this->water_compressibility,"md.hydrology.water_compressibility");
-							iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer");
-
-							if(isefficientlayer){
-								iomodel->FindConstant(&this->epl_compressibility,"md.hydrology.epl_compressibility");
-								iomodel->FindConstant(&this->epl_porosity,"md.hydrology.epl_porosity");
-								iomodel->FindConstant(&this->epl_init_thickness,"md.hydrology.epl_initial_thickness");
-								iomodel->FindConstant(&this->epl_colapse_thickness,"md.hydrology.epl_colapse_thickness");
-								iomodel->FindConstant(&this->epl_max_thickness,"md.hydrology.epl_max_thickness");
-								iomodel->FindConstant(&this->epl_conductivity,"md.hydrology.epl_conductivity");
-							}
-						}
-						else if(hydrology_model==HydrologyshreveEnum){
-							/*Nothing to add*/
-						}
-						else if(hydrology_model==HydrologyshaktiEnum){
-							/*Nothing to add*/
-						}
-						else{
-							_error_("Hydrology model "<<EnumToStringx(hydrology_model)<<" not supported yet");
-						}
-
-						/*gia: */
-						iomodel->FindConstant(&this->lithosphere_shear_modulus,"md.materials.lithosphere_shear_modulus");
-						iomodel->FindConstant(&this->lithosphere_density,"md.materials.lithosphere_density");
-						iomodel->FindConstant(&this->mantle_shear_modulus,"md.materials.mantle_shear_modulus");
-						iomodel->FindConstant(&this->mantle_density,"md.materials.mantle_density");
-
-						/*slr:*/
-						iomodel->FindConstant(&this->earth_density,"md.materials.earth_density");
-						//}}}
-						break;
-					default:
-						_error_("Materials "<<EnumToStringx(IoCodeToEnumMaterials(nature[i]))<<" not supported");
-
-				} //}}}
-			}
-			//Free ressources:
-			xDelete<int>(nature);
-			break;
-
-			break;
-		default:
-			_error_("Material "<< EnumToStringx(materials_type) <<" not supported yet");
-	}
-}
-/*}}}*/
-Matpar::~Matpar(){/*{{{*/
-	return;
-}
-/*}}}*/
-void Matpar::SetMid(int matpar_mid){/*{{{*/
-	this->mid=matpar_mid;
-}
-/*}}}*/
-
-/*Object virtual functions definitions:*/
-Object* Matpar::copy() {/*{{{*/
-
-	/*Output*/
-	Matpar* matpar;
-
-	/*Initialize output*/
-	matpar=new Matpar(*this);
-
-	/*copy fields: */
-	matpar->mid=this->mid;
-	matpar->rho_ice=this->rho_ice;
-	matpar->rho_water=this->rho_water;
-	matpar->rho_freshwater=this->rho_freshwater;
-	matpar->mu_water=this->mu_water;
-	matpar->heatcapacity=this->heatcapacity;
-	matpar->thermalconductivity=this->thermalconductivity;
-	matpar->temperateiceconductivity=this->temperateiceconductivity;
-	matpar->latentheat=this->latentheat;
-	matpar->beta=this->beta;
-	matpar->meltingpoint=this->meltingpoint;
-	matpar->referencetemperature=this->referencetemperature;
-	matpar->mixed_layer_capacity=this->mixed_layer_capacity;
-	matpar->thermal_exchange_velocity=this->thermal_exchange_velocity;
-	matpar->g=this->g;
-	matpar->desfac=this->desfac;
-	matpar->rlaps=this->rlaps;
-	matpar->rlapslgm=this->rlapslgm;
-	matpar->dpermil=this->dpermil;
-	matpar->rheology_law=this->rheology_law;
-
-	matpar->sediment_compressibility=this->sediment_compressibility;
-	matpar->sediment_porosity=this->sediment_porosity;
-	matpar->sediment_thickness=this->sediment_thickness;
-	matpar->water_compressibility=this->water_compressibility;
-
-	matpar->epl_compressibility=this->epl_compressibility;
-	matpar->epl_porosity=this->epl_porosity;
-	matpar->epl_init_thickness=this->epl_init_thickness;
-	matpar->epl_colapse_thickness=this->epl_colapse_thickness;
-	matpar->epl_max_thickness=this->epl_max_thickness;
-	matpar->epl_conductivity=this->epl_conductivity;
-
-	matpar->lithosphere_shear_modulus=this->lithosphere_shear_modulus;
-	matpar->lithosphere_density=this->lithosphere_density;
-	matpar->mantle_shear_modulus=this->mantle_shear_modulus;
-	matpar->mantle_density=this->mantle_density;
-
-	matpar->earth_density=this->earth_density;
-
-	return matpar;
-}
-/*}}}*/
-void Matpar::DeepEcho(void){/*{{{*/
-
-	this->Echo();
-}
-/*}}}*/
-void Matpar::Echo(void){/*{{{*/
-
-	_printf_("Matpar:\n");
-	_printf_("   mid: " << mid << "\n");
-	_printf_("   rho_ice: " << rho_ice << "\n");
-	_printf_("   rho_water: " << rho_water << "\n");
-	_printf_("   rho_freshwater: " << rho_freshwater << "\n");
-	_printf_("   mu_water: " << mu_water << "\n");
-	_printf_("   heatcapacity: " << heatcapacity << "\n");
-	_printf_("   thermalconductivity: " << thermalconductivity << "\n");
-	_printf_("   temperateiceconductivity: " << temperateiceconductivity << "\n");
-	_printf_("   latentheat: " << latentheat << "\n");
-	_printf_("   beta: " << beta << "\n");
-	_printf_("   meltingpoint: " << meltingpoint << "\n");
-	_printf_("   referencetemperature: " << referencetemperature << "\n");
-	_printf_("   mixed_layer_capacity: " << mixed_layer_capacity << "\n");
-	_printf_("   thermal_exchange_velocity: " << thermal_exchange_velocity << "\n");
-	_printf_("   g: " << g << "\n");
-	_printf_("   omega: " << omega << "\n");
-	_printf_("   desfac: " << desfac << "\n");
-	_printf_("   rlaps: " << rlaps << "\n");
-	_printf_("   rlapslgm: " << rlapslgm << "\n");
-	_printf_("   dpermil: " << dpermil << "\n");
-	_printf_("   rheology_law: " << rheology_law << "\n");
-	_printf_("   albedo_ice: " << albedo_ice << "\n");
-	_printf_("   albedo_snow: " << albedo_snow << "\n");
-	_printf_("   sediment_compressibility: " << sediment_compressibility << "\n");
-	_printf_("   sediment_porosity: " << sediment_porosity << "\n");
-	_printf_("   sediment_thickness: " << sediment_thickness << "\n");
-	_printf_("   water_compressibility: " << water_compressibility << "\n");
-	_printf_("   epl_compressibility: " << epl_compressibility << "\n");
-	_printf_("   epl_porosity: " << epl_porosity << "\n");
-	_printf_("   epl_init_thickness: " << epl_init_thickness << "\n");
-	_printf_("   epl_colapse_thickness: " << epl_colapse_thickness << "\n");
-	_printf_("   epl_max_thickness: " << epl_max_thickness << "\n");
-	_printf_("   epl_conductivity: " << epl_conductivity << "\n");
-	_printf_("   lithosphere_shear_modulus: " << lithosphere_shear_modulus << "\n");
-	_printf_("   lithosphere_density: " << lithosphere_density << "\n");
-	_printf_("   mantle_shear_modulus: " << mantle_shear_modulus << "\n");
-	_printf_("   mantle_density: " << mantle_density << "\n");
-	_printf_("   earth_density: " << earth_density << "\n");
-	return;
-}
-/*}}}*/
-int  Matpar::Id(void){ return mid; }/*{{{*/
-/*}}}*/
-void Matpar::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
-
-	MARSHALLING_ENUM(MatparEnum);
-
-	MARSHALLING(mid);
-	MARSHALLING(rho_ice);
-	MARSHALLING(rho_water);
-	MARSHALLING(rho_freshwater);
-	MARSHALLING(mu_water);
-	MARSHALLING(heatcapacity);
-	MARSHALLING(thermalconductivity);
-	MARSHALLING(temperateiceconductivity);
-	MARSHALLING(latentheat);
-	MARSHALLING(beta);
-	MARSHALLING(meltingpoint);
-	MARSHALLING(referencetemperature);
-	MARSHALLING(mixed_layer_capacity);
-	MARSHALLING(thermal_exchange_velocity);
-	MARSHALLING(g);
-	MARSHALLING(omega);
-	MARSHALLING(desfac);
-	MARSHALLING(rlaps);
-	MARSHALLING(rlapslgm);
-	MARSHALLING(dpermil);
-	MARSHALLING(rheology_law);
-
-	//hydrology Dual Porous Continuum:
-	MARSHALLING(sediment_compressibility);
-	MARSHALLING(sediment_porosity);
-	MARSHALLING(sediment_thickness);
-	MARSHALLING(water_compressibility);
-
-	MARSHALLING(epl_compressibility);
-	MARSHALLING(epl_porosity);
-	MARSHALLING(epl_init_thickness);
-	MARSHALLING(epl_colapse_thickness);
-	MARSHALLING(epl_max_thickness);
-	MARSHALLING(epl_conductivity);
-
-	//gia:
-	MARSHALLING(lithosphere_shear_modulus);
-	MARSHALLING(lithosphere_density);
-	MARSHALLING(mantle_shear_modulus);
-	MARSHALLING(mantle_density);
-
-	//slr:
-	MARSHALLING(earth_density);
-}
-/*}}}*/
-int  Matpar::ObjectEnum(void){/*{{{*/
-
-	return MatparEnum;
-
-}
-/*}}}*/
-
-/*Update virtual functions definitions:*/
-void   Matpar::InputUpdateFromConstant(IssmDouble constant, int name){/*{{{*/
-
-	switch(name){
-		case MaterialsRhoIceEnum:
-			this->rho_ice=constant;
-			break;
-		case MaterialsRhoSeawaterEnum:
-			this->rho_water=constant;
-			break;
-		case MaterialsRhoFreshwaterEnum:
-			this->rho_freshwater=constant;
-			break;
-		case MaterialsMuWaterEnum:
-			this->mu_water=constant;
-			break;
-		case MaterialsHeatcapacityEnum:
-			this->heatcapacity=constant;
-			break;
-	  	case MaterialsThermalconductivityEnum:
-			this->thermalconductivity=constant;
-			break;
-	  	case MaterialsTemperateiceconductivityEnum:
-			this->temperateiceconductivity=constant;
-			break;
-		case  MaterialsLatentheatEnum:
-			this->latentheat=constant;
-			break;
-		case  MaterialsBetaEnum:
-			this->beta=constant;
-			break;
-		case  MaterialsMeltingpointEnum:
-			this->meltingpoint=constant;
-			break;
-		case  ConstantsReferencetemperatureEnum:
-			this->referencetemperature=constant;
-			break;
-		case  MaterialsMixedLayerCapacityEnum:
-			this->mixed_layer_capacity=constant;
-			break;
-		case  MaterialsThermalExchangeVelocityEnum:
-			this->thermalconductivity=constant;
-			break;
-		case  ConstantsGEnum:
-			this->g=constant;
-			break;
-		case  SmbDesfacEnum:
-			this->desfac=constant;
-			break;
-		case SmbRlapsEnum:
-			this->rlaps=constant;
-			break;
-		case SmbRlapslgmEnum:
-			this->rlapslgm=constant;
-			break;
-		case SmbRdlEnum:
-			this->rdl=constant;
-			break;			
-		case  SmbDpermilEnum:
-			this->dpermil=constant;
-			break;
-		default:
-			break;
-	}
-
-}
-/*}}}*/
-
-/*Matpar management: */
-void       Matpar::Configure(Elements* elementsin){/*{{{*/
-
-	/*nothing done yet!*/
-
-}
-/*}}}*/
-void       Matpar::EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
-
-	/*Ouput*/
-	IssmDouble temperature,waterfraction;
-
-	if(enthalpy<PureIceEnthalpy(pressure)){
-		temperature=referencetemperature+enthalpy/heatcapacity;
-		waterfraction=0.;
-	}
-	else{
-		temperature=TMeltingPoint(pressure);
-		waterfraction=(enthalpy-PureIceEnthalpy(pressure))/latentheat;
-	}
-
-	/*Assign output pointers:*/
-	*pwaterfraction=waterfraction;
-	*ptemperature=temperature;
-}
-/*}}}*/
-IssmDouble Matpar::GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
-	if (enthalpy<PureIceEnthalpy(pressure))
-		return thermalconductivity/heatcapacity;
-	else
-		return temperateiceconductivity/heatcapacity;
-}
-/*}}}*/
-IssmDouble Matpar::GetEnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){/*{{{*/
-
-	int         iv;
-	IssmDouble  lambda;                 // fraction of cold ice
-	IssmDouble  kappa,kappa_c,kappa_t;  //enthalpy conductivities
-	IssmDouble  Hc,Ht;
-	IssmDouble* PIE   = xNew<IssmDouble>(numvertices);
-	IssmDouble* dHpmp = xNew<IssmDouble>(numvertices);
-
-	for(iv=0; iv<numvertices; iv++){
-		PIE[iv]=PureIceEnthalpy(pressure[iv]);
-		dHpmp[iv]=enthalpy[iv]-PIE[iv];
-	}
-
-	bool allequalsign=true;
-	if(dHpmp[0]<0)
-		for(iv=1; iv<numvertices;iv++) allequalsign=(allequalsign && (dHpmp[iv]<0));
-	else
-		for(iv=1; iv<numvertices;iv++) allequalsign=(allequalsign && (dHpmp[iv]>=0));
-
-	if(allequalsign){
-		kappa=GetEnthalpyDiffusionParameter(enthalpy[0], pressure[0]);
-	}
-	else {
-		/* return harmonic mean of thermal conductivities, weighted by fraction of cold/temperate ice,
-		 cf Patankar 1980, pp44 */
-		kappa_c=GetEnthalpyDiffusionParameter(PureIceEnthalpy(0.)-1.,0.);
-		kappa_t=GetEnthalpyDiffusionParameter(PureIceEnthalpy(0.)+1.,0.);
-		Hc=0.; Ht=0.;
-		for(iv=0; iv<numvertices;iv++){
-			if(enthalpy[iv]<PIE[iv])
-			 Hc+=(PIE[iv]-enthalpy[iv]);
-			else
-			 Ht+=(enthalpy[iv]-PIE[iv]);
-		}
-		_assert_((Hc+Ht)>0.);
-		lambda = Hc/(Hc+Ht);
-		kappa  = 1./(lambda/kappa_c + (1.-lambda)/kappa_t);
-	}
-
-	/*Clean up and return*/
-	xDelete<IssmDouble>(PIE);
-	xDelete<IssmDouble>(dHpmp);
-	return kappa;
-}
-/*}}}*/
-IssmDouble Matpar::GetMaterialParameter(int enum_in){/*{{{*/
-
-	switch(enum_in){
-		case MaterialsRhoIceEnum:                    return this->rho_ice;
-		case MaterialsRhoSeawaterEnum:               return this->rho_water;
-		case MaterialsRhoFreshwaterEnum:             return this->rho_freshwater;
-		case MaterialsMuWaterEnum:                   return this->mu_water;
-		case MaterialsHeatcapacityEnum:              return this->heatcapacity;
-		case MaterialsThermalconductivityEnum:       return this->thermalconductivity;
-		case MaterialsTemperateiceconductivityEnum:  return this->temperateiceconductivity;
-		case MaterialsLatentheatEnum:                return this->latentheat;
-		case MaterialsBetaEnum:                      return this->beta;
-		case MaterialsMeltingpointEnum:              return this->meltingpoint;
-		case ConstantsReferencetemperatureEnum:      return this->referencetemperature;
-		case MaterialsMixedLayerCapacityEnum:        return this->mixed_layer_capacity;
-		case MaterialsThermalExchangeVelocityEnum:   return this->thermal_exchange_velocity;
-		case HydrologydcSedimentPorosityEnum:        return this->sediment_porosity;
-		case HydrologydcSedimentThicknessEnum:       return this->sediment_thickness;
-		case HydrologydcSedimentCompressibilityEnum: return this->sediment_compressibility;
-		case HydrologydcEplPorosityEnum:             return this->epl_porosity;
-		case HydrologydcEplCompressibilityEnum:      return this->epl_compressibility;
-		case HydrologydcEplConductivityEnum:         return this->epl_conductivity;
-		case HydrologydcEplInitialThicknessEnum:     return this->epl_init_thickness;
-		case HydrologydcEplColapseThicknessEnum:     return this->epl_colapse_thickness;
-		case HydrologydcEplMaxThicknessEnum:         return this->epl_max_thickness;
-		case HydrologydcWaterCompressibilityEnum:    return this->water_compressibility;
-		case ConstantsGEnum:                         return this->g;
-		case SmbDesfacEnum:                          return this->desfac;
-		case SmbRlapsEnum:                           return this->rlaps;
-		case SmbRlapslgmEnum:                        return this->rlapslgm;
-		case SmbRdlEnum:										return this->rdl;
-		case SmbDpermilEnum:                         return this->dpermil;
-		case MaterialsLithosphereShearModulusEnum:   return this->lithosphere_shear_modulus;
-		case MaterialsLithosphereDensityEnum:        return this->lithosphere_density;
-		case MaterialsMantleDensityEnum:             return this->mantle_density;
-		case MaterialsMantleShearModulusEnum:        return this->mantle_shear_modulus;
-		case MaterialsEarthDensityEnum:              return this->earth_density;
-		default: _error_("Enum "<<EnumToStringx(enum_in)<<" not supported yet");
-	}
-
-}
-/*}}}*/
-int        Matpar::GetIntegerMaterialParameter(int enum_in){/*{{{*/
-
-	switch(enum_in){
-		case MaterialsRheologyLawEnum:               return this->rheology_law;
-		default: _error_("Enum "<<EnumToStringx(enum_in)<<" not supported yet");
-	}
-
-}
-/*}}}*/
-IssmDouble Matpar::PureIceEnthalpy(IssmDouble pressure){/*{{{*/
-	return heatcapacity*(TMeltingPoint(pressure)-referencetemperature);
-}
-/*}}}*/
-void       Matpar::ResetHooks(){/*{{{*/
-
-	//Nothing to be done
-	return;
-}
-/*}}}*/
-void       Matpar::ThermalToEnthalpy(IssmDouble * penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){/*{{{*/
-
-	/*Ouput*/
-	IssmDouble enthalpy;
-
-	if(temperature<TMeltingPoint(pressure)){
-		enthalpy=heatcapacity*(temperature-referencetemperature);
-	}
-	else{
-		enthalpy=PureIceEnthalpy(pressure)+latentheat*waterfraction;
-	}
-
-	/*Assign output pointers:*/
-	*penthalpy=enthalpy;
-}
-/*}}}*/
-IssmDouble Matpar::TMeltingPoint(IssmDouble pressure){/*{{{*/
-	return meltingpoint-beta*pressure;
-}
-/*}}}*/
Index: sm/trunk-jpl/src/c/classes/Materials/Matpar.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Materials/Matpar.h	(revision 23643)
+++ 	(revision )
@@ -1,130 +1,0 @@
-/*!\file Matpar.h
- * \brief: header file for matpar object
- */
-
-#ifndef _MATPAR_H_
-#define _MATPAR_H_
-
-/*Headers:*/
-/*{{{*/
-#include "./Material.h"
-class IoModel;
-/*}}}*/
-
-class Matpar: public Material{
-
-	private: 
-		int	      mid;
-		IssmDouble  rho_ice; 
-		IssmDouble  rho_water;
-		IssmDouble  rho_freshwater;
-		IssmDouble  mu_water;
-		IssmDouble  heatcapacity;
-		IssmDouble  thermalconductivity;
-		IssmDouble  temperateiceconductivity;
-		IssmDouble  latentheat;
-		IssmDouble  beta;
-		IssmDouble  meltingpoint;
-		IssmDouble  referencetemperature;
-		IssmDouble  mixed_layer_capacity;
-		IssmDouble  thermal_exchange_velocity;
-		IssmDouble  g;
-		IssmDouble  omega;
-		IssmDouble  desfac;
-		IssmDouble  rlaps;
-		IssmDouble  rlapslgm;
-		IssmDouble  rdl;
-		IssmDouble  dpermil;
-		int         rheology_law;
-
-		/*albedo: */
-		IssmDouble albedo_ice;
-		IssmDouble albedo_snow;
-
-		/*hydrology Dual Porous Continuum: */	 
-		IssmDouble  sediment_compressibility;
-		IssmDouble  sediment_porosity;	 
-		IssmDouble  sediment_thickness;
-		IssmDouble  water_compressibility;
-
-		IssmDouble  epl_compressibility;
-		IssmDouble  epl_porosity;
-		IssmDouble  epl_init_thickness;
-		IssmDouble  epl_colapse_thickness;
-		IssmDouble  epl_max_thickness;
-		IssmDouble  epl_conductivity;	 
-
-		/*gia: */
-		IssmDouble lithosphere_shear_modulus;
-		IssmDouble lithosphere_density;
-		IssmDouble mantle_shear_modulus;
-		IssmDouble mantle_density;
-
-		/*slr:*/
-		IssmDouble earth_density;
-
-	public:
-		Matpar();
-		Matpar(IoModel* iomodel);
-		~Matpar();
-		void SetMid(int matpar_mid);
-
-		/*Object virtual functions definitions:{{{ */
-		Object *copy();
-		void    DeepEcho();
-		void    Echo();
-		int     Id();
-		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
-		int     ObjectEnum();
-		/*}}}*/
-		/*Material virtual functions resolution: {{{*/
-		Material*  copy2(Element* element){_error_("not implemented");};
-		void       Configure(Elements* elements);
-		void       GetViscosity(IssmDouble* pviscosity,IssmDouble eps_eff,Gauss* gauss){_error_("not supported");};
-		void       GetViscosityBar(IssmDouble* pviscosity,IssmDouble eps_eff,Gauss* gauss){_error_("not supported");};
-		void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon,Gauss* gauss){_error_("not supported");};
-		void       GetViscosityDComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon,Gauss* gauss){_error_("not supported");};
-		void       GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon,Gauss* gauss){_error_("not supported");};
-		void       GetViscosity_B(IssmDouble* pviscosity,IssmDouble eps_eff,Gauss* gauss){_error_("not supported");};
-		void       GetViscosity_D(IssmDouble* pviscosity,IssmDouble eps_eff,Gauss* gauss){_error_("not supported");};
-		void       GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon,Gauss* gauss){_error_("not supported");};
-		IssmDouble GetA(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetAbar(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetB(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetBbar(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetD(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetDbar(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetN(){_error_("not supported");};
-		bool       IsDamage(){_error_("not supported");};
-		bool       IsEnhanced(){_error_("not supported");};
-		void       ResetHooks();
-
-		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not supported");};
-		void       ViscosityFSDerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon,Gauss* gauss){_error_("not supported");};
-		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
-		void       ViscosityHODerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon,Gauss* gauss){_error_("not supported");};
-		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf){_error_("not supported");};
-		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
-		void       ViscositySSADerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon,Gauss* gauss){_error_("not supported");};
-		void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble eps_eff){_error_("not supported");};
-		void       ViscosityBHO(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,IssmDouble eps_eff){_error_("not supported");};
-		void       ViscosityBSSA(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,IssmDouble eps_eff){_error_("not supported");};
-		void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not supported");};
-		void       ViscosityBHO(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
-		void       ViscosityBSSA(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
-		/*}}}*/
-		/*Numerics: {{{*/
-		void       EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
-		IssmDouble GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure);
-		IssmDouble GetEnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure);
-		IssmDouble GetMaterialParameter(int in_enum); 
-		int        GetIntegerMaterialParameter(int in_enum); 
-		IssmDouble PureIceEnthalpy(IssmDouble pressure);
-		void       ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
-		IssmDouble TMeltingPoint(IssmDouble pressure);
-		void       InputUpdateFromConstant(IssmDouble constant, int name);
-		/*}}}*/
-
-};
-
-#endif  /* _MATPAR_H_ */
Index: /issm/trunk-jpl/src/c/classes/Params/Parameters.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 23644)
@@ -485,4 +485,21 @@
 }
 /*}}}*/
+IssmDouble Parameters::FindParam(int param_enum){ _assert_(this);/*{{{*/
+	#ifdef _ISSM_DEBUG_
+	if(param_enum<ParametersSTARTEnum || param_enum>ParametersENDEnum){
+		_error_(EnumToStringx(param_enum) <<" is not with the parameter Enums");
+	}
+	#endif
+	_assert_(param_enum>ParametersSTARTEnum);
+	_assert_(param_enum<ParametersENDEnum);
+
+	int index = param_enum - ParametersSTARTEnum -1;
+	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
+
+	IssmDouble value;
+	this->params[index]->GetParameterValue(&value);
+	return value;
+}
+/*}}}*/
 
 void   Parameters::SetParam(bool boolean,int enum_type){/*{{{*/
Index: /issm/trunk-jpl/src/c/classes/Params/Parameters.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Params/Parameters.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/Params/Parameters.h	(revision 23644)
@@ -55,4 +55,5 @@
 		void  FindParamAndMakePassive(IssmPDouble** pvec,int* pM,int enum_type);
 		void  FindParamInDataset(IssmDouble** pIssmDoublearray,int* pM,int* pN,int dataset_type,int enum_type);
+		IssmDouble FindParam(int enum_type);
 
 		void  SetParam(bool boolean,int enum_type);
Index: /issm/trunk-jpl/src/c/classes/classes.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/classes.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/classes/classes.h	(revision 23644)
@@ -90,5 +90,4 @@
 #include "./Materials/Matlitho.h"
 #include "./Materials/Matestar.h"
-#include "./Materials/Matpar.h"
 
 /*Params: */
Index: /issm/trunk-jpl/src/c/datastructures/DataSet.cpp
===================================================================
--- /issm/trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 23644)
@@ -173,10 +173,4 @@
 				this->AddObject(matestar);
 			}
-			else if(obj_enum==MatparEnum){
-				Matpar* matpar=NULL;
-				matpar=new Matpar();
-				matpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-				this->AddObject(matpar);
-			}
 			else if(obj_enum==SpcStaticEnum){
 				SpcStatic* spcstatic=NULL;
Index: /issm/trunk-jpl/src/c/main/esmfbinders.cpp
===================================================================
--- /issm/trunk-jpl/src/c/main/esmfbinders.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/main/esmfbinders.cpp	(revision 23644)
@@ -72,5 +72,5 @@
 
 						/*Recover rho_ice: */
-						rho_ice=element->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+						rho_ice=element->FindParam(MaterialsRhoIceEnum);
 
 						/*Recover area of element: */
Index: /issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp	(revision 23644)
@@ -8,55 +8,31 @@
 
 void InputUpdateFromConstantx(FemModel* femmodel,bool constant, int name){
-
-	int i;
 	if(VerboseModule()) _printf0_("   Input updates from constant\n");
 
 	/*Elements and loads drive the update: */
-	for(i=0;i<femmodel->elements->Size();i++){
+	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
 		element->InputUpdateFromConstant(constant,name);
-	}
-
-	for(i=0;i<femmodel->materials->Size();i++){
-		Material* material=(Material*)femmodel->materials->GetObjectByOffset(i);
-		if(material->ObjectEnum()==MatparEnum){
-			((Matpar*)material)->InputUpdateFromConstant(constant,name);
-		}
 	}
 }
 void InputUpdateFromConstantx(FemModel* femmodel,int constant, int name){
 
-	int i;
 	if(VerboseModule()) _printf0_("   Input updates from constant\n");
 
 	/*Elements and loads drive the update: */
-	for(i=0;i<femmodel->elements->Size();i++){
+	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
 		element->InputUpdateFromConstant(constant,name);
-	}
-	for(i=0;i<femmodel->materials->Size();i++){
-		Material* material=(Material*)femmodel->materials->GetObjectByOffset(i);
-		if(material->ObjectEnum()==MatparEnum){
-			((Matpar*)material)->InputUpdateFromConstant(constant,name);
-		}
 	}
 }
 void InputUpdateFromConstantx(FemModel* femmodel,IssmDouble constant, int name){
 
-	int i;
 	if(VerboseModule()) _printf0_("   Input updates from constant\n");
 
 	/*Elements and loads drive the update: */
-	for(i=0;i<femmodel->elements->Size();i++){
+	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
 		element->InputUpdateFromConstant(constant,name);
 	}
-	for(i=0;i<femmodel->materials->Size();i++){
-		Material* material=(Material*)femmodel->materials->GetObjectByOffset(i);
-		if(material->ObjectEnum()==MatparEnum){
-			((Matpar*)material)->InputUpdateFromConstant(constant,name);
-		}
-	}
-
 }
 void InputUpdateFromConstantx(Elements* elements,IssmDouble constant, int name){
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 23644)
@@ -254,9 +254,4 @@
 	/*Free data: */
 	iomodel->DeleteData(3,"md.material.rheology_B","md.material.rheology_n","md.damage.D");
-
-	/*Add new constant material property to materials, at the end: */
-	materials->AddObject(new Matpar(iomodel));//put it at the end of the materials
-
-
 }/*}}}*/
 void CreateVertices(Elements* elements,Vertices* vertices,IoModel* iomodel,int solution_type,bool isamr){/*{{{*/
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 23644)
@@ -19,5 +19,5 @@
 
 	int         i,j,m,k;
-	int         numoutputs,materialtype,smb_model,basalforcing_model,timestepping_type;
+	int         numoutputs,basalforcing_model,timestepping_type;
 	char**      requestedoutputs = NULL;
 	char*       fieldname = NULL;
@@ -272,9 +272,114 @@
 	iomodel->DeleteData(&requestedoutputs,numoutputs,"md.steadystate.requested_outputs");
 
-	iomodel->FindConstant(&materialtype,"md.materials.type");
-	if(materialtype==MatdamageiceEnum || materialtype==MaticeEnum || materialtype==MatenhancediceEnum){
-		parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_ice",MaterialsRhoIceEnum));
-	}
-	if(materialtype==MatdamageiceEnum){
+	int materialstype;
+	iomodel->FindConstant(&materialstype,"md.materials.type");
+	switch(materialstype){
+		case MaticeEnum:
+		case MatdamageiceEnum:
+		case MatenhancediceEnum:
+		case MatestarEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_ice",MaterialsRhoIceEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_water",MaterialsRhoSeawaterEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_freshwater",MaterialsRhoFreshwaterEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.mu_water",MaterialsMuWaterEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.heatcapacity",MaterialsHeatcapacityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.thermalconductivity",MaterialsThermalconductivityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.temperateiceconductivity",MaterialsTemperateiceconductivityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.latentheat",MaterialsLatentheatEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.beta",MaterialsBetaEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.meltingpoint",MaterialsMeltingpointEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.constants.referencetemperature",ConstantsReferencetemperatureEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.mixed_layer_capacity",MaterialsMixedLayerCapacityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.thermal_exchange_velocity",MaterialsThermalExchangeVelocityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.constants.g",ConstantsGEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.rheology_law",MaterialsRheologyLawEnum));
+
+			/*gia: */
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.lithosphere_shear_modulus",MaterialsLithosphereShearModulusEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.lithosphere_density",MaterialsLithosphereDensityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.mantle_shear_modulus",MaterialsMantleShearModulusEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.mantle_density",MaterialsMantleDensityEnum));
+
+			/*slr:*/
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
+			break;
+		default:
+			_error_("Material "<< EnumToStringx(materialstype) <<" not supported yet");
+	}
+
+	int smb_model;
+	iomodel->FindConstant(&smb_model,"md.smb.model");
+	switch(smb_model){
+		case SMBforcingEnum:
+		case SMBgradientsEnum:
+		case SMBgradientselaEnum:
+		case SMBhenningEnum:
+		case SMBcomponentsEnum:
+		case SMBmeltcomponentsEnum:
+		case SMBgradientscomponentsEnum:
+			/*Nothing to add*/
+			break;
+		case SMBgembEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIce",SmbAIceEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aSnow",SmbASnowEnum));
+			break;
+		case SMBpddEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.desfac",SmbDesfacEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlaps",SmbRlapsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlapslgm",SmbRlapslgmEnum));
+			break;
+		case SMBpddSicopolisEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.desfac",SmbDesfacEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlaps",SmbRlapsEnum));
+			break;
+		case SMBd18opddEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.desfac",SmbDesfacEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlaps",SmbRlapsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlapslgm",SmbRlapslgmEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.dpermil",SmbDpermilEnum));
+			break;
+		case SMBsemicEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.desfac",SmbDesfacEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlaps",SmbRlapsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rdl",SmbRdlEnum));
+			break;
+		default:
+			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+	}
+
+	int hydrology_model;
+	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
+	if(hydrology_model==HydrologydcEnum){
+		parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.sediment_compressibility",HydrologydcSedimentCompressibilityEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.sediment_porosity",HydrologydcSedimentPorosityEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.sediment_thickness",HydrologydcSedimentThicknessEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.water_compressibility",HydrologydcWaterCompressibilityEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.isefficientlayer",HydrologydcIsefficientlayerEnum));
+
+		bool isefficientlayer;
+		iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer");
+		if(isefficientlayer){
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_compressibility",HydrologydcEplCompressibilityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_porosity",HydrologydcEplPorosityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_initial_thickness",HydrologydcEplInitialThicknessEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_colapse_thickness",HydrologydcEplColapseThicknessEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_max_thickness",HydrologydcEplMaxThicknessEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_conductivity",HydrologydcEplConductivityEnum));
+		}
+	}
+	else if(hydrology_model==HydrologyshreveEnum){
+		/*Nothing to add*/
+	}
+	else if(hydrology_model==HydrologyshaktiEnum){
+		/*Nothing to add*/
+	}
+	else if(hydrology_model==HydrologypismEnum){
+		/*Nothing to add*/
+	}
+	else{
+		_error_("Hydrology model "<<EnumToStringx(hydrology_model)<<" not supported yet");
+	}
+
+	if(materialstype==MatdamageiceEnum){
 		iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.damage.requested_outputs");
 		parameters->AddObject(new IntParam(DamageEvolutionNumRequestedOutputsEnum,numoutputs));
Index: /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 23644)
@@ -41,6 +41,6 @@
 
 		/*Get material parameters :*/
-		rho_ice=element->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-		rho_water=element->matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+		rho_ice=element->FindParam(MaterialsRhoIceEnum);
+		rho_water=element->FindParam(MaterialsRhoFreshwaterEnum);
 
 		/* Get constants */
Index: /issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 23644)
@@ -71,5 +71,5 @@
 	}
 
-	if(VerboseModule()) _printf0_("   Generating matrices\n");
+	if(VerboseModule()) _printf0_("   Assembling matrices\n");
 
 	/*Fill stiffness matrix and load vector from elements*/
Index: /issm/trunk-jpl/src/c/shared/Elements/elements.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/elements.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/shared/Elements/elements.h	(revision 23644)
@@ -44,4 +44,7 @@
 IssmDouble StressIntensityIntegralWeight(IssmDouble depth, IssmDouble water_depth, IssmDouble thickness);
 
+/*Enthalphy*/
+void EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
+
 /*Print arrays*/
 void printarray(IssmPDouble* array,int lines,int cols=1);
Index: /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 23643)
+++ /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 23644)
@@ -93,4 +93,6 @@
 	CalvingMinthicknessEnum,
 	ConfigurationTypeEnum,
+	ConstantsGEnum,
+	ConstantsReferencetemperatureEnum,
 	ConstantsYtsEnum,
 	DamageC1Enum,
@@ -138,8 +140,18 @@
 	HydrologydcEplflipLockEnum,
 	HydrologydcEplThickCompEnum,
+	HydrologydcEplColapseThicknessEnum,
+	HydrologydcEplCompressibilityEnum,
+	HydrologydcEplConductivityEnum,
+	HydrologydcEplInitialThicknessEnum,
+	HydrologydcEplMaxThicknessEnum,
+	HydrologydcEplPorosityEnum,
 	HydrologydcIsefficientlayerEnum,
 	HydrologydcLeakageFactorEnum,
+	HydrologydcSedimentCompressibilityEnum,
+	HydrologydcSedimentPorosityEnum,
+	HydrologydcSedimentThicknessEnum,
 	HydrologydcMaxIterEnum,
 	HydrologydcPenaltyFactorEnum,
+	HydrologydcWaterCompressibilityEnum,
 	HydrologydcPenaltyLockEnum,
 	HydrologydcRelTolEnum,
@@ -208,5 +220,22 @@
 	MasstransportRequestedOutputsEnum,
 	MasstransportStabilizationEnum,
+	MaterialsBetaEnum,
+	MaterialsEarthDensityEnum,
+	MaterialsHeatcapacityEnum,
+	MaterialsLatentheatEnum,
+	MaterialsLithosphereDensityEnum,
+	MaterialsLithosphereShearModulusEnum,
+	MaterialsMantleDensityEnum,
+	MaterialsMantleShearModulusEnum,
+	MaterialsMeltingpointEnum,
+	MaterialsMixedLayerCapacityEnum,
+	MaterialsMuWaterEnum,
+	MaterialsRheologyLawEnum,
 	MaterialsRhoIceEnum,
+	MaterialsRhoFreshwaterEnum,
+	MaterialsRhoSeawaterEnum,
+	MaterialsTemperateiceconductivityEnum,
+	MaterialsThermalconductivityEnum,
+	MaterialsThermalExchangeVelocityEnum,
 	MeltingOffsetEnum,
 	MeshAverageVertexConnectivityEnum,
@@ -280,4 +309,6 @@
 	SmbAIceEnum,
 	SmbAIdxEnum,
+	SmbDesfacEnum,
+	SmbDpermilEnum,
 	SmbDsnowIdxEnum,
 	SmbASnowEnum,
@@ -309,4 +340,7 @@
 	SmbPfacEnum,
 	SmbRequestedOutputsEnum,
+	SmbRdlEnum,
+	SmbRlapsEnum,
+	SmbRlapslgmEnum,
 	SmbRunoffaltiEnum,
 	SmbRunoffgradEnum,
@@ -727,6 +761,4 @@
 	ClosedEnum,
 	ColinearEnum,
-	ConstantsGEnum,
-	ConstantsReferencetemperatureEnum,
 	ConstraintsEnum,
 	ContactEnum,
@@ -822,17 +854,7 @@
 	HydrologyDCEfficientAnalysisEnum,
 	HydrologydcEnum,
-	HydrologydcEplColapseThicknessEnum,
-	HydrologydcEplCompressibilityEnum,
-	HydrologydcEplConductivityEnum,
-	HydrologydcEplInitialThicknessEnum,
-	HydrologydcEplMaxThicknessEnum,
-	HydrologydcEplPorosityEnum,
 	HydrologydcEplThicknessStackedEnum,
 	HydrologydcEplThicknessEnum,
 	HydrologyDCInefficientAnalysisEnum,
-	HydrologydcSedimentCompressibilityEnum,
-	HydrologydcSedimentPorosityEnum,
-	HydrologydcSedimentThicknessEnum,
-	HydrologydcWaterCompressibilityEnum,
 	HydrologyShreveAnalysisEnum,
 	HydrologyshreveEnum,
@@ -893,26 +915,8 @@
 	MatdamageiceEnum,
 	MatenhancediceEnum,
-	MaterialsBetaEnum,
-	MaterialsEarthDensityEnum,
+	MatestarEnum,
 	MaterialsEnum,
-	MaterialsHeatcapacityEnum,
-	MaterialsLatentheatEnum,
-	MaterialsLithosphereDensityEnum,
-	MaterialsLithosphereShearModulusEnum,
-	MaterialsMantleDensityEnum,
-	MaterialsMantleShearModulusEnum,
-	MaterialsMeltingpointEnum,
-	MaterialsMixedLayerCapacityEnum,
-	MaterialsMuWaterEnum,
-	MaterialsRheologyLawEnum,
-	MaterialsRhoFreshwaterEnum,
-	MaterialsRhoSeawaterEnum,
-	MaterialsTemperateiceconductivityEnum,
-	MaterialsThermalconductivityEnum,
-	MaterialsThermalExchangeVelocityEnum,
-	MatestarEnum,
 	MaticeEnum,
 	MatlithoEnum,
-	MatparEnum,
 	MatrixParamEnum,
 	MaxAbsVxEnum,
@@ -1106,6 +1110,4 @@
 	SMBcomponentsEnum,
 	SMBd18opddEnum,
-	SmbDesfacEnum,
-	SmbDpermilEnum,
 	SmbDzAddEnum,
 	SmbFACEnum,
@@ -1121,7 +1123,4 @@
 	SMBpddSicopolisEnum,
 	SMBgradientscomponentsEnum,
-	SmbRdlEnum,
-	SmbRlapsEnum,
-	SmbRlapslgmEnum,
 	SmbSolutionEnum,
 	SmoothAnalysisEnum,
Index: /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 23644)
@@ -101,4 +101,6 @@
 		case CalvingMinthicknessEnum : return "CalvingMinthickness";
 		case ConfigurationTypeEnum : return "ConfigurationType";
+		case ConstantsGEnum : return "ConstantsG";
+		case ConstantsReferencetemperatureEnum : return "ConstantsReferencetemperature";
 		case ConstantsYtsEnum : return "ConstantsYts";
 		case DamageC1Enum : return "DamageC1";
@@ -146,8 +148,18 @@
 		case HydrologydcEplflipLockEnum : return "HydrologydcEplflipLock";
 		case HydrologydcEplThickCompEnum : return "HydrologydcEplThickComp";
+		case HydrologydcEplColapseThicknessEnum : return "HydrologydcEplColapseThickness";
+		case HydrologydcEplCompressibilityEnum : return "HydrologydcEplCompressibility";
+		case HydrologydcEplConductivityEnum : return "HydrologydcEplConductivity";
+		case HydrologydcEplInitialThicknessEnum : return "HydrologydcEplInitialThickness";
+		case HydrologydcEplMaxThicknessEnum : return "HydrologydcEplMaxThickness";
+		case HydrologydcEplPorosityEnum : return "HydrologydcEplPorosity";
 		case HydrologydcIsefficientlayerEnum : return "HydrologydcIsefficientlayer";
 		case HydrologydcLeakageFactorEnum : return "HydrologydcLeakageFactor";
+		case HydrologydcSedimentCompressibilityEnum : return "HydrologydcSedimentCompressibility";
+		case HydrologydcSedimentPorosityEnum : return "HydrologydcSedimentPorosity";
+		case HydrologydcSedimentThicknessEnum : return "HydrologydcSedimentThickness";
 		case HydrologydcMaxIterEnum : return "HydrologydcMaxIter";
 		case HydrologydcPenaltyFactorEnum : return "HydrologydcPenaltyFactor";
+		case HydrologydcWaterCompressibilityEnum : return "HydrologydcWaterCompressibility";
 		case HydrologydcPenaltyLockEnum : return "HydrologydcPenaltyLock";
 		case HydrologydcRelTolEnum : return "HydrologydcRelTol";
@@ -216,5 +228,22 @@
 		case MasstransportRequestedOutputsEnum : return "MasstransportRequestedOutputs";
 		case MasstransportStabilizationEnum : return "MasstransportStabilization";
+		case MaterialsBetaEnum : return "MaterialsBeta";
+		case MaterialsEarthDensityEnum : return "MaterialsEarthDensity";
+		case MaterialsHeatcapacityEnum : return "MaterialsHeatcapacity";
+		case MaterialsLatentheatEnum : return "MaterialsLatentheat";
+		case MaterialsLithosphereDensityEnum : return "MaterialsLithosphereDensity";
+		case MaterialsLithosphereShearModulusEnum : return "MaterialsLithosphereShearModulus";
+		case MaterialsMantleDensityEnum : return "MaterialsMantleDensity";
+		case MaterialsMantleShearModulusEnum : return "MaterialsMantleShearModulus";
+		case MaterialsMeltingpointEnum : return "MaterialsMeltingpoint";
+		case MaterialsMixedLayerCapacityEnum : return "MaterialsMixedLayerCapacity";
+		case MaterialsMuWaterEnum : return "MaterialsMuWater";
+		case MaterialsRheologyLawEnum : return "MaterialsRheologyLaw";
 		case MaterialsRhoIceEnum : return "MaterialsRhoIce";
+		case MaterialsRhoFreshwaterEnum : return "MaterialsRhoFreshwater";
+		case MaterialsRhoSeawaterEnum : return "MaterialsRhoSeawater";
+		case MaterialsTemperateiceconductivityEnum : return "MaterialsTemperateiceconductivity";
+		case MaterialsThermalconductivityEnum : return "MaterialsThermalconductivity";
+		case MaterialsThermalExchangeVelocityEnum : return "MaterialsThermalExchangeVelocity";
 		case MeltingOffsetEnum : return "MeltingOffset";
 		case MeshAverageVertexConnectivityEnum : return "MeshAverageVertexConnectivity";
@@ -288,4 +317,6 @@
 		case SmbAIceEnum : return "SmbAIce";
 		case SmbAIdxEnum : return "SmbAIdx";
+		case SmbDesfacEnum : return "SmbDesfac";
+		case SmbDpermilEnum : return "SmbDpermil";
 		case SmbDsnowIdxEnum : return "SmbDsnowIdx";
 		case SmbASnowEnum : return "SmbASnow";
@@ -317,4 +348,7 @@
 		case SmbPfacEnum : return "SmbPfac";
 		case SmbRequestedOutputsEnum : return "SmbRequestedOutputs";
+		case SmbRdlEnum : return "SmbRdl";
+		case SmbRlapsEnum : return "SmbRlaps";
+		case SmbRlapslgmEnum : return "SmbRlapslgm";
 		case SmbRunoffaltiEnum : return "SmbRunoffalti";
 		case SmbRunoffgradEnum : return "SmbRunoffgrad";
@@ -731,6 +765,4 @@
 		case ClosedEnum : return "Closed";
 		case ColinearEnum : return "Colinear";
-		case ConstantsGEnum : return "ConstantsG";
-		case ConstantsReferencetemperatureEnum : return "ConstantsReferencetemperature";
 		case ConstraintsEnum : return "Constraints";
 		case ContactEnum : return "Contact";
@@ -826,17 +858,7 @@
 		case HydrologyDCEfficientAnalysisEnum : return "HydrologyDCEfficientAnalysis";
 		case HydrologydcEnum : return "Hydrologydc";
-		case HydrologydcEplColapseThicknessEnum : return "HydrologydcEplColapseThickness";
-		case HydrologydcEplCompressibilityEnum : return "HydrologydcEplCompressibility";
-		case HydrologydcEplConductivityEnum : return "HydrologydcEplConductivity";
-		case HydrologydcEplInitialThicknessEnum : return "HydrologydcEplInitialThickness";
-		case HydrologydcEplMaxThicknessEnum : return "HydrologydcEplMaxThickness";
-		case HydrologydcEplPorosityEnum : return "HydrologydcEplPorosity";
 		case HydrologydcEplThicknessStackedEnum : return "HydrologydcEplThicknessStacked";
 		case HydrologydcEplThicknessEnum : return "HydrologydcEplThickness";
 		case HydrologyDCInefficientAnalysisEnum : return "HydrologyDCInefficientAnalysis";
-		case HydrologydcSedimentCompressibilityEnum : return "HydrologydcSedimentCompressibility";
-		case HydrologydcSedimentPorosityEnum : return "HydrologydcSedimentPorosity";
-		case HydrologydcSedimentThicknessEnum : return "HydrologydcSedimentThickness";
-		case HydrologydcWaterCompressibilityEnum : return "HydrologydcWaterCompressibility";
 		case HydrologyShreveAnalysisEnum : return "HydrologyShreveAnalysis";
 		case HydrologyshreveEnum : return "Hydrologyshreve";
@@ -897,26 +919,8 @@
 		case MatdamageiceEnum : return "Matdamageice";
 		case MatenhancediceEnum : return "Matenhancedice";
-		case MaterialsBetaEnum : return "MaterialsBeta";
-		case MaterialsEarthDensityEnum : return "MaterialsEarthDensity";
+		case MatestarEnum : return "Matestar";
 		case MaterialsEnum : return "Materials";
-		case MaterialsHeatcapacityEnum : return "MaterialsHeatcapacity";
-		case MaterialsLatentheatEnum : return "MaterialsLatentheat";
-		case MaterialsLithosphereDensityEnum : return "MaterialsLithosphereDensity";
-		case MaterialsLithosphereShearModulusEnum : return "MaterialsLithosphereShearModulus";
-		case MaterialsMantleDensityEnum : return "MaterialsMantleDensity";
-		case MaterialsMantleShearModulusEnum : return "MaterialsMantleShearModulus";
-		case MaterialsMeltingpointEnum : return "MaterialsMeltingpoint";
-		case MaterialsMixedLayerCapacityEnum : return "MaterialsMixedLayerCapacity";
-		case MaterialsMuWaterEnum : return "MaterialsMuWater";
-		case MaterialsRheologyLawEnum : return "MaterialsRheologyLaw";
-		case MaterialsRhoFreshwaterEnum : return "MaterialsRhoFreshwater";
-		case MaterialsRhoSeawaterEnum : return "MaterialsRhoSeawater";
-		case MaterialsTemperateiceconductivityEnum : return "MaterialsTemperateiceconductivity";
-		case MaterialsThermalconductivityEnum : return "MaterialsThermalconductivity";
-		case MaterialsThermalExchangeVelocityEnum : return "MaterialsThermalExchangeVelocity";
-		case MatestarEnum : return "Matestar";
 		case MaticeEnum : return "Matice";
 		case MatlithoEnum : return "Matlitho";
-		case MatparEnum : return "Matpar";
 		case MatrixParamEnum : return "MatrixParam";
 		case MaxAbsVxEnum : return "MaxAbsVx";
@@ -1110,6 +1114,4 @@
 		case SMBcomponentsEnum : return "SMBcomponents";
 		case SMBd18opddEnum : return "SMBd18opdd";
-		case SmbDesfacEnum : return "SmbDesfac";
-		case SmbDpermilEnum : return "SmbDpermil";
 		case SmbDzAddEnum : return "SmbDzAdd";
 		case SmbFACEnum : return "SmbFAC";
@@ -1125,7 +1127,4 @@
 		case SMBpddSicopolisEnum : return "SMBpddSicopolis";
 		case SMBgradientscomponentsEnum : return "SMBgradientscomponents";
-		case SmbRdlEnum : return "SmbRdl";
-		case SmbRlapsEnum : return "SmbRlaps";
-		case SmbRlapslgmEnum : return "SmbRlapslgm";
 		case SmbSolutionEnum : return "SmbSolution";
 		case SmoothAnalysisEnum : return "SmoothAnalysis";
Index: /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 23643)
+++ /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 23644)
@@ -101,4 +101,6 @@
 	      else if (strcmp(name,"CalvingMinthickness")==0) return CalvingMinthicknessEnum;
 	      else if (strcmp(name,"ConfigurationType")==0) return ConfigurationTypeEnum;
+	      else if (strcmp(name,"ConstantsG")==0) return ConstantsGEnum;
+	      else if (strcmp(name,"ConstantsReferencetemperature")==0) return ConstantsReferencetemperatureEnum;
 	      else if (strcmp(name,"ConstantsYts")==0) return ConstantsYtsEnum;
 	      else if (strcmp(name,"DamageC1")==0) return DamageC1Enum;
@@ -135,10 +137,10 @@
 	      else if (strcmp(name,"FrictionF")==0) return FrictionFEnum;
 	      else if (strcmp(name,"FrictionGamma")==0) return FrictionGammaEnum;
-	      else if (strcmp(name,"FrictionLaw")==0) return FrictionLawEnum;
-	      else if (strcmp(name,"FrictionPseudoplasticityExponent")==0) return FrictionPseudoplasticityExponentEnum;
          else stage=2;
    }
    if(stage==2){
-	      if (strcmp(name,"FrictionThresholdSpeed")==0) return FrictionThresholdSpeedEnum;
+	      if (strcmp(name,"FrictionLaw")==0) return FrictionLawEnum;
+	      else if (strcmp(name,"FrictionPseudoplasticityExponent")==0) return FrictionPseudoplasticityExponentEnum;
+	      else if (strcmp(name,"FrictionThresholdSpeed")==0) return FrictionThresholdSpeedEnum;
 	      else if (strcmp(name,"FrictionDelta")==0) return FrictionDeltaEnum;
 	      else if (strcmp(name,"FrictionVoidRatio")==0) return FrictionVoidRatioEnum;
@@ -149,8 +151,18 @@
 	      else if (strcmp(name,"HydrologydcEplflipLock")==0) return HydrologydcEplflipLockEnum;
 	      else if (strcmp(name,"HydrologydcEplThickComp")==0) return HydrologydcEplThickCompEnum;
+	      else if (strcmp(name,"HydrologydcEplColapseThickness")==0) return HydrologydcEplColapseThicknessEnum;
+	      else if (strcmp(name,"HydrologydcEplCompressibility")==0) return HydrologydcEplCompressibilityEnum;
+	      else if (strcmp(name,"HydrologydcEplConductivity")==0) return HydrologydcEplConductivityEnum;
+	      else if (strcmp(name,"HydrologydcEplInitialThickness")==0) return HydrologydcEplInitialThicknessEnum;
+	      else if (strcmp(name,"HydrologydcEplMaxThickness")==0) return HydrologydcEplMaxThicknessEnum;
+	      else if (strcmp(name,"HydrologydcEplPorosity")==0) return HydrologydcEplPorosityEnum;
 	      else if (strcmp(name,"HydrologydcIsefficientlayer")==0) return HydrologydcIsefficientlayerEnum;
 	      else if (strcmp(name,"HydrologydcLeakageFactor")==0) return HydrologydcLeakageFactorEnum;
+	      else if (strcmp(name,"HydrologydcSedimentCompressibility")==0) return HydrologydcSedimentCompressibilityEnum;
+	      else if (strcmp(name,"HydrologydcSedimentPorosity")==0) return HydrologydcSedimentPorosityEnum;
+	      else if (strcmp(name,"HydrologydcSedimentThickness")==0) return HydrologydcSedimentThicknessEnum;
 	      else if (strcmp(name,"HydrologydcMaxIter")==0) return HydrologydcMaxIterEnum;
 	      else if (strcmp(name,"HydrologydcPenaltyFactor")==0) return HydrologydcPenaltyFactorEnum;
+	      else if (strcmp(name,"HydrologydcWaterCompressibility")==0) return HydrologydcWaterCompressibilityEnum;
 	      else if (strcmp(name,"HydrologydcPenaltyLock")==0) return HydrologydcPenaltyLockEnum;
 	      else if (strcmp(name,"HydrologydcRelTol")==0) return HydrologydcRelTolEnum;
@@ -219,5 +231,22 @@
 	      else if (strcmp(name,"MasstransportRequestedOutputs")==0) return MasstransportRequestedOutputsEnum;
 	      else if (strcmp(name,"MasstransportStabilization")==0) return MasstransportStabilizationEnum;
+	      else if (strcmp(name,"MaterialsBeta")==0) return MaterialsBetaEnum;
+	      else if (strcmp(name,"MaterialsEarthDensity")==0) return MaterialsEarthDensityEnum;
+	      else if (strcmp(name,"MaterialsHeatcapacity")==0) return MaterialsHeatcapacityEnum;
+	      else if (strcmp(name,"MaterialsLatentheat")==0) return MaterialsLatentheatEnum;
+	      else if (strcmp(name,"MaterialsLithosphereDensity")==0) return MaterialsLithosphereDensityEnum;
+	      else if (strcmp(name,"MaterialsLithosphereShearModulus")==0) return MaterialsLithosphereShearModulusEnum;
+	      else if (strcmp(name,"MaterialsMantleDensity")==0) return MaterialsMantleDensityEnum;
+	      else if (strcmp(name,"MaterialsMantleShearModulus")==0) return MaterialsMantleShearModulusEnum;
+	      else if (strcmp(name,"MaterialsMeltingpoint")==0) return MaterialsMeltingpointEnum;
+	      else if (strcmp(name,"MaterialsMixedLayerCapacity")==0) return MaterialsMixedLayerCapacityEnum;
+	      else if (strcmp(name,"MaterialsMuWater")==0) return MaterialsMuWaterEnum;
+	      else if (strcmp(name,"MaterialsRheologyLaw")==0) return MaterialsRheologyLawEnum;
 	      else if (strcmp(name,"MaterialsRhoIce")==0) return MaterialsRhoIceEnum;
+	      else if (strcmp(name,"MaterialsRhoFreshwater")==0) return MaterialsRhoFreshwaterEnum;
+	      else if (strcmp(name,"MaterialsRhoSeawater")==0) return MaterialsRhoSeawaterEnum;
+	      else if (strcmp(name,"MaterialsTemperateiceconductivity")==0) return MaterialsTemperateiceconductivityEnum;
+	      else if (strcmp(name,"MaterialsThermalconductivity")==0) return MaterialsThermalconductivityEnum;
+	      else if (strcmp(name,"MaterialsThermalExchangeVelocity")==0) return MaterialsThermalExchangeVelocityEnum;
 	      else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
 	      else if (strcmp(name,"MeshAverageVertexConnectivity")==0) return MeshAverageVertexConnectivityEnum;
@@ -231,5 +260,8 @@
 	      else if (strcmp(name,"OceanGridNy")==0) return OceanGridNyEnum;
 	      else if (strcmp(name,"OceanGridX")==0) return OceanGridXEnum;
-	      else if (strcmp(name,"OceanGridY")==0) return OceanGridYEnum;
+         else stage=3;
+   }
+   if(stage==3){
+	      if (strcmp(name,"OceanGridY")==0) return OceanGridYEnum;
 	      else if (strcmp(name,"OutputBufferPointer")==0) return OutputBufferPointerEnum;
 	      else if (strcmp(name,"OutputBufferSizePointer")==0) return OutputBufferSizePointerEnum;
@@ -260,8 +292,5 @@
 	      else if (strcmp(name,"SealevelriseFluidLove")==0) return SealevelriseFluidLoveEnum;
 	      else if (strcmp(name,"SealevelriseGElastic")==0) return SealevelriseGElasticEnum;
-         else stage=3;
-   }
-   if(stage==3){
-	      if (strcmp(name,"SealevelriseGeodetic")==0) return SealevelriseGeodeticEnum;
+	      else if (strcmp(name,"SealevelriseGeodetic")==0) return SealevelriseGeodeticEnum;
 	      else if (strcmp(name,"SealevelriseGeodeticRunFrequency")==0) return SealevelriseGeodeticRunFrequencyEnum;
 	      else if (strcmp(name,"SealevelriseHElastic")==0) return SealevelriseHElasticEnum;
@@ -294,4 +323,6 @@
 	      else if (strcmp(name,"SmbAIce")==0) return SmbAIceEnum;
 	      else if (strcmp(name,"SmbAIdx")==0) return SmbAIdxEnum;
+	      else if (strcmp(name,"SmbDesfac")==0) return SmbDesfacEnum;
+	      else if (strcmp(name,"SmbDpermil")==0) return SmbDpermilEnum;
 	      else if (strcmp(name,"SmbDsnowIdx")==0) return SmbDsnowIdxEnum;
 	      else if (strcmp(name,"SmbASnow")==0) return SmbASnowEnum;
@@ -323,4 +354,7 @@
 	      else if (strcmp(name,"SmbPfac")==0) return SmbPfacEnum;
 	      else if (strcmp(name,"SmbRequestedOutputs")==0) return SmbRequestedOutputsEnum;
+	      else if (strcmp(name,"SmbRdl")==0) return SmbRdlEnum;
+	      else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
+	      else if (strcmp(name,"SmbRlapslgm")==0) return SmbRlapslgmEnum;
 	      else if (strcmp(name,"SmbRunoffalti")==0) return SmbRunoffaltiEnum;
 	      else if (strcmp(name,"SmbRunoffgrad")==0) return SmbRunoffgradEnum;
@@ -349,5 +383,8 @@
 	      else if (strcmp(name,"StressbalanceRestol")==0) return StressbalanceRestolEnum;
 	      else if (strcmp(name,"StressbalanceRiftPenaltyThreshold")==0) return StressbalanceRiftPenaltyThresholdEnum;
-	      else if (strcmp(name,"StressbalanceShelfDampening")==0) return StressbalanceShelfDampeningEnum;
+         else stage=4;
+   }
+   if(stage==4){
+	      if (strcmp(name,"StressbalanceShelfDampening")==0) return StressbalanceShelfDampeningEnum;
 	      else if (strcmp(name,"ThermalIsdynamicbasalspc")==0) return ThermalIsdynamicbasalspcEnum;
 	      else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
@@ -383,8 +420,5 @@
 	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
 	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
-         else stage=4;
-   }
-   if(stage==4){
-	      if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
 	      else if (strcmp(name,"TransientIsslr")==0) return TransientIsslrEnum;
@@ -472,5 +506,8 @@
 	      else if (strcmp(name,"FrictionEffectivePressure")==0) return FrictionEffectivePressureEnum;
 	      else if (strcmp(name,"FrictionM")==0) return FrictionMEnum;
-	      else if (strcmp(name,"FrictionP")==0) return FrictionPEnum;
+         else stage=5;
+   }
+   if(stage==5){
+	      if (strcmp(name,"FrictionP")==0) return FrictionPEnum;
 	      else if (strcmp(name,"FrictionPressureAdjustedTemperature")==0) return FrictionPressureAdjustedTemperatureEnum;
 	      else if (strcmp(name,"FrictionQ")==0) return FrictionQEnum;
@@ -506,8 +543,5 @@
 	      else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
 	      else if (strcmp(name,"HydrologyDrainageRate")==0) return HydrologyDrainageRateEnum;
-         else stage=5;
-   }
-   if(stage==5){
-	      if (strcmp(name,"Ice")==0) return IceEnum;
+	      else if (strcmp(name,"Ice")==0) return IceEnum;
 	      else if (strcmp(name,"IceMaskNodeActivation")==0) return IceMaskNodeActivationEnum;
 	      else if (strcmp(name,"Input")==0) return InputEnum;
@@ -595,5 +629,8 @@
 	      else if (strcmp(name,"SmbDzMin")==0) return SmbDzMinEnum;
 	      else if (strcmp(name,"SmbDzTop")==0) return SmbDzTopEnum;
-	      else if (strcmp(name,"SmbEAir")==0) return SmbEAirEnum;
+         else stage=6;
+   }
+   if(stage==6){
+	      if (strcmp(name,"SmbEAir")==0) return SmbEAirEnum;
 	      else if (strcmp(name,"SmbEC")==0) return SmbECEnum;
 	      else if (strcmp(name,"SmbECini")==0) return SmbECiniEnum;
@@ -629,8 +666,5 @@
 	      else if (strcmp(name,"SmbSmbCorr")==0) return SmbSmbCorrEnum;
 	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
-         else stage=6;
-   }
-   if(stage==6){
-	      if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum;
+	      else if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum;
 	      else if (strcmp(name,"SmbTemperaturesLgm")==0) return SmbTemperaturesLgmEnum;
 	      else if (strcmp(name,"SmbTemperaturesPresentday")==0) return SmbTemperaturesPresentdayEnum;
@@ -718,5 +752,8 @@
 	      else if (strcmp(name,"AndroidFrictionCoefficient")==0) return AndroidFrictionCoefficientEnum;
 	      else if (strcmp(name,"Arrhenius")==0) return ArrheniusEnum;
-	      else if (strcmp(name,"AutodiffJacobian")==0) return AutodiffJacobianEnum;
+         else stage=7;
+   }
+   if(stage==7){
+	      if (strcmp(name,"AutodiffJacobian")==0) return AutodiffJacobianEnum;
 	      else if (strcmp(name,"Balancethickness2Analysis")==0) return Balancethickness2AnalysisEnum;
 	      else if (strcmp(name,"Balancethickness2Solution")==0) return Balancethickness2SolutionEnum;
@@ -746,14 +783,9 @@
 	      else if (strcmp(name,"Closed")==0) return ClosedEnum;
 	      else if (strcmp(name,"Colinear")==0) return ColinearEnum;
-	      else if (strcmp(name,"ConstantsG")==0) return ConstantsGEnum;
-	      else if (strcmp(name,"ConstantsReferencetemperature")==0) return ConstantsReferencetemperatureEnum;
 	      else if (strcmp(name,"Constraints")==0) return ConstraintsEnum;
 	      else if (strcmp(name,"Contact")==0) return ContactEnum;
 	      else if (strcmp(name,"Contour")==0) return ContourEnum;
 	      else if (strcmp(name,"Contours")==0) return ContoursEnum;
-         else stage=7;
-   }
-   if(stage==7){
-	      if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
+	      else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
 	      else if (strcmp(name,"ControlInputValues")==0) return ControlInputValuesEnum;
 	      else if (strcmp(name,"ControlInputMins")==0) return ControlInputMinsEnum;
@@ -843,18 +875,11 @@
 	      else if (strcmp(name,"HydrologyBasalFlux")==0) return HydrologyBasalFluxEnum;
 	      else if (strcmp(name,"HydrologyDCEfficientAnalysis")==0) return HydrologyDCEfficientAnalysisEnum;
-	      else if (strcmp(name,"Hydrologydc")==0) return HydrologydcEnum;
-	      else if (strcmp(name,"HydrologydcEplColapseThickness")==0) return HydrologydcEplColapseThicknessEnum;
-	      else if (strcmp(name,"HydrologydcEplCompressibility")==0) return HydrologydcEplCompressibilityEnum;
-	      else if (strcmp(name,"HydrologydcEplConductivity")==0) return HydrologydcEplConductivityEnum;
-	      else if (strcmp(name,"HydrologydcEplInitialThickness")==0) return HydrologydcEplInitialThicknessEnum;
-	      else if (strcmp(name,"HydrologydcEplMaxThickness")==0) return HydrologydcEplMaxThicknessEnum;
-	      else if (strcmp(name,"HydrologydcEplPorosity")==0) return HydrologydcEplPorosityEnum;
+         else stage=8;
+   }
+   if(stage==8){
+	      if (strcmp(name,"Hydrologydc")==0) return HydrologydcEnum;
 	      else if (strcmp(name,"HydrologydcEplThicknessStacked")==0) return HydrologydcEplThicknessStackedEnum;
 	      else if (strcmp(name,"HydrologydcEplThickness")==0) return HydrologydcEplThicknessEnum;
 	      else if (strcmp(name,"HydrologyDCInefficientAnalysis")==0) return HydrologyDCInefficientAnalysisEnum;
-	      else if (strcmp(name,"HydrologydcSedimentCompressibility")==0) return HydrologydcSedimentCompressibilityEnum;
-	      else if (strcmp(name,"HydrologydcSedimentPorosity")==0) return HydrologydcSedimentPorosityEnum;
-	      else if (strcmp(name,"HydrologydcSedimentThickness")==0) return HydrologydcSedimentThicknessEnum;
-	      else if (strcmp(name,"HydrologydcWaterCompressibility")==0) return HydrologydcWaterCompressibilityEnum;
 	      else if (strcmp(name,"HydrologyShreveAnalysis")==0) return HydrologyShreveAnalysisEnum;
 	      else if (strcmp(name,"Hydrologyshreve")==0) return HydrologyshreveEnum;
@@ -875,8 +900,5 @@
 	      else if (strcmp(name,"Intersect")==0) return IntersectEnum;
 	      else if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
-         else stage=8;
-   }
-   if(stage==8){
-	      if (strcmp(name,"IntInput")==0) return IntInputEnum;
+	      else if (strcmp(name,"IntInput")==0) return IntInputEnum;
 	      else if (strcmp(name,"IntMatExternalResult")==0) return IntMatExternalResultEnum;
 	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
@@ -918,26 +940,8 @@
 	      else if (strcmp(name,"Matdamageice")==0) return MatdamageiceEnum;
 	      else if (strcmp(name,"Matenhancedice")==0) return MatenhancediceEnum;
-	      else if (strcmp(name,"MaterialsBeta")==0) return MaterialsBetaEnum;
-	      else if (strcmp(name,"MaterialsEarthDensity")==0) return MaterialsEarthDensityEnum;
+	      else if (strcmp(name,"Matestar")==0) return MatestarEnum;
 	      else if (strcmp(name,"Materials")==0) return MaterialsEnum;
-	      else if (strcmp(name,"MaterialsHeatcapacity")==0) return MaterialsHeatcapacityEnum;
-	      else if (strcmp(name,"MaterialsLatentheat")==0) return MaterialsLatentheatEnum;
-	      else if (strcmp(name,"MaterialsLithosphereDensity")==0) return MaterialsLithosphereDensityEnum;
-	      else if (strcmp(name,"MaterialsLithosphereShearModulus")==0) return MaterialsLithosphereShearModulusEnum;
-	      else if (strcmp(name,"MaterialsMantleDensity")==0) return MaterialsMantleDensityEnum;
-	      else if (strcmp(name,"MaterialsMantleShearModulus")==0) return MaterialsMantleShearModulusEnum;
-	      else if (strcmp(name,"MaterialsMeltingpoint")==0) return MaterialsMeltingpointEnum;
-	      else if (strcmp(name,"MaterialsMixedLayerCapacity")==0) return MaterialsMixedLayerCapacityEnum;
-	      else if (strcmp(name,"MaterialsMuWater")==0) return MaterialsMuWaterEnum;
-	      else if (strcmp(name,"MaterialsRheologyLaw")==0) return MaterialsRheologyLawEnum;
-	      else if (strcmp(name,"MaterialsRhoFreshwater")==0) return MaterialsRhoFreshwaterEnum;
-	      else if (strcmp(name,"MaterialsRhoSeawater")==0) return MaterialsRhoSeawaterEnum;
-	      else if (strcmp(name,"MaterialsTemperateiceconductivity")==0) return MaterialsTemperateiceconductivityEnum;
-	      else if (strcmp(name,"MaterialsThermalconductivity")==0) return MaterialsThermalconductivityEnum;
-	      else if (strcmp(name,"MaterialsThermalExchangeVelocity")==0) return MaterialsThermalExchangeVelocityEnum;
-	      else if (strcmp(name,"Matestar")==0) return MatestarEnum;
 	      else if (strcmp(name,"Matice")==0) return MaticeEnum;
 	      else if (strcmp(name,"Matlitho")==0) return MatlithoEnum;
-	      else if (strcmp(name,"Matpar")==0) return MatparEnum;
 	      else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
 	      else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum;
@@ -994,12 +998,12 @@
 	      else if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
 	      else if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
-	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+         else stage=9;
+   }
+   if(stage==9){
+	      if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
 	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
-         else stage=9;
-   }
-   if(stage==9){
-	      if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
 	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
 	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
@@ -1117,12 +1121,12 @@
 	      else if (strcmp(name,"SealevelNmotion")==0) return SealevelNmotionEnum;
 	      else if (strcmp(name,"SealevelriseAnalysis")==0) return SealevelriseAnalysisEnum;
-	      else if (strcmp(name,"SealevelriseSolution")==0) return SealevelriseSolutionEnum;
+         else stage=10;
+   }
+   if(stage==10){
+	      if (strcmp(name,"SealevelriseSolution")==0) return SealevelriseSolutionEnum;
 	      else if (strcmp(name,"SealevelriseStericRate")==0) return SealevelriseStericRateEnum;
 	      else if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
 	      else if (strcmp(name,"SedimentHeadStacked")==0) return SedimentHeadStackedEnum;
-         else stage=10;
-   }
-   if(stage==10){
-	      if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
+	      else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
 	      else if (strcmp(name,"Seg")==0) return SegEnum;
 	      else if (strcmp(name,"SegInput")==0) return SegInputEnum;
@@ -1137,6 +1141,4 @@
 	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
 	      else if (strcmp(name,"SMBd18opdd")==0) return SMBd18opddEnum;
-	      else if (strcmp(name,"SmbDesfac")==0) return SmbDesfacEnum;
-	      else if (strcmp(name,"SmbDpermil")==0) return SmbDpermilEnum;
 	      else if (strcmp(name,"SmbDzAdd")==0) return SmbDzAddEnum;
 	      else if (strcmp(name,"SmbFAC")==0) return SmbFACEnum;
@@ -1152,7 +1154,4 @@
 	      else if (strcmp(name,"SMBpddSicopolis")==0) return SMBpddSicopolisEnum;
 	      else if (strcmp(name,"SMBgradientscomponents")==0) return SMBgradientscomponentsEnum;
-	      else if (strcmp(name,"SmbRdl")==0) return SmbRdlEnum;
-	      else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
-	      else if (strcmp(name,"SmbRlapslgm")==0) return SmbRlapslgmEnum;
 	      else if (strcmp(name,"SmbSolution")==0) return SmbSolutionEnum;
 	      else if (strcmp(name,"SmoothAnalysis")==0) return SmoothAnalysisEnum;
