Index: /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 9362)
@@ -33,5 +33,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*First of, find the record for the enum, and get code  of data type: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp	(revision 9362)
@@ -13,5 +13,5 @@
 	
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Output*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp	(revision 9362)
@@ -20,5 +20,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Output*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 9362)
@@ -30,8 +30,8 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
-	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp	(revision 9362)
@@ -20,7 +20,7 @@
 
 	/*Fetch data needed: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Update elements: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp	(revision 9362)
@@ -24,5 +24,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp	(revision 9362)
@@ -20,7 +20,7 @@
 
 	/*Fetch data needed: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Update elements: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 9362)
@@ -27,7 +27,7 @@
 	
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
-	iomodel->parameters->FindParam(&num_control_type,NumControlTypeEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum);
+	iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum);
 
 	/*Now, return if no control*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 9362)
@@ -27,7 +27,7 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Did we already create the elements? : */
@@ -43,13 +43,5 @@
 	
 	/*Fetch data needed: */
-	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
-	iomodel->FetchData(&iomodel->elementconnectivity,NULL,NULL,ElementconnectivityEnum);
-	iomodel->FetchData(&iomodel->upperelements,NULL,NULL,UpperelementsEnum);
-	iomodel->FetchData(&iomodel->lowerelements,NULL,NULL,LowerelementsEnum);
-	iomodel->FetchData(&iomodel->rheology_B,NULL,NULL,RheologyBEnum);
-	iomodel->FetchData(&iomodel->rheology_n,NULL,NULL,RheologyNEnum);
-	iomodel->FetchData(&iomodel->control_type,NULL,NULL,ControlTypeEnum);
-	iomodel->FetchData(&iomodel->cm_min,NULL,NULL,CmMinEnum);
-	iomodel->FetchData(&iomodel->cm_max,NULL,NULL,CmMaxEnum);
+	iomodel->FetchData(9,ElementsEnum,ElementconnectivityEnum,UpperelementsEnum,LowerelementsEnum,RheologyBEnum,RheologyNEnum,ControlTypeEnum,CmMinEnum,CmMaxEnum);
 	
 	/*Create elements and materials: */
@@ -59,8 +51,6 @@
 
 			/*Create and add tria element to elements dataset: */
-			if(dim==2)
-			 elements->AddObject(new Tria(i+1,i,i,iomodel,nummodels));
-			else
-			 elements->AddObject(new Penta(i+1,i,i,iomodel,nummodels));
+			if(dim==2) elements->AddObject(new Tria(i+1,i,i,iomodel,nummodels));
+			else       elements->AddObject(new Penta(i+1,i,i,iomodel,nummodels));
 
 			/*Create and add material property to materials dataset: */
@@ -70,13 +60,5 @@
 	
 	/*Free data: */
-	xfree((void**)&iomodel->elements);
-	xfree((void**)&iomodel->elementconnectivity);
-	xfree((void**)&iomodel->upperelements);
-	xfree((void**)&iomodel->lowerelements);
-	xfree((void**)&iomodel->rheology_B);
-	xfree((void**)&iomodel->rheology_n);
-	xfree((void**)&iomodel->control_type);
-	xfree((void**)&iomodel->cm_min);
-	xfree((void**)&iomodel->cm_max);
+	iomodel->DeleteData(9,ElementsEnum,ElementconnectivityEnum,UpperelementsEnum,LowerelementsEnum,RheologyBEnum,RheologyNEnum,ControlTypeEnum,CmMinEnum,CmMaxEnum);
 
 	/*Add new constrant material property tgo materials, at the end: */
@@ -84,9 +66,7 @@
 	
 	/*Create vertices: */
-	iomodel->FetchData(&iomodel->x,NULL,NULL,XEnum);
-	iomodel->FetchData(&iomodel->y,NULL,NULL,YEnum);
-	iomodel->FetchData(&iomodel->z,NULL,NULL,ZEnum);
-	iomodel->FetchData(&iomodel->bed,NULL,NULL,BedEnum);
-	iomodel->FetchData(&iomodel->thickness,NULL,NULL,ThicknessEnum);
+
+	/*Fetch data:*/
+	iomodel->FetchData(5,XEnum,YEnum,ZEnum,BedEnum,ThicknessEnum);
 	
 	for (i=0;i<numberofvertices;i++){
@@ -100,13 +80,7 @@
 	}
 
-	/*Clean fetched data: */
-	xfree((void**)&iomodel->x);
-	xfree((void**)&iomodel->y);
-	xfree((void**)&iomodel->z);
-	xfree((void**)&iomodel->bed);
-	xfree((void**)&iomodel->thickness);
+	/*Free data: */
+	iomodel->DeleteData(5,XEnum,YEnum,ZEnum,BedEnum,ThicknessEnum);
 
-	cleanup_and_return:
-	
 	/*Assign output pointer: */
 	*pelements=elements;
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp	(revision 9362)
@@ -23,4 +23,5 @@
 	int    numberofelements;
 	int    numberofvertices;
+	double* elements=NULL;
 
 	/*output*/
@@ -28,12 +29,13 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	elements=iomodel->f(ElementsEnum);
 
 	/*Some checks if debugging*/
 	_assert_(numberofvertices);
 	_assert_(numberofelements);
-	_assert_(iomodel->elements);
+	_assert_(elements);
 
 	/*Allocate ouput*/
@@ -51,5 +53,5 @@
 	for (i=0;i<numberofelements;i++){
 		for (j=0;j<elementswidth;j++){
-			vertexid=(int)iomodel->elements[elementswidth*i+j];
+			vertexid=(int)elements[elementswidth*i+j];
 			_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 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 9362)
@@ -24,5 +24,5 @@
 		
 	/*Initialize dataset: */
-	parameters = (Parameters*)iomodel->parameters->Copy();
+	parameters = (Parameters*)iomodel->constants->Copy();
 
 	/*some parameters that did not come with the iomodel: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp	(revision 9362)
@@ -23,4 +23,5 @@
 	int    numberofelements;
 	int    numberofvertices;
+	double* elements=NULL;
 
 	/*output*/
@@ -28,7 +29,8 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	elements=iomodel->f(ElementsEnum);
 
 	/*Some checks if debugging*/
@@ -36,5 +38,5 @@
 	_assert_(numberofelements);
 	_assert_(iomodel->my_elements);
-	_assert_(iomodel->elements);
+	_assert_(elements);
 
 	/*Allocate ouput*/
@@ -54,5 +56,5 @@
 		if(iomodel->my_elements[i]){
 			for (j=0;j<elementswidth;j++){
-				vertexid=(int)iomodel->elements[elementswidth*i+j];
+				vertexid=(int)elements[elementswidth*i+j];
 				_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 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 9362)
@@ -30,12 +30,12 @@
 
 	/*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);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&yts,YtsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&g,GEnum);
+	iomodel->constants->FindParam(&rho_ice,RhoIceEnum);
+	iomodel->constants->FindParam(&stokesreconditioning,StokesreconditioningEnum);
+	iomodel->constants->FindParam(&isstokes,IsstokesEnum);
+	iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 9362)
@@ -31,8 +31,8 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
-	iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
-	iomodel->parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&isstokes,IsstokesEnum);
+	iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp	(revision 9362)
@@ -25,7 +25,7 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
-	iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
-	iomodel->parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&isstokes,IsstokesEnum);
+	iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 9362)
@@ -27,10 +27,10 @@
 	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);
+	iomodel->constants->FindParam(&isstokes,IsstokesEnum);
+	iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum);
+	iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum);
 
 
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp	(revision 9362)
@@ -28,7 +28,7 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&yts,YtsEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
-	iomodel->parameters->FindParam(&ishutter,IshutterEnum);
+	iomodel->constants->FindParam(&yts,YtsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&ishutter,IshutterEnum);
 
 	/*Create constraints if they do not exist yet*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp	(revision 9362)
@@ -25,6 +25,6 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
-	iomodel->parameters->FindParam(&ishutter,IshutterEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&ishutter,IshutterEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp	(revision 9362)
@@ -23,6 +23,6 @@
 	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);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&ishutter,IshutterEnum);
 
 	/*Now, is the flag hutter on? otherwise, do nothing: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 9362)
@@ -24,6 +24,6 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&yts,YtsEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&yts,YtsEnum);
 
 	/*Recover pointer: */
@@ -39,5 +39,5 @@
 	iomodel->FetchData(&iomodel->spcvz,NULL,NULL,SpcvzEnum);
 	iomodel->FetchData(&iomodel->nodeonstokes,NULL,NULL,NodeOnStokesEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Initialize counter*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp	(revision 9362)
@@ -25,6 +25,6 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	(revision 9362)
@@ -20,6 +20,6 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Now, is the model 3d? otherwise, do nothing: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 9362)
@@ -42,13 +42,17 @@
 	int  el1,el2;
 	int    dim;
+	double* elements=NULL;
+	double* elements2d=NULL;
+	double* riftinfo=NULL;
+	double* penalties=NULL;
 
 	/*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);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofelements2d,NumberOfElements2DEnum);
+	iomodel->constants->FindParam(&numberofvertices2d,NumberOfNodes2DEnum);
+	iomodel->constants->FindParam(&numlayers,NumlayersEnum);
+	iomodel->constants->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: */
@@ -63,16 +67,16 @@
 	if(dim==2){
 		/*load elements: */
-		iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
+		iomodel->FetchData(&elements,NULL,NULL,ElementsEnum);
 	}
 	else{
 		/*load elements2d: */
-		iomodel->FetchData(&iomodel->elements2d,NULL,NULL,Elements2DEnum);
+		iomodel->FetchData(&elements2d,NULL,NULL,Elements2DEnum);
 	}
 
-	MeshPartitionx(&epart, &npart,numberofelements,numberofvertices,iomodel->elements, numberofelements2d,numberofvertices2d,iomodel->elements2d,numlayers,elements_width, dim,num_procs);
+	MeshPartitionx(&epart, &npart,numberofelements,numberofvertices,elements, numberofelements2d,numberofvertices2d,elements2d,numlayers,elements_width, dim,num_procs);
 
 	/*Free elements and elements2d: */
-	xfree((void**)&iomodel->elements);
-	xfree((void**)&iomodel->elements2d);
+	xfree((void**)&elements);
+	xfree((void**)&elements2d);
 
 	#else
@@ -82,14 +86,14 @@
 
 	/*Deal with rifts, they have to be included into one partition only, not several: */
-	iomodel->FetchData(&iomodel->riftinfo,&numrifts,NULL,RiftinfoEnum);
+	iomodel->FetchData(&riftinfo,&numrifts,NULL,RiftinfoEnum);
 
 	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
+		el1=(int)*(riftinfo+RIFTINFOSIZE*i+2)-1; //matlab indexing to c indexing
+		el2=(int)*(riftinfo+RIFTINFOSIZE*i+3)-1; //matlab indexing to c indexing
 		epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding vertices;
 	}
 
 	/*Free rifts: */
-	xfree((void**)&iomodel->riftinfo); 
+	xfree((void**)&riftinfo); 
 
 	/*Used later on: */
@@ -98,5 +102,5 @@
 
 	/*Start figuring out, out of the partition, which elements belong to this cpu: */
-	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
+	iomodel->FetchData(&elements,NULL,NULL,ElementsEnum);
 	for (i=0;i<numberofelements;i++){
 
@@ -110,28 +114,28 @@
 			 into the vertices coordinates. If we start plugging 1 into my_vertices for each index[n][i] (i=0:2), then my_vertices 
 			 will hold which vertices belong to this partition*/
-			my_vertices[(int)*(iomodel->elements+elements_width*i+0)-1]=1;
-			my_vertices[(int)*(iomodel->elements+elements_width*i+1)-1]=1;
-			my_vertices[(int)*(iomodel->elements+elements_width*i+2)-1]=1;
+			my_vertices[(int)*(elements+elements_width*i+0)-1]=1;
+			my_vertices[(int)*(elements+elements_width*i+1)-1]=1;
+			my_vertices[(int)*(elements+elements_width*i+2)-1]=1;
 			
 			if(elements_width==6){
-				my_vertices[(int)*(iomodel->elements+elements_width*i+3)-1]=1;
-				my_vertices[(int)*(iomodel->elements+elements_width*i+4)-1]=1;
-				my_vertices[(int)*(iomodel->elements+elements_width*i+5)-1]=1;
+				my_vertices[(int)*(elements+elements_width*i+3)-1]=1;
+				my_vertices[(int)*(elements+elements_width*i+4)-1]=1;
+				my_vertices[(int)*(elements+elements_width*i+5)-1]=1;
 			}
 		}
 	}//for (i=0;i<numberofelements;i++)
 	/*Free data : */
