Index: /issm/trunk/src/c/Container/Parameters.cpp
===================================================================
--- /issm/trunk/src/c/Container/Parameters.cpp	(revision 9355)
+++ /issm/trunk/src/c/Container/Parameters.cpp	(revision 9356)
@@ -430,4 +430,17 @@
 }
 /*}}}*/
+/*FUNCTION Parameters::UnitConversion(int direction_enum);{{{1*/
+void   Parameters::UnitConversion(int direction_enum){
+
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		param=(Param*)(*object);
+		param->UnitConversion(direction_enum);
+	}
+
+}
+/*}}}*/
 
 /*FUNCTION Parameters::FindParamObject{{{1*/
Index: /issm/trunk/src/c/Container/Parameters.h
===================================================================
--- /issm/trunk/src/c/Container/Parameters.h	(revision 9355)
+++ /issm/trunk/src/c/Container/Parameters.h	(revision 9356)
@@ -54,4 +54,5 @@
 		void  SetParam(Mat mat,int enum_type);
 		void  SetParam(FILE* fid,int enum_type);
+		void  UnitConversion(int direction_enum);
 
 		Object* FindParamObject(int enum_type);
Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 9355)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 9356)
@@ -177,5 +177,5 @@
 	AdjointzEnum,
 	AdjointpEnum,
-	ArtDiffEnum,
+	Fake35Enum,
 	BedEnum,
 	BathymetryEnum,
@@ -187,5 +187,5 @@
 	Fake2Enum,
 	ConstantEnum,
-	NumControlsEnum,
+	Fake37Enum,
 	ControlTypeEnum,
 	ConvergedEnum,
@@ -400,5 +400,5 @@
 	QmuInNameEnum,
 	QmuMassFluxSegmentsEnum,
-	QmuNPartEnum,
+	Fake39Enum,
 	QmuOutNameEnum,
 	QmuPartEnum,
@@ -422,5 +422,5 @@
 	FsetEnum,
 	SsetEnum,
-	GroundingLineMigrationEnum,
+	GroundinglineMigrationEnum,
 	YtsEnum,
 	/*}}}*/
@@ -458,5 +458,5 @@
 	VelAbsGradientEnum,
 	DatasetInputEnum,
-	NumResponsesEnum,
+	Fake38Enum,
 	StepResponsesEnum,
 	IntMatParamEnum,
@@ -489,5 +489,5 @@
 	NodeOnHutterEnum,
 	ZEnum,
-	GlMigrationEnum,
+	Fake36Enum,
 	RiftinfoEnum,
 	ElementOnIceSheetEnum,
Index: /issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp	(revision 9355)
+++ /issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp	(revision 9356)
@@ -22,5 +22,4 @@
 		case VyEnum : return "vy";
 		case VyObsEnum : return "vy_obs";
-		case GroundingLineMigrationEnum : return "gl_migration";
 		case BasalMeltingRateEnum : return "basal_melting_rate";
       case SurfaceAccumulationRateEnum : return "surface_accumulation_rate";
Index: /issm/trunk/src/c/include/typedefs.h
===================================================================
--- /issm/trunk/src/c/include/typedefs.h	(revision 9355)
+++ /issm/trunk/src/c/include/typedefs.h	(revision 9356)
@@ -11,4 +11,5 @@
 #define SQRT3 1.732050807568877293527446341505872366942805253810380628055806979
 #define PI 3.141592653589793238462643383279502884197169399375105820974944592308
+#define YTS 365.0*24.0*3600.0
 
 #define NDOF1 1
Index: /issm/trunk/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp
===================================================================
--- /issm/trunk/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp	(revision 9356)
@@ -24,5 +24,5 @@
 	int     dummy;
 
-	int     qmu_npart;
+	int     npart;
 	double *qmu_part  = NULL;
 	int     numberofvertices;
@@ -39,12 +39,12 @@
 	/*Some parameters: */
 	numberofvertices=vertices->NumberOfVertices();
-	parameters->FindParam(&qmu_npart,QmuNPartEnum);
+	parameters->FindParam(&npart,NpartEnum);
 
 	/*average onto the separate areas. The result will be a npart sized vector. */
 
 	/*allocate: */
-	partition_contributions=NewVec(qmu_npart);
-	partition_areas=NewVec(qmu_npart);
-	vec_average=NewVec(qmu_npart);
+	partition_contributions=NewVec(npart);
+	partition_areas=NewVec(npart);
+	vec_average=NewVec(npart);
 
 	/*loop on each element, and add contribution of the element to the partition (surface weighted average): */
Index: /issm/trunk/src/c/modules/CostFunctionx/CostFunctionx.cpp
===================================================================
--- /issm/trunk/src/c/modules/CostFunctionx/CostFunctionx.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/CostFunctionx/CostFunctionx.cpp	(revision 9356)
@@ -24,5 +24,5 @@
 	
 	/*Recover parameters*/
-	parameters->FindParam(&num_responses,NumResponsesEnum);
+	parameters->FindParam(&num_responses,NumCmResponsesEnum);
 	parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
 
Index: /issm/trunk/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp
===================================================================
--- /issm/trunk/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp	(revision 9356)
@@ -36,5 +36,5 @@
 
 	/*retrieve npart: */
-	parameters->FindParam(&npart,QmuNPartEnum);
+	parameters->FindParam(&npart,NpartEnum);
 
 	/*save the d_responses pointer: */
Index: /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 9356)
@@ -145,5 +145,5 @@
 		case AdjointzEnum : return "Adjointz";
 		case AdjointpEnum : return "Adjointp";
-		case ArtDiffEnum : return "ArtDiff";
+		case Fake35Enum : return "Fake35";
 		case BedEnum : return "Bed";
 		case BathymetryEnum : return "Bathymetry";
@@ -155,5 +155,5 @@
 		case Fake2Enum : return "Fake2";
 		case ConstantEnum : return "Constant";
-		case NumControlsEnum : return "NumControls";
+		case Fake37Enum : return "Fake37";
 		case ControlTypeEnum : return "ControlType";
 		case ConvergedEnum : return "Converged";
@@ -350,5 +350,5 @@
 		case QmuInNameEnum : return "QmuInName";
 		case QmuMassFluxSegmentsEnum : return "QmuMassFluxSegments";
-		case QmuNPartEnum : return "QmuNPart";
+		case Fake39Enum : return "Fake39";
 		case QmuOutNameEnum : return "QmuOutName";
 		case QmuPartEnum : return "QmuPart";
@@ -372,5 +372,5 @@
 		case FsetEnum : return "Fset";
 		case SsetEnum : return "Sset";
-		case GroundingLineMigrationEnum : return "GroundingLineMigration";
+		case GroundinglineMigrationEnum : return "GroundinglineMigration";
 		case YtsEnum : return "Yts";
 		case TriangleInterpEnum : return "TriangleInterp";
@@ -401,5 +401,5 @@
 		case VelAbsGradientEnum : return "VelAbsGradient";
 		case DatasetInputEnum : return "DatasetInput";
-		case NumResponsesEnum : return "NumResponses";
+		case Fake38Enum : return "Fake38";
 		case StepResponsesEnum : return "StepResponses";
 		case IntMatParamEnum : return "IntMatParam";
@@ -431,5 +431,5 @@
 		case NodeOnHutterEnum : return "NodeOnHutter";
 		case ZEnum : return "Z";
-		case GlMigrationEnum : return "GlMigration";
+		case Fake36Enum : return "Fake36";
 		case RiftinfoEnum : return "Riftinfo";
 		case ElementOnIceSheetEnum : return "ElementOnIceSheet";
Index: /issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationx.cpp
===================================================================
--- /issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationx.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationx.cpp	(revision 9356)
@@ -19,5 +19,5 @@
 	
 	/*retrieve parameters: */
-	parameters->FindParam(&migration_style,GroundingLineMigrationEnum);
+	parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
 
 	/*call different migration modules, according to user wishes: */
Index: /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 9356)
@@ -16,5 +16,5 @@
 	
 	int     numberofvertices;
-	int     qmu_npart;
+	int     npart;
 	double *qmu_part  = NULL;
 
@@ -25,5 +25,5 @@
 
 	/*retrieve parameters: */
-	parameters->FindParam(&qmu_npart,QmuNPartEnum);
+	parameters->FindParam(&npart,NpartEnum);
 	parameters->FindParam(&qmu_part,&dummy,QmuPartEnum);
 	numberofvertices=vertices->NumberOfVertices();
@@ -40,5 +40,5 @@
 			
 			/*Variable is scaled. Determine root name of variable (ex: scaled_DragCoefficient_1 -> DragCoefficient). Allocate distributed_values and fill the 
-			 * distributed_values with the next qmu_npart variables: */
+			 * distributed_values with the next npart variables: */
 			
 			//strcpy(root,strstr(descriptor,"_")+1); *strstr(root,"_")='\0';
@@ -47,6 +47,6 @@
 
 
-			distributed_values=(double*)xmalloc(qmu_npart*sizeof(double));
-			for(j=0;j<qmu_npart;j++){
+			distributed_values=(double*)xmalloc(npart*sizeof(double));
+			for(j=0;j<npart;j++){
 				distributed_values[j]=variables[i+j];
 			}
@@ -76,5 +76,5 @@
 
 			/*increment i to skip the distributed values just collected: */
-			i+=qmu_npart-1; //careful, the for loop will add 1.
+			i+=npart-1; //careful, the for loop will add 1.
 
 			/*Free allocations: */
Index: /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 9356)
@@ -26,4 +26,5 @@
 	bool    spcpresent=false;
 	int     count=0;
+	int     numberofvertices;
 
 	/*variables being fetched: */
@@ -31,4 +32,6 @@
 	int     M,N;
 
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*First of, find the record for the enum, and get code  of data type: */
@@ -42,10 +45,10 @@
 
 	/*Transient or static?:*/