-	xfree((void**)&iomodel->elements);
+	xfree((void**)&elements);
 
 	/*We might have penalties in which case, some vertices have to be cloned:
 	 * 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,&numpenalties,NULL,PenaltiesEnum);
+	iomodel->FetchData(&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
+		if(my_vertices[(int)penalties[2*i+0]-1] && !my_vertices[(int)penalties[2*i+1]-1]){
+			my_vertices[(int)penalties[2*i+1]-1]=2; //to know that these elements are not on the partition
 		}
 	}
-	xfree((void**)&iomodel->penalties);
+	xfree((void**)&penalties);
 
 	/*Free ressources:*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	(revision 9362)
@@ -26,8 +26,8 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
-	iomodel->parameters->FindParam(&heatcapacity,HeatcapacityEnum);
-	iomodel->parameters->FindParam(&referencetemperature,ReferencetemperatureEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&heatcapacity,HeatcapacityEnum);
+	iomodel->constants->FindParam(&referencetemperature,ReferencetemperatureEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp	(revision 9362)
@@ -24,5 +24,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 	
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp	(revision 9362)
@@ -20,6 +20,6 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Now, is the model 3d? otherwise, do nothing: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp	(revision 9362)
@@ -24,5 +24,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 	
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp	(revision 9362)
@@ -20,5 +20,5 @@
 	/*Fetch data needed: */
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Update elements: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 9362)
@@ -22,6 +22,6 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*if 2d: Error*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp	(revision 9362)
@@ -24,5 +24,5 @@
 	
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	(revision 9362)
@@ -20,6 +20,6 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Now, is the model 3d? otherwise, do nothing: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 9362)
@@ -37,6 +37,6 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&verbose,VerboseEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&verbose,VerboseEnum);
 	
 	SetVerbosityLevel(verbose);
Index: /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 9362)
@@ -42,5 +42,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	my_nodes=(bool*)xmalloc(numberofvertices*sizeof(bool));
@@ -57,5 +57,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->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 
@@ -74,7 +74,9 @@
 	int     pos;
 	int     numberofedges;
+	double* edges=NULL;
+	double* elements=NULL;
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
 
 	/*Build discontinuous node partitioning
@@ -107,6 +109,6 @@
 
 	/*Get edges and elements*/
-	iomodel->FetchData(&iomodel->edges,&numberofedges,&cols,EdgesEnum);
-	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
+	iomodel->FetchData(&edges,&numberofedges,&cols,EdgesEnum);
+	iomodel->FetchData(&elements,NULL,NULL,ElementsEnum);
 	if (cols!=4) _error_("field edges should have 4 columns");
 
@@ -115,6 +117,6 @@
 
 		/*Get left and right elements*/
-		e1=iomodel->edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2]
-		e2=iomodel->edges[4*i+3]-1; //edges are [node1 node2 elem1 elem2]
+		e1=edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2]
+		e2=edges[4*i+3]-1; //edges are [node1 node2 elem1 elem2]
 
 		/* 1) If the element e1 is in the current partition
@@ -126,11 +128,11 @@
 
 			/*1: Get vertices ids*/
-			i1=(int)iomodel->edges[4*i+0];
-			i2=(int)iomodel->edges[4*i+1];
+			i1=(int)edges[4*i+0];
+			i2=(int)edges[4*i+1];
 
 			/*2: Get the column where these ids are located in the index*/
 			pos=UNDEF;
 			for(j=0;j<3;j++){
-				if ((int)iomodel->elements[3*(int)e2+j]==i1) pos=j;
+				if ((int)elements[3*(int)e2+j]==i1) pos=j;
 			}
 
@@ -156,6 +158,6 @@
 
 	/*Free data: */
-	xfree((void**)&iomodel->elements);
-	xfree((void**)&iomodel->edges);
+	xfree((void**)&elements);
+	xfree((void**)&edges);
 
 	/*Assign output pointers:*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 9362)
@@ -13,5 +13,5 @@
 	
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Output*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 9362)
@@ -26,5 +26,5 @@
 	
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 9362)
@@ -30,8 +30,8 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
-	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 9362)
@@ -21,8 +21,8 @@
 
 	/*Fetch data needed: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
 
 	/*Update elements: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp	(revision 9362)
@@ -24,5 +24,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp	(revision 9362)
@@ -20,7 +20,7 @@
 
 	/*Fetch data needed: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
 	iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Update elements: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 9362)
@@ -23,5 +23,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 9362)
@@ -26,6 +26,6 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Create loads if they do not exist yet*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp	(revision 9362)
@@ -24,5 +24,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp	(revision 9361)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp	(revision 9362)
@@ -21,7 +21,7 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum);
 
 	/*Now, is the model 3d? otherwise, do nothing: */
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 9362)
@@ -57,6 +57,6 @@
 	/*Checks in debugging mode*/
 	/*{{{2*/
-	_assert_(iomodel->upperelements);
-	_assert_(iomodel->lowerelements);
+	_assert_(iomodel->f(UpperelementsEnum));
+	_assert_(iomodel->f(LowerelementsEnum));
 	/*}}}*/
 
@@ -66,13 +66,13 @@
 
 	/*Build neighbors list*/
-	if (isnan(iomodel->upperelements[index])) penta_elements_ids[1]=this->id; //upper penta is the same penta
-	else                                    penta_elements_ids[1]=(int)(iomodel->upperelements[index]);
-	if (isnan(iomodel->lowerelements[index])) penta_elements_ids[0]=this->id; //lower penta is the same penta
-	else                                    penta_elements_ids[0]=(int)(iomodel->lowerelements[index]);
+	if (isnan(iomodel->f(UpperelementsEnum)[index])) penta_elements_ids[1]=this->id; //upper penta is the same penta
+	else                                    penta_elements_ids[1]=(int)(iomodel->f(UpperelementsEnum)[index]);
+	if (isnan(iomodel->f(LowerelementsEnum)[index])) penta_elements_ids[0]=this->id; //lower penta is the same penta
+	else                                    penta_elements_ids[0]=(int)(iomodel->f(LowerelementsEnum)[index]);
 	this->InitHookNeighbors(penta_elements_ids);
 
 	/*Build horizontalneighborsids list: */
-	_assert_(iomodel->elementconnectivity);
-	for(i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->elementconnectivity[3*index+i]-1;
+	_assert_(iomodel->f(ElementconnectivityEnum));
+	for(i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->f(ElementconnectivityEnum)[3*index+i]-1;
 
 	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
@@ -4859,7 +4859,7 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&yts,YtsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&yts,YtsEnum);
 
 	/*Branch on type of vector: nodal or elementary: */
@@ -4868,5 +4868,5 @@
 		/*Recover vertices ids needed to initialize inputs*/
 		for(i=0;i<6;i++){ 
-			penta_vertex_ids[i]=(int)iomodel->elements[6*index+i]; //ids for vertices are in the elements array from Matlab
+			penta_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
 		}
 
@@ -5168,53 +5168,53 @@
 
 	/*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);
+	iomodel->constants->FindParam(&yts,YtsEnum);
+	iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum);
+	iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum);
+	iomodel->constants->FindParam(&num_cm_responses,NumCmResponsesEnum);
 
 	/*Checks if debuging*/
 	/*{{{2*/
-	_assert_(iomodel->elements);
+	_assert_(iomodel->f(ElementEnum));
 	/*}}}*/
 
 	/*Recover vertices ids needed to initialize inputs*/
 	for(i=0;i<6;i++){ 
-		penta_vertex_ids[i]=(int)iomodel->elements[6*index+i]; //ids for vertices are in the elements array from Matlab
+		penta_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
 	}
 
 	
 	/*Control Inputs*/
-	if (control_analysis && iomodel->control_type){
+	if (control_analysis && iomodel->f(ControlTypeEnum)){
 		for(i=0;i<num_control_type;i++){
-			switch((int)iomodel->control_type[i]){
+			switch((int)iomodel->f(ControlTypeEnum)[i]){
 				case DhdtEnum:
-					if (iomodel->dhdt){
-						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;
+					if (iomodel->f(DhdtEnum)){
+						for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(DhdtEnum)[penta_vertex_ids[j]-1]/yts;
+						for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(DhdtEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case VxEnum:
-					if (iomodel->vx){
-						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;
+					if (iomodel->f(VxEnum)){
+						for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(VxEnum)[penta_vertex_ids[j]-1]/yts;
+						for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(VxEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case VyEnum:
-					if (iomodel->vy){
-						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;
+					if (iomodel->f(VyEnum)){
+						for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(VyEnum)[penta_vertex_ids[j]-1]/yts;
+						for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(VyEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case DragCoefficientEnum:
-					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)*num_control_type+i];
-						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*num_control_type+i];
+					if (iomodel->f(DragCoefficientEnum)){
+						for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(DragCoefficientEnum)[penta_vertex_ids[j]-1];
+						for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];
+						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];
 						this->inputs->AddInput(new ControlInput(DragCoefficientEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
@@ -5223,5 +5223,5 @@
 					/*Matice will take care of it*/ break;
 				default:
-					_error_("Control %s not implemented yet",EnumToStringx((int)iomodel->control_type[i]));
+					_error_("Control %s not implemented yet",EnumToStringx((int)iomodel->f(ControlTypeEnum)[i]));
 			}
 		}
@@ -5229,41 +5229,41 @@
 
 	//Need to know the type of approximation for this element
-	if(iomodel->elements_type){
-		if (*(iomodel->elements_type+index)==MacAyealApproximationEnum){
+	if(iomodel->f(ElementsTypeEnum)){
+		if (*(iomodel->f(ElementsTypeEnum)+index)==MacAyealApproximationEnum){
 			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealApproximationEnum));
 		}
-		else if (*(iomodel->elements_type+index)==PattynApproximationEnum){
+		else if (*(iomodel->f(ElementsTypeEnum)+index)==PattynApproximationEnum){
 			this->inputs->AddInput(new IntInput(ApproximationEnum,PattynApproximationEnum));
 		}
-		else if (*(iomodel->elements_type+index)==MacAyealPattynApproximationEnum){
+		else if (*(iomodel->f(ElementsTypeEnum)+index)==MacAyealPattynApproximationEnum){
 			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealPattynApproximationEnum));
 		}
-		else if (*(iomodel->elements_type+index)==HutterApproximationEnum){
+		else if (*(iomodel->f(ElementsTypeEnum)+index)==HutterApproximationEnum){
 			this->inputs->AddInput(new IntInput(ApproximationEnum,HutterApproximationEnum));
 		}
-		else if (*(iomodel->elements_type+index)==StokesApproximationEnum){
+		else if (*(iomodel->f(ElementsTypeEnum)+index)==StokesApproximationEnum){
 			this->inputs->AddInput(new IntInput(ApproximationEnum,StokesApproximationEnum));
 		}
-		else if (*(iomodel->elements_type+index)==MacAyealStokesApproximationEnum){
+		else if (*(iomodel->f(ElementsTypeEnum)+index)==MacAyealStokesApproximationEnum){
 			this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealStokesApproximationEnum));
 		}
-		else if (*(iomodel->elements_type+index)==PattynStokesApproximationEnum){
+		else if (*(iomodel->f(ElementsTypeEnum)+index)==PattynStokesApproximationEnum){
 			this->inputs->AddInput(new IntInput(ApproximationEnum,PattynStokesApproximationEnum));
 		}
-		else if (*(iomodel->elements_type+index)==NoneApproximationEnum){
+		else if (*(iomodel->f(ElementsTypeEnum)+index)==NoneApproximationEnum){
 			this->inputs->AddInput(new IntInput(ApproximationEnum,NoneApproximationEnum));
 		}
 		else{
-			_error_("Approximation type %s not supported yet",EnumToStringx((int)*(iomodel->elements_type+index)));
+			_error_("Approximation type %s not supported yet",EnumToStringx((int)*(iomodel->f(ElementsTypeEnum)+index)));
 		}
 	}
 
 	/*DatasetInputs*/
-	if (iomodel->weights) {
+	if (iomodel->f(WeightsEnum)) {
 
 		/*Create inputs and add to DataSetInput*/
 		DatasetInput* datasetinput=new DatasetInput(WeightsEnum);
 		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];
+			for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(WeightsEnum)[(penta_vertex_ids[j]-1)*num_cm_responses+i];
 			datasetinput->inputs->AddObject(new PentaVertexInput(WeightsEnum,nodeinputs));
 		}
@@ -7520,18 +7520,18 @@
 
 	/*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);
+	iomodel->constants->FindParam(&yts,YtsEnum);
+	iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum);
+	iomodel->constants->FindParam(&isstokes,IsstokesEnum);
+	iomodel->constants->FindParam(&beta,BetaEnum);
+	iomodel->constants->FindParam(&heatcapacity,HeatcapacityEnum);
+	iomodel->constants->FindParam(&referencetemperature,ReferencetemperatureEnum);
+	iomodel->constants->FindParam(&meltingpoint,MeltingpointEnum);
+	iomodel->constants->FindParam(&latentheat,LatentheatEnum);
 
 
 	/*Checks if debuging*/
 	/*{{{2*/
-	_assert_(iomodel->elements);
+	_assert_(iomodel->f(ElementsEnum));
 	/*}}}*/
 
@@ -7548,5 +7548,5 @@
 
 	/*Recover vertices ids needed to initialize inputs*/
-	for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->elements[6*index+i]; //ids for vertices are in the elements array from Matlab
+	for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
 
 	/*Recover nodes ids needed to initialize the node hook.*/
@@ -7554,5 +7554,5 @@
 		//go recover node ids, needed to initialize the node hook.
 		//WARNING: We assume P1 elements here!!!!!
-		penta_node_ids[i]=iomodel->nodecounter+(int)iomodel->elements[6*index+i]; //ids for vertices are in the elements array from Matlab
+		penta_node_ids[i]=iomodel->nodecounter+(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
 	}
 
@@ -7569,6 +7569,6 @@
 
 			/*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]/yts;
+			if(!iomodel->f(VxEnum)){
+				if (iomodel->f(VxObsEnum)) for(i=0;i<6;i++)nodeinputs[i]=iomodel->f(VxObsEnum)[penta_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<6;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new PentaVertexInput(VxEnum,nodeinputs));
@@ -7576,6 +7576,6 @@
 				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]/yts;
+			if(!iomodel->f(VyEnum)){
+				if (iomodel->f(VyObsEnum)) for(i=0;i<6;i++)nodeinputs[i]=iomodel->f(VyObsEnum)[penta_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<6;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new PentaVertexInput(VyEnum,nodeinputs));
@@ -7583,6 +7583,6 @@
 				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]/yts;
+			if(!iomodel->f(VzEnum)){
+				if (iomodel->f(VzObsEnum)) for(i=0;i<6;i++)nodeinputs[i]=iomodel->f(VzObsEnum)[penta_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<6;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new PentaVertexInput(VzEnum,nodeinputs));
@@ -7590,5 +7590,5 @@
 				if(qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVzEnum,nodeinputs));
 			}
-			if(!iomodel->pressure){
+			if(!iomodel->f(PressureEnum)){
 				for(i=0;i<6;i++)nodeinputs[i]=0;
 				if(qmu_analysis){
@@ -7601,10 +7601,10 @@
 				}
 			}
-			if(*(iomodel->elements_type+index)==PattynStokesApproximationEnum){
+			if(*(iomodel->f(ElementsTypeEnum)+index)==PattynStokesApproximationEnum){
 				/*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]/yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1];
+				if(iomodel->f(VzEnum) && iomodel->f(NodeOnStokesEnum)){
+					for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->f(NodeOnStokesEnum)[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]/yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]);
+					for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->f(NodeOnStokesEnum)[penta_vertex_ids[i]-1]);
 					this->inputs->AddInput(new PentaVertexInput(VzPattynEnum,nodeinputs));
 				}
@@ -7615,10 +7615,10 @@
 				}
 			}
-			if(*(iomodel->elements_type+index)==MacAyealStokesApproximationEnum){
+			if(*(iomodel->f(ElementsTypeEnum)+index)==MacAyealStokesApproximationEnum){
 				/*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]/yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1];
+				if(iomodel->f(VzEnum) && iomodel->f(NodeOnStokesEnum)){
+					for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->f(NodeOnStokesEnum)[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]/yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]);
+					for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->f(NodeOnStokesEnum)[penta_vertex_ids[i]-1]);
 					this->inputs->AddInput(new PentaVertexInput(VzMacAyealEnum,nodeinputs));
 				}
@@ -7645,12 +7645,12 @@
 			this->inputs->AddInput(new PentaVertexInput(VyMeshEnum,nodeinputs));
 			this->inputs->AddInput(new PentaVertexInput(VzMeshEnum,nodeinputs));
-			if (iomodel->temperature && iomodel->waterfraction) {
+			if (iomodel->f(TemperatureEnum) && iomodel->f(WaterfractionEnum)) {
 				for(i=0;i<6;i++){
-					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);
+					if(iomodel->f(TemperatureEnum)[penta_vertex_ids[i]-1] < meltingpoint-beta*iomodel->f(PressureEnum)[penta_vertex_ids[i]-1]){
+						nodeinputs[i]=heatcapacity*(iomodel->f(TemperatureEnum)[penta_vertex_ids[i]-1]-referencetemperature);
 					}
 					else nodeinputs[i]=heatcapacity*
-					 (meltingpoint-beta*iomodel->pressure[penta_vertex_ids[i]-1]-referencetemperature)
-						+latentheat*iomodel->waterfraction[penta_vertex_ids[i]-1];
+					 (meltingpoint-beta*iomodel->f(PressureEnum)[penta_vertex_ids[i]-1]-referencetemperature)
+						+latentheat*iomodel->f(WaterfractionEnum)[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 9361)
+++ /issm/trunk/src/c/objects/Elements/PentaHook.cpp	(revision 9362)
@@ -51,5 +51,5 @@
 	
 	/*retrieve parameters: */
-	iomodel->parameters->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;
+	iomodel->constants->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;
 
 	this->numanalyses=in_numanalyses;
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 9362)
@@ -52,5 +52,5 @@
 
 		/*Build horizontalneighborsids list: */
-		_assert_(iomodel->elementconnectivity);
+		_assert_(iomodel->f(ElementconnectivityEnum));
 		//for (i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->elementconnectivity[3*index+i]-1;
 
@@ -3279,51 +3279,51 @@
 	/*Checks if debuging*/
 	/*{{{2*/
-	_assert_(iomodel->elements);
+	_assert_(iomodel->f(ElementEnum));
 	/*}}}*/
 
 	/*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);
+	iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum);
+	iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum);
+	iomodel->constants->FindParam(&yts,YtsEnum); 
+	iomodel->constants->FindParam(&num_cm_responses,NumCmResponsesEnum);
 
 	/*Recover vertices ids needed to initialize inputs*/
 	for(i=0;i<3;i++){ 
-		tria_vertex_ids[i]=(int)iomodel->elements[3*index+i]; //ids for vertices are in the elements array from Matlab
+		tria_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
 	}
 
 	/*Control Inputs*/
-	if (control_analysis && iomodel->control_type){
+	if (control_analysis && iomodel->f(ControlTypeEnum)){
 		for(i=0;i<num_control_type;i++){
-			switch((int)iomodel->control_type[i]){
+			switch((int)iomodel->f(ControlTypeEnum)[i]){
 				case DhdtEnum:
-					if (iomodel->dhdt){
-						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;
+					if (iomodel->f(DhdtEnum)){
+						for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(DhdtEnum)[tria_vertex_ids[j]-1]/yts;
+						for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(DhdtEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case VxEnum:
-					if (iomodel->vx){
-						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;
+					if (iomodel->f(VxEnum)){
+						for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(VxEnum)[tria_vertex_ids[j]-1]/yts;
+						for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(VxEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case VyEnum:
-					if (iomodel->vy){
-						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;
+					if (iomodel->f(VyEnum)){
+						for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(VyEnum)[tria_vertex_ids[j]-1]/yts;
+						for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
+						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
 						this->inputs->AddInput(new ControlInput(VyEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case DragCoefficientEnum:
-					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)*num_control_type+i];
-						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*num_control_type+i];
+					if (iomodel->f(DragCoefficientEnum)){
+						for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(DragCoefficientEnum)[tria_vertex_ids[j]-1];
+						for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
+						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
 						this->inputs->AddInput(new ControlInput(DragCoefficientEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
@@ -3332,5 +3332,5 @@
 					/*Matice will take care of it*/ break;
 				default:
-					_error_("Control %s not implemented yet",EnumToStringx((int)iomodel->control_type[i]));
+					_error_("Control %s not implemented yet",EnumToStringx((int)iomodel->f(ControlTypeEnum)[i]));
 			}
 		}
@@ -3338,10 +3338,10 @@
 
 	/*DatasetInputs*/
-	if (iomodel->weights) {
+	if (iomodel->f(WeightsEnum)) {
 
 		/*Create inputs and add to DataSetInput*/
 		DatasetInput* datasetinput=new DatasetInput(WeightsEnum);
 		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];
+			for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(WeightsEnum)[(tria_vertex_ids[j]-1)*num_cm_responses+i];
 			datasetinput->inputs->AddObject(new TriaVertexInput(WeightsEnum,nodeinputs));
 		}
@@ -3910,7 +3910,7 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&yts,YtsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&yts,YtsEnum);
 
 	/*Branch on type of vector: nodal or elementary: */
@@ -3919,5 +3919,5 @@
 		/*Recover vertices ids needed to initialize inputs*/
 		for(i=0;i<3;i++){ 
-			tria_vertex_ids[i]=(int)iomodel->elements[3*index+i]; //ids for vertices are in the elements array from Matlab
+			tria_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
 		}
 
@@ -5227,11 +5227,11 @@
 	/*Checks if debuging*/
 	/*{{{2*/
-	_assert_(iomodel->elements);
+	_assert_(iomodel->f(ElementsEnum));
 	/*}}}*/
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&yts,YtsEnum);
-	iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
-	iomodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
+	iomodel->constants->FindParam(&yts,YtsEnum);
+	iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
+	iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum);
 
 	/*Recover element type*/
@@ -5248,5 +5248,5 @@
 	/*Recover vertices ids needed to initialize inputs*/
 	for(i=0;i<3;i++){ 
-		tria_vertex_ids[i]=(int)iomodel->elements[3*index+i]; //ids for vertices are in the elements array from Matlab
+		tria_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
 	}
 
@@ -5261,5 +5261,5 @@
 		/*Continuous Galerkin*/
 		for(i=0;i<3;i++){ 
-			tria_node_ids[i]=iomodel->nodecounter+(int)*(iomodel->elements+3*index+i); //ids for vertices are in the elements array from Matlab
+			tria_node_ids[i]=iomodel->nodecounter+(int)*(iomodel->f(ElementsEnum)+3*index+i); //ids for vertices are in the elements array from Matlab
 		}
 	}
@@ -5277,6 +5277,6 @@
 
 			/*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]/yts;
+			if(!iomodel->f(VxEnum)){
+				if (iomodel->f(VxObsEnum)) for(i=0;i<3;i++)nodeinputs[i]=iomodel->f(VxObsEnum)[tria_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<3;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new TriaVertexInput(VxEnum,nodeinputs));
@@ -5284,6 +5284,6 @@
 				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]/yts;
+			if(!iomodel->f(VyEnum)){
+				if (iomodel->f(VyObsEnum)) for(i=0;i<3;i++)nodeinputs[i]=iomodel->f(VyObsEnum)[tria_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<3;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new TriaVertexInput(VyEnum,nodeinputs));
@@ -5291,6 +5291,6 @@
 				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]/yts;
+			if(!iomodel->f(VzEnum)){
+				if (iomodel->f(VzObsEnum)) for(i=0;i<3;i++)nodeinputs[i]=iomodel->f(VzObsEnum)[tria_vertex_ids[i]-1]/yts;
 				else                 for(i=0;i<3;i++)nodeinputs[i]=0;
 				this->inputs->AddInput(new TriaVertexInput(VzEnum,nodeinputs));
@@ -5298,5 +5298,5 @@
 				if(qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVzEnum,nodeinputs));
 			}
-			if(!iomodel->pressure){
+			if(!iomodel->f(PressureEnum)){
 				for(i=0;i<3;i++)nodeinputs[i]=0;
 				if(qmu_analysis){
Index: /issm/trunk/src/c/objects/Elements/TriaHook.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/TriaHook.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Elements/TriaHook.cpp	(revision 9362)
@@ -49,5 +49,5 @@
 
 	/*retrieve parameters: */
-	iomodel->parameters->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;
+	iomodel->constants->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;
 	
 	this->numanalyses=in_numanalyses;
Index: /issm/trunk/src/c/objects/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/objects/IoModel.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/IoModel.cpp	(revision 9362)
@@ -12,4 +12,7 @@
 #include <string.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
 #include "./objects.h"
 #include "./Container/Parameters.h"
@@ -21,220 +24,56 @@
 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();
-
-}
-/*}}}*/
-/*FUNCTION IoModel::~IoModel(){{{1*/
-IoModel::~IoModel(){
-	
-	int i;
-
-	/*!Two cases here: 
-	 * - serial mode: matlab's memory manager will take care of delete iomodel when returning from Imp. Do nothing here, so as not to confuse 
-	 *                the memory manager.
-     * - in parallel, anything the io layer does (FetchData) did needs to be erased explicitely in the iomodel.
-	 */
-
-	#ifdef _PARALLEL_
-	xfree((void**)&this->x);
-	xfree((void**)&this->y);
-	xfree((void**)&this->z);
-	xfree((void**)&this->elements);
-	xfree((void**)&this->elementconnectivity);
-	xfree((void**)&this->elements_type);
-	xfree((void**)&this->vertices_type);
-	xfree((void**)&this->nodeonhutter);
-	xfree((void**)&this->nodeonmacayeal);
-	xfree((void**)&this->elements2d);
-	xfree((void**)&this->upperelements);
-	xfree((void**)&this->lowerelements);
-	xfree((void**)&this->nodeonpattyn);
-	xfree((void**)&this->elementonbed);
-	xfree((void**)&this->elementonsurface);
-	xfree((void**)&this->nodeonbed);
-	xfree((void**)&this->nodeonsurface);
-	xfree((void**)&this->nodeonstokes);
-	xfree((void**)&this->borderstokes);
-	xfree((void**)&this->thickness_obs);
-	xfree((void**)&this->thickness_coeff);
-	xfree((void**)&this->thickness);
-	xfree((void**)&this->surface);
-	xfree((void**)&this->bed);
-	xfree((void**)&this->bathymetry);
-	xfree((void**)&this->vx_obs);
-	xfree((void**)&this->vy_obs);
-	xfree((void**)&this->vz_obs);
-	xfree((void**)&this->vx);
-	xfree((void**)&this->vy);
-	xfree((void**)&this->vz);
-	xfree((void**)&this->pressure);
-	xfree((void**)&this->temperature);
-	xfree((void**)&this->waterfraction);
-	xfree((void**)&this->drag_coefficient);
-	xfree((void**)&this->drag_p);
-	xfree((void**)&this->drag_q);
-	xfree((void**)&this->elementoniceshelf);
-	xfree((void**)&this->elementonwater);
-	xfree((void**)&this->nodeonicesheet);
-	xfree((void**)&this->nodeoniceshelf);
-	xfree((void**)&this->nodeonwater);
-	xfree((void**)&this->pressureload);
-	xfree((void**)&this->spcvx);
-	xfree((void**)&this->spcvy);
-	xfree((void**)&this->spcvz);
-	xfree((void**)&this->spcthickness);
-	xfree((void**)&this->spcwatercolumn);
-	xfree((void**)&this->spctemperature);
-	xfree((void**)&this->diagnostic_ref);
-	xfree((void**)&this->edges);
-	xfree((void**)&this->geothermalflux);
-	xfree((void**)&this->basal_melting_rate);
-	xfree((void**)&this->watercolumn);
-	xfree((void**)&this->basal_melting_rate_correction);
-	xfree((void**)&this->surface_accumulation_rate);
-	xfree((void**)&this->surface_ablation_rate);
-	xfree((void**)&this->surface_mass_balance);
-	xfree((void**)&this->dhdt);
-	xfree((void**)&this->rheology_B);
-	xfree((void**)&this->rheology_n);
-	xfree((void**)&this->control_type);
-	xfree((void**)&this->cm_responses);
-	xfree((void**)&this->weights);
-	xfree((void**)&this->cm_jump);
-	xfree((void**)&this->cm_min);
-	xfree((void**)&this->cm_max);
-	xfree((void**)&this->optscal);
-	xfree((void**)&this->maxiter);
-
-
-	/*!Delete structure fields: */
-	xfree((void**)&this->riftinfo);
-	xfree((void**)&this->penalties);
-	
-	/*exterior data: */
-	xfree((void**)&this->my_elements);
-	xfree((void**)&this->my_vertices);
-	xfree((void**)&this->my_nodes);
-	xfree((void**)&this->singlenodetoelementconnectivity);
-	xfree((void**)&this->numbernodetoelementconnectivity);
-	#endif
-}
-/*}}}*/
-/*FUNCTION IoModel::IoModelInit{{{1*/
-void IoModel::IoModelInit(void){
-
-	/*exterior data: */
+	this->constants=NULL;
+	
+	this->my_elements=NULL;
+	this->my_nodes=NULL;
+	this->my_vertices=NULL;
+	this->singlenodetoelementconnectivity=NULL;
+	this->numbernodetoelementconnectivity=NULL;
+	
 	this->nodecounter=0;
 	this->loadcounter=0;
 	this->constraintcounter=0;
-	
-	/*!initialize all pointers to 0: */
-	this->x=NULL; 
-	this->y=NULL;
-	this->z=NULL;
-	this->elements=NULL;
-	this->elementconnectivity=NULL;
-	this->elements_type=NULL;
-	this->vertices_type=NULL;
-	this->elements2d=NULL;
-	this->upperelements=NULL;
-	this->lowerelements=NULL;
-	this->nodeonhutter=NULL;
-	this->nodeonmacayeal=NULL;
-	this->nodeonpattyn=NULL;
-	
-	this->vx_obs=NULL;
-	this->vy_obs=NULL;
-	this->vz_obs=NULL;
-	this->vx=NULL;
-	this->vy=NULL;
-	this->vz=NULL;
-	this->pressure=NULL;
-	this->temperature=NULL;
-	this->waterfraction=NULL;
-	this->basal_melting_rate=NULL;
-	this->watercolumn=NULL;
-	this->basal_melting_rate_correction=NULL;
-	this->geothermalflux=NULL;
-	this->elementonbed=NULL;
-	this->elementonsurface=NULL;
-	this->nodeonbed=NULL;
-	this->nodeonsurface=NULL;
-	this->nodeonstokes=NULL;
-	this->borderstokes=NULL;
-	this->thickness_obs=NULL;
-	this->thickness_coeff=NULL;
-	this->thickness=NULL;
-	this->surface=NULL;
-	this->bed=NULL;
-	this->bathymetry=NULL;
-	this->elementoniceshelf=NULL;
-	this->elementonwater=NULL;
-	this->nodeonicesheet=NULL;
-	this->nodeoniceshelf=NULL;
-	this->nodeonwater=NULL;
-
-	this->drag_coefficient=NULL;
-	this->drag_p=NULL;
-	this->drag_q=NULL;
-	
-	
-	this->pressureload=NULL;
-	this-> spcvx=NULL;
-	this-> spcvy=NULL;
-	this-> spcvz=NULL;
-	this-> spctemperature=NULL;
-	this-> spcthickness=NULL;
-	this-> spcwatercolumn=NULL;
-	this-> diagnostic_ref=NULL;
-	this->edges=NULL;
-	
-	/*!materials: */
-	this->rheology_n=NULL;
-	this->rheology_B=NULL;
-
-	/*!solution parameters: */
-	this->control_type=NULL;
-	this->cm_responses=NULL;
-	this->weights=NULL;
-	this->cm_jump=NULL;
-	this->maxiter=NULL;
-	this->cm_min=NULL;
-	this->cm_max=NULL;
-	this->optscal=NULL;
-
-	this->riftinfo=NULL;
-
-	/*!penalties: */
-	this->penalties=NULL;
-
-	/*!surface: */
-	this->surface_mass_balance=NULL;
-   this->surface_accumulation_rate=NULL;
-	this->surface_ablation_rate=NULL;
-	this->dhdt=NULL;
-
-	/*exterior data: */
+
+}
+/*}}}*/
+/*FUNCTION IoModel::IoModel(FILE*  iomodel_handle){{{1*/
+IoModel::IoModel(FILE* iomodel_handle){
+	
+	/*First, keep track of the file handle: */
+	this->fid=iomodel_handle;
+
+	/*Initialize and read constants:*/
+	this->constants=new Parameters();
+	this->FetchParameters(this->constants); /*this routine goes through the input file, and fetches bools, ints, doubles and strings only, nothing memory intensive*/
+
+	/*Initialize data: */
+	this->data=new Parameters();
+	
+	/*Initialize permanent data: */
 	this->my_elements=NULL;
+	this->my_nodes=NULL;
 	this->my_vertices=NULL;
-	this->my_nodes=NULL;
 	this->singlenodetoelementconnectivity=NULL;
 	this->numbernodetoelementconnectivity=NULL;
+	
+	this->nodecounter=0;
+	this->loadcounter=0;
+	this->constraintcounter=0;
+
+
+}
+/*}}}*/
+/*FUNCTION IoModel::~IoModel(){{{1*/
+IoModel::~IoModel(){
+
+	delete this->constants;
+	delete this->data;
+
+	xfree((void**)&this->my_elements);
+	xfree((void**)&this->my_nodes);
+	xfree((void**)&this->my_vertices);
+	xfree((void**)&this->singlenodetoelementconnectivity);
+	xfree((void**)&this->numbernodetoelementconnectivity);
 }
 /*}}}*/
@@ -638,4 +477,76 @@
 	*pndims=ndims;
 	*pnumrecords=numrecords;
+}
+/*}}}*/
+/*FUNCTION IoModel::FetchData(int num,...){{{1*/
+void  IoModel::FetchData(int num,...){
+
+
+	va_list ap;
+	int     dataenum;
+	double* matrix=NULL;
+	int     M,N;
+	int     i;
+
+	/*Go through the entire list of enums and fetch the corresponding data. Add it to the iomodel->data dataset. Everything
+	 *we fetch is a double* : */
+	
+	va_start(ap,num);
+
+	for(i = 0; i <num; i++){
+		
+		dataenum=va_arg(ap, int);
+		this->FetchData(&matrix,&M,&N,dataenum);
+
+		/*Add to this->data: */
+		this->data->AddObject(new DoubleMatParam(dataenum,matrix,M,N));
+		
+		/*Free ressources:*/
+		xfree((void**)&matrix);
+	}
+	va_end(ap);
+
+}
+/*}}}*/
+/*FUNCTION IoModel::DeleteData(int num,...){{{1*/
+void  IoModel::DeleteData(int num,...){
+
+
+	va_list ap;
+	int     dataenum;
+	int     i;
+	DoubleMatParam* parameter=NULL;
+
+	/*Go through the entire list of enums and delete the corresponding data from the iomodel-data dataset: */
+	
+	va_start(ap,num);
+
+	for(i = 0; i <num; i++){
+		
+		dataenum=va_arg(ap, int);
+	
+		parameter=(DoubleMatParam*)this->data->FindParamObject(dataenum); 
+		if(parameter){
+			this->data->DeleteObject((Object*)parameter);
+		}
+		else{
+			/*do nothing, we did not find the data, but this is no reason to error out: */
+		}
+	}
+	va_end(ap);
+
+}
+/*}}}*/
+/*FUNCTION IoModel::get(int dataenum){{{1*/
+double* IoModel::f(int dataenum){
+
+	DoubleMatParam* parameter=NULL;
+		
+	parameter=(DoubleMatParam*)this->data->FindParamObject(dataenum);
+
+	if (parameter==NULL)return NULL; //might be legitimate
+	else{
+		return parameter->GetPointer();
+	}
 }
 /*}}}*/
@@ -935,5 +846,5 @@
 
 	/*Fetch parameters: */
-	this->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	this->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*First of, find the record for the enum, and get code  of data type: */
Index: /issm/trunk/src/c/objects/IoModel.h
===================================================================
--- /issm/trunk/src/c/objects/IoModel.h	(revision 9361)
+++ /issm/trunk/src/c/objects/IoModel.h	(revision 9362)
@@ -12,4 +12,6 @@
 
 class Elements;
+
+
 class IoModel {
 
@@ -18,114 +20,8 @@
 
 	public:
-		Parameters* parameters; //this dataset holds all double, int, bool and char* parameters read in from the input file.* 
-		/*Data: {{{1*/
+		Parameters* constants; //this dataset holds all double, int, bool and char* parameters read in from the input file.* 
+		Parameters* data; //this dataset holds temporary data, memory intensive.
 
-		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: */
-		double* x;
-		double* y;
-		double* z;
-		double* elements;
-		double* elements_type;
-		double* vertices_type;
-		double* elementconnectivity;
-
-		/*3d mesh: */
-		double* elements2d;
-		double* upperelements;
-		double* lowerelements;
-
-		/*elements type: */
-		double* nodeonhutter;
-		double* nodeonmacayeal;
-		double* nodeonpattyn;
-
-		/*results: */
-		double* vx;
-		double* vy;
-		double* vz;
-		double* pressure;
-		double* temperature;
-		double* waterfraction;
-
-		/*observations: */
-		double*  thickness_obs;
-		double*  vx_obs;
-		double*  vy_obs;
-		double*  vz_obs;
-
-		/*geometry: */
-		double* elementonbed;
-		double* elementonsurface;
-		double* nodeonbed;
-		double* nodeonsurface;
-		double* nodeonstokes;
-		double* borderstokes;
-		double* thickness;
-		double* thickness_coeff;
-		double* surface;
-		double* bed;
-		double* bathymetry;
-		double* elementoniceshelf;
-		double* elementonwater;
-		double* nodeonicesheet;
-		double* nodeoniceshelf;
-		double* nodeonwater;
-
-		/*friction: */
-		double* drag_coefficient;
-		double* drag_p;
-		double* drag_q;
-
-		/*boundary conditions: */
-		double* pressureload;
-		double* spcvx;
-		double* spcvy;
-		double* spcvz;
-		double* spctemperature;
-		double* spcthickness;
-		double* spcwatercolumn;
-		double* diagnostic_ref;
-		double* geothermalflux;
-		double* edges;
-
-		/*materials: */
-		double* rheology_B;
-		double* rheology_n;
-
-		/*numerical parameters: */
-		double* cm_min;
-		double* cm_max;
-
-		/*control methods: */
-		double*  control_type;
-
-		/*solution parameters: */
-		double* cm_responses;
-		double* weights;
-		double* cm_jump;
-		double* maxiter;
-		double* optscal;
-
-		/*rifts: */
-		double*  riftinfo;
-
-		/*penalties: */
-		double*  penalties;
-
-		/*basal: */
-		double*  basal_melting_rate;
-		double*  watercolumn;
-		double*  basal_melting_rate_correction;
-		double*  surface_mass_balance;
-		double*  surface_accumulation_rate;
-		double*  surface_ablation_rate;
-
-		double*  dhdt;
-
-		/*exterior partitioning data, to be carried around: */
+		/*This data needs to stay memory resident at all time, even if it's memory intensive: */
 		bool*   my_elements;
 		bool*   my_nodes;
@@ -134,10 +30,13 @@
 		int*    numbernodetoelementconnectivity;
 
-		 /*}}}*/
+		/*Data to synchronize through low level object drivers: */
+		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
+
 		/*Methods: {{{1*/
 		~IoModel();
 		IoModel();
 		IoModel(FILE* iomodel_handle);
-		void IoModelInit(void);
 		/*}}}*/
 		/*Input/Output:{{{1*/
@@ -153,4 +52,7 @@
 		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);
+		void  FetchData(int num,...);
+		double* f(int dataenum);
+		void  DeleteData(int num,...);
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Loads/Icefront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 9362)
@@ -54,6 +54,6 @@
 	
 	/*find parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*First, retrieve element index and element type: */
@@ -64,19 +64,19 @@
 		segment_width=6;
 	}
-	element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)
+	element=(int)(*(iomodel->f(PressureloadEnum)+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)
 
 	/*Build ids for hook constructors: */
-	icefront_eid=(int) *(iomodel->pressureload+segment_width*i+segment_width-2); //matlab indexing
+	icefront_eid=(int) *(iomodel->f(PressureloadEnum)+segment_width*i+segment_width-2); //matlab indexing
 	icefront_mparid=numberofelements+1; //matlab indexing
 
 	if (in_icefront_type==MacAyeal2dIceFrontEnum || in_icefront_type==MacAyeal3dIceFrontEnum){
-		icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+0);
-		icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+1);
+		icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+0);
+		icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+1);
 	}
 	else if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum){
-		icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+0);
-		icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+1);
-		icefront_node_ids[2]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+2);
-		icefront_node_ids[3]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+3);
+		icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+0);
+		icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+1);
+		icefront_node_ids[2]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+2);
+		icefront_node_ids[3]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+3);
 	}
 	else _error_("in_icefront_type %s not supported yet!",EnumToStringx(in_icefront_type));
@@ -84,5 +84,5 @@
 	if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum) num_nodes=4;
 	else num_nodes=2;
-	icefront_fill=(int)*(iomodel->pressureload+segment_width*i+segment_width-1); 
+	icefront_fill=(int)*(iomodel->f(PressureloadEnum)+segment_width*i+segment_width-1); 
 	
 	/*Ok, we have everything to build the object: */
Index: /issm/trunk/src/c/objects/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 9362)
@@ -54,5 +54,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/* Get MatPar id */
@@ -60,7 +60,7 @@
 
 	/*First, see wether this is an internal or boundary edge (if e2=NaN)*/
-	if (isnan((double)iomodel->edges[4*i+3])){ //edges are [node1 node2 elem1 elem2]
+	if (isnan((double)iomodel->f(EdgesEnum)[4*i+3])){ //edges are [node1 node2 elem1 elem2]
 		/* Boundary edge, only one element */
-		e1=(int)iomodel->edges[4*i+2];
+		e1=(int)iomodel->f(EdgesEnum)[4*i+2];
 		e2=(int)UNDEF;
 		num_elems=1;
@@ -71,6 +71,6 @@
 	else{
 		/* internal edge: connected to 2 elements */
-		e1=(int)iomodel->edges[4*i+2];
-		e2=(int)iomodel->edges[4*i+3];
+		e1=(int)iomodel->f(EdgesEnum)[4*i+2];
+		e2=(int)iomodel->f(EdgesEnum)[4*i+3];
 		num_elems=2;
 		num_nodes=4;
@@ -81,6 +81,6 @@
 
 	/*1: Get vertices ids*/
-	i1=(int)iomodel->edges[4*i+0];
-	i2=(int)iomodel->edges[4*i+1];
+	i1=(int)iomodel->f(EdgesEnum)[4*i+0];
+	i2=(int)iomodel->f(EdgesEnum)[4*i+1];
 
 	if (numericalflux_type==InternalEnum){
@@ -91,8 +91,8 @@
 		pos1=pos2=pos3=pos4=UNDEF;
 		for(j=0;j<3;j++){
-			if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
-			if (iomodel->elements[3*(e1-1)+j]==i2) pos2=j+1;
-			if (iomodel->elements[3*(e2-1)+j]==i1) pos3=j+1;
-			if (iomodel->elements[3*(e2-1)+j]==i2) pos4=j+1;
+			if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
+			if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
+			if (iomodel->f(ElementsEnum)[3*(e2-1)+j]==i1) pos3=j+1;
+			if (iomodel->f(ElementsEnum)[3*(e2-1)+j]==i2) pos4=j+1;
 		}
 		_assert_(pos1!=UNDEF && pos2!=UNDEF && pos3!=UNDEF && pos4!=UNDEF);
@@ -110,6 +110,6 @@
 		pos1=pos2=UNDEF;
 		for(j=0;j<3;j++){
-			if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
-			if (iomodel->elements[3*(e1-1)+j]==i2) pos2=j+1;
+			if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
+			if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
 		}
 		_assert_(pos1!=UNDEF && pos2!=UNDEF);
Index: /issm/trunk/src/c/objects/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 9362)
@@ -53,6 +53,6 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
 
 	/*Some checks if debugging activated*/
Index: /issm/trunk/src/c/objects/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Riftfront.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Loads/Riftfront.cpp	(revision 9362)
@@ -56,13 +56,13 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
-	iomodel->parameters->FindParam(&penalty_lock,PenaltyLockEnum);
+	iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
+	iomodel->constants->FindParam(&penalty_lock,PenaltyLockEnum);
 
 	/*Ok, retrieve all the data needed to add a penalty between the two nodes: */
-	el1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2);
-	el2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+3); 
-
-	node1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+0); 
-	node2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+1);
+	el1=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+2);
+	el2=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+3); 
+
+	node1=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+0); 
+	node2=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+1);
 
 	/*id: */