-	if(M==iomodel->numberofvertices){
+	if(M==numberofvertices){
 		/*static: just create Constraints objects*/
 		count=0;
 	
 		/*Create Constraints from x,y,z: */
-		for (i=0;i<iomodel->numberofvertices;i++){
+		for (i=0;i<numberofvertices;i++){
 			
 			/*keep only this partition's nodes:*/
@@ -60,5 +63,5 @@
 		}
 	}
-	else if (M==iomodel->numberofvertices+1){
+	else if (M==(numberofvertices+1)){
 		/*transient: create transient SpcTransient objects. Same logic, except we need to retrieve 
 		 * various times and values to initialize an SpcTransient object: */
@@ -74,5 +77,5 @@
 
 		/*Create constraints from x,y,z: */
-		for (i=0;i<iomodel->numberofvertices;i++){
+		for (i=0;i<numberofvertices;i++){
 			
 			/*keep only this partition's nodes:*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp	(revision 9356)
@@ -10,4 +10,9 @@
 void	CreateConstraintsBalancethickness(Constraints** pconstraints, IoModel* iomodel){
 
+	int    prognostic_DG;	
+	
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+
 	/*Output*/
 	Constraints* constraints = NULL;
@@ -20,5 +25,5 @@
 
 	/*Do not add constraints in DG*/
-	if(!iomodel->prognostic_DG){
+	if(!prognostic_DG){
 		IoModelToConstraintsx(constraints,iomodel,SpcthicknessEnum,BalancethicknessAnalysisEnum);
 	}
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp	(revision 9356)
@@ -16,4 +16,9 @@
 	int i;
 	int element;
+	int prognostic_DG;
+	int numberofedges;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Output*/
@@ -27,13 +32,13 @@
 	
 	/*Loads only in DG*/
-	if (iomodel->prognostic_DG){
+	if (prognostic_DG){
 
 		/*Get edges and elements*/
-		iomodel->FetchData(&iomodel->edges,&iomodel->numberofedges,NULL,EdgesEnum);
+		iomodel->FetchData(&iomodel->edges,&numberofedges,NULL,EdgesEnum);
 		iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
 		iomodel->FetchData(&iomodel->thickness,NULL,NULL,ThicknessEnum);
 
 		/*First load data:*/
-		for (i=0;i<iomodel->numberofedges;i++){
+		for (i=0;i<numberofedges;i++){
 
 			/*Get left and right elements*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 9356)
@@ -21,7 +21,17 @@
 	int  io_index;
 	bool continuous_galerkin=true;
+	int    dim;
+	int    numberofelements;
+	int    numberofvertices;
+	int    prognostic_DG;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Recover pointer: */
@@ -32,9 +42,9 @@
 
 	/*Continuous Galerkin partition of nodes: */
-	if(iomodel->prognostic_DG) continuous_galerkin=false;
+	if(prognostic_DG) continuous_galerkin=false;
 	NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
 
 	/*Check in 3d*/
-	if(iomodel->prognostic_DG && iomodel->dim==3) _error_("DG 3d not implemented yet");
+	if(prognostic_DG && dim==3) _error_("DG 3d not implemented yet");
 
 	/*First fetch data: */
@@ -50,5 +60,5 @@
 
 		/*Build Nodes dataset (Continuous Galerkin)*/
-		for (i=0;i<iomodel->numberofvertices;i++){
+		for (i=0;i<numberofvertices;i++){
 
 			if(iomodel->my_vertices[i]){
@@ -63,5 +73,5 @@
 
 		/*Build Nodes dataset -> 3 for each element (Discontinuous Galerkin)*/
-		for (i=0;i<iomodel->numberofelements;i++){
+		for (i=0;i<numberofelements;i++){
 			for (j=0;j<3;j++){
 
@@ -71,5 +81,5 @@
 					vertex_id=(int)*(iomodel->elements+3*i+j); //(Matlab indexing)
 					io_index=vertex_id-1;                      //(C indexing)
-					_assert_(vertex_id>0 && vertex_id<=iomodel->numberofvertices);
+					_assert_(vertex_id>0 && vertex_id<=numberofvertices);
 
 					//Compute Node id
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp	(revision 9356)
@@ -16,10 +16,15 @@
 void	UpdateElementsBalancethickness(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
+	int    dim;
+	int    numberofelements;
+
 	/*Fetch data needed: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -42,5 +47,5 @@
 	iomodel->FetchDataToInput(elements,DhdtEnum);
 
-	if (iomodel->dim==3){
+	if (dim==3){
 		iomodel->FetchDataToInput(elements,ElementOnBedEnum);
 		iomodel->FetchDataToInput(elements,ElementOnSurfaceEnum);
Index: /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp	(revision 9356)
@@ -18,7 +18,11 @@
 	int i;
 	bool continuous_galerkin=true;
+	int    numberofvertices;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Recover pointer: */
@@ -39,5 +43,5 @@
 	iomodel->FetchData(&iomodel->nodeonwater,NULL,NULL,NodeOnWaterEnum);
 
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		if(iomodel->my_vertices[i]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp	(revision 9356)
@@ -16,10 +16,15 @@
 void	UpdateElementsBedSlope(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
+	int    dim;
+	int    numberofelements;
+
 	/*Fetch data needed: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -33,5 +38,5 @@
 	iomodel->FetchDataToInput(elements,ElementOnWaterEnum);
 
-	if (iomodel->dim==3){
+	if (dim==3){
 		iomodel->FetchDataToInput(elements,ElementOnBedEnum);
 		iomodel->FetchDataToInput(elements,ElementOnSurfaceEnum);
Index: /issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 9356)
@@ -14,21 +14,24 @@
 void CreateParametersControl(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type){
 	
-	int i;
+	int         i;
 	Parameters* parameters=NULL;
+	bool        control_analysis=false;
+	int         nsteps;
+	int         num_control_type;
+	int         num_cm_responses;
+	int*        control_type=NULL;
 
 	/*Get parameters: */
 	parameters=*pparameters;
-	parameters->AddObject(new   BoolParam(ControlAnalysisEnum,iomodel->control_analysis));
 
-	if(iomodel->control_analysis){
+	/*retrieve some parameters: */
+	parameters->FindParam(&control_analysis,ControlAnalysisEnum);
 
-		/*How many controls and how many responses?*/
-		parameters->AddObject(new IntParam(NumControlsEnum,iomodel->num_control_type));
-		parameters->AddObject(new IntParam(NumResponsesEnum,iomodel->num_cm_responses));
+	if(control_analysis){
 
 		/*What control type?*/
-		iomodel->FetchData(&iomodel->control_type,NULL,NULL,ControlTypeEnum);
-		parameters->AddObject(new IntVecParam(ControlTypeEnum,iomodel->control_type,iomodel->num_control_type));
-		xfree((void**)&iomodel->control_type);
+		iomodel->FetchData(&control_type,&num_control_type,NULL,ControlTypeEnum);
+		parameters->AddObject(new IntVecParam(ControlTypeEnum,control_type,num_control_type));
+		xfree((void**)&control_type);
 
 		/*What solution type?*/
@@ -39,21 +42,15 @@
 			parameters->AddObject(new BoolParam(ControlSteadyEnum,false));
 		}
-		parameters->AddObject(new IntParam(NstepsEnum,iomodel->nsteps));
-		parameters->AddObject(new DoubleParam(TolxEnum,iomodel->tolx));
-		parameters->AddObject(new DoubleParam(EpsCmEnum,iomodel->eps_cm));
-		parameters->AddObject(new DoubleParam(MeanvelEnum,iomodel->meanvel));
-
-		parameters->AddObject(new BoolParam(CmGradientEnum,iomodel->cm_gradient));
 
 		/*Now, recover fit, optscal and maxiter as vectors: */
-		iomodel->FetchData(&iomodel->cm_responses,NULL,NULL,CmResponsesEnum);
-		iomodel->FetchData(&iomodel->cm_jump,NULL,NULL,CmJumpEnum);
+		iomodel->FetchData(&iomodel->cm_responses,&nsteps,&num_control_type,CmResponsesEnum);
+		iomodel->FetchData(&iomodel->cm_jump,&nsteps,&num_cm_responses,CmJumpEnum);
 		iomodel->FetchData(&iomodel->optscal,NULL,NULL,OptscalEnum);
 		iomodel->FetchData(&iomodel->maxiter,NULL,NULL,MaxiterEnum);
 
-		parameters->AddObject(new DoubleMatParam(OptscalEnum,iomodel->optscal,iomodel->nsteps,iomodel->num_control_type));
-		parameters->AddObject(new DoubleMatParam(CmResponsesEnum,iomodel->cm_responses,iomodel->nsteps,iomodel->num_cm_responses));
-		parameters->AddObject(new DoubleVecParam(CmJumpEnum,iomodel->cm_jump,iomodel->nsteps));
-		parameters->AddObject(new DoubleVecParam(MaxiterEnum,iomodel->maxiter,iomodel->nsteps));
+		parameters->AddObject(new DoubleMatParam(OptscalEnum,iomodel->optscal,nsteps,num_control_type));
+		parameters->AddObject(new DoubleMatParam(CmResponsesEnum,iomodel->cm_responses,nsteps,num_cm_responses));
+		parameters->AddObject(new DoubleVecParam(CmJumpEnum,iomodel->cm_jump,nsteps));
+		parameters->AddObject(new DoubleVecParam(MaxiterEnum,iomodel->maxiter,nsteps));
 
 		xfree((void**)&iomodel->cm_responses);
Index: /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 9356)
@@ -21,11 +21,19 @@
 	Element  *element = NULL;
 	Material *material = NULL;
+	int    numberofelements;
+	int    num_control_type;
+	bool   control_analysis;
+
+	
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
+	iomodel->parameters->FindParam(&num_control_type,NumControlTypeEnum);
 
 	/*Now, return if no control*/
-	if (!iomodel->control_analysis) return;
+	if (!control_analysis) return;
 
 	/*Fetch data needed: */
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
-
 	iomodel->FetchDataToInput(elements,VxObsEnum);
 	iomodel->FetchDataToInput(elements,VyObsEnum); 
@@ -36,5 +44,5 @@
 	iomodel->FetchData(&iomodel->cm_min,NULL,NULL,CmMinEnum);
 	iomodel->FetchData(&iomodel->cm_max,NULL,NULL,CmMaxEnum);
-	for(i=0;i<iomodel->num_control_type;i++){
+	for(i=0;i<num_control_type;i++){
 		switch((int)iomodel->control_type[i]){
 			case DhdtEnum:
@@ -60,5 +68,5 @@
 	/*Update elements and materials: */
 	counter=0;
-	for (i=0;i<iomodel->numberofelements;i++){
+	for (i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			element=(Element*)elements->GetObjectByOffset(counter);
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 9356)
@@ -17,4 +17,7 @@
 	/*Intermediary*/
 	int i,j,k,n;
+	int    dim;
+	int    numberofelements;
+	int    numberofvertices;
 
 	/*DataSets: */
@@ -22,4 +25,9 @@
 	Vertices*     vertices = NULL;
 	Materials*    materials = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Did we already create the elements? : */
@@ -46,10 +54,10 @@
 	
 	/*Create elements and materials: */
-	for (i=0;i<iomodel->numberofelements;i++){
+	for (i=0;i<numberofelements;i++){
 
 		if(iomodel->my_elements[i]){
 
 			/*Create and add tria element to elements dataset: */
-			if(iomodel->dim==2)
+			if(dim==2)
 			 elements->AddObject(new Tria(i+1,i,i,iomodel,nummodels));
 			else
@@ -73,5 +81,5 @@
 
 	/*Add new constrant material property tgo materials, at the end: */
-	materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));//put it at the end of the materials
+	materials->AddObject(new Matpar(numberofelements+1,iomodel));//put it at the end of the materials
 	
 	/*Create vertices: */
@@ -82,5 +90,5 @@
 	iomodel->FetchData(&iomodel->thickness,NULL,NULL,ThicknessEnum);
 	
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		/*vertices and nodes (same number, as we are running continuous galerkin formulation: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp	(revision 9356)
@@ -20,18 +20,26 @@
 	int vertexid;
 	int elementswidth;
+	int    dim;
+	int    numberofelements;
+	int    numberofvertices;
 
 	/*output*/
 	int* connectivity=NULL;
 
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+
 	/*Some checks if debugging*/
-	_assert_(iomodel->numberofvertices);
-	_assert_(iomodel->numberofelements);
+	_assert_(numberofvertices);
+	_assert_(numberofelements);
 	_assert_(iomodel->elements);
 
 	/*Allocate ouput*/
-	connectivity=(int*)xcalloc(iomodel->numberofvertices,sizeof(int));
+	connectivity=(int*)xcalloc(numberofvertices,sizeof(int));
 
 	/*Get element width (3 or 6)*/
-	if (iomodel->dim==2){
+	if (dim==2){
 		elementswidth=3;
 	}
@@ -41,8 +49,8 @@
 
 	/*Create connectivity table*/
-	for (i=0;i<iomodel->numberofelements;i++){
+	for (i=0;i<numberofelements;i++){
 		for (j=0;j<elementswidth;j++){
 			vertexid=(int)iomodel->elements[elementswidth*i+j];
-			_assert_(vertexid>0 && vertexid-1<iomodel->numberofvertices);
+			_assert_(vertexid>0 && vertexid-1<numberofvertices);
 			connectivity[vertexid-1]+=1;
 		}
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 9356)
@@ -24,61 +24,12 @@
 		
 	/*Initialize dataset: */
-	parameters = new Parameters(ParametersEnum);
+	parameters = (Parameters*)iomodel->parameters->Copy();
 
+	/*some parameters that did not come with the iomodel: */
 	parameters->AddObject(new IntParam(SolutionTypeEnum,solution_type));
 	parameters->AddObject(new IntParam(AnalysisTypeEnum,analysis_type));
 	parameters->AddObject(new IntParam(AnalysisCounterEnum,analysis_counter));
 
-	parameters->AddObject(new IntParam(DimEnum,iomodel->dim));
-	parameters->AddObject(new BoolParam(IshutterEnum,iomodel->ishutter));
-	parameters->AddObject(new BoolParam(IsmacayealpattynEnum,iomodel->ismacayealpattyn));
-	parameters->AddObject(new BoolParam(IsstokesEnum,iomodel->isstokes));
-	parameters->AddObject(new IntParam(OutputFrequencyEnum,iomodel->output_frequency));
-	parameters->AddObject(new DoubleParam(EpsResEnum,iomodel->eps_res));
-	parameters->AddObject(new DoubleParam(EpsRelEnum,iomodel->eps_rel));
-	parameters->AddObject(new DoubleParam(EpsAbsEnum,iomodel->eps_abs));
-	parameters->AddObject(new IntParam(MaxNonlinearIterationsEnum,(IssmInt)iomodel->max_nonlinear_iterations));
-	parameters->AddObject(new IntParam(MaxSteadystateIterationsEnum,(IssmInt)iomodel->max_steadystate_iterations));
-	parameters->AddObject(new DoubleParam(EpsvelEnum,iomodel->epsvel));
-	parameters->AddObject(new DoubleParam(YtsEnum,iomodel->yts));
-	parameters->AddObject(new DoubleParam(DtEnum,iomodel->dt*iomodel->yts));  //Ndt is in yeats in iomodel
-	parameters->AddObject(new DoubleParam(NdtEnum,iomodel->ndt*iomodel->yts));//Ndt is in yeats in iomodel
-	parameters->AddObject(new BoolParam(TimeAdaptEnum,iomodel->time_adapt)); 
-	parameters->AddObject(new DoubleParam(CflCoefficientEnum,iomodel->cfl_coefficient)); 
-	parameters->AddObject(new IntParam(HydrostaticAdjustmentEnum,iomodel->hydrostatic_adjustment)); 
-	parameters->AddObject(new DoubleParam(PenaltyOffsetEnum,iomodel->penalty_offset));
-	parameters->AddObject(new DoubleParam(SparsityEnum,iomodel->sparsity));
-	parameters->AddObject(new BoolParam(LowmemEnum,iomodel->lowmem));
-	parameters->AddObject(new IntParam(ConnectivityEnum,iomodel->connectivity));
-	parameters->AddObject(new DoubleParam(BetaEnum,iomodel->beta));
-	parameters->AddObject(new DoubleParam(MeltingpointEnum,iomodel->meltingpoint));
-	parameters->AddObject(new DoubleParam(ReferencetemperatureEnum,iomodel->referencetemperature));
-	parameters->AddObject(new DoubleParam(LatentheatEnum,iomodel->latentheat));
-	parameters->AddObject(new DoubleParam(HeatcapacityEnum,iomodel->heatcapacity));
-	parameters->AddObject(new IntParam(ArtDiffEnum,iomodel->artdiff));
-	parameters->AddObject(new IntParam(BasalMeltingRateCorrectionApplyEnum,iomodel->basal_melting_rate_correction_apply));
-	parameters->AddObject(new DoubleParam(GroundingLineMeltingRateEnum,iomodel->gl_melting_rate));
-	parameters->AddObject(new DoubleParam(PenaltyMeltingEnum,iomodel->penalty_melting));
-	parameters->AddObject(new IntParam(MinThermalConstraintsEnum,iomodel->min_thermal_constraints));
-	parameters->AddObject(new IntParam(MinMechanicalConstraintsEnum,iomodel->min_mechanical_constraints));
-	parameters->AddObject(new IntParam(StabilizeConstraintsEnum,iomodel->stabilize_constraints));
-	parameters->AddObject(new DoubleParam(StokesreconditioningEnum,iomodel->stokesreconditioning));
-	parameters->AddObject(new IntParam(ShelfDampeningEnum,iomodel->shelf_dampening));
-	parameters->AddObject(new DoubleParam(ViscosityOvershootEnum,iomodel->viscosity_overshoot));
-	parameters->AddObject(new BoolParam(WaitonlockEnum,iomodel->waitonlock));
-	parameters->AddObject(new IntParam(NumberOfElementsEnum,iomodel->numberofelements));
-	parameters->AddObject(new BoolParam(IoGatherEnum,iomodel->io_gather));
-	parameters->AddObject(new IntParam(GroundingLineMigrationEnum,iomodel->gl_migration));
-	parameters->AddObject(new IntParam(RheologyLawEnum,iomodel->rheology_law));
-	parameters->AddObject(new BoolParam(IsdiagnosticEnum,iomodel->isdiagnostic));
-	parameters->AddObject(new BoolParam(IsprognosticEnum,iomodel->isprognostic));
-	parameters->AddObject(new BoolParam(IsthermalEnum,iomodel->isthermal));
 	parameters->AddObject(new DoubleParam(TimeEnum,0.0));  //start at time 0 by default for all solutions.
-
-	/*Deal with more complex parameters*/
-	iomodel->FetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,RiftinfoEnum);
-	parameters->AddObject(new IntParam(NumRiftsEnum,iomodel->numrifts));
-	xfree((void**)&iomodel->riftinfo); 
-
 
 	/*Requested output?*/
@@ -92,4 +43,7 @@
 	CreateParametersQmu(&parameters,iomodel,solution_type,analysis_type);
 
+	/*Go through all parameters, and convert units to SI: */
+	parameters->UnitConversion(ExtToIuEnum);
+
 	/*Assign output pointer: */
 	*pparameters=parameters;
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp	(revision 9356)
@@ -20,19 +20,27 @@
 	int vertexid;
 	int elementswidth;
+	int    dim;
+	int    numberofelements;
+	int    numberofvertices;
 
 	/*output*/
 	int* connectivity=NULL;
 
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+
 	/*Some checks if debugging*/
-	_assert_(iomodel->numberofvertices);
-	_assert_(iomodel->numberofelements);
+	_assert_(numberofvertices);
+	_assert_(numberofelements);
 	_assert_(iomodel->my_elements);
 	_assert_(iomodel->elements);
 
 	/*Allocate ouput*/
-	connectivity=(int*)xcalloc(iomodel->numberofvertices,sizeof(int));
+	connectivity=(int*)xcalloc(numberofvertices,sizeof(int));
 
 	/*Get element width (3 or 6)*/
-	if (iomodel->dim==2){
+	if (dim==2){
 		elementswidth=3;
 	}
@@ -42,10 +50,10 @@
 
 	/*Create connectivity table*/
-	for (i=0;i<iomodel->numberofelements;i++){
+	for (i=0;i<numberofelements;i++){
 		/*!! in parallel we do not want the vertex to be connected to an element that is not in its partition!!*/
 		if(iomodel->my_elements[i]){
 			for (j=0;j<elementswidth;j++){
 				vertexid=(int)iomodel->elements[elementswidth*i+j];
-				_assert_(vertexid>0 && vertexid-1<iomodel->numberofvertices);
+				_assert_(vertexid>0 && vertexid-1<numberofvertices);
 				connectivity[vertexid-1]=i+1;
 			}
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 9356)
@@ -16,4 +16,9 @@
 	int i,j;
 	int count;
+	double yts;
+	double g;
+	double rho_ice;
+	double stokesreconditioning;
+	bool   isstokes,ismacayealpattyn;
 	
 	/*Output*/
@@ -21,4 +26,16 @@
 	SpcStatic*    spcstatic  = NULL;
 	int     node1,node2;
+	int    dim;
+	int    numberofvertices;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&yts,YtsEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&g,GEnum);
+	iomodel->parameters->FindParam(&rho_ice,RhoIceEnum);
+	iomodel->parameters->FindParam(&stokesreconditioning,StokesreconditioningEnum);
+	iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
+	iomodel->parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
 
 	/*Recover pointer: */
@@ -29,5 +46,5 @@
 	
 	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
-	if (!iomodel->ismacayealpattyn & !iomodel->isstokes)goto cleanup_and_return;
+	if (!ismacayealpattyn & !isstokes)goto cleanup_and_return;
 	
 	/*Constraints: fetch data: */
@@ -37,6 +54,6 @@
 	iomodel->FetchData(&iomodel->nodeonhutter,NULL,NULL,NodeOnHutterEnum);
 	iomodel->FetchData(&iomodel->nodeonmacayeal,NULL,NULL,NodeOnMacayealEnum);
-	if(iomodel->dim==3)iomodel->FetchData(&iomodel->nodeonpattyn,NULL,NULL,NodeOnPattynEnum);
-	if(iomodel->dim==3)iomodel->FetchData(&iomodel->nodeonstokes,NULL,NULL,NodeOnStokesEnum);
+	if(dim==3)iomodel->FetchData(&iomodel->nodeonpattyn,NULL,NULL,NodeOnPattynEnum);
+	if(dim==3)iomodel->FetchData(&iomodel->nodeonstokes,NULL,NULL,NodeOnStokesEnum);
 	iomodel->FetchData(&iomodel->vertices_type,NULL,NULL,VerticesTypeEnum);
 	iomodel->FetchData(&iomodel->surface,NULL,NULL,SurfaceEnum);
@@ -47,5 +64,5 @@
 	
 	/*Create spcs from x,y,z, as well as the spc values on those spcs: */
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 		if(iomodel->my_vertices[i]){
 
@@ -59,9 +76,9 @@
 						count++;
 						if (!isnan(iomodel->spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,iomodel->spcvx[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
-							count++;
-						}
-						if (!isnan(iomodel->spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,iomodel->spcvy[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,iomodel->spcvx[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							count++;
+						}
+						if (!isnan(iomodel->spcvy[i])){
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,iomodel->spcvy[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -74,9 +91,9 @@
 						count++;
 						if (!isnan(iomodel->spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spcvx[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
-							count++;
-						}
-						if (!isnan(iomodel->spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,iomodel->spcvy[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spcvx[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							count++;
+						}
+						if (!isnan(iomodel->spcvy[i])){
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,iomodel->spcvy[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -96,9 +113,9 @@
 						count++;
 						if (!isnan(iomodel->spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spcvx[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
-							count++;
-						}
-						if (!isnan(iomodel->spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,iomodel->spcvy[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spcvx[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							count++;
+						}
+						if (!isnan(iomodel->spcvy[i])){
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,iomodel->spcvy[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -111,13 +128,13 @@
 						count++;
 						if (!isnan(iomodel->spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,iomodel->spcvx[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
-							count++;
-						}
-						if (!isnan(iomodel->spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,iomodel->spcvy[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,iomodel->spcvx[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							count++;
+						}
+						if (!isnan(iomodel->spcvy[i])){
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,iomodel->spcvy[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
 						if (!isnan(iomodel->spcvz[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,5,iomodel->spcvz[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,5,iomodel->spcvz[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -136,9 +153,9 @@
 						count++;
 						if (!isnan(iomodel->spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spcvx[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
-							count++;
-						}
-						if (!isnan(iomodel->spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,iomodel->spcvy[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spcvx[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							count++;
+						}
+						if (!isnan(iomodel->spcvy[i])){
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,iomodel->spcvy[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -151,13 +168,13 @@
 						count++;
 						if (!isnan(iomodel->spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,iomodel->spcvx[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
-							count++;
-						}
-						if (!isnan(iomodel->spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,iomodel->spcvy[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,iomodel->spcvx[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							count++;
+						}
+						if (!isnan(iomodel->spcvy[i])){
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,iomodel->spcvy[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
 						if (!isnan(iomodel->spcvz[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,5,iomodel->spcvz[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,5,iomodel->spcvz[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -168,5 +185,5 @@
 			else{
 				if (!isnan(iomodel->spcvx[i])){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spcvx[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spcvx[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 					count++;
 				}
@@ -177,5 +194,5 @@
 				
 				if (!isnan(iomodel->spcvy[i])){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,iomodel->spcvy[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vy.
+					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,iomodel->spcvy[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vy.
 					count++;
 				}
@@ -186,9 +203,9 @@
 
 				if (!isnan(iomodel->spcvz[i]) && ((int)iomodel->vertices_type[i]==StokesApproximationEnum ||  ((int)iomodel->vertices_type[i]==NoneApproximationEnum))){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,iomodel->spcvz[i]/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
+					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,iomodel->spcvz[i]/yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
 					count++;
 				}
 				if ((int)iomodel->vertices_type[i]==NoneApproximationEnum){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,iomodel->g*iomodel->rho_ice*(iomodel->surface[i]-iomodel->z[i])/iomodel->stokesreconditioning,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
+					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,g*rho_ice*(iomodel->surface[i]-iomodel->z[i])/stokesreconditioning,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
 					count++;
 				}
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 9356)
@@ -25,4 +25,14 @@
 	int count=0;
 	int penpair_ids[2];
+	int dim;
+	int numberofvertices;
+	bool ismacayealpattyn,isstokes;
+	int  numpenalties,numberofpressureloads,numrifts;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
+	iomodel->parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
 
 	/*Recover pointer: */
@@ -33,9 +43,9 @@
 
 	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
-	if (!iomodel->ismacayealpattyn & !iomodel->isstokes)goto cleanup_and_return;
+	if (!ismacayealpattyn & !isstokes)goto cleanup_and_return;
 	
 	/*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the nodes
 	 * referenced by a certain load must belong to the cluster node): */
-	iomodel->FetchData(&iomodel->pressureload,&iomodel->numberofpressureloads,NULL,PressureloadEnum);
+	iomodel->FetchData(&iomodel->pressureload,&numberofpressureloads,NULL,PressureloadEnum);
 	iomodel->FetchData(&iomodel->elements_type,NULL,NULL,ElementsTypeEnum);
 	iomodel->FetchData(&iomodel->thickness,NULL,NULL,ThicknessEnum);
@@ -46,8 +56,8 @@
 
 	/*First load data:*/
-	for (i=0;i<iomodel->numberofpressureloads;i++){
+	for (i=0;i<numberofpressureloads;i++){
 		
 		/*Retrieve element to which this icefront belongs: */
-		if (iomodel->dim==2) segment_width=4; 
+		if (dim==2) segment_width=4; 
 		else segment_width=6;
 		element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)
@@ -60,9 +70,9 @@
 
 		/*Create and  add load: */
-		if ((int)*(iomodel->elements_type+element)==(MacAyealApproximationEnum) && iomodel->dim==2){
+		if ((int)*(iomodel->elements_type+element)==(MacAyealApproximationEnum) && dim==2){
 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal2dIceFrontEnum,DiagnosticHorizAnalysisEnum));
 			count++;
 		}
-		else if ((int)*(iomodel->elements_type+element)==(MacAyealApproximationEnum) && iomodel->dim==3){
+		else if ((int)*(iomodel->elements_type+element)==(MacAyealApproximationEnum) && dim==3){
 			loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,MacAyeal3dIceFrontEnum,DiagnosticHorizAnalysisEnum));
 			count++;
@@ -113,5 +123,5 @@
 	CreateSingleNodeToElementConnectivity(iomodel);
 	
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 		
 		if(iomodel->my_vertices[i]==1 && iomodel->singlenodetoelementconnectivity[i]!=0){
@@ -137,7 +147,7 @@
 
 	/*Create Penpair for penalties: */
-	iomodel->FetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,PenaltiesEnum);
+	iomodel->FetchData(&iomodel->penalties,&numpenalties,NULL,PenaltiesEnum);
 	
-	for(i=0;i<iomodel->numpenalties;i++){
+	for(i=0;i<numpenalties;i++){
 
 		if(iomodel->my_vertices[(int)iomodel->penalties[2*i+0]-1]){
@@ -160,5 +170,5 @@
 
 	/*Create Riffront loads for rifts: */
-	iomodel->FetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,RiftinfoEnum);
+	iomodel->FetchData(&iomodel->riftinfo,&numrifts,NULL,RiftinfoEnum);
 	iomodel->FetchData(&iomodel->thickness,NULL,NULL,ThicknessEnum);
 	iomodel->FetchData(&iomodel->bed,NULL,NULL,BedEnum);
@@ -167,5 +177,5 @@
 
 	
-	for(i=0;i<iomodel->numrifts;i++){
+	for(i=0;i<numrifts;i++){
 
 		if(iomodel->my_elements[(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2)-1]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp	(revision 9356)
@@ -17,8 +17,15 @@
 	/*Intermediary*/
 	int i;
-	bool continuous_galerkin=true;
+	bool   continuous_galerkin=true;
+	int    numberofvertices;
+	bool   isstokes,ismacayealpattyn;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
+	iomodel->parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
 
 	/*Recover pointer: */
@@ -29,5 +36,5 @@
 	
 	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
-	if (!iomodel->ismacayealpattyn & !iomodel->isstokes)goto cleanup_and_return;
+	if (!ismacayealpattyn & !isstokes)goto cleanup_and_return;
 
 	/*Continuous Galerkin partition of nodes: */
@@ -46,5 +53,5 @@
 	iomodel->FetchData(&iomodel->diagnostic_ref,NULL,NULL,DiagnosticRefEnum);
 	
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		if(iomodel->my_vertices[i]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 9356)
@@ -16,14 +16,29 @@
 void	UpdateElementsDiagnosticHoriz(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
-	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
-	if (!iomodel->ismacayealpattyn & !iomodel->isstokes) return;
-
+	int    dim;
+	int    numberofelements;
+	bool   ismacayealpattyn;
+	bool   isstokes;
+	bool   control_analysis;
+	bool   qmu_analysis;
+		
 	/*Fetch data needed: */
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
 	iomodel->FetchData(&iomodel->elements_type,NULL,NULL,ElementsTypeEnum);
 
+	iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
+	iomodel->parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
+	iomodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
+
+
+	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
+	if (!ismacayealpattyn & !isstokes) return;
+
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -50,5 +65,5 @@
 	iomodel->FetchDataToInput(elements,BathymetryEnum);
 
-	if (iomodel->dim==3){
+	if (dim==3){
 		iomodel->FetchDataToInput(elements,ElementOnBedEnum);
 		iomodel->FetchDataToInput(elements,ElementOnSurfaceEnum);
@@ -61,5 +76,5 @@
 	}
 
-	if(iomodel->control_analysis){
+	if(control_analysis){
 		iomodel->FetchDataToInput(elements,VxObsEnum);
 		iomodel->FetchDataToInput(elements,VyObsEnum);
@@ -70,14 +85,14 @@
 	elements->InputDuplicate(VxEnum,VxPicardEnum);
 	elements->InputDuplicate(VxEnum,VxObsEnum);
-	if(iomodel->qmu_analysis)elements->InputDuplicate(VxEnum,QmuVxEnum);
+	if(qmu_analysis)elements->InputDuplicate(VxEnum,QmuVxEnum);
 	
 	elements->InputDuplicate(VyEnum,VyPicardEnum);
 	elements->InputDuplicate(VyEnum,VyObsEnum);
-	if(iomodel->qmu_analysis)elements->InputDuplicate(VyEnum,QmuVyEnum);
+	if(qmu_analysis)elements->InputDuplicate(VyEnum,QmuVyEnum);
 	
-	if(iomodel->dim==3){
+	if(dim==3){
 		elements->InputDuplicate(VzEnum,VzPicardEnum);
 		elements->InputDuplicate(VzEnum,VzObsEnum);
-		if(iomodel->qmu_analysis)elements->InputDuplicate(VzEnum,QmuVzEnum);
+		if(qmu_analysis)elements->InputDuplicate(VzEnum,QmuVzEnum);
 	}
 	
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp	(revision 9356)
@@ -16,4 +16,7 @@
 	int i;
 	int count;
+	double yts;
+	int    numberofvertices;
+	bool   ishutter;
 
 	/*Output*/
@@ -24,9 +27,14 @@
 	constraints=*pconstraints;
 
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&yts,YtsEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&ishutter,IshutterEnum);
+
 	/*Create constraints if they do not exist yet*/
 	if(!constraints) constraints = new Constraints(ConstraintsEnum);
 
 	/*Now, is the flag ishutter on? otherwise, do nothing: */
-	if (!iomodel->ishutter) goto cleanup_and_return;
+	if (!ishutter) goto cleanup_and_return;
 
 	/*Fetch data: */
@@ -39,5 +47,5 @@
 
 	/*vx and vy are spc'd if we are not on nodeonhutter: */
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 		/*keep only this partition's nodes:*/
 		if((iomodel->my_vertices[i])){
@@ -52,10 +60,10 @@
 			else{
 				if (!isnan(iomodel->spcvx[i])){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spcvx[i]/iomodel->yts,DiagnosticHutterAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spcvx[i]/yts,DiagnosticHutterAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 					count++;
 				}
 
 				if (!isnan(iomodel->spcvy[i])){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,iomodel->spcvy[i]/iomodel->yts,DiagnosticHutterAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
+					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,iomodel->spcvy[i]/yts,DiagnosticHutterAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
 					count++;
 				}
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp	(revision 9356)
@@ -18,7 +18,13 @@
 	int i;
 	bool continuous_galerkin=true;
+	int    numberofvertices;
+	bool   ishutter;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&ishutter,IshutterEnum);
 
 	/*Recover pointer: */
@@ -29,5 +35,5 @@
 
 	/*Now, is the flag ishutter on? otherwise, do nothing: */
-	if (!iomodel->ishutter)goto cleanup_and_return;
+	if (!ishutter)goto cleanup_and_return;
 
 	/*Continuous Galerkin partition of nodes: */
@@ -46,5 +52,5 @@
 	CreateNumberNodeToElementConnectivity(iomodel);
 
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		if(iomodel->my_vertices[i]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp	(revision 9356)
@@ -16,14 +16,20 @@
 void	UpdateElementsDiagnosticHutter(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
-	/*Now, is the flag hutter on? otherwise, do nothing: */
-	if (!iomodel->ishutter)return;
+	int    numberofelements;
+	bool   ishutter;
 
+	
 	/*Fetch data needed: */
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
 	iomodel->FetchData(&iomodel->elements_type,NULL,NULL,ElementsTypeEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&ishutter,IshutterEnum);
+
+	/*Now, is the flag hutter on? otherwise, do nothing: */
+	if (!ishutter)return;
 
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 9356)
@@ -15,8 +15,15 @@
 	/*Intermediary*/
 	int i;
+	int dim;
 	int count;
+	double yts;
+	int    numberofvertices;
 
 	/*Output*/
 	Constraints* constraints = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&yts,YtsEnum);
 
 	/*Recover pointer: */
@@ -27,9 +34,10 @@
 
 	/*return if 2d mesh*/
-	if (iomodel->dim==2) goto cleanup_and_return;
+	if (dim==2) goto cleanup_and_return;
 
 	/*Fetch data: */
 	iomodel->FetchData(&iomodel->spcvz,NULL,NULL,SpcvzEnum);
 	iomodel->FetchData(&iomodel->nodeonstokes,NULL,NULL,NodeOnStokesEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Initialize counter*/
@@ -37,5 +45,5 @@
 
 	/*Create spcs from x,y,z, as well as the spc values on those spcs: */
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		/*keep only this partition's nodes:*/
@@ -48,5 +56,5 @@
 			else if (!isnan(iomodel->spcvz[i])){
 				constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,
-								iomodel->spcvz[i]/iomodel->yts,DiagnosticVertAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+								iomodel->spcvz[i]/yts,DiagnosticVertAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 				count++;
 
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp	(revision 9356)
@@ -18,7 +18,13 @@
 	int i;
 	bool continuous_galerkin=true;
+	int    dim;
+	int    numberofvertices;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Recover pointer: */
@@ -29,5 +35,5 @@
 
 	/*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
-	if (iomodel->dim==2)goto cleanup_and_return;
+	if (dim==2)goto cleanup_and_return;
 
 	/*Continuous Galerkin partition of nodes: */
@@ -42,5 +48,5 @@
 	iomodel->FetchData(&iomodel->nodeonwater,NULL,NULL,NodeOnWaterEnum);
 
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		if(iomodel->my_vertices[i]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	(revision 9356)
@@ -16,6 +16,13 @@
 void	UpdateElementsDiagnosticVert(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
+	int    dim;
+	int    numberofelements;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+
 	/*Now, is the model 3d? otherwise, do nothing: */
-	if (iomodel->dim==2)return;
+	if (dim==2)return;
 
 	/*Fetch data needed: */
@@ -24,5 +31,5 @@
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
Index: /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 9356)
@@ -24,4 +24,11 @@
 	extern int my_rank;
 	extern int num_procs;
+	int    numberofelements;
+	int    numberofvertices;
+	int    numberofelements2d;
+	int    numberofvertices2d;
+	int    numlayers;
+	int    numrifts;
+	int    numpenalties;
 
 	/*output: */
@@ -34,4 +41,14 @@
 	int  elements_width; //number of columns in elements (2d->3, 3d->6)
 	int  el1,el2;
+	int    dim;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&numberofelements2d,NumberOfElements2DEnum);
+	iomodel->parameters->FindParam(&numberofvertices2d,NumberOfNodes2DEnum);
+	iomodel->parameters->FindParam(&numlayers,NumlayersEnum);
+	iomodel->parameters->FindParam(&numrifts,NumRiftsEnum);
 
 	/*First, check that partitioning has not yet been carryed out. Just check whether my_elements pointers is not already assigned a value: */
@@ -39,10 +56,10 @@
 
 	/*Number of vertices per elements, needed to correctly retrieve data: */
-	if(iomodel->dim==2) elements_width=3; //tria elements
+	if(dim==2) elements_width=3; //tria elements
 	else elements_width=6; //penta elements
 
 	#ifdef _PARALLEL_
 	/*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
-	if(iomodel->dim==2){
+	if(dim==2){
 		/*load elements: */
 		iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
@@ -53,5 +70,5 @@
 	}
 
-	MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofvertices,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofvertices2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->dim,num_procs);
+	MeshPartitionx(&epart, &npart,numberofelements,numberofvertices,iomodel->elements, numberofelements2d,numberofvertices2d,iomodel->elements2d,numlayers,elements_width, dim,num_procs);
 
 	/*Free elements and elements2d: */
@@ -61,11 +78,11 @@
 	#else
 	/*In serial mode, epart is full of 0: all elements belong to cpu 0: */
-	epart=(int*)xcalloc(iomodel->numberofelements,sizeof(int));
+	epart=(int*)xcalloc(numberofelements,sizeof(int));
 	#endif
 
 	/*Deal with rifts, they have to be included into one partition only, not several: */
-	iomodel->FetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,RiftinfoEnum);
+	iomodel->FetchData(&iomodel->riftinfo,&numrifts,NULL,RiftinfoEnum);
 
-	for(i=0;i<iomodel->numrifts;i++){
+	for(i=0;i<numrifts;i++){
 		el1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2)-1; //matlab indexing to c indexing
 		el2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+3)-1; //matlab indexing to c indexing
@@ -77,10 +94,10 @@
 
 	/*Used later on: */
-	my_vertices=(int*)xcalloc(iomodel->numberofvertices,sizeof(int));
-	my_elements=(bool*)xcalloc(iomodel->numberofelements,sizeof(bool));
+	my_vertices=(int*)xcalloc(numberofvertices,sizeof(int));
+	my_elements=(bool*)xcalloc(numberofelements,sizeof(bool));
 
 	/*Start figuring out, out of the partition, which elements belong to this cpu: */
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
-	for (i=0;i<iomodel->numberofelements;i++){
+	for (i=0;i<numberofelements;i++){
 
 		/*!All elements have been partitioned above, only deal with elements for this cpu: */
@@ -110,6 +127,6 @@
 	 * penpair has 2 nodes that are poointing toward 2 vertices.
 	 * The 2 vertices must be in the same cpu as the penpair*/
-	iomodel->FetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,PenaltiesEnum);
-	for(i=0;i<iomodel->numpenalties;i++){
+	iomodel->FetchData(&iomodel->penalties,&numpenalties,NULL,PenaltiesEnum);
+	for(i=0;i<numpenalties;i++){
 		if(my_vertices[(int)iomodel->penalties[2*i+0]-1] && !my_vertices[(int)iomodel->penalties[2*i+1]-1]){
 			my_vertices[(int)iomodel->penalties[2*i+1]-1]=2; //to know that these elements are not on the partition
Index: /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 9356)
@@ -16,8 +16,18 @@
 	int i;
 	int count;
+	int    dim;
+	int    numberofvertices;
+	double heatcapacity;
+	double referencetemperature;
 	
 	/*Output*/
 	Constraints* constraints = NULL;
 	SpcStatic*    spcstatic  = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&heatcapacity,HeatcapacityEnum);
+	iomodel->parameters->FindParam(&referencetemperature,ReferencetemperatureEnum);
 
 	/*Recover pointer: */
@@ -28,5 +38,5 @@
 
 	/*return if 2d mesh*/
-	if (iomodel->dim==2) goto cleanup_and_return;
+	if (dim==2) goto cleanup_and_return;
 
 	/*Fetch data: */
@@ -37,5 +47,5 @@
 
 	/*Create constraints from x,y,z: */
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 		/*keep only this partition's nodes:*/
 		if((iomodel->my_vertices[i])){
@@ -43,5 +53,5 @@
 			if ((int)iomodel->spctemperature[2*i]){
 
-				constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->heatcapacity*(iomodel->spctemperature[2*i+1]-iomodel->referencetemperature),EnthalpyAnalysisEnum));
+				constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,heatcapacity*(iomodel->spctemperature[2*i+1]-referencetemperature),EnthalpyAnalysisEnum));
 				count++;
 
Index: /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp	(revision 9356)
@@ -18,7 +18,11 @@
 	int i;
 	bool continuous_galerkin=true;
+	int    numberofvertices;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
 	
 	/*Recover pointer: */
@@ -39,5 +43,5 @@
 	iomodel->FetchData(&iomodel->nodeonwater,NULL,NULL,NodeOnWaterEnum);
 
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		if(iomodel->my_vertices[i]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp	(revision 9356)
@@ -16,6 +16,13 @@
 void	UpdateElementsEnthalpy(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
+	int    dim;
+	int    numberofelements;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+
 	/*Now, is the model 3d? otherwise, do nothing: */
-	if (iomodel->dim==2)return;
+	if (dim==2)return;
 
 	/*Fetch data needed: */
@@ -24,5 +31,5 @@
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
Index: /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp	(revision 9356)
@@ -18,7 +18,11 @@
 	int i;
 	bool continuous_galerkin=true;
+	int    numberofvertices;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
 	
 	/*Recover pointer: */
@@ -39,5 +43,5 @@
 	iomodel->FetchData(&iomodel->nodeonwater,NULL,NULL,NodeOnWaterEnum);
 
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		if(iomodel->my_vertices[i]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp	(revision 9356)
@@ -16,10 +16,13 @@
 void	UpdateElementsHydrology(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
+	int    numberofelements;
+	
 	/*Fetch data needed: */
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
Index: /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 9356)
@@ -15,10 +15,16 @@
 	/*Intermediary*/
 	int i;
+	int    dim;
+	int    numberofvertices;
 
 	/*DataSet*/
 	Loads*    loads    = NULL;
 
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+
 	/*if 2d: Error*/
-	if (iomodel->dim==2) _error_("2d meshes not supported yet");
+	if (dim==2) _error_("2d meshes not supported yet");
 
 	/*Recover pointer: */
@@ -33,5 +39,5 @@
 	CreateSingleNodeToElementConnectivity(iomodel);
 
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 		
 		if((iomodel->my_vertices[i]==1)){
Index: /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp	(revision 9356)
@@ -18,7 +18,11 @@
 	int i;
 	bool continuous_galerkin=true;
+	int    numberofvertices;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
+	
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Recover pointer: */
@@ -39,5 +43,5 @@
 	iomodel->FetchData(&iomodel->nodeonwater,NULL,NULL,NodeOnWaterEnum);
 
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		if(iomodel->my_vertices[i]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	(revision 9356)
@@ -16,6 +16,13 @@
 void	UpdateElementsMelting(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
+	int    dim;
+	int    numberofelements;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+
 	/*Now, is the model 3d? otherwise, do nothing: */
-	if (iomodel->dim==2)return;
+	if (dim==2)return;
 
 	/*Fetch data needed: */
@@ -24,5 +31,5 @@
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
Index: /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 9356)
@@ -20,4 +20,6 @@
 	int i;
 	int analysis_type;
+	int dim;
+	int verbose;
 	
 	/*output: */
@@ -30,7 +32,13 @@
 	Parameters  *parameters  = NULL;
 
+	
 	/*Initialize IoModel from input file*/
 	IoModel* iomodel = new IoModel(IOMODEL);
-	SetVerbosityLevel(iomodel->verbose);
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&verbose,VerboseEnum);
+	
+	SetVerbosityLevel(verbose);
 
 	for(i=0;i<nummodels;i++){
@@ -39,6 +47,6 @@
 
 		/*Hack for trasient runs (to be improved)*/
-		if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && iomodel->dim==2) continue;
-		if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && iomodel->dim==2) continue;
+		if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && dim==2) continue;
+		if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && dim==2) continue;
 	
 		_printf_(VerboseMProcessor(),"   create datasets for analysis %s\n",EnumToStringx(analysis_type));
Index: /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 9356)
@@ -36,10 +36,14 @@
 
 	/*as many nodes as there are vertices */
+	int    numberofvertices;
 
 	/*output: */
 	bool* my_nodes=NULL;
 
-	my_nodes=(bool*)xmalloc(iomodel->numberofvertices*sizeof(bool));
-	memcpy(my_nodes,my_vertices,iomodel->numberofvertices*sizeof(bool));
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+
+	my_nodes=(bool*)xmalloc(numberofvertices*sizeof(bool));
+	memcpy(my_nodes,my_vertices,numberofvertices*sizeof(bool));
 
 	/*Assign output pointers:*/
@@ -50,4 +54,9 @@
 void  DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel){
 
+	int    numberofelements;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+
 	/*each element has it own nodes (as many as vertices) + additional nodes from neighbouring elements for each edge. This yields to a very different partition for 
 	 * the nodes and the vertices. The vertices are similar to continuous galerkin, but the nodes partitioning involves edges, which mess up sorting of 
@@ -55,4 +64,5 @@
 	
 	int i,j;
+	int    dim;
 
 	/*output: */
@@ -63,4 +73,8 @@
 	double  e1,e2;
 	int     pos;
+	int     numberofedges;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
 
 	/*Build discontinuous node partitioning
@@ -74,9 +88,9 @@
 
 	/*Allocate*/
-	my_nodes=(bool*)xcalloc(3*iomodel->numberofelements,sizeof(int));
+	my_nodes=(bool*)xcalloc(3*numberofelements,sizeof(int));
 
 	/*First: add all the nodes of all the elements belonging to this cpu*/
-	if (iomodel->dim==2){
-		for (i=0;i<iomodel->numberofelements;i++){
+	if (dim==2){
+		for (i=0;i<numberofelements;i++){
 			if (my_elements[i]){
 				my_nodes[3*i+0]=1;
@@ -93,10 +107,10 @@
 
 	/*Get edges and elements*/
-	iomodel->FetchData(&iomodel->edges,&iomodel->numberofedges,&cols,EdgesEnum);
+	iomodel->FetchData(&iomodel->edges,&numberofedges,&cols,EdgesEnum);
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
 	if (cols!=4) _error_("field edges should have 4 columns");
 
 	/*!All elements have been partitioned above, only create elements for this CPU: */
-	for (i=0;i<iomodel->numberofedges;i++){
+	for (i=0;i<numberofedges;i++){
 
 		/*Get left and right elements*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 9356)
@@ -10,4 +10,9 @@
 void	CreateConstraintsPrognostic(Constraints** pconstraints, IoModel* iomodel){
 
+	int prognostic_DG;
+	
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+
 	/*Output*/
 	Constraints *constraints = NULL;
@@ -20,5 +25,5 @@
 
 	/*Do not add constraints in DG, they are weakly imposed*/
-	if(!iomodel->prognostic_DG){
+	if(!prognostic_DG){
 		IoModelToConstraintsx(constraints,iomodel,SpcthicknessEnum,PrognosticAnalysisEnum);
 	}
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 9356)
@@ -18,7 +18,13 @@
 	int penpair_ids[2];
 	int count=0;
+	int prognostic_DG;
+	int numberofedges;
+	int numpenalties;
 
 	/*DataSet*/
 	Loads*    loads    = NULL;
+	
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Recover pointer: */
@@ -29,13 +35,13 @@
 
 	/*Loads only in DG*/
-	if (iomodel->prognostic_DG){
+	if (prognostic_DG){
 
 		/*Get edges and elements*/
-		iomodel->FetchData(&iomodel->edges,&iomodel->numberofedges,NULL,EdgesEnum);
+		iomodel->FetchData(&iomodel->edges,&numberofedges,NULL,EdgesEnum);
 		iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
 		iomodel->FetchData(&iomodel->thickness,NULL,NULL,ThicknessEnum);
 
 		/*First load data:*/
-		for (i=0;i<iomodel->numberofedges;i++){
+		for (i=0;i<numberofedges;i++){
 
 			/*Get left and right elements*/
@@ -57,8 +63,8 @@
 
 	/*Create Penpair for penalties: */
-	iomodel->FetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,PenaltiesEnum);
+	iomodel->FetchData(&iomodel->penalties,&numpenalties,NULL,PenaltiesEnum);
 	iomodel->FetchData(&iomodel->nodeonbed,NULL,NULL,NodeOnBedEnum);
 
-	for(i=0;i<iomodel->numpenalties;i++){
+	for(i=0;i<numpenalties;i++){
 
 		if(iomodel->my_vertices[(int)iomodel->penalties[2*i+0]-1]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 9356)
@@ -21,7 +21,17 @@
 	int  io_index;
 	bool continuous_galerkin=true;
+	int  dim;
+	int    numberofelements;
+	int    numberofvertices;
+	int    prognostic_DG;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Recover pointer: */
@@ -32,9 +42,9 @@
 
 	/*Create partition of nodes: */
-	if(iomodel->prognostic_DG) continuous_galerkin=false;
+	if(prognostic_DG) continuous_galerkin=false;
 	NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
 
 	/*Check in 3d*/
-	if(iomodel->prognostic_DG && iomodel->dim==3) _error_("DG 3d not implemented yet");
+	if(prognostic_DG && dim==3) _error_("DG 3d not implemented yet");
 
 	/*First fetch data: */
@@ -50,5 +60,5 @@
 
 		/*Build Nodes dataset (Continuous Galerkin)*/
-		for (i=0;i<iomodel->numberofvertices;i++){
+		for (i=0;i<numberofvertices;i++){
 
 			if(iomodel->my_vertices[i]){
@@ -63,5 +73,5 @@
 
 		/*Build Nodes dataset -> 3 for each element (Discontinuous Galerkin)*/
-		for (i=0;i<iomodel->numberofelements;i++){
+		for (i=0;i<numberofelements;i++){
 			for (j=0;j<3;j++){
 
@@ -71,5 +81,5 @@
 					vertex_id=(int)*(iomodel->elements+3*i+j); //(Matlab indexing)
 					io_index=vertex_id-1;                      //(C indexing)
-					_assert_(vertex_id>0 && vertex_id<=iomodel->numberofvertices);
+					_assert_(vertex_id>0 && vertex_id<=numberofvertices);
 
 					//Compute Node id
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 9356)
@@ -16,10 +16,17 @@
 void	UpdateElementsPrognostic(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
+	int    dim;
+	int    numberofelements;
+	int    prognostic_DG;
+
 	/*Fetch data needed: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -42,9 +49,9 @@
 	iomodel->FetchDataToInput(elements,VyEnum);
 
-	if(iomodel->prognostic_DG){
+	if(prognostic_DG){
 		iomodel->FetchDataToInput(elements,SpcthicknessEnum); //for DG, we need the spc in the element
 	}
 	
-	if (iomodel->dim==3){
+	if (dim==3){
 		iomodel->FetchDataToInput(elements,ElementOnBedEnum);
 		iomodel->FetchDataToInput(elements,ElementOnSurfaceEnum);
Index: /issm/trunk/src/c/modules/ModelProcessorx/Qmu/CreateParametersQmu.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Qmu/CreateParametersQmu.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Qmu/CreateParametersQmu.cpp	(revision 9356)
@@ -52,4 +52,8 @@
 	int      m,n;
 	int      count;
+	bool     qmu_analysis=false;
+	char*    name=NULL;
+	int      numberofresponses;
+	int      numberofvertices;
 
 	/*}}}*/
@@ -58,18 +62,22 @@
 	parameters=*pparameters;
 
-	parameters->AddObject(new   BoolParam(QmuAnalysisEnum,iomodel->qmu_analysis));
-	if(iomodel->qmu_analysis){
+	/*recover parameters: */
+	parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
+	parameters->FindParam(&name,NameEnum);
+	parameters->FindParam(&numberofresponses,NumberOfResponsesEnum);
+	parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	if(qmu_analysis){
 
 		/*name of qmu input, error and output files:{{{1*/
-		qmuinname=(char*)xmalloc((strlen(iomodel->name)+strlen(".qmu.in")+1)*sizeof(char));
-		sprintf(qmuinname,"%s%s",iomodel->name,".qmu.in");
+		qmuinname=(char*)xmalloc((strlen(name)+strlen(".qmu.in")+1)*sizeof(char));
+		sprintf(qmuinname,"%s%s",name,".qmu.in");
 		parameters->AddObject(new   StringParam(QmuInNameEnum,qmuinname));
 
-		qmuoutname=(char*)xmalloc((strlen(iomodel->name)+strlen(".qmu.out")+1)*sizeof(char));
-		sprintf(qmuoutname,"%s%s",iomodel->name,".qmu.out");
+		qmuoutname=(char*)xmalloc((strlen(name)+strlen(".qmu.out")+1)*sizeof(char));
+		sprintf(qmuoutname,"%s%s",name,".qmu.out");
 		parameters->AddObject(new   StringParam(QmuOutNameEnum,qmuoutname));
 
-		qmuerrname=(char*)xmalloc((strlen(iomodel->name)+strlen(".qmu.err")+1)*sizeof(char));
-		sprintf(qmuerrname,"%s%s",iomodel->name,".qmu.err");
+		qmuerrname=(char*)xmalloc((strlen(name)+strlen(".qmu.err")+1)*sizeof(char));
+		sprintf(qmuerrname,"%s%s",name,".qmu.err");
 		parameters->AddObject(new   StringParam(QmuErrNameEnum,qmuerrname));
 		/*}}}*/
@@ -86,9 +94,8 @@
 		/*Ok, we have all the response descriptors. Build a parameter with it: */
 		parameters->AddObject(new StringArrayParam(ResponsedescriptorsEnum,responsedescriptors,numresponsedescriptors));
-		parameters->AddObject(new    IntParam(QmuNumberOfResponsesEnum,iomodel->numberofresponses));
+		parameters->AddObject(new    IntParam(QmuNumberOfResponsesEnum,numberofresponses));
 		/*}}}*/
 		/*Deal with partitioning: {{{1*/
 		/*partition vertices in iomodel->qmu_npart parts, unless a partition is already present: */
-		parameters->AddObject(new    IntParam(QmuNPartEnum,iomodel->qmu_npart));
 		
 		iomodel->FetchData(&dpart,NULL,NULL,PartEnum);
@@ -99,8 +106,8 @@
 			ElementsAndVerticesPartitioning(&iomodel->my_elements,&iomodel->my_vertices,iomodel);
 
-			dpart=(double*)xmalloc(iomodel->numberofvertices*sizeof(double));
-			for(i=0;i<iomodel->numberofvertices;i++)dpart[i]=iomodel->my_vertices[i];
-		}
-		parameters->AddObject(new DoubleVecParam(QmuPartEnum,dpart,iomodel->numberofvertices));
+			dpart=(double*)xmalloc(numberofvertices*sizeof(double));
+			for(i=0;i<numberofvertices;i++)dpart[i]=iomodel->my_vertices[i];
+		}
+		parameters->AddObject(new DoubleVecParam(QmuPartEnum,dpart,numberofvertices));
 		/*}}}*/
 		/*Deal with data needed because of qmu variables: {{{1*/
@@ -116,8 +123,8 @@
 
 				/*Convert units: */
-				UnitConversion(dakota_parameter,iomodel->numberofvertices,ExtToIuEnum,StringToEnumx(tag));
+				UnitConversion(dakota_parameter,numberofvertices,ExtToIuEnum,StringToEnumx(tag));
 
 				/*Add to parameters: */
-				parameters->AddObject(new DoubleVecParam(StringToEnumx(tag),dakota_parameter,iomodel->numberofvertices));
+				parameters->AddObject(new DoubleVecParam(StringToEnumx(tag),dakota_parameter,numberofvertices));
 				
 				/*Free ressources:*/
@@ -187,5 +194,4 @@
 		}
 		/*}}}*/
-		parameters->AddObject(new   BoolParam(QmuSaveFemmodelEnum,iomodel->qmu_save_femmodel));
 		/*Free data: {{{1*/
 		for(i=0;i<numresponsedescriptors;i++){
@@ -208,6 +214,7 @@
 		xfree((void**)&qmuerrname);
 		xfree((void**)&qmuoutname);
-		/*}}}*/
-	} //if(iomodel->qmu_analysis)
+		xfree((void**)&name);
+		/*}}}*/
+	} //if(qmu_analysis)
 
 	/*Assign output pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp	(revision 9356)
@@ -18,7 +18,11 @@
 	int i;
 	bool continuous_galerkin=true;
+	int    numberofvertices;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Recover pointer: */
@@ -39,5 +43,5 @@
 	iomodel->FetchData(&iomodel->nodeonwater,NULL,NULL,NodeOnWaterEnum);
 
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		if(iomodel->my_vertices[i]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp	(revision 9356)
@@ -16,10 +16,15 @@
 void	UpdateElementsSurfaceSlope(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
+	int    dim;
+	int    numberofelements;
+
 	/*Fetch data needed: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -33,5 +38,5 @@
 	iomodel->FetchDataToInput(elements,ElementOnWaterEnum);
 	
-	if (iomodel->dim==3){
+	if (dim==3){
 		iomodel->FetchDataToInput(elements,ElementOnBedEnum);
 		iomodel->FetchDataToInput(elements,ElementOnSurfaceEnum);
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 9356)
@@ -17,7 +17,11 @@
 	int i;
 	int count;
+	int    dim;
 	
 	/*Output*/
 	Constraints* constraints = NULL;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
 
 	/*Recover pointer: */
@@ -28,5 +32,5 @@
 
 	/*Only 3d mesh supported*/
-	if (iomodel->dim==3){
+	if (dim==3){
 		IoModelToConstraintsx(constraints,iomodel,SpctemperatureEnum,ThermalAnalysisEnum);
 	}
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 9356)
@@ -15,4 +15,6 @@
 	/*Intermediary*/
 	int i;
+	int    dim;
+	int    numberofvertices;
 
 	/*DataSet*/
@@ -23,9 +25,13 @@
 	loads=*ploads;
 
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+
 	/*Create loads if they do not exist yet*/
 	if(!loads) loads = new Loads(LoadsEnum);
 
 	/*return if 2d mesh*/
-	if (iomodel->dim==2) _error_("2d meshes not supported yet");
+	if (dim==2) _error_("2d meshes not supported yet");
 
 	//create penalties for nodes: no node can have a temperature over the melting point
@@ -34,5 +40,5 @@
 	CreateSingleNodeToElementConnectivity(iomodel);
 
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 	
 		/*keep only this partition's nodes:*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp	(revision 9356)
@@ -18,8 +18,12 @@
 	int i;
 	bool continuous_galerkin=true;
+	int    numberofvertices;
 
 	/*DataSets: */
 	Nodes*    nodes = NULL;
-	
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+
 	/*Recover pointer: */
 	nodes=*pnodes;
@@ -39,5 +43,5 @@
 	iomodel->FetchData(&iomodel->nodeonwater,NULL,NULL,NodeOnWaterEnum);
 
-	for (i=0;i<iomodel->numberofvertices;i++){
+	for (i=0;i<numberofvertices;i++){
 
 		if(iomodel->my_vertices[i]){
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp	(revision 9356)
@@ -16,6 +16,15 @@
 void	UpdateElementsThermal(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
 
+	int    dim;
+	int    numberofelements;
+	bool   qmu_analysis;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
+
 	/*Now, is the model 3d? otherwise, do nothing: */
-	if (iomodel->dim==2)return;
+	if (dim==2)return;
 
 	/*Fetch data needed: */
@@ -24,5 +33,5 @@
 	/*Update elements: */
 	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<numberofelements;i++){
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -53,5 +62,5 @@
 	iomodel->FetchDataToInput(elements,VzEnum);
 	
-	if(iomodel->qmu_analysis)elements->InputDuplicate(TemperatureEnum,QmuTemperatureEnum);
+	if(qmu_analysis)elements->InputDuplicate(TemperatureEnum,QmuTemperatureEnum);
 
 	/*Free data: */
Index: /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 9355)
+++ /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 9356)
@@ -143,5 +143,5 @@
 	else if (strcmp(name,"Adjointz")==0) return AdjointzEnum;
 	else if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
-	else if (strcmp(name,"ArtDiff")==0) return ArtDiffEnum;
+	else if (strcmp(name,"Fake35")==0) return Fake35Enum;
 	else if (strcmp(name,"Bed")==0) return BedEnum;
 	else if (strcmp(name,"Bathymetry")==0) return BathymetryEnum;
@@ -153,5 +153,5 @@
 	else if (strcmp(name,"Fake2")==0) return Fake2Enum;
 	else if (strcmp(name,"Constant")==0) return ConstantEnum;
-	else if (strcmp(name,"NumControls")==0) return NumControlsEnum;
+	else if (strcmp(name,"Fake37")==0) return Fake37Enum;
 	else if (strcmp(name,"ControlType")==0) return ControlTypeEnum;
 	else if (strcmp(name,"Converged")==0) return ConvergedEnum;
@@ -348,5 +348,5 @@
 	else if (strcmp(name,"QmuInName")==0) return QmuInNameEnum;
 	else if (strcmp(name,"QmuMassFluxSegments")==0) return QmuMassFluxSegmentsEnum;
-	else if (strcmp(name,"QmuNPart")==0) return QmuNPartEnum;
+	else if (strcmp(name,"Fake39")==0) return Fake39Enum;
 	else if (strcmp(name,"QmuOutName")==0) return QmuOutNameEnum;
 	else if (strcmp(name,"QmuPart")==0) return QmuPartEnum;
@@ -370,5 +370,5 @@
 	else if (strcmp(name,"Fset")==0) return FsetEnum;
 	else if (strcmp(name,"Sset")==0) return SsetEnum;
-	else if (strcmp(name,"GroundingLineMigration")==0) return GroundingLineMigrationEnum;
+	else if (strcmp(name,"GroundinglineMigration")==0) return GroundinglineMigrationEnum;
 	else if (strcmp(name,"Yts")==0) return YtsEnum;
 	else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
@@ -399,5 +399,5 @@
 	else if (strcmp(name,"VelAbsGradient")==0) return VelAbsGradientEnum;
 	else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
-	else if (strcmp(name,"NumResponses")==0) return NumResponsesEnum;
+	else if (strcmp(name,"Fake38")==0) return Fake38Enum;
 	else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
 	else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
@@ -429,5 +429,5 @@
 	else if (strcmp(name,"NodeOnHutter")==0) return NodeOnHutterEnum;
 	else if (strcmp(name,"Z")==0) return ZEnum;
-	else if (strcmp(name,"GlMigration")==0) return GlMigrationEnum;
+	else if (strcmp(name,"Fake36")==0) return Fake36Enum;
 	else if (strcmp(name,"Riftinfo")==0) return RiftinfoEnum;
 	else if (strcmp(name,"ElementOnIceSheet")==0) return ElementOnIceSheetEnum;
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 9356)
@@ -49,5 +49,5 @@
 Penta::Penta(int penta_id, int penta_sid, int index, IoModel* iomodel,int nummodels)
 	:PentaRef(nummodels)
-	,PentaHook(nummodels,index+1,iomodel->numberofelements+1) //index+1: matice id, iomodel->numberofelements+1: matpar id
+	,PentaHook(nummodels,index+1,iomodel) //index+1: matice id, iomodel->numberofelements+1: matpar id
                                                                       { //i is the element index
 
@@ -1881,5 +1881,5 @@
 	thermalconductivity=matpar->GetThermalConductivity();
 	this->parameters->FindParam(&dt,DtEnum);
-	this->parameters->FindParam(&artdiff,ArtDiffEnum);
+	this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
 	this->parameters->FindParam(&epsvel,EpsvelEnum);
 	Input* pressure_input=inputs->GetInput(PressureEnum);      _assert_(pressure_input);
@@ -2155,5 +2155,5 @@
 	thermalconductivity=matpar->GetThermalConductivity();
 	this->parameters->FindParam(&dt,DtEnum);
-	this->parameters->FindParam(&artdiff,ArtDiffEnum);
+	this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
 	this->parameters->FindParam(&epsvel,EpsvelEnum);
 	Input* vx_input=inputs->GetInput(VxEnum);      _assert_(vx_input);
@@ -3318,5 +3318,5 @@
 	thermalconductivity=matpar->GetThermalConductivity();
 	this->parameters->FindParam(&dt,DtEnum);
-	this->parameters->FindParam(&artdiff,ArtDiffEnum);
+	this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
 	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
 	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
@@ -3587,5 +3587,5 @@
 	thermalconductivity=matpar->GetThermalConductivity();
 	this->parameters->FindParam(&dt,DtEnum);
-	this->parameters->FindParam(&artdiff,ArtDiffEnum);
+	this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
 	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
 	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
@@ -4467,5 +4467,5 @@
 	int        *responses = NULL;
 	int         num_responses,resp;
-	this->parameters->FindParam(&num_responses,NumResponsesEnum);
+	this->parameters->FindParam(&num_responses,NumCmResponsesEnum);
 	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
 
@@ -4795,5 +4795,5 @@
 
 	/*retrieve some parameters: */
-	this->parameters->FindParam(&num_controls,NumControlsEnum);
+	this->parameters->FindParam(&num_controls,NumControlTypeEnum);
 	this->parameters->FindParam(&control_type,NULL,ControlTypeEnum);
 
@@ -4853,5 +4853,14 @@
 	double time;
 	TransientInput* transientinput=NULL;
-		
+
+	int    numberofvertices;
+	int    numberofelements;
+	double yts;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&yts,YtsEnum);
+
 	/*Branch on type of vector: nodal or elementary: */
 	if(vector_type==1){ //nodal vector
@@ -4863,5 +4872,5 @@
 
 		/*Are we in transient or static? */
-		if(M==iomodel->numberofvertices){
+		if(M==numberofvertices){
 
 			/*create input values: */
@@ -4874,5 +4883,5 @@
 			this->inputs->AddInput(new PentaVertexInput(vector_enum,nodeinputs));
 		}
-		else if(M==iomodel->numberofvertices+1){
+		else if(M==numberofvertices+1){
 			/*create transient input: */
 			for(t=0;t<N;t++){ //N is the number of times
@@ -4888,5 +4897,5 @@
 
 				/*time? :*/
-				time=(double)vector[(M-1)*N+t]*iomodel->yts;
+				time=(double)vector[(M-1)*N+t]*yts;
 
 				if(t==0)transientinput=new TransientInput(vector_enum);
@@ -4895,9 +4904,9 @@
 			this->inputs->AddInput(transientinput);
 		}
-		else _error_("nodal vector is either numberofnodes (%i), or numberofnodes+1 long. Field provided is %i long. Enum %s",iomodel->numberofvertices,M,EnumToStringx(vector_enum));
+		else _error_("nodal vector is either numberofnodes (%i), or numberofnodes+1 long. Field provided is %i long. Enum %s",numberofvertices,M,EnumToStringx(vector_enum));
 	}
 	else if(vector_type==2){ //element vector
 		/*Are we in transient or static? */
-		if(M==iomodel->numberofelements){
+		if(M==numberofelements){
 
 			/*static mode: create an input out of the element value: */
@@ -5153,4 +5162,15 @@
 	double  cmmaxinputs[6];
 
+	double  yts;
+	int     control_analysis;
+	int     num_control_type;
+	int     num_cm_responses;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&yts,YtsEnum);
+	iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
+	iomodel->parameters->FindParam(&num_control_type,NumControlTypeEnum);
+	iomodel->parameters->FindParam(&num_cm_responses,NumCmResponsesEnum);
+
 	/*Checks if debuging*/
 	/*{{{2*/
@@ -5165,12 +5185,12 @@
 	
 	/*Control Inputs*/
-	if (iomodel->control_analysis && iomodel->control_type){
-		for(i=0;i<iomodel->num_control_type;i++){
+	if (control_analysis && iomodel->control_type){
+		for(i=0;i<num_control_type;i++){
 			switch((int)iomodel->control_type[i]){
 				case DhdtEnum:
 					if (iomodel->dhdt){
-						for(j=0;j<6;j++)nodeinputs[j]=iomodel->dhdt[penta_vertex_ids[j]-1]/iomodel->yts;
-						for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
-						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
+						for(j=0;j<6;j++)nodeinputs[j]=iomodel->dhdt[penta_vertex_ids[j]-1]/yts;
+						for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(DhdtEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
@@ -5178,7 +5198,7 @@
 				case VxEnum:
 					if (iomodel->vx){
-						for(j=0;j<6;j++)nodeinputs[j]=iomodel->vx[penta_vertex_ids[j]-1]/iomodel->yts;
-						for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
-						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
+						for(j=0;j<6;j++)nodeinputs[j]=iomodel->vx[penta_vertex_ids[j]-1]/yts;
+						for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(VxEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
@@ -5186,7 +5206,7 @@
 				case VyEnum:
 					if (iomodel->vy){
-						for(j=0;j<6;j++)nodeinputs[j]=iomodel->vy[penta_vertex_ids[j]-1]/iomodel->yts;
-						for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
-						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
+						for(j=0;j<6;j++)nodeinputs[j]=iomodel->vy[penta_vertex_ids[j]-1]/yts;
+						for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(VyEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
@@ -5195,6 +5215,6 @@
 					if (iomodel->drag_coefficient){
 						for(j=0;j<6;j++)nodeinputs[j]=iomodel->drag_coefficient[penta_vertex_ids[j]-1];
-						for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*iomodel->num_control_type+i];
-						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*iomodel->num_control_type+i];
+						for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*num_control_type+i];
+						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*num_control_type+i];
 						this->inputs->AddInput(new ControlInput(DragCoefficientEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
@@ -5244,6 +5264,6 @@
 		/*Create inputs and add to DataSetInput*/
 		DatasetInput* datasetinput=new DatasetInput(WeightsEnum);
-		for(i=0;i<iomodel->num_cm_responses;i++){
-			for(j=0;j<6;j++)nodeinputs[j]=iomodel->weights[(penta_vertex_ids[j]-1)*iomodel->num_cm_responses+i];
+		for(i=0;i<num_cm_responses;i++){
+			for(j=0;j<6;j++)nodeinputs[j]=iomodel->weights[(penta_vertex_ids[j]-1)*num_cm_responses+i];
 			datasetinput->inputs->AddObject(new PentaVertexInput(WeightsEnum,nodeinputs));
 		}
@@ -7493,4 +7513,21 @@
 	int     penta_vertex_ids[6];
 	double  nodeinputs[6];
+	double  yts;
+	int     prognostic_DG;
+	bool    qmu_analysis;
+	int     isstokes;
+	double  beta,heatcapacity,referencetemperature,meltingpoint,latentheat;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&yts,YtsEnum);
+	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
+	iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
+	iomodel->parameters->FindParam(&beta,BetaEnum);
+	iomodel->parameters->FindParam(&heatcapacity,HeatcapacityEnum);
+	iomodel->parameters->FindParam(&referencetemperature,ReferencetemperatureEnum);
+	iomodel->parameters->FindParam(&meltingpoint,MeltingpointEnum);
+	iomodel->parameters->FindParam(&latentheat,LatentheatEnum);
+
 
 	/*Checks if debuging*/
@@ -7500,5 +7537,5 @@
 
 	/*Recover element type*/
-	if ((analysis_type==PrognosticAnalysisEnum || analysis_type==BalancethicknessAnalysisEnum) && iomodel->prognostic_DG){
+	if ((analysis_type==PrognosticAnalysisEnum || analysis_type==BalancethicknessAnalysisEnum) && prognostic_DG){
 		/*P1 Discontinuous Galerkin*/
 		penta_type=P1DGEnum;
@@ -7533,31 +7570,31 @@
 			/*default vx,vy and vz: either observation or 0 */
 			if(!iomodel->vx){
-				if (iomodel->vx_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vx_obs[penta_vertex_ids[i]-1]/iomodel->yts;
+				if (iomodel->vx_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vx_obs[penta_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<6;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new PentaVertexInput(VxEnum,nodeinputs));
 				this->inputs->AddInput(new PentaVertexInput(VxPicardEnum,nodeinputs));
-				if(iomodel->qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVxEnum,nodeinputs));
+				if(qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVxEnum,nodeinputs));
 			}
 			if(!iomodel->vy){
-				if (iomodel->vy_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vy_obs[penta_vertex_ids[i]-1]/iomodel->yts;
+				if (iomodel->vy_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vy_obs[penta_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<6;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new PentaVertexInput(VyEnum,nodeinputs));
 				this->inputs->AddInput(new PentaVertexInput(VyPicardEnum,nodeinputs));
-				if(iomodel->qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVyEnum,nodeinputs));
+				if(qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVyEnum,nodeinputs));
 			}
 			if(!iomodel->vz){
-				if (iomodel->vz_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vz_obs[penta_vertex_ids[i]-1]/iomodel->yts;
+				if (iomodel->vz_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vz_obs[penta_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<6;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new PentaVertexInput(VzEnum,nodeinputs));
 				this->inputs->AddInput(new PentaVertexInput(VzPicardEnum,nodeinputs));
-				if(iomodel->qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVzEnum,nodeinputs));
+				if(qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVzEnum,nodeinputs));
 			}
 			if(!iomodel->pressure){
 				for(i=0;i<6;i++)nodeinputs[i]=0;
-				if(iomodel->qmu_analysis){
+				if(qmu_analysis){
 					this->inputs->AddInput(new PentaVertexInput(PressureEnum,nodeinputs));
 					this->inputs->AddInput(new PentaVertexInput(QmuPressureEnum,nodeinputs));
 				}
-				if(iomodel->isstokes){
+				if(isstokes){
 					this->inputs->AddInput(new PentaVertexInput(PressureEnum,nodeinputs));
 					this->inputs->AddInput(new PentaVertexInput(PressurePicardEnum,nodeinputs));
@@ -7567,7 +7604,7 @@
 				/*Create VzPattyn and VzStokes Enums*/
 				if(iomodel->vz && iomodel->nodeonstokes){
-					for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1];
+					for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1];
 					this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs));
-					for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]);
+					for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]);
 					this->inputs->AddInput(new PentaVertexInput(VzPattynEnum,nodeinputs));
 				}
@@ -7581,7 +7618,7 @@
 				/*Create VzMacAyeal and VzStokes Enums*/
 				if(iomodel->vz && iomodel->nodeonstokes){
-					for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1];
+					for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1];
 					this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs));
-					for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]);
+					for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]);
 					this->inputs->AddInput(new PentaVertexInput(VzMacAyealEnum,nodeinputs));
 				}
@@ -7610,10 +7647,10 @@
 			if (iomodel->temperature && iomodel->waterfraction) {
 				for(i=0;i<6;i++){
-					if(iomodel->temperature[penta_vertex_ids[i]-1] < iomodel->meltingpoint-iomodel->beta*iomodel->pressure[penta_vertex_ids[i]-1]){
-						nodeinputs[i]=iomodel->heatcapacity*(iomodel->temperature[penta_vertex_ids[i]-1]-iomodel->referencetemperature);
+					if(iomodel->temperature[penta_vertex_ids[i]-1] < meltingpoint-beta*iomodel->pressure[penta_vertex_ids[i]-1]){
+						nodeinputs[i]=heatcapacity*(iomodel->temperature[penta_vertex_ids[i]-1]-referencetemperature);
 					}
-					else nodeinputs[i]=iomodel->heatcapacity*
-					 (iomodel->meltingpoint-iomodel->beta*iomodel->pressure[penta_vertex_ids[i]-1]-iomodel->referencetemperature)
-						+iomodel->latentheat*iomodel->waterfraction[penta_vertex_ids[i]-1];
+					else nodeinputs[i]=heatcapacity*
+					 (meltingpoint-beta*iomodel->pressure[penta_vertex_ids[i]-1]-referencetemperature)
+						+latentheat*iomodel->waterfraction[penta_vertex_ids[i]-1];
 				}
 				this->inputs->AddInput(new PentaVertexInput(EnthalpyEnum,nodeinputs));
Index: /issm/trunk/src/c/objects/Elements/PentaHook.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/PentaHook.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Elements/PentaHook.cpp	(revision 9356)
@@ -45,6 +45,12 @@
 /*}}}*/
 /*FUNCTION PentaHook::PentaHook(int in_numanalyses,int matice_id, int matpar_id){{{1*/
-PentaHook::PentaHook(int in_numanalyses,int matice_id, int matpar_id){
+PentaHook::PentaHook(int in_numanalyses,int matice_id, IoModel* iomodel){
+
+	/*intermediary: */
+	int matpar_id;
 	
+	/*retrieve parameters: */
+	iomodel->parameters->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;
+
 	this->numanalyses=in_numanalyses;
 	this->hnodes=new Hook*[in_numanalyses];
Index: /issm/trunk/src/c/objects/Elements/PentaHook.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/PentaHook.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Elements/PentaHook.h	(revision 9356)
@@ -8,4 +8,5 @@
 class Hook;
 class TriaHook;
+class IoModel;
 
 class PentaHook{
@@ -20,5 +21,5 @@
 		/*FUNCTION constructors, destructors {{{1*/
 		PentaHook();
-		PentaHook(int in_numanalyses,int matice_id, int matpar_id);
+		PentaHook(int in_numanalyses,int matice_id, IoModel* iomodel);
 		~PentaHook();
 		void SetHookNodes(int* node_ids,int analysis_counter);
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 9356)
@@ -41,5 +41,5 @@
 Tria::Tria(int tria_id, int tria_sid, int index, IoModel* iomodel,int nummodels)
 	:TriaRef(nummodels)
-	,TriaHook(nummodels,index+1,iomodel->numberofelements+1){
+	,TriaHook(nummodels,index+1,iomodel){
 		
 		int i;
@@ -534,5 +534,5 @@
 	/*Retrieve all Inputs and parameters: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
-	this->parameters->FindParam(&artdiff,ArtDiffEnum);
+	this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
 	this->parameters->FindParam(&dim,DimEnum);
 	Input* vxaverage_input=NULL;
@@ -861,5 +861,5 @@
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
 	this->parameters->FindParam(&dt,DtEnum);
-	this->parameters->FindParam(&artdiff,ArtDiffEnum);
+	this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
 	Input* vx_input=inputs->GetInput(HydrologyWaterVxEnum); _assert_(vx_input);
 	Input* vy_input=inputs->GetInput(HydrologyWaterVyEnum); _assert_(vy_input);
@@ -1020,5 +1020,5 @@
 	this->parameters->FindParam(&dt,DtEnum);
 	this->parameters->FindParam(&dim,DimEnum);
-	this->parameters->FindParam(&artdiff,ArtDiffEnum);
+	this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
 	Input* vxaverage_input=NULL;
 	Input* vyaverage_input=NULL;
@@ -1462,5 +1462,5 @@
 	/*Retrieve all inputs and parameters*/
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
-	this->parameters->FindParam(&num_responses,NumResponsesEnum);
+	this->parameters->FindParam(&num_responses,NumCmResponsesEnum);
 	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
 	Input* thickness_input    = inputs->GetInput(ThicknessEnum);   _assert_(thickness_input);
@@ -1528,5 +1528,5 @@
 	/*Retrieve all inputs and parameters*/
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
-	this->parameters->FindParam(&num_responses,NumResponsesEnum);
+	this->parameters->FindParam(&num_responses,NumCmResponsesEnum);
 	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
 	this->parameters->FindParam(&meanvel,MeanvelEnum);
@@ -1704,5 +1704,5 @@
 	/*Retrieve all inputs and parameters*/
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
-	this->parameters->FindParam(&num_responses,NumResponsesEnum);
+	this->parameters->FindParam(&num_responses,NumCmResponsesEnum);
 	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
 	this->parameters->FindParam(&meanvel,MeanvelEnum);
@@ -2718,5 +2718,5 @@
 	int        *responses = NULL;
 	int         num_responses,resp;
-	this->parameters->FindParam(&num_responses,NumResponsesEnum);
+	this->parameters->FindParam(&num_responses,NumCmResponsesEnum);
 	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
 
@@ -3112,5 +3112,5 @@
 
 	/*retrieve some parameters: */
-	this->parameters->FindParam(&num_controls,NumControlsEnum);
+	this->parameters->FindParam(&num_controls,NumControlTypeEnum);
 	this->parameters->FindParam(&control_type,NULL,ControlTypeEnum);
 
@@ -3271,4 +3271,9 @@
 	double cmmininputs[3];
 	double cmmaxinputs[3];
+	bool   control_analysis=false;
+	int    num_control_type;
+	double yts;
+	int    num_cm_responses;
+   
 
 	/*Checks if debuging*/
@@ -3277,4 +3282,10 @@
 	/*}}}*/
 
+	/*Get parameters: */
+	iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
+	iomodel->parameters->FindParam(&num_control_type,NumControlTypeEnum);
+	iomodel->parameters->FindParam(&yts,YtsEnum); 
+	iomodel->parameters->FindParam(&num_cm_responses,NumCmResponsesEnum);
+
 	/*Recover vertices ids needed to initialize inputs*/
 	for(i=0;i<3;i++){ 
@@ -3283,12 +3294,12 @@
 
 	/*Control Inputs*/
-	if (iomodel->control_analysis && iomodel->control_type){
-		for(i=0;i<iomodel->num_control_type;i++){
+	if (control_analysis && iomodel->control_type){
+		for(i=0;i<num_control_type;i++){
 			switch((int)iomodel->control_type[i]){
 				case DhdtEnum:
 					if (iomodel->dhdt){
-						for(j=0;j<3;j++)nodeinputs[j]=iomodel->dhdt[tria_vertex_ids[j]-1]/iomodel->yts;
-						for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
-						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
+						for(j=0;j<3;j++)nodeinputs[j]=iomodel->dhdt[tria_vertex_ids[j]-1]/yts;
+						for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(DhdtEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
@@ -3296,7 +3307,7 @@
 				case VxEnum:
 					if (iomodel->vx){
-						for(j=0;j<3;j++)nodeinputs[j]=iomodel->vx[tria_vertex_ids[j]-1]/iomodel->yts;
-						for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
-						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
+						for(j=0;j<3;j++)nodeinputs[j]=iomodel->vx[tria_vertex_ids[j]-1]/yts;
+						for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(VxEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
@@ -3304,7 +3315,7 @@
 				case VyEnum:
 					if (iomodel->vy){
-						for(j=0;j<3;j++)nodeinputs[j]=iomodel->vy[tria_vertex_ids[j]-1]/iomodel->yts;
-						for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
-						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*iomodel->num_control_type+i]/iomodel->yts;
+						for(j=0;j<3;j++)nodeinputs[j]=iomodel->vy[tria_vertex_ids[j]-1]/yts;
+						for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(VyEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
@@ -3313,6 +3324,6 @@
 					if (iomodel->drag_coefficient){
 						for(j=0;j<3;j++)nodeinputs[j]=iomodel->drag_coefficient[tria_vertex_ids[j]-1];
-						for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*iomodel->num_control_type+i];
-						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*iomodel->num_control_type+i];
+						for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*num_control_type+i];
+						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*num_control_type+i];
 						this->inputs->AddInput(new ControlInput(DragCoefficientEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
@@ -3331,6 +3342,6 @@
 		/*Create inputs and add to DataSetInput*/
 		DatasetInput* datasetinput=new DatasetInput(WeightsEnum);
-		for(i=0;i<iomodel->num_cm_responses;i++){
-			for(j=0;j<3;j++)nodeinputs[j]=iomodel->weights[(tria_vertex_ids[j]-1)*iomodel->num_cm_responses+i];
+		for(i=0;i<num_cm_responses;i++){
+			for(j=0;j<3;j++)nodeinputs[j]=iomodel->weights[(tria_vertex_ids[j]-1)*num_cm_responses+i];
 			datasetinput->inputs->AddObject(new TriaVertexInput(WeightsEnum,nodeinputs));
 		}
@@ -3893,4 +3904,13 @@
 	double time;
 	TransientInput* transientinput=NULL;
+	int    numberofvertices;
+	int    numberofelements;
+	double yts;
+
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&yts,YtsEnum);
 
 	/*Branch on type of vector: nodal or elementary: */
@@ -3903,5 +3923,5 @@
 
 		/*Are we in transient or static? */
-		if(M==iomodel->numberofvertices){
+		if(M==numberofvertices){
 
 			/*create input values: */
@@ -3914,5 +3934,5 @@
 			this->inputs->AddInput(new TriaVertexInput(vector_enum,nodeinputs));
 		}
-		else if(M==iomodel->numberofvertices+1){
+		else if(M==numberofvertices+1){
 			/*create transient input: */
 			for(t=0;t<N;t++){ //N is the number of times
@@ -3928,5 +3948,5 @@
 
 				/*time? :*/
-				time=(double)vector[(M-1)*N+t]*iomodel->yts;
+				time=(double)vector[(M-1)*N+t]*yts;
 
 				if(t==0) transientinput=new TransientInput(vector_enum);
@@ -3935,9 +3955,9 @@
 			this->inputs->AddInput(transientinput);
 		}
-		else _error_("nodal vector is either numberofnodes (%i), or numberofnodes+1 long. Field provided is %i long",iomodel->numberofvertices,M);
+		else _error_("nodal vector is either numberofnodes (%i), or numberofnodes+1 long. Field provided is %i long",numberofvertices,M);
 	}
 	else if(vector_type==2){ //element vector
 		/*Are we in transient or static? */
-		if(M==iomodel->numberofelements){
+		if(M==numberofelements){
 
 			/*static mode: create an input out of the element value: */
@@ -5201,4 +5221,7 @@
 	int    tria_type;
 	double nodeinputs[3];
+	double yts;
+	int    prognostic_DG;
+	bool   qmu_analysis;
 
 	/*Checks if debuging*/
@@ -5207,6 +5230,11 @@
 	/*}}}*/
 
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&yts,YtsEnum);
+	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
+
 	/*Recover element type*/
-	if ((analysis_type==PrognosticAnalysisEnum || analysis_type==BalancethicknessAnalysisEnum) && iomodel->prognostic_DG){
+	if ((analysis_type==PrognosticAnalysisEnum || analysis_type==BalancethicknessAnalysisEnum) && prognostic_DG){
 		/*P1 Discontinuous Galerkin*/
 		tria_type=P1DGEnum;
@@ -5250,27 +5278,27 @@
 			/*default vx,vy and vz: either observation or 0 */
 			if(!iomodel->vx){
-				if (iomodel->vx_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vx_obs[tria_vertex_ids[i]-1]/iomodel->yts;
+				if (iomodel->vx_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vx_obs[tria_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<3;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new TriaVertexInput(VxEnum,nodeinputs));
 				this->inputs->AddInput(new TriaVertexInput(VxPicardEnum,nodeinputs));
-				if(iomodel->qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVxEnum,nodeinputs));
+				if(qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVxEnum,nodeinputs));
 			}
 			if(!iomodel->vy){
-				if (iomodel->vy_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vy_obs[tria_vertex_ids[i]-1]/iomodel->yts;
+				if (iomodel->vy_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vy_obs[tria_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<3;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new TriaVertexInput(VyEnum,nodeinputs));
 				this->inputs->AddInput(new TriaVertexInput(VyPicardEnum,nodeinputs));
-				if(iomodel->qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVyEnum,nodeinputs));
+				if(qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVyEnum,nodeinputs));
 			}
 			if(!iomodel->vz){
-				if (iomodel->vz_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vz_obs[tria_vertex_ids[i]-1]/iomodel->yts;
+				if (iomodel->vz_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vz_obs[tria_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<3;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new TriaVertexInput(VzEnum,nodeinputs));
 				this->inputs->AddInput(new TriaVertexInput(VzPicardEnum,nodeinputs));
-				if(iomodel->qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVzEnum,nodeinputs));
+				if(qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVzEnum,nodeinputs));
 			}
 			if(!iomodel->pressure){
 				for(i=0;i<3;i++)nodeinputs[i]=0;
-				if(iomodel->qmu_analysis){
+				if(qmu_analysis){
 					this->inputs->AddInput(new TriaVertexInput(PressureEnum,nodeinputs));
 					this->inputs->AddInput(new TriaVertexInput(QmuPressureEnum,nodeinputs));
Index: /issm/trunk/src/c/objects/Elements/TriaHook.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/TriaHook.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Elements/TriaHook.cpp	(revision 9356)
@@ -43,5 +43,11 @@
 /*}}}*/
 /*FUNCTION TriaHook::TriaHook(int in_numanalyses,int matice_id, int matpar_id){{{1*/
-TriaHook::TriaHook(int in_numanalyses,int matice_id, int matpar_id){
+TriaHook::TriaHook(int in_numanalyses,int matice_id, IoModel* iomodel){
+
+	/*intermediary: */
+	int matpar_id;
+
+	/*retrieve parameters: */
+	iomodel->parameters->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;
 	
 	this->numanalyses=in_numanalyses;
Index: /issm/trunk/src/c/objects/Elements/TriaHook.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/TriaHook.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Elements/TriaHook.h	(revision 9356)
@@ -7,4 +7,5 @@
 
 class Hook;
+class IoModel;
 
 class TriaHook{
@@ -19,5 +20,5 @@
 		/*FUNCTION constructors, destructors {{{1*/
 		TriaHook();
-		TriaHook(int in_numanalyses,int matice_id, int matpar_id);
+		TriaHook(int in_numanalyses,int matice_id, IoModel* iomodel);
 		~TriaHook();
 		void SetHookNodes(int* node_ids,int analysis_counter);
Index: /issm/trunk/src/c/objects/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/objects/IoModel.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/IoModel.cpp	(revision 9356)
@@ -13,4 +13,5 @@
 #include <stdio.h>
 #include "./objects.h"
+#include "./Container/Parameters.h"
 #include "../shared/shared.h"
 #include "../io/io.h"
@@ -19,5 +20,23 @@
 /*FUNCTION IoModel::IoModel(){{{1*/
 IoModel::IoModel(){
+	this->fid=NULL;
+	this->parameters=NULL;
+}
+/*}}}*/
+/*FUNCTION IoModel::IoModel(FILE*  iomodel_handle){{{1*/
+IoModel::IoModel(FILE* iomodel_handle){
+	
+	int i,j;
+
+	/*First, keep track of the file handle: */
+	this->fid=iomodel_handle;
+
+	/*Initialize and read parameters:*/
+	this->parameters=new Parameters();
+	this->FetchParameters(this->parameters); /*this routine goes through the input file, and fetches bools, ints, doubles and strings only, nothing memory intensive*/
+
+	/*Initialize the structure: */
 	this->IoModelInit();
+
 }
 /*}}}*/
@@ -43,10 +62,8 @@
 	xfree((void**)&this->nodeonhutter);
 	xfree((void**)&this->nodeonmacayeal);
-	if (this->dim==3){
-		xfree((void**)&this->elements2d);
-		xfree((void**)&this->upperelements);
-		xfree((void**)&this->lowerelements);
-		xfree((void**)&this->nodeonpattyn);
-	}
+	xfree((void**)&this->elements2d);
+	xfree((void**)&this->upperelements);
+	xfree((void**)&this->lowerelements);
+	xfree((void**)&this->nodeonpattyn);
 	xfree((void**)&this->elementonbed);
 	xfree((void**)&this->elementonsurface);
@@ -108,8 +125,4 @@
 
 	/*!Delete structure fields: */
-	xfree((void**)&this->inputfilename);
-	xfree((void**)&this->outputfilename);
-	xfree((void**)&this->repository);
-	xfree((void**)&this->name);
 	xfree((void**)&this->riftinfo);
 	xfree((void**)&this->penalties);
@@ -124,143 +137,13 @@
 }
 /*}}}*/
-/*FUNCTION IoModel::IoModel(FILE*  iomodel_handle){{{1*/
-IoModel::IoModel(FILE* iomodel_handle){
-
-	/*First, keep track of the fil handle: */
-	this->fid=iomodel_handle;
-	
-	int i,j;
-		
-	/*First, initialize the structure: */
-	this->IoModelInit();
-	
-	/*Get all the data that consists of scalars, integers and strings: */
-
-	this->FetchData(&this->name,NameEnum); 
-	this->FetchData(&this->inputfilename,InputfilenameEnum); 
-	this->FetchData(&this->outputfilename,OutputfilenameEnum); 
-	this->FetchData(&this->qmu_analysis,QmuAnalysisEnum); 
-	this->FetchData(&this->control_analysis,ControlAnalysisEnum); 
-	this->FetchData(&this->dim,DimEnum);
-	/*!Get numberofelements and numberofvertices: */
-	this->FetchData(&this->numberofvertices,NumberOfNodesEnum);
-	this->FetchData(&this->numberofelements,NumberOfElementsEnum);
-	/*!In case we are running 3d, we are going to need the collapsed and non-collapsed 2d meshes, from which the 3d mesh was extruded: */
-	if (this->dim==3){
-	
-		/*!Deal with 2d mesh: */
-		this->FetchData(&this->numberofelements2d,NumberOfElements2DEnum);
-		this->FetchData(&this->numberofvertices2d,NumberOfNodes2DEnum);
-		this->FetchData(&this->numlayers,NumlayersEnum);
-	}
-
-
-	/*elements type: */
-	this->FetchData(&this->ishutter,IshutterEnum);
-	this->FetchData(&this->ismacayealpattyn,IsmacayealpattynEnum);
-	this->FetchData(&this->isstokes,IsstokesEnum);
-
-	/*!Get drag_type, drag and p,q: */
-	this->FetchData(&this->drag_type,DragTypeEnum);
-
-	/*!Get materials: */
-	this->FetchData(&this->rho_water,RhoWaterEnum);
-	this->FetchData(&this->rho_ice,RhoIceEnum);
-	this->FetchData(&this->g,GEnum);
-
-	/*Get control parameters: */
-	this->FetchData(&this->num_control_type,NumControlTypeEnum); 
-	this->FetchData(&this->num_cm_responses,NumCmResponsesEnum); 
-
-	/*!Get solution parameters: */
-	this->FetchData(&this->yts,YtsEnum);
-	this->FetchData(&this->meanvel,MeanvelEnum);
-	this->FetchData(&this->epsvel,EpsvelEnum);
-	this->FetchData(&this->verbose,VerboseBinaryEnum);
-	this->FetchData(&this->output_frequency,OutputFrequencyEnum);
-	this->FetchData(&this->prognostic_DG,PrognosticDGEnum);
-	this->FetchData(&this->nsteps,NstepsEnum);
-	this->FetchData(&this->eps_cm,EpsCmEnum);
-	this->FetchData(&this->tolx,TolxEnum);
-	this->FetchData(&this->cm_gradient,CmGradientEnum);
-	this->FetchData(&this->eps_res,EpsResEnum);
-	this->FetchData(&this->eps_rel,EpsRelEnum);
-	this->FetchData(&this->eps_abs,EpsAbsEnum);
-	this->FetchData(&this->max_nonlinear_iterations,MaxNonlinearIterationsEnum);
-	this->FetchData(&this->max_steadystate_iterations,MaxSteadystateIterationsEnum);
-	this->FetchData(&this->dt,DtEnum);
-	this->FetchData(&this->ndt,NdtEnum);
-	this->FetchData(&this->time_adapt,TimeAdaptEnum);
-	this->FetchData(&this->cfl_coefficient,CflCoefficientEnum);
-	this->FetchData(&this->hydrostatic_adjustment,HydrostaticAdjustmentEnum);
-	this->FetchData(&this->penalty_offset,PenaltyOffsetEnum);
-	this->FetchData(&this->penalty_melting,PenaltyMeltingEnum);
-	this->FetchData(&this->penalty_lock,PenaltyLockEnum);
-	this->FetchData(&this->sparsity,SparsityEnum);
-	this->FetchData(&this->connectivity,ConnectivityEnum);
-	this->FetchData(&this->lowmem,LowmemEnum);
-	this->FetchData(&this->viscosity_overshoot,ViscosityOvershootEnum);
-	this->FetchData(&this->artdiff,ArtificialDiffusivityEnum);
-	this->FetchData(&this->prognostic_DG,PrognosticDGEnum);
-	this->FetchData(&this->stokesreconditioning,StokesreconditioningEnum);
-	this->FetchData(&this->shelf_dampening,ShelfDampeningEnum);
-	this->FetchData(&this->waitonlock,WaitonlockEnum);
-	this->FetchData(&this->gl_migration,GlMigrationEnum);
-	this->FetchData(&this->isdiagnostic,IsdiagnosticEnum); 
-	this->FetchData(&this->isprognostic,IsprognosticEnum); 
-	this->FetchData(&this->isthermal,IsthermalEnum); 
-
-	/*!Get thermal parameters: */
-	this->FetchData(&this->beta,BetaEnum);
-	this->FetchData(&this->meltingpoint,MeltingpointEnum);
-	this->FetchData(&this->referencetemperature,ReferencetemperatureEnum);
-	this->FetchData(&this->latentheat,LatentheatEnum);
-	this->FetchData(&this->heatcapacity,HeatcapacityEnum);
-	this->FetchData(&this->thermalconductivity,ThermalconductivityEnum);
-	this->FetchData(&this->min_thermal_constraints,MinThermalConstraintsEnum);
-	this->FetchData(&this->min_mechanical_constraints,MinMechanicalConstraintsEnum);
-	this->FetchData(&this->stabilize_constraints,StabilizeConstraintsEnum);
-	this->FetchData(&this->mixed_layer_capacity,MixedLayerCapacityEnum);
-	this->FetchData(&this->thermal_exchange_velocity,ThermalExchangeVelocityEnum);
-	this->FetchData(&this->basal_melting_rate_correction_apply,BasalMeltingRateCorrectionApplyEnum);
-	this->FetchData(&this->gl_melting_rate,GlMeltingRateEnum);
-	this->FetchData(&this->rheology_law,RheologyLawEnum);
-
-	/*!Get hydrology parameters: */		 
-	this->FetchData(&this->hydro_kn,HydroKnEnum);			 
-	this->FetchData(&this->hydro_p,HydroPEnum);		 
-	this->FetchData(&this->hydro_q,HydroQEnum);		 
-	this->FetchData(&this->hydro_CR,HydroCREnum);		 
-	this->FetchData(&this->hydro_n,HydroNEnum); 
-
-	/*qmu: */
-	if(this->qmu_analysis){
-		this->FetchData(&this->numberofvariables,NumberOfVariablesEnum);
-		this->FetchData(&this->numberofresponses,NumberOfResponsesEnum);
-		this->FetchData(&this->qmu_npart,NpartEnum);
-		this->FetchData(&this->qmu_save_femmodel,QmuSaveFemmodelEnum); 
-	}
-
-	/*i/o: */
-	this->FetchData(&this->io_gather,IoGatherEnum);
-}
-/*}}}*/
 /*FUNCTION IoModel::IoModelInit{{{1*/
 void IoModel::IoModelInit(void){
+
+	/*exterior data: */
+	this->nodecounter=0;
+	this->loadcounter=0;
+	this->constraintcounter=0;
 	
 	/*!initialize all pointers to 0: */
-	this->name=NULL;
-	this->inputfilename=NULL;
-	this->outputfilename=NULL;
-	this->repository=NULL;
-	this->qmu_analysis=0;
-	this->control_analysis=0;
-	this->numberofvariables=0;
-	this->numvariabledescriptors=0;
-	this->numberofresponses=0;
-	this->numresponsedescriptors=0;
-	this->qmu_npart=0; 
-	this->numberofelements=0;
-	this->numberofvertices=0;
 	this->x=NULL; 
 	this->y=NULL;
@@ -270,7 +153,5 @@
 	this->elements_type=NULL;
 	this->vertices_type=NULL;
-	this->numberofvertices2d=0;
 	this->elements2d=NULL;
-	this->numlayers=0;
 	this->upperelements=NULL;
 	this->lowerelements=NULL;
@@ -278,5 +159,4 @@
 	this->nodeonmacayeal=NULL;
 	this->nodeonpattyn=NULL;
-	this->io_gather=1;
 	
 	this->vx_obs=NULL;
@@ -289,9 +169,7 @@
 	this->temperature=NULL;
 	this->waterfraction=NULL;
-	this->gl_melting_rate=0;
 	this->basal_melting_rate=NULL;
 	this->watercolumn=NULL;
 	this->basal_melting_rate_correction=NULL;
-	this->basal_melting_rate_correction_apply=0;
 	this->geothermalflux=NULL;
 	this->elementonbed=NULL;
@@ -313,5 +191,4 @@
 	this->nodeonwater=NULL;
 
-	this->drag_type=0;
 	this->drag_coefficient=NULL;
 	this->drag_p=NULL;
@@ -319,5 +196,4 @@
 	
 	
-	this->numberofpressureloads=0;
 	this->pressureload=NULL;
 	this-> spcvx=NULL;
@@ -328,14 +204,9 @@
 	this-> spcwatercolumn=NULL;
 	this-> diagnostic_ref=NULL;
-	this->numberofedges=0;
 	this->edges=NULL;
 	
 	/*!materials: */
-	this->rho_water=0;
-	this->rho_ice=0;
-	this->g=0;
 	this->rheology_n=NULL;
 	this->rheology_B=NULL;
-	this->rheology_law=0;
 
 	/*!solution parameters: */
@@ -344,63 +215,12 @@
 	this->weights=NULL;
 	this->cm_jump=NULL;
-	this->meanvel=0;
-	this->epsvel=0;
-	this->nsteps=0;
-	this->eps_cm=0;
-	this->tolx=0;
 	this->maxiter=NULL;
 	this->cm_min=NULL;
 	this->cm_max=NULL;
-	this->cm_gradient=0;
-	this->verbose=0;
-	this->output_frequency=0;
-	this->eps_res=0;
-	this->eps_rel=0;
-	this->eps_abs=0;
-	this->max_nonlinear_iterations=0;
-	this->max_steadystate_iterations=0;
-	this->dt=0;
-	this->ndt=0;
-	this->time_adapt=0;
-	this->cfl_coefficient=0;
-	this->hydrostatic_adjustment=0;
-	this->gl_migration=0;
-	this->penalty_offset=0;
-	this->penalty_melting=0;
-	this->penalty_lock=0;
-	this->sparsity=0;
-	this->connectivity=0;
-	this->lowmem=0;
 	this->optscal=NULL;
-	this->yts=0;
-	this->viscosity_overshoot=0;
-	this->artdiff=0;
-	this->prognostic_DG=0;
-	this->stokesreconditioning=0;
-	this->shelf_dampening=0;
-	this->waitonlock=0;
-	this->isdiagnostic=0;
-	this->isprognostic=0;
-	this->isthermal=0;
-
-	/*!thermal parameters: */
-	this->beta=0;
-	this->meltingpoint=0;
-	this->referencetemperature=0;
-	this->latentheat=0;
-	this->heatcapacity=0;
-	this->thermalconductivity=0;
-	this->min_thermal_constraints=0;
-	this->min_mechanical_constraints=0;
-	this->stabilize_constraints=0;
-	this->mixed_layer_capacity=0;
-	this->thermal_exchange_velocity=0;
-
-	
-	this->numrifts=0;
+
 	this->riftinfo=NULL;
 
 	/*!penalties: */
-	this->numpenalties=0;
 	this->penalties=NULL;
 
@@ -410,9 +230,4 @@
 	this->surface_ablation_rate=NULL;
 	this->dhdt=NULL;
-
-	/*elements type: */
-	this->ishutter=0;
-	this->ismacayealpattyn=0;
-	this->isstokes=0;
 
 	/*exterior data: */
@@ -422,7 +237,4 @@
 	this->singlenodetoelementconnectivity=NULL;
 	this->numbernodetoelementconnectivity=NULL;
-	this->nodecounter=0;
-	this->loadcounter=0;
-	this->constraintcounter=0;
 }
 /*}}}*/
@@ -435,21 +247,21 @@
 
 	/*output: */
-	bool  boolean;
+	int   booleanint;
 	int   code;
 	
 	/*Set file pointer to beginning of the data: */
 	fid=this->SetFilePointerToData(&code,NULL,data_enum);
-	
+
 	if(code!=1)_error_("%s%s","IoModel::FetchData expecting a boolean for enum ",EnumToStringx(data_enum));
 	
 	/*We have to read a boolean from disk. */
 	if(my_rank==0){  
-		if(fread(&boolean,sizeof(bool),1,fid)!=1) _error_(" could not read boolean ");
-	}
-
-	MPI_Bcast(&boolean,1,MPI_BYTE,0,MPI_COMM_WORLD); 
-
+		if(fread(&booleanint,sizeof(int),1,fid)!=1) _error_(" could not read boolean ");
+	}
+	MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	/*cast to bool: */
 	/*Assign output pointers: */
-	*pboolean=boolean;
+	*pboolean=(bool)booleanint;
 
 }
@@ -558,16 +370,17 @@
 }
 /*}}}*/
-/*FUNCTION IoModel::FetchData(double**  pdoublematrix,int* pM,int* pN,int data_enum){{{1*/
-void  IoModel::FetchData(double** pmatrix,int* pM,int* pN,int data_enum){
+/*FUNCTION IoModel::FetchData(int**  pintegerematrix,int* pM,int* pN,int data_enum){{{1*/
+void  IoModel::FetchData(int** pmatrix,int* pM,int* pN,int data_enum){
 
 	extern int my_rank;
 	extern int num_procs;
+	int i,j;
 
 	/*output: */
 	int M,N;
 	double* matrix=NULL;
+	int*    integer_matrix=NULL;
 	int code=0;
 	int vector_type=0;
-	
 	
 	
@@ -604,4 +417,72 @@
 	}
 
+	/*Now cast to integer: */
+	if(M*N){
+		integer_matrix=(int*)xmalloc(M*N*sizeof(int));
+		for (i=0;i<M;i++){
+			for (j=0;j<N;j++){
+				integer_matrix[i*N+j]=(int)matrix[i*N+j];
+			}
+		}
+	}
+	else{
+		integer_matrix=NULL;
+	}
+	/*Free ressources:*/
+	xfree((void**)&matrix);
+
+	/*Assign output pointers: */
+	*pmatrix=integer_matrix;
+	if (pM)*pM=M;
+	if (pN)*pN=N;
+
+}
+/*}}}*/
+/*FUNCTION IoModel::FetchData(double**  pdoublematrix,int* pM,int* pN,int data_enum){{{1*/
+void  IoModel::FetchData(double** pmatrix,int* pM,int* pN,int data_enum){
+
+	extern int my_rank;
+	extern int num_procs;
+
+	/*output: */
+	int M,N;
+	double* matrix=NULL;
+	int code=0;
+	int vector_type=0;
+	
+	
+	
+	/*Set file pointer to beginning of the data: */
+	fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
+
+	if((code!=5) && (code!=6) && (code!=7))_error_("%s%s","IoModel::FetchData expecting a double, integer or boolean matrix for enum ",EnumToStringx(data_enum));
+	
+	/*Now fetch: */
+
+	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
+	/*numberofelements: */
+	if(my_rank==0){  
+		if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
+	}
+
+	MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	if(my_rank==0){  
+		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
+	}
+	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	/*Now allocate matrix: */
+	if(M*N){
+		matrix=(double*)xmalloc(M*N*sizeof(double));
+
+		/*Read matrix on node 0, then broadcast: */
+		if(my_rank==0){  
+			if(fread(matrix,M*N*sizeof(double),1,fid)!=1) _error_("could not read matrix ");
+		}
+		
+		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+	}
+
 	/*Assign output pointers: */
 	*pmatrix=matrix;
@@ -757,4 +638,210 @@
 	*pndims=ndims;
 	*pnumrecords=numrecords;
+}
+/*}}}*/
+/*FUNCTION IoModel::FetchParameters(Parameters* parameters){{{1*/
+void  IoModel::FetchParameters(Parameters* parameters){
+
+	extern int my_rank;
+	extern int num_procs;
+	
+	/*record descriptions; */
+	int record_enum;
+	int record_length;
+	int record_code; //1 to 7 number
+
+	/*records: */
+	int  booleanint=0;
+	int  integer=0;
+	double scalar=0;
+	char* string=NULL;
+	int   string_size;
+
+ 
+	/*Go find in the binary file, the position of the data we want to fetch: */
+	if(my_rank==0){ //cpu 0{{{2
+	
+		/*First set FILE* position to the beginning of the file: */
+		fseek(this->fid,0,SEEK_SET);
+
+		/*Now march through file looking for the correct data identifiers (bool,int,double or string): */
+		for(;;){
+			if(fread(&record_enum,sizeof(int),1,this->fid)==0){
+
+				/*Ok, we have reached the end of the file. break: */
+				record_code=0; //0 means bailout
+				MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*tell others cpus we are bailing: */
+				break;
+			}
+			else{
+			
+				/* Read the record length and the data type code: */
+				fread(&record_length,sizeof(int),1,this->fid);
+				fread(&record_code,sizeof(int),1,this->fid);
+					
+				/*Tell other cpus what we are doing: */
+				MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*tell other cpus what we are going to do: */
+
+				/*Tell other cpus the name of the data, then branch according to the data type: */
+				MPI_Bcast(&record_enum,1,MPI_INT,0,MPI_COMM_WORLD);  
+				MPI_Bcast(&record_length,1,MPI_INT,0,MPI_COMM_WORLD);  
+				
+
+				switch(record_code){
+					case 1: 
+						/*Read the boolean and broadcast it to other cpus:*/
+						if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error_(" could not read boolean ");
+						MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+						/*create BoolParam: */
+						parameters->AddObject(new BoolParam(record_enum,(bool)booleanint)); //cast to boolean
+
+						break;
+					case 2:
+						/*Read the integer and broadcast it to other cpus:*/
+						if(fread(&integer,sizeof(int),1,this->fid)!=1) _error_(" could not read integer ");
+						MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+						/*create IntParam: */
+						parameters->AddObject(new IntParam(record_enum,integer));
+
+						break;
+					case 3:
+						/*Read the scalar and broadcast it to other cpus:*/
+						if(fread(&scalar,sizeof(double),1,this->fid)!=1) _error_(" could not read scalar ");
+						MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+
+						/*create DoubleParam: */
+						parameters->AddObject(new DoubleParam(record_enum,scalar));
+
+						break;
+					case 4: 
+						/*We have to read a string from disk. First read the dimensions of the string, then the string: */
+						if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_(" could not read length of string ");
+						MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+						if(string_size){
+							string=(char*)xmalloc((string_size+1)*sizeof(char));
+							string[string_size]='\0';
+
+							/*Read string, then broadcast: */
+							if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_("  could not read string ");
+							MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+						}
+						else{
+							string=(char*)xmalloc(sizeof(char));
+							string[0]='\0';
+						}
+						
+						/*Add string to parameters: */
+						parameters->AddObject(new StringParam(record_enum,string));
+
+						break;
+					case 5: 
+							/*We are not interested in this record, too memory intensive. Skip it: */
+							/*skip: */
+							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
+							fseek(fid,record_length,SEEK_CUR);
+							break;
+					case 6: 
+							/*We are not interested in this record, too memory intensive. Skip it: */
+							/*skip: */
+							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
+							fseek(fid,record_length,SEEK_CUR);
+							break;
+					case 7: 
+							/*We are not interested in this record, too memory intensive. Skip it: */
+							/*skip: */
+							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
+							fseek(fid,record_length,SEEK_CUR);
+							break;
+
+					case 8: 
+							/*We are not interested in this record, too memory intensive. Skip it: */
+							/*skip: */
+							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
+							fseek(fid,record_length,SEEK_CUR);
+							break;
+
+					case 9: 
+							/*We are not interested in this record, too memory intensive. Skip it: */
+							/*skip: */
+							fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer
+							fseek(fid,record_length,SEEK_CUR);
+							break;
+
+					default: 
+						_error_("%s%i","unknown record type:",record_code); 
+						break;;
+				}
+			}
+		}
+	} //}}}
+	else{ //cpu ~0 {{{2
+		for(;;){ //wait on cpu 0
+			MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);  /*get from cpu 0 what we are going to do: */
+			if(record_code==0){
+				break; //we are done, break from the loop
+			}
+			else{
+				MPI_Bcast(&record_enum,1,MPI_INT,0,MPI_COMM_WORLD);   //get from cpu 0 name of the data
+				MPI_Bcast(&record_length,1,MPI_INT,0,MPI_COMM_WORLD);  
+				switch(record_code){
+				case 1: 
+					/*boolean. get it from cpu 0 */
+					MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD); 
+						
+					/*create BoolParam: */
+					parameters->AddObject(new BoolParam(record_enum,(bool)booleanint)); //cast to a boolean
+					break;
+
+				case 2:
+					/*integer. get it from cpu 0 */
+					MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+						
+					/*create IntParam: */
+					parameters->AddObject(new IntParam(record_enum,integer));
+
+					break;
+				case 3:
+					/*scalar. get it from cpu 0 */
+					MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+						
+					/*create DoubleParam: */
+					parameters->AddObject(new DoubleParam(record_enum,scalar));
+
+					break;
+				case 4: 
+					MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+					if(string_size){
+						string=(char*)xmalloc((string_size+1)*sizeof(char));
+						string[string_size]='\0';
+
+						/*Read string from cpu 0: */
+						MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+					}
+					else{
+						string=(char*)xmalloc(sizeof(char));
+						string[0]='\0';
+					}
+					/*Add string to parameters: */
+					parameters->AddObject(new StringParam(record_enum,string));
+
+					break;
+				case 5: break; //do nothing. not interested in this type of data, which is memory intensive.
+				case 6: break; //do nothing. not interested in this type of data, which is memory intensive.
+				case 7: break; //do nothing. not interested in this type of data, which is memory intensive.
+				case 8: break; //do nothing. not interested in this type of data, which is memory intensive.
+				case 9: break; //do nothing. not interested in this type of data, which is memory intensive.
+
+				default: 
+					_error_("%s%i","unknown record type:",record_code); 
+					break;;
+				}
+
+
+			}
+		}
+	} //}}}
 }
 /*}}}*/
@@ -821,26 +908,4 @@
 }
 /*}}}*/
-/*FUNCTION IoModel::Echo{{{1*/
-void IoModel::Echo(int which_part,int rank) {
-
-	//which_part  determines what gets echoed, otherwise, we'll get too much output.
-	//1-> penalties
-
-	int i,j;
-
-	if(which_part==1 && my_rank==rank && this->dim==3){
-		printf("IoModel penalties: \n");
-		printf("   number of penalties: %i\n",this->numpenalties);
-		printf("   nodes: \n");
-
-		for(i=0;i<this->numpenalties;i++){
-			for(j=0;j<this->numlayers;j++){
-				printf("%i ",(int)*(this->penalties+this->numlayers*i+j));
-			}
-			printf("\n");
-		}
-	}
-}
-/*}}}*/
 /*FUNCTION IoModel::FetchDataToInput(Elements* elements,IoModel* iomodel,int vector_enum,int default_vector_enum,double default_value{{{1*/
 void IoModel::FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum,double default_value){
@@ -858,4 +923,5 @@
 	int     nods;
 	int     nel;
+	int     numberofelements;
 
 
@@ -868,4 +934,7 @@
 	int     M,N;
 
+	/*Fetch parameters: */
+	this->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+
 	/*First of, find the record for the enum, and get code  of data type: */
 	fid=this->SetFilePointerToData(&code, &vector_layout,vector_enum);
@@ -877,5 +946,5 @@
 			/*Add boolean constant input to all elements: */
 			counter=0;
-			for (i=0;i<this->numberofelements;i++){
+			for (i=0;i<numberofelements;i++){
 				if(this->my_elements[i]){
 					Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -890,5 +959,5 @@
 			/*Add integer constant input to all elements: */
 			counter=0;
-			for (i=0;i<this->numberofelements;i++){
+			for (i=0;i<numberofelements;i++){
 				if(this->my_elements[i]){
 					Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -903,5 +972,5 @@
 			/*Add double constant input to all elements: */
 			counter=0;
-			for (i=0;i<this->numberofelements;i++){
+			for (i=0;i<numberofelements;i++){
 				if(this->my_elements[i]){
 					Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -940,5 +1009,5 @@
 			/*Create inputs:*/
 			counter=0;
-			for (i=0;i<this->numberofelements;i++){
+			for (i=0;i<numberofelements;i++){
 				if(this->my_elements[i]){
 					Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -978,5 +1047,5 @@
 			/*Create inputs:*/
 			counter=0;
-			for (i=0;i<this->numberofelements;i++){
+			for (i=0;i<numberofelements;i++){
 				if(this->my_elements[i]){
 					Element* element=(Element*)elements->GetObjectByOffset(counter);
@@ -1016,5 +1085,5 @@
 			/*Create inputs:*/
 			counter=0;
-			for (i=0;i<this->numberofelements;i++){
+			for (i=0;i<numberofelements;i++){
 				if(this->my_elements[i]){
 					Element* element=(Element*)elements->GetObjectByOffset(counter);
Index: /issm/trunk/src/c/objects/IoModel.h
===================================================================
--- /issm/trunk/src/c/objects/IoModel.h	(revision 9355)
+++ /issm/trunk/src/c/objects/IoModel.h	(revision 9356)
@@ -16,17 +16,14 @@
 	private: 
 		FILE* fid; //pointer to input file
+
 	public:
+		Parameters* parameters; //this dataset holds all double, int, bool and char* parameters read in from the input file.* 
 		/*Data: {{{1*/
-		char*   name;
-		char*	inputfilename;
-		char*	outputfilename;
-		char*   repository;
-		int     dim;
-		int     qmu_analysis;
-		int     control_analysis;
+
+		int     nodecounter; //keep track of how many nodes are being created in each analysis type
+		int     loadcounter; //keep track of how many loads are being created in each analysis type
+		int     constraintcounter; //keep track of how many constraints are being created in each analysis type
 
 		/*2d mesh: */
-		int     numberofelements;
-		int     numberofvertices;
 		double* x;
 		double* y;
@@ -38,15 +35,9 @@
 
 		/*3d mesh: */
-		int     numberofvertices2d;
-		int     numberofelements2d;
 		double* elements2d;
-		int     numlayers;
 		double* upperelements;
 		double* lowerelements;
 
 		/*elements type: */
-		int     ishutter;
-		int     ismacayealpattyn;
-		int     isstokes;
 		double* nodeonhutter;
 		double* nodeonmacayeal;
@@ -61,7 +52,4 @@
 		double* waterfraction;
 
-		/*i/o: */
-		int    io_gather;
-
 		/*observations: */
 		double*  thickness_obs;
@@ -69,11 +57,4 @@
 		double*  vy_obs;
 		double*  vz_obs;
-
-		/*qmu: */
-		int      numberofvariables;
-		int      numvariabledescriptors;
-		int      numberofresponses;
-		int      numresponsedescriptors;
-		int      qmu_npart;
 
 		/*geometry: */
@@ -96,5 +77,4 @@
 
 		/*friction: */
-		int     drag_type;
 		double* drag_coefficient;
 		double* drag_p;
@@ -102,5 +82,4 @@
 
 		/*boundary conditions: */
-		int     numberofpressureloads;
 		double* pressureload;
 		double* spcvx;
@@ -112,29 +91,15 @@
 		double* diagnostic_ref;
 		double* geothermalflux;
-		int     numberofedges;
 		double* edges;
 
 		/*materials: */
-		double  rho_water,rho_ice;
-		double  g;
 		double* rheology_B;
 		double* rheology_n;
-		int     rheology_law;
 
 		/*numerical parameters: */
-		double  meanvel;
-		double  epsvel;
-		int     artdiff;
-		int     prognostic_DG;
-		double  viscosity_overshoot;
-		double  stokesreconditioning;
-		int     shelf_dampening;
 		double* cm_min;
 		double* cm_max;
-		int     cm_gradient;;
 
 		/*control methods: */
-		int      num_cm_responses;
-		int      num_control_type;
 		double*  control_type;
 
@@ -143,50 +108,11 @@
 		double* weights;
 		double* cm_jump;
-		int     nsteps;
-		double  eps_cm;
-		double  tolx;
 		double* maxiter;
-		int     verbose;
-		int     output_frequency;
-		double  eps_res;
-		double  eps_rel;
-		double  eps_abs;
-		double  max_nonlinear_iterations;
-		double  max_steadystate_iterations;
-		double  dt,ndt;
-		int     time_adapt;
-		double  cfl_coefficient;
-		int     hydrostatic_adjustment;
-		double  penalty_offset;
-		double  penalty_melting;
-		int     penalty_lock;
-		double  sparsity;
-		int     connectivity;
-		int     lowmem;
 		double* optscal;
-		double  yts;
-		double  waitonlock;
-		int     isdiagnostic;
-		int     isprognostic;
-		int     isthermal;
-
-		/*thermal parameters: */
-		double beta;
-		double meltingpoint;
-		double referencetemperature;
-		double latentheat;
-		double  heatcapacity,thermalconductivity;
-		int    min_thermal_constraints;
-		int    min_mechanical_constraints;
-		int    stabilize_constraints;
-		double mixed_layer_capacity;
-		double thermal_exchange_velocity;
 
 		/*rifts: */
-		int      numrifts;
 		double*  riftinfo;
 
 		/*penalties: */
-		int      numpenalties;
 		double*  penalties;
 
@@ -194,7 +120,5 @@
 		double*  basal_melting_rate;
 		double*  watercolumn;
-		double   gl_melting_rate;
 		double*  basal_melting_rate_correction;
-		int      basal_melting_rate_correction_apply;
 		double*  surface_mass_balance;
 		double*  surface_accumulation_rate;
@@ -202,10 +126,4 @@
 
 		double*  dhdt;
-
-		/*qmu: */
-		int      qmu_save_femmodel;
-
-		/*grounding line migration: */
-		int      gl_migration;
 
 		/*exterior partitioning data, to be carried around: */
@@ -215,14 +133,5 @@
 		int*    singlenodetoelementconnectivity;
 		int*    numbernodetoelementconnectivity;
-		int     nodecounter; //keep track of how many nodes are being created in each analysis type
-		int     loadcounter; //keep track of how many loads are being created in each analysis type
-		int     constraintcounter; //keep track of how many constraints are being created in each analysis type
 
-		/*hydrology parameters: */		 
-		double hydro_kn;		 
-		double hydro_p;		 
-		double hydro_q;		 
-		double hydro_CR;			 
-		double hydro_n; 
 		 /*}}}*/
 		/*Methods: {{{1*/
@@ -231,5 +140,4 @@
 		IoModel(FILE* iomodel_handle);
 		void IoModelInit(void);
-		void Echo(int which_part,int rank);
 		/*}}}*/
 		/*Input/Output:{{{1*/
@@ -238,7 +146,9 @@
 		void  FetchData(double*   pscalar,int data_enum);
 		void  FetchData(char**    pstring,int data_enum);
+		void  FetchData(int** pmatrix,int* pM,int* pN,int data_enum);
 		void  FetchData(double**  pscalarmatrix,int* pM,int* pN,int data_enum);
 		void  FetchData(char***   pstringarray,int* pnumstrings,int data_enum);
 		void  FetchData(double*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum);
+		void  FetchParameters(Parameters* parameters);
 		FILE* SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);
 		void  FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,double default_value=0);
Index: /issm/trunk/src/c/objects/Loads/Icefront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 9356)
@@ -43,5 +43,7 @@
 	int segment_width;
 	int element;
-	int num_nodes;
+	int num_nodes; 
+	int dim;
+	int numberofelements;
 
 	/*icefront constructor data: */
@@ -50,7 +52,11 @@
 	int  icefront_node_ids[NUMVERTICESQUA]; //initialize with largest size
 	int  icefront_fill;
+	
+	/*find parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*First, retrieve element index and element type: */
-	if (iomodel->dim==2){
+	if (dim==2){
 		segment_width=4;
 	}
@@ -62,5 +68,5 @@
 	/*Build ids for hook constructors: */
 	icefront_eid=(int) *(iomodel->pressureload+segment_width*i+segment_width-2); //matlab indexing
-	icefront_mparid=iomodel->numberofelements+1; //matlab indexing
+	icefront_mparid=numberofelements+1; //matlab indexing
 
 	if (in_icefront_type==MacAyeal2dIceFrontEnum || in_icefront_type==MacAyeal3dIceFrontEnum){
Index: /issm/trunk/src/c/objects/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 9356)
@@ -51,6 +51,11 @@
 	int   numericalflux_type;
 
+	int    numberofelements;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+
 	/* Get MatPar id */
-	numericalflux_mparid=iomodel->numberofelements+1; //matlab indexing
+	numericalflux_mparid=numberofelements+1; //matlab indexing
 
 	/*First, see wether this is an internal or boundary edge (if e2=NaN)*/
Index: /issm/trunk/src/c/objects/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 9356)
@@ -49,7 +49,14 @@
 	int pengrid_element_id;
 
+	int numberofvertices;
+	int numberofelements;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+
 	/*Some checks if debugging activated*/
 	_assert_(iomodel->singlenodetoelementconnectivity);
-	_assert_(index>=0 && index<iomodel->numberofvertices);
+	_assert_(index>=0 && index<numberofvertices);
 	_assert_(id);
 
@@ -62,5 +69,5 @@
 	pengrid_element_id=iomodel->singlenodetoelementconnectivity[index];
 	_assert_(pengrid_element_id);
-	pengrid_matpar_id=iomodel->numberofelements+1; //refers to the constant material parameters object
+	pengrid_matpar_id=numberofelements+1; //refers to the constant material parameters object
 
 	this->hnode=new Hook(&pengrid_node_id,1);
Index: /issm/trunk/src/c/objects/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Riftfront.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Loads/Riftfront.cpp	(revision 9356)
@@ -48,8 +48,14 @@
 	double riftfront_fractionincrement;
 	bool   riftfront_shelf;
+	int    numberofelements;
+	int    penalty_lock;
 
 	/*intermediary: */
 	int el1    ,el2;
 	int node1  ,node2;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->parameters->FindParam(&penalty_lock,PenaltyLockEnum);
 
 	/*Ok, retrieve all the data needed to add a penalty between the two nodes: */
@@ -69,5 +75,5 @@
 	riftfront_elem_ids[0]=el1;
 	riftfront_elem_ids[1]=el2;
-	riftfront_matpar_id=iomodel->numberofelements+1; //matlab indexing
+	riftfront_matpar_id=numberofelements+1; //matlab indexing
 
 	/*Hooks: */
@@ -81,5 +87,5 @@
 	this->counter=0;
 	this->prestable=0;
-	this->penalty_lock=iomodel->penalty_lock;
+	this->penalty_lock=penalty_lock;
 	this->material_converged=0;
 	this->normal[0]=*(iomodel->riftinfo+RIFTINFOSIZE*i+4);
Index: /issm/trunk/src/c/objects/Materials/Matice.cpp
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 9356)
@@ -655,6 +655,16 @@
 	int i,j;
 
+	int    dim;
+	int    control_analysis;
+	int    num_control_type;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
+	iomodel->parameters->FindParam(&num_control_type,NumControlTypeEnum);
+
+
 	/*if 2d*/
-	if(iomodel->dim==2){
+	if(dim==2){
 
 		/*Intermediaries*/
@@ -677,6 +687,6 @@
 
 		/*Control Inputs*/
-		if (iomodel->control_analysis && iomodel->control_type){
-			for(i=0;i<iomodel->num_control_type;i++){
+		if (control_analysis && iomodel->control_type){
+			for(i=0;i<num_control_type;i++){
 				switch((int)iomodel->control_type[i]){
 					case RheologyBbarEnum:
@@ -684,6 +694,6 @@
 							_assert_(iomodel->rheology_B);_assert_(iomodel->cm_min); _assert_(iomodel->cm_max); 
 							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+j]-1)];
-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->cm_min[int(iomodel->elements[num_vertices*index+j]-1)*iomodel->num_control_type+i];
-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->cm_max[int(iomodel->elements[num_vertices*index+j]-1)*iomodel->num_control_type+i];
+							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->cm_min[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];
+							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->cm_max[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];
 							this->inputs->AddInput(new ControlInput(RheologyBbarEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 						}
@@ -695,5 +705,5 @@
 
 	/*if 3d*/
-	else if(iomodel->dim==3){
+	else if(dim==3){
 
 		/*Intermediaries*/
@@ -716,6 +726,6 @@
 
 		/*Control Inputs*/
-		if (iomodel->control_analysis && iomodel->control_type){
-			for(i=0;i<iomodel->num_control_type;i++){
+		if (control_analysis && iomodel->control_type){
+			for(i=0;i<num_control_type;i++){
 				switch((int)iomodel->control_type[i]){
 					case RheologyBbarEnum:
@@ -723,6 +733,6 @@
 							_assert_(iomodel->rheology_B);_assert_(iomodel->cm_min); _assert_(iomodel->cm_max); 
 							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+j]-1)];
-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->cm_min[int(iomodel->elements[num_vertices*index+j]-1)*iomodel->num_control_type+i];
-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->cm_max[int(iomodel->elements[num_vertices*index+j]-1)*iomodel->num_control_type+i];
+							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->cm_min[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];
+							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->cm_max[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];
 							this->inputs->AddInput(new ControlInput(RheologyBEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 						}
Index: /issm/trunk/src/c/objects/Materials/Matpar.cpp
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matpar.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Materials/Matpar.cpp	(revision 9356)
@@ -26,21 +26,21 @@
 
 	this->mid                       = matpar_mid;
-	this->rho_ice                   = iomodel->rho_ice;
-	this->rho_water                 = iomodel->rho_water;
-	this->heatcapacity              = iomodel->heatcapacity;
-	this->thermalconductivity       = iomodel->thermalconductivity;
-	this->latentheat                = iomodel->latentheat;
-	this->beta                      = iomodel->beta;
-	this->meltingpoint              = iomodel->meltingpoint;
-	this->referencetemperature      = iomodel->referencetemperature;
-	this->mixed_layer_capacity      = iomodel->mixed_layer_capacity;
-	this->thermal_exchange_velocity = iomodel->thermal_exchange_velocity;
-	this->g                         = iomodel->g;
-
-	this->kn                        = iomodel->hydro_kn;			 
-	this->hydro_p                   = iomodel->hydro_p;		 
-	this->hydro_q                   = iomodel->hydro_q;		 
-	this->hydro_CR                  = iomodel->hydro_CR;			 
-	this->hydro_n                   = iomodel->hydro_n; 
+	iomodel->parameters->FindParam(&this->rho_ice,RhoIceEnum);
+	iomodel->parameters->FindParam(&this->rho_water,RhoWaterEnum);
+	iomodel->parameters->FindParam(&this->heatcapacity,HeatcapacityEnum);
+	iomodel->parameters->FindParam(&this->thermalconductivity,ThermalconductivityEnum);
+	iomodel->parameters->FindParam(&this->latentheat,LatentheatEnum);
+	iomodel->parameters->FindParam(&this->beta,BetaEnum);
+	iomodel->parameters->FindParam(&this->meltingpoint,MeltingpointEnum);
+	iomodel->parameters->FindParam(&this->referencetemperature,ReferencetemperatureEnum);
+	iomodel->parameters->FindParam(&this->mixed_layer_capacity,MixedLayerCapacityEnum);
+	iomodel->parameters->FindParam(&this->thermal_exchange_velocity,ThermalExchangeVelocityEnum);
+	iomodel->parameters->FindParam(&this->g,GEnum);
+	
+	iomodel->parameters->FindParam(&this->kn,HydroKnEnum);
+	iomodel->parameters->FindParam(&this->hydro_p,HydroPEnum);
+	iomodel->parameters->FindParam(&this->hydro_q,HydroQEnum);
+	iomodel->parameters->FindParam(&this->hydro_CR,HydroCREnum);
+	iomodel->parameters->FindParam(&this->hydro_n,HydroNEnum);
 }
 /*}}}1*/
Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 9356)
@@ -34,4 +34,8 @@
 	int k,l;
 	int gsize;
+	int dim;
+
+	/*Fetch parameters: */
+	iomodel->parameters->FindParam(&dim,DimEnum);
 
 	/*id: */
@@ -69,5 +73,5 @@
 	/*Diagnostic Horiz*/
 	if (analysis_type==DiagnosticHorizAnalysisEnum){
-		if (iomodel->dim==3){
+		if (dim==3){
 			/*We have a  3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
 			if (!iomodel->nodeonbed) _error_("iomodel->nodeonbed is NULL");
@@ -116,5 +120,5 @@
 				analysis_type==BalancethicknessAnalysisEnum
 				){
-		if (iomodel->dim==3){
+		if (dim==3){
 			/*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
 			_assert_(iomodel->nodeonbed);
Index: /issm/trunk/src/c/objects/Params/BoolParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/BoolParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/BoolParam.cpp	(revision 9356)
@@ -141,2 +141,7 @@
 #endif
 /*}}}*/
+/*FUNCTION BoolParam::UnitConversion{{{1*/
+void  BoolParam::UnitConversion(int direction_enum){
+	/*do nothing, no unit conversion*/
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/BoolParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/BoolParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/BoolParam.h	(revision 9356)
@@ -76,4 +76,5 @@
 		void  SetValue(FILE* fid){_error_("Bool param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("Bool param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 		
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/DoubleMatArrayParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleMatArrayParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/DoubleMatArrayParam.cpp	(revision 9356)
@@ -384,2 +384,14 @@
 }
 /*}}}*/
+/*FUNCTION DoubleMatArrayParam::UnitConversion{{{1*/
+void  DoubleMatArrayParam::UnitConversion(int direction_enum){
+	/*go through all matrices and convert: */
+	for (int i=0;i<this->M;i++){
+		double* matrix=this->array[i];
+		int     m=this->mdim_array[i];
+		int     n=this->ndim_array[i];
+		::UnitConversion(matrix,m*n,direction_enum,this->enum_type);
+	}
+
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h	(revision 9356)
@@ -79,4 +79,5 @@
 		void  SetValue(FILE* fid){_error_("Bool param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array);
+		void  UnitConversion(int direction_enum);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/DoubleMatParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleMatParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/DoubleMatParam.cpp	(revision 9356)
@@ -224,2 +224,7 @@
 }
 /*}}}*/
+/*FUNCTION DoubleMatParam::UnitConversion{{{1*/
+void  DoubleMatParam::UnitConversion(int direction_enum){
+	::UnitConversion(this->value,this->M*this->N,direction_enum,this->enum_type);
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/DoubleMatParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleMatParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/DoubleMatParam.h	(revision 9356)
@@ -78,4 +78,5 @@
 		void  SetValue(FILE* fid){_error_("DoubleMat param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("DoubleMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/DoubleParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/DoubleParam.cpp	(revision 9356)
@@ -227,2 +227,7 @@
 #endif
 /*}}}*/
+/*FUNCTION DoubleParam::UnitConversion{{{1*/
+void  DoubleParam::UnitConversion(int direction_enum){
+	::UnitConversion(&this->value,1,direction_enum,this->enum_type);
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/DoubleParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/DoubleParam.h	(revision 9356)
@@ -77,4 +77,5 @@
 		void  SetValue(FILE* fid){_error_("Double param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("Double param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/DoubleVecParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleVecParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/DoubleVecParam.cpp	(revision 9356)
@@ -215,2 +215,7 @@
 }
 /*}}}*/
+/*FUNCTION DoubleVecParam::UnitConversion{{{1*/
+void  DoubleVecParam::UnitConversion(int direction_enum){
+	::UnitConversion(this->values,this->M,direction_enum,this->enum_type);
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/DoubleVecParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleVecParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/DoubleVecParam.h	(revision 9356)
@@ -77,4 +77,5 @@
 		void  SetValue(FILE* fid){_error_("DoubleVec param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("DoubleVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 		
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/FileParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/FileParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/FileParam.cpp	(revision 9356)
@@ -107,2 +107,7 @@
 #endif
 /*}}}*/
+/*FUNCTION FileParam::UnitConversion{{{1*/
+void  FileParam::UnitConversion(int direction_enum){
+	/*do nothing, no unit conversion*/
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/FileParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/FileParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/FileParam.h	(revision 9356)
@@ -76,4 +76,5 @@
 		void  SetValue(FILE* fid){_error_("File param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("File param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/IntMatParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/IntMatParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/IntMatParam.cpp	(revision 9356)
@@ -212,2 +212,7 @@
 }
 /*}}}*/
+/*FUNCTION IntMatParam::UnitConversion{{{1*/
+void  IntMatParam::UnitConversion(int direction_enum){
+	/*do nothing, no unit conversion*/
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/IntMatParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/IntMatParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/IntMatParam.h	(revision 9356)
@@ -78,4 +78,5 @@
 		void  SetValue(FILE* fid){_error_("IntMat param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("IntMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/IntParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/IntParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/IntParam.cpp	(revision 9356)
@@ -142,2 +142,7 @@
 #endif
 /*}}}*/
+/*FUNCTION IntParam::UnitConversion{{{1*/
+void  IntParam::UnitConversion(int direction_enum){
+	/*do nothing, no unit conversion*/
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/IntParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/IntParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/IntParam.h	(revision 9356)
@@ -77,4 +77,5 @@
 		void  SetValue(FILE* fid){_error_("Int param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("Int param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/IntVecParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/IntVecParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/IntVecParam.cpp	(revision 9356)
@@ -227,2 +227,7 @@
 }
 /*}}}*/
+/*FUNCTION IntVecParam::UnitConversion{{{1*/
+void  IntVecParam::UnitConversion(int direction_enum){
+	/*do nothing, no unit conversion*/
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/IntVecParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/IntVecParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/IntVecParam.h	(revision 9356)
@@ -78,4 +78,5 @@
 		void  SetValue(FILE* fid){_error_("IntVec param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("IntVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 		
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/Param.h
===================================================================
--- /issm/trunk/src/c/objects/Params/Param.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/Param.h	(revision 9356)
@@ -58,4 +58,5 @@
 		virtual void  SetValue(FILE* fid)=0;
 		virtual void  SetValue(double** array, int M, int* mdim_array, int* ndim_array)=0;
+		virtual void  UnitConversion(int direction_enum)=0;
 
 		virtual char* GetParameterName(void)=0;
Index: /issm/trunk/src/c/objects/Params/PetscMatParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/PetscMatParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/PetscMatParam.cpp	(revision 9356)
@@ -234,2 +234,7 @@
 }
 /*}}}*/
+/*FUNCTION PetscMatParam::UnitConversion{{{1*/
+void  PetscMatParam::UnitConversion(int direction_enum){
+	/*do nothing, no unit conversion*/
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/PetscMatParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/PetscMatParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/PetscMatParam.h	(revision 9356)
@@ -77,4 +77,5 @@
 		void  SetValue(FILE* fid){_error_("PetscMat param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("PetscMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/PetscVecParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/PetscVecParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/PetscVecParam.cpp	(revision 9356)
@@ -229,2 +229,7 @@
 }
 /*}}}*/
+/*FUNCTION PetscVecParam::UnitConversion{{{1*/
+void  PetscVecParam::UnitConversion(int direction_enum){
+	/*do nothing, no unit conversion*/
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/PetscVecParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/PetscVecParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/PetscVecParam.h	(revision 9356)
@@ -77,4 +77,5 @@
 		void  SetValue(FILE* fid){_error_("PetscVec of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("PetscVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/StringArrayParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/StringArrayParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/StringArrayParam.cpp	(revision 9356)
@@ -285,2 +285,7 @@
 }
 /*}}}*/
+/*FUNCTION StringArrayParam::UnitConversion{{{1*/
+void  StringArrayParam::UnitConversion(int direction_enum){
+	/*do nothing, no unit conversion*/
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/StringArrayParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/StringArrayParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/StringArrayParam.h	(revision 9356)
@@ -79,4 +79,5 @@
 		void  SetValue(FILE* fid){_error_("StringArray param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("StringArray param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Params/StringParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/StringParam.cpp	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/StringParam.cpp	(revision 9356)
@@ -188,2 +188,7 @@
 }
 /*}}}*/
+/*FUNCTION StringParam::UnitConversion{{{1*/
+void  StringParam::UnitConversion(int direction_enum){
+	/*do nothing, no unit conversion*/
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/StringParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/StringParam.h	(revision 9355)
+++ /issm/trunk/src/c/objects/Params/StringParam.h	(revision 9356)
@@ -77,4 +77,5 @@
 		void  SetValue(FILE* fid){_error_("String param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
 		void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("String param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
+		void  UnitConversion(int direction_enum);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/shared/Numerics/UnitConversion.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/UnitConversion.cpp	(revision 9355)
+++ /issm/trunk/src/c/shared/Numerics/UnitConversion.cpp	(revision 9356)
@@ -47,4 +47,6 @@
 	double scale;
 	switch(type_enum){
+		case DtEnum:        scale=1.0/yts;break; //yr
+		case NdtEnum:        scale=1.0/yts;break; //yr
 		case TimeEnum:        scale=1.0/yts;break; //yr
 		case VxEnum:          scale=yts;break; //m/yr
Index: /issm/trunk/src/c/solutions/control_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/control_core.cpp	(revision 9355)
+++ /issm/trunk/src/c/solutions/control_core.cpp	(revision 9356)
@@ -46,6 +46,6 @@
 
 	/*Recover parameters used throughout the solution:{{{1*/
-	femmodel->parameters->FindParam(&num_controls,NumControlsEnum);
-	femmodel->parameters->FindParam(&num_responses,NumResponsesEnum);
+	femmodel->parameters->FindParam(&num_controls,NumControlTypeEnum);
+	femmodel->parameters->FindParam(&num_responses,NumCmResponsesEnum);
 	femmodel->parameters->FindParam(&control_type,NULL,ControlTypeEnum);
 	femmodel->parameters->FindParam(&responses,NULL,NULL,CmResponsesEnum);
Index: /issm/trunk/src/c/solutions/controlrestart.cpp
===================================================================
--- /issm/trunk/src/c/solutions/controlrestart.cpp	(revision 9355)
+++ /issm/trunk/src/c/solutions/controlrestart.cpp	(revision 9356)
@@ -15,5 +15,5 @@
 
 	/*retrieve output file name: */
-	femmodel->parameters->FindParam(&num_controls,NumControlsEnum);
+	femmodel->parameters->FindParam(&num_controls,NumControlTypeEnum);
 	femmodel->parameters->FindParam(&control_type,NULL,ControlTypeEnum);
 	femmodel->parameters->FindParam(&nsteps,NstepsEnum);
Index: /issm/trunk/src/c/solutions/gradient_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/gradient_core.cpp	(revision 9355)
+++ /issm/trunk/src/c/solutions/gradient_core.cpp	(revision 9356)
@@ -29,5 +29,5 @@
 	/*retrieve parameters:*/
 	femmodel->parameters->FindParam(&control_steady,ControlSteadyEnum);
-	femmodel->parameters->FindParam(&num_controls,NumControlsEnum);
+	femmodel->parameters->FindParam(&num_controls,NumControlTypeEnum);
 	femmodel->parameters->FindParam(&control_type,NULL,ControlTypeEnum);
 	femmodel->parameters->FindParam(&optscal_list,NULL,NULL,OptscalEnum);
Index: /issm/trunk/src/c/solutions/transient_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/transient_core.cpp	(revision 9355)
+++ /issm/trunk/src/c/solutions/transient_core.cpp	(revision 9356)
@@ -21,5 +21,5 @@
 	int    solution_type;
 	int    output_frequency;
-	int    dim,gl_migration;
+	int    dim,groundingline_migration;
 	
 	/*intermediary: */
@@ -36,5 +36,5 @@
 	femmodel->parameters->FindParam(&output_frequency,OutputFrequencyEnum);
 	femmodel->parameters->FindParam(&time_adapt,TimeAdaptEnum);
-	femmodel->parameters->FindParam(&gl_migration,GroundingLineMigrationEnum);
+	femmodel->parameters->FindParam(&groundingline_migration,GroundinglineMigrationEnum);
 	femmodel->parameters->FindParam(&isdiagnostic,IsdiagnosticEnum);
 	femmodel->parameters->FindParam(&isprognostic,IsprognosticEnum);
@@ -76,5 +76,5 @@
 		}
 
-		if (gl_migration!=NoneEnum){
+		if (groundingline_migration!=NoneEnum){
 			if(dim==3) _error_("Grounding line migration not implemented in 3d");
 			_printf_(VerboseSolution(),"   computing new grounding line position\n");