@@ -89,9 +89,9 @@
 	this->penalty_lock=penalty_lock;
 	this->material_converged=0;
-	this->normal[0]=*(iomodel->riftinfo+RIFTINFOSIZE*i+4);
-	this->normal[1]=*(iomodel->riftinfo+RIFTINFOSIZE*i+5);
-	this->length=*(iomodel->riftinfo+RIFTINFOSIZE*i+6);
-	this->fraction=*(iomodel->riftinfo+RIFTINFOSIZE*i+9);
-	this->state=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+11);
+	this->normal[0]=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+4);
+	this->normal[1]=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+5);
+	this->length=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+6);
+	this->fraction=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+9);
+	this->state=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+11);
 
 	//intialize inputs, and add as many inputs per element as requested: 
@@ -99,8 +99,8 @@
 		
 	riftfront_type=SegmentRiftfrontEnum;
-	riftfront_fill = (int)*(iomodel->riftinfo+RIFTINFOSIZE*i+7);
-	riftfront_friction=*(iomodel->riftinfo+RIFTINFOSIZE*i+8);
-	riftfront_fractionincrement=*(iomodel->riftinfo+RIFTINFOSIZE*i+10);
-	riftfront_shelf=(bool)iomodel->nodeoniceshelf[node1-1];
+	riftfront_fill = (int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+7);
+	riftfront_friction=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+8);
+	riftfront_fractionincrement=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+10);
+	riftfront_shelf=(bool)iomodel->f(NodeOnIceShelfEnum)[node1-1];
 
 	this->inputs->AddInput(new IntInput(TypeEnum,riftfront_type));
Index: /issm/trunk/src/c/objects/Materials/Matice.cpp
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 9362)
@@ -660,7 +660,7 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
-	iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
-	iomodel->parameters->FindParam(&num_control_type,NumControlTypeEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum);
+	iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum);
 
 
@@ -675,25 +675,25 @@
 
 		/*Get B*/
-		if (iomodel->rheology_B) {
-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];
+		if (iomodel->f(RheologyBEnum)) {
+			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+i]-1)];
 			this->inputs->AddInput(new TriaVertexInput(RheologyBbarEnum,nodeinputs));
 		}
 
 		/*Get n*/
-		if (iomodel->rheology_n) {
-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->rheology_n[index];
+		if (iomodel->f(RheologyNEnum)) {
+			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyNEnum)[index];
 			this->inputs->AddInput(new TriaVertexInput(RheologyNEnum,nodeinputs));
 		}
 
 		/*Control Inputs*/
-		if (control_analysis && iomodel->control_type){
+		if (control_analysis && iomodel->f(ControlTypeEnum)){
 			for(i=0;i<num_control_type;i++){
-				switch((int)iomodel->control_type[i]){
+				switch((int)iomodel->f(ControlTypeEnum)[i]){
 					case RheologyBbarEnum:
-						if (iomodel->rheology_B){
-							_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)*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];
+						if (iomodel->f(RheologyBEnum)){
+							_assert_(iomodel->f(RheologyBEnum));_assert_(iomodel->f(CmMinEnum)); _assert_(iomodel->f(CmMaxEnum)); 
+							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)];
+							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
 							this->inputs->AddInput(new ControlInput(RheologyBbarEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 						}
@@ -714,25 +714,25 @@
 
 		/*Get B*/
-		if (iomodel->rheology_B) {
-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];
+		if (iomodel->f(RheologyBEnum)) {
+			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+i]-1)];
 			this->inputs->AddInput(new PentaVertexInput(RheologyBEnum,nodeinputs));
 		}
 
 		/*Get n*/
-		if (iomodel->rheology_n) {
-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->rheology_n[index];
+		if (iomodel->f(RheologyNEnum)) {
+			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyNEnum)[index];
 			this->inputs->AddInput(new PentaVertexInput(RheologyNEnum,nodeinputs));
 		}
 
 		/*Control Inputs*/
-		if (control_analysis && iomodel->control_type){
+		if (control_analysis && iomodel->f(ControlTypeEnum)){
 			for(i=0;i<num_control_type;i++){
-				switch((int)iomodel->control_type[i]){
+				switch((int)iomodel->f(ControlTypeEnum)[i]){
 					case RheologyBbarEnum:
-						if (iomodel->rheology_B){
-							_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)*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];
+						if (iomodel->f(RheologyBEnum)){
+							_assert_(iomodel->f(RheologyBEnum));_assert_(iomodel->f(CmMinEnum)); _assert_(iomodel->f(CmMaxEnum)); 
+							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)];
+							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[int(iomodel->f(ElementsEnum)[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 9361)
+++ /issm/trunk/src/c/objects/Materials/Matpar.cpp	(revision 9362)
@@ -26,21 +26,21 @@
 
 	this->mid                       = matpar_mid;
-	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);
+	iomodel->constants->FindParam(&this->rho_ice,RhoIceEnum);
+	iomodel->constants->FindParam(&this->rho_water,RhoWaterEnum);
+	iomodel->constants->FindParam(&this->heatcapacity,HeatcapacityEnum);
+	iomodel->constants->FindParam(&this->thermalconductivity,ThermalconductivityEnum);
+	iomodel->constants->FindParam(&this->latentheat,LatentheatEnum);
+	iomodel->constants->FindParam(&this->beta,BetaEnum);
+	iomodel->constants->FindParam(&this->meltingpoint,MeltingpointEnum);
+	iomodel->constants->FindParam(&this->referencetemperature,ReferencetemperatureEnum);
+	iomodel->constants->FindParam(&this->mixed_layer_capacity,MixedLayerCapacityEnum);
+	iomodel->constants->FindParam(&this->thermal_exchange_velocity,ThermalExchangeVelocityEnum);
+	iomodel->constants->FindParam(&this->g,GEnum);
+	
+	iomodel->constants->FindParam(&this->kn,HydroKnEnum);
+	iomodel->constants->FindParam(&this->hydro_p,HydroPEnum);
+	iomodel->constants->FindParam(&this->hydro_q,HydroQEnum);
+	iomodel->constants->FindParam(&this->hydro_CR,HydroCREnum);
+	iomodel->constants->FindParam(&this->hydro_n,HydroNEnum);
 }
 /*}}}1*/
Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 9362)
@@ -37,5 +37,5 @@
 
 	/*Fetch parameters: */
-	iomodel->parameters->FindParam(&dim,DimEnum);
+	iomodel->constants->FindParam(&dim,DimEnum);
 
 	/*id: */
@@ -46,5 +46,5 @@
 
 	/*indexing:*/
-	DistributeNumDofs(&this->indexing,analysis_type,iomodel->vertices_type+io_index); //number of dofs per node
+	DistributeNumDofs(&this->indexing,analysis_type,iomodel->f(VerticesTypeEnum)+io_index); //number of dofs per node
 	gsize=this->indexing.gsize;
 
@@ -54,16 +54,16 @@
 	//intialize inputs, and add as many inputs per element as requested: 
 	this->inputs=new Inputs();
-	if (iomodel->nodeonbed)      this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->nodeonbed[io_index]));
-	if (iomodel->nodeonsurface)  this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->nodeonsurface[io_index]));
-	if (iomodel->nodeoniceshelf) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->nodeoniceshelf[io_index]));
-	if (iomodel->nodeonicesheet) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->nodeonicesheet[io_index]));
+	if (iomodel->f(NodeOnBedEnum))      this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->f(NodeOnBedEnum)[io_index]));
+	if (iomodel->f(NodeOnSurfaceEnum))  this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->f(NodeOnSurfaceEnum)[io_index]));
+	if (iomodel->f(NodeOnIceShelfEnum)) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->f(NodeOnIceShelfEnum)[io_index]));
+	if (iomodel->f(NodeOnIceSheetEnum)) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->f(NodeOnIceSheetEnum)[io_index]));
 	if (iomodel->numbernodetoelementconnectivity) this->inputs->AddInput(new IntInput(NumberNodeToElementConnectivityEnum,(IssmInt)iomodel->numbernodetoelementconnectivity[io_index]));
-	if (analysis_type==DiagnosticHorizAnalysisEnum) this->inputs->AddInput(new IntInput(ApproximationEnum,(IssmInt)iomodel->vertices_type[io_index]));
+	if (analysis_type==DiagnosticHorizAnalysisEnum) this->inputs->AddInput(new IntInput(ApproximationEnum,(IssmInt)iomodel->f(VerticesTypeEnum)[io_index]));
 	
 	/*set single point constraints: */
 
 	/*spc all nodes on water*/
-	if (!iomodel->nodeonwater) _error_("iomodel->nodeonwater is NULL");
-	if (iomodel->nodeonwater[io_index]){
+	if (!iomodel->f(NodeOnWaterEnum)) _error_("iomodel->nodeonwater is NULL");
+	if (iomodel->f(NodeOnWaterEnum)[io_index]){
 		for(k=1;k<=gsize;k++){
 			this->FreezeDof(k);
@@ -75,16 +75,16 @@
 		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");
-			if (!iomodel->vertices_type) _error_("iomodel->vertices_type is NULL");
-			if (iomodel->vertices_type[io_index]==MacAyealApproximationEnum && !iomodel->nodeonbed[io_index]){
+			if (!iomodel->f(NodeOnBedEnum)) _error_("iomodel->nodeonbed is NULL");
+			if (!iomodel->f(VerticesTypeEnum)) _error_("iomodel->vertices_type is NULL");
+			if (iomodel->f(VerticesTypeEnum)[io_index]==MacAyealApproximationEnum && !iomodel->f(NodeOnBedEnum)[io_index]){
 				for(k=1;k<=gsize;k++) this->FreezeDof(k);
 			}
-			if (iomodel->vertices_type[io_index]==MacAyealPattynApproximationEnum && iomodel->nodeonmacayeal[io_index]){
-				if(!iomodel->nodeonbed[io_index]){
+			if (iomodel->f(VerticesTypeEnum)[io_index]==MacAyealPattynApproximationEnum && iomodel->f(NodeOnMacayealEnum)[io_index]){
+				if(!iomodel->f(NodeOnBedEnum)[io_index]){
 					for(k=1;k<=gsize;k++) this->FreezeDof(k);
 				}
 			}
-			if (iomodel->vertices_type[io_index]==MacAyealStokesApproximationEnum && iomodel->nodeonmacayeal[io_index]){
-				if(!iomodel->nodeonbed[io_index]){
+			if (iomodel->f(VerticesTypeEnum)[io_index]==MacAyealStokesApproximationEnum && iomodel->f(NodeOnMacayealEnum)[io_index]){
+				if(!iomodel->f(NodeOnBedEnum)[io_index]){
 					for(k=1;k<=2;k++) this->FreezeDof(k);
 				}
@@ -92,6 +92,6 @@
 		}
 		/*spc all nodes on hutter*/
-		if (!iomodel->nodeonhutter) _error_("iomodel->nodeonhutter is NULL");
-		if (iomodel->nodeonhutter[io_index]){
+		if (!iomodel->f(NodeOnHutterEnum)) _error_("iomodel->nodeonhutter is NULL");
+		if (iomodel->f(NodeOnHutterEnum)[io_index]){
 			for(k=1;k<=gsize;k++){
 				this->FreezeDof(k);
@@ -104,6 +104,6 @@
 	if (analysis_type==DiagnosticHutterAnalysisEnum){
 		/*Constrain all nodes that are not Hutter*/
-		if (!iomodel->nodeonhutter) _error_("iomodel->nodeonhutter is NULL");
-		if (!iomodel->nodeonhutter[io_index]){
+		if (!iomodel->f(NodeOnHutterEnum)) _error_("iomodel->nodeonhutter is NULL");
+		if (!iomodel->f(NodeOnHutterEnum)[io_index]){
 			for(k=1;k<=gsize;k++){
 				this->FreezeDof(k);
@@ -122,6 +122,6 @@
 		if (dim==3){
 			/*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
-			_assert_(iomodel->nodeonbed);
-			if (!iomodel->nodeonbed[io_index]){
+			_assert_(iomodel->f(NodeOnBedEnum));
+			if (!iomodel->f(NodeOnBedEnum)[io_index]){
 				for(k=1;k<=gsize;k++){
 					this->FreezeDof(k);
Index: /issm/trunk/src/c/objects/Params/DoubleMatParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleMatParam.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Params/DoubleMatParam.cpp	(revision 9362)
@@ -229,2 +229,9 @@
 }
 /*}}}*/
+		
+/*diverse: */
+/*FUNCTION DoubleMatParam::GetPointer{{{1*/
+double* DoubleMatParam::GetPointer(void){
+	return this->value;
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/Params/DoubleMatParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleMatParam.h	(revision 9361)
+++ /issm/trunk/src/c/objects/Params/DoubleMatParam.h	(revision 9362)
@@ -79,4 +79,5 @@
 		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);
+		double* GetPointer(void);
 
 		char* GetParameterName(void);
Index: /issm/trunk/src/c/objects/Vertex.cpp
===================================================================
--- /issm/trunk/src/c/objects/Vertex.cpp	(revision 9361)
+++ /issm/trunk/src/c/objects/Vertex.cpp	(revision 9362)
@@ -31,5 +31,5 @@
 Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel){
 
-	this->Init(vertex_id, vertex_sid, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]));
+	this->Init(vertex_id, vertex_sid, iomodel->f(XEnum)[i],iomodel->f(YEnum)[i],iomodel->f(ZEnum)[i],(iomodel->f(ZEnum)[i]-iomodel->f(BedEnum)[i])/(iomodel->f(ThicknessEnum)[i]));
 
 }
