Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp	(revision 1834)
@@ -11,8 +11,8 @@
 #include "../../objects/objects.h"
 #include "../../shared/shared.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateConstraintsDiagnosticStokes(DataSet** pconstraints, Model* model,ConstDataHandle model_handle){
+void	CreateConstraintsDiagnosticStokes(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	int i;
@@ -34,15 +34,15 @@
 
 	/*Now, is the flag ishutter on? otherwise, do nothing: */
-	if (!model->isstokes)goto cleanup_and_return;
+	if (!iomodel->isstokes)goto cleanup_and_return;
 
 	/*Fetch data: */
-	ModelFetchData((void**)&gridonstokes,NULL,NULL,model_handle,"gridonstokes","Matrix","Mat");
+	IoModelFetchData((void**)&gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes","Matrix","Mat");
 
 	count=0;
 	/*Create spcs from x,y,z, as well as the spc values on those spcs: */
-	for (i=0;i<model->numberofnodes;i++){
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
-	if((model->my_grids[i]==1)){
+	if((iomodel->my_grids[i]==1)){
 	#endif
 
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp	(revision 1834)
@@ -12,8 +12,8 @@
 #include "../../shared/shared.h"
 #include "../../MeshPartitionx/MeshPartitionx.h"
-#include "../Model.h"
-
-
-void	CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle){
+#include "../IoModel.h"
+
+
+void	CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
@@ -124,8 +124,8 @@
 
 	/*Now, is the flag ishutter on? otherwise, do nothing: */
-	if (!model->isstokes)goto cleanup_and_return;
+	if (!iomodel->isstokes)goto cleanup_and_return;
 
 	/*Width of elements: */
-	if(strcmp(model->meshtype,"2d")==0){
+	if(strcmp(iomodel->meshtype,"2d")==0){
 		elements_width=3; //tria elements
 	}
@@ -137,22 +137,22 @@
 	#ifdef _PARALLEL_
 	/*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
-	if(strcmp(model->meshtype,"2d")==0){
+	if(strcmp(iomodel->meshtype,"2d")==0){
 		/*load elements: */
-		ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
 	}
 	else{
 		/*load elements2d: */
-		ModelFetchData((void**)&model->elements2d,NULL,NULL,model_handle,"elements2d","Matrix","Mat");
-	}
-
-
-	MeshPartitionx(&epart, &npart,model->numberofelements,model->numberofnodes,model->elements, model->numberofelements2d,model->numberofnodes2d,model->elements2d,model->numlayers,elements_width, model->meshtype,num_procs);
+		IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+	}
+
+
+	MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofnodes,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofnodes2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->meshtype,num_procs);
 
 	/*Free elements and elements2d: */
-	xfree((void**)&model->elements);
-	xfree((void**)&model->elements2d);
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->elements2d);
 
 	/*Used later on: */
-	my_grids=(int*)xcalloc(model->numberofnodes,sizeof(int));
+	my_grids=(int*)xcalloc(iomodel->numberofnodes,sizeof(int));
 	#endif
 
@@ -161,5 +161,5 @@
 
 	/*2d mesh: */
-	if (strcmp(model->meshtype,"2d")==0){
+	if (strcmp(iomodel->meshtype,"2d")==0){
 
 		throw ErrorException(__FUNCT__," stokes elements only supported in 3d!");
@@ -169,22 +169,22 @@
 
 		/*Fetch data needed: */
-		ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
-		ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-		ModelFetchData((void**)&model->surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
-		ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-		ModelFetchData((void**)&model->drag,NULL,NULL,model_handle,"drag","Matrix","Mat");
-		ModelFetchData((void**)&model->p,NULL,NULL,model_handle,"p","Matrix","Mat");
-		ModelFetchData((void**)&model->q,NULL,NULL,model_handle,"q","Matrix","Mat");
-		ModelFetchData((void**)&model->elementoniceshelf,NULL,NULL,model_handle,"elementoniceshelf","Matrix","Mat");
-		ModelFetchData((void**)&model->elementonbed,NULL,NULL,model_handle,"elementonbed","Matrix","Mat");
-		ModelFetchData((void**)&model->elementonsurface,NULL,NULL,model_handle,"elementonsurface","Matrix","Mat");
-		ModelFetchData((void**)&model->elements_type,NULL,NULL,model_handle,"elements_type","Matrix","Mat");
-		ModelFetchData((void**)&model->B,NULL,NULL,model_handle,"B","Matrix","Mat");
-		ModelFetchData((void**)&model->n,NULL,NULL,model_handle,"n","Matrix","Mat");
-		ModelFetchData((void**)&model->accumulation,NULL,NULL,model_handle,"accumulation","Matrix","Mat");
-		ModelFetchData((void**)&model->melting,NULL,NULL,model_handle,"melting","Matrix","Mat");
-		ModelFetchData((void**)&model->elementonwater,NULL,NULL,model_handle,"elementonwater","Matrix","Mat");
-	
-		for (i=0;i<model->numberofelements;i++){
+		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
+	
+		for (i=0;i<iomodel->numberofelements;i++){
 		#ifdef _PARALLEL_
 		/*We are using our element partition to decide which elements will be created on this node: */
@@ -196,39 +196,39 @@
 			penta_id=i+1; //matlab indexing.
 			penta_mid=i+1; //refers to the corresponding material property card
-			penta_mparid=model->numberofelements+1;//refers to the corresponding parmat property card
+			penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
 
 			/*vertices,thickness,surface,bed and drag: */
 			for(j=0;j<6;j++){
-				penta_g[j]=(int)*(model->elements+elements_width*i+j);
-				penta_h[j]=*(model->thickness+    ((int)*(model->elements+elements_width*i+j)-1)); 
-				penta_s[j]=*(model->surface+    ((int)*(model->elements+elements_width*i+j)-1)); 
-				penta_b[j]=*(model->bed+    ((int)*(model->elements+elements_width*i+j)-1)); 
-				penta_k[j]=*(model->drag+        ((int)*(model->elements+elements_width*i+j)-1)); 
-				penta_melting[j]=*(model->melting+        ((int)*(model->elements+elements_width*i+j)-1));
-				penta_accumulation[j]=*(model->accumulation+        ((int)*(model->elements+elements_width*i+j)-1));
+				penta_g[j]=(int)*(iomodel->elements+elements_width*i+j);
+				penta_h[j]=*(iomodel->thickness+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+				penta_s[j]=*(iomodel->surface+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+				penta_b[j]=*(iomodel->bed+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+				penta_k[j]=*(iomodel->drag+        ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+				penta_melting[j]=*(iomodel->melting+        ((int)*(iomodel->elements+elements_width*i+j)-1));
+				penta_accumulation[j]=*(iomodel->accumulation+        ((int)*(iomodel->elements+elements_width*i+j)-1));
 			}
 
 			/*basal drag:*/
-			penta_friction_type=(int)model->drag_type;
-	
-			penta_p=model->p[i];
-			penta_q=model->q[i];
+			penta_friction_type=(int)iomodel->drag_type;
+	
+			penta_p=iomodel->p[i];
+			penta_q=iomodel->q[i];
 
 			/*diverse: */
-			penta_shelf=(int)*(model->elementoniceshelf+i);
-			penta_onbed=(int)*(model->elementonbed+i);
-			penta_onsurface=(int)*(model->elementonsurface+i);
-			penta_meanvel=model->meanvel;
-			penta_epsvel=model->epsvel;
-			penta_onwater=(bool)*(model->elementonwater+i);
+			penta_shelf=(int)*(iomodel->elementoniceshelf+i);
+			penta_onbed=(int)*(iomodel->elementonbed+i);
+			penta_onsurface=(int)*(iomodel->elementonsurface+i);
+			penta_meanvel=iomodel->meanvel;
+			penta_epsvel=iomodel->epsvel;
+			penta_onwater=(bool)*(iomodel->elementonwater+i);
 	
 			/*viscosity_overshoot*/
-			penta_viscosity_overshoot=model->viscosity_overshoot;
+			penta_viscosity_overshoot=iomodel->viscosity_overshoot;
 
 			/*stokesreconditioning: */
-			penta_stokesreconditioning=model->stokesreconditioning;
-
-			
-			if (*(model->elements_type+2*i+1)==StokesFormulationEnum()){
+			penta_stokesreconditioning=iomodel->stokesreconditioning;
+
+			
+			if (*(iomodel->elements_type+2*i+1)==StokesFormulationEnum()){
 			
 				/*Create Penta using its constructor:*/
@@ -248,11 +248,11 @@
 			B_avg=0;
 			for(j=0;j<6;j++){
-				B_avg+=*(model->B+((int)*(model->elements+elements_width*i+j)-1));
+				B_avg+=*(iomodel->B+((int)*(iomodel->elements+elements_width*i+j)-1));
 			}
 			B_avg=B_avg/6;
 			matice_B= B_avg;
-			matice_n=(double)*(model->n+i);
-			
-			if (*(model->elements_type+2*i+1)==StokesFormulationEnum()){
+			matice_n=(double)*(iomodel->n+i);
+			
+			if (*(iomodel->elements_type+2*i+1)==StokesFormulationEnum()){
 	
 				/*Create matice using its constructor:*/
@@ -268,10 +268,10 @@
 			 into the grid coordinates. If we start plugging 1 into my_grids for each index[n][i] (i=0:2), then my_grids 
 			 will hold which grids belong to this partition*/
-			my_grids[(int)*(model->elements+elements_width*i+0)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+1)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+2)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+3)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+4)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+5)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+0)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+1)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+2)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+3)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+4)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+5)-1]=1;
 			#endif
 
@@ -283,35 +283,35 @@
 
 		/*Free data: */
-		xfree((void**)&model->elements);
-		xfree((void**)&model->thickness);
-		xfree((void**)&model->surface);
-		xfree((void**)&model->bed);
-		xfree((void**)&model->drag);
-		xfree((void**)&model->p);
-		xfree((void**)&model->q);
-		xfree((void**)&model->elementoniceshelf);
-		xfree((void**)&model->elementonbed);
-		xfree((void**)&model->elementonsurface);
-		xfree((void**)&model->elements_type);
-		xfree((void**)&model->n);
-		xfree((void**)&model->B);
-		xfree((void**)&model->accumulation);
-		xfree((void**)&model->melting);
-		xfree((void**)&model->elementonwater);
+		xfree((void**)&iomodel->elements);
+		xfree((void**)&iomodel->thickness);
+		xfree((void**)&iomodel->surface);
+		xfree((void**)&iomodel->bed);
+		xfree((void**)&iomodel->drag);
+		xfree((void**)&iomodel->p);
+		xfree((void**)&iomodel->q);
+		xfree((void**)&iomodel->elementoniceshelf);
+		xfree((void**)&iomodel->elementonbed);
+		xfree((void**)&iomodel->elementonsurface);
+		xfree((void**)&iomodel->elements_type);
+		xfree((void**)&iomodel->n);
+		xfree((void**)&iomodel->B);
+		xfree((void**)&iomodel->accumulation);
+		xfree((void**)&iomodel->melting);
+		xfree((void**)&iomodel->elementonwater);
 
 	} //if (strcmp(meshtype,"2d")==0)
 
 	/*Add one constant material property to materials: */
-	matpar_mid=model->numberofelements+1; //put it at the end of the materials
-	matpar_g=model->g; 
-	matpar_rho_ice=model->rho_ice; 
-	matpar_rho_water=model->rho_water; 
-	matpar_thermalconductivity=model->thermalconductivity; 
-	matpar_heatcapacity=model->heatcapacity; 
-	matpar_latentheat=model->latentheat; 
-	matpar_beta=model->beta; 
-	matpar_meltingpoint=model->meltingpoint; 
-	matpar_mixed_layer_capacity=model->mixed_layer_capacity; 
-	matpar_thermal_exchange_velocity=model->thermal_exchange_velocity; 
+	matpar_mid=iomodel->numberofelements+1; //put it at the end of the materials
+	matpar_g=iomodel->g; 
+	matpar_rho_ice=iomodel->rho_ice; 
+	matpar_rho_water=iomodel->rho_water; 
+	matpar_thermalconductivity=iomodel->thermalconductivity; 
+	matpar_heatcapacity=iomodel->heatcapacity; 
+	matpar_latentheat=iomodel->latentheat; 
+	matpar_beta=iomodel->beta; 
+	matpar_meltingpoint=iomodel->meltingpoint; 
+	matpar_mixed_layer_capacity=iomodel->mixed_layer_capacity; 
+	matpar_thermal_exchange_velocity=iomodel->thermal_exchange_velocity; 
 
 	/*Create matpar object using its constructor: */
@@ -326,7 +326,7 @@
 		/*From the element partitioning, we can determine which grids are on the inside of this cpu's 
 		 *element partition, and which are on its border with other nodes:*/
-		gridborder=NewVec(model->numberofnodes);
-
-		for (i=0;i<model->numberofnodes;i++){
+		gridborder=NewVec(iomodel->numberofnodes);
+
+		for (i=0;i<iomodel->numberofnodes;i++){
 			if(my_grids[i])VecSetValue(gridborder,i,1,ADD_VALUES);
 		}
@@ -342,5 +342,5 @@
 		#ifdef _DEBUG_
 		if(my_rank==0){
-			for (i=0;i<model->numberofnodes;i++){
+			for (i=0;i<iomodel->numberofnodes;i++){
 				printf("Grid id %i Border grid %lf\n",i+1,my_bordergrids[i]);
 			}
@@ -350,25 +350,25 @@
 
 	/*Partition penalties in 3d: */
-	if(strcmp(model->meshtype,"3d")==0){
+	if(strcmp(iomodel->meshtype,"3d")==0){
 	
 		/*Get penalties: */
-		ModelFetchData((void**)&model->penalties,&model->numpenalties,NULL,model_handle,"penalties","Matrix","Mat");
-
-		if(model->numpenalties){
-
-			model->penaltypartitioning=(int*)xmalloc(model->numpenalties*sizeof(int));
+		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+
+		if(iomodel->numpenalties){
+
+			iomodel->penaltypartitioning=(int*)xmalloc(iomodel->numpenalties*sizeof(int));
 			#ifdef _SERIAL_
-			for(i=0;i<model->numpenalties;i++)model->penaltypartitioning[i]=1;
+			for(i=0;i<iomodel->numpenalties;i++)iomodel->penaltypartitioning[i]=1;
 			#else
-			for(i=0;i<model->numpenalties;i++)model->penaltypartitioning[i]=-1;
-
-			for(i=0;i<model->numpenalties;i++){
-				first_grid_index=(int)(*(model->penalties+i*model->numlayers+0)-1);
+			for(i=0;i<iomodel->numpenalties;i++)iomodel->penaltypartitioning[i]=-1;
+
+			for(i=0;i<iomodel->numpenalties;i++){
+				first_grid_index=(int)(*(iomodel->penalties+i*iomodel->numlayers+0)-1);
 				if((my_grids[first_grid_index]==1) && (my_bordergrids[first_grid_index]<=1.0) ) { //this grid belongs to this node's internal partition  grids
 					/*All grids that are being penalised belong to this node's internal grid partition.:*/
-					model->penaltypartitioning[i]=1;
+					iomodel->penaltypartitioning[i]=1;
 				}
 				if(my_bordergrids[first_grid_index]>1.0) { //this grid belongs to a partition border
-					model->penaltypartitioning[i]=0;
+					iomodel->penaltypartitioning[i]=0;
 				}
 			}
@@ -377,5 +377,5 @@
 
 		/*Free penalties: */
-		xfree((void**)&model->penalties);
+		xfree((void**)&iomodel->penalties);
 	}
 
@@ -388,25 +388,25 @@
 		
 	/*First fetch data: */
-	if (strcmp(model->meshtype,"3d")==0){
-		ModelFetchData((void**)&model->deadgrids,NULL,NULL,model_handle,"deadgrids","Matrix","Mat");
-		ModelFetchData((void**)&model->uppernodes,NULL,NULL,model_handle,"uppergrids","Matrix","Mat");
-	}
-	ModelFetchData((void**)&model->x,NULL,NULL,model_handle,"x","Matrix","Mat");
-	ModelFetchData((void**)&model->y,NULL,NULL,model_handle,"y","Matrix","Mat");
-	ModelFetchData((void**)&model->z,NULL,NULL,model_handle,"z","Matrix","Mat");
-	ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-	ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonbed,NULL,NULL,model_handle,"gridonbed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonsurface,NULL,NULL,model_handle,"gridonsurface","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonicesheet,NULL,NULL,model_handle,"gridonicesheet","Matrix","Mat");
-	ModelFetchData((void**)&model->gridoniceshelf,NULL,NULL,model_handle,"gridoniceshelf","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonstokes,NULL,NULL,model_handle,"gridonstokes","Matrix","Mat");
-	ModelFetchData((void**)&model->borderstokes,NULL,NULL,model_handle,"borderstokes","Matrix","Mat");
+	if (strcmp(iomodel->meshtype,"3d")==0){
+		IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
+	}
+	IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->borderstokes,NULL,NULL,iomodel_handle,"borderstokes","Matrix","Mat");
 
 
 	/*Get number of dofs per node: */
-	DistributeNumDofs(&node_numdofs,model->analysis_type,model->sub_analysis_type);
-
-	for (i=0;i<model->numberofnodes;i++){
+	DistributeNumDofs(&node_numdofs,iomodel->analysis_type,iomodel->sub_analysis_type);
+
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
@@ -429,20 +429,20 @@
 		#endif
 
-		node_x[0]=model->x[i];
-		node_x[1]=model->y[i];
-		node_x[2]=model->z[i];
-		node_sigma=(model->z[i]-model->bed[i])/(model->thickness[i]);
-		
-		node_onbed=(int)model->gridonbed[i];
-		node_onsurface=(int)model->gridonsurface[i];	
-		node_onshelf=(int)model->gridoniceshelf[i];	
-		node_onsheet=(int)model->gridonicesheet[i];	
-
-		if (strcmp(model->meshtype,"3d")==0){
-			if (isnan(model->uppernodes[i])){
+		node_x[0]=iomodel->x[i];
+		node_x[1]=iomodel->y[i];
+		node_x[2]=iomodel->z[i];
+		node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]);
+		
+		node_onbed=(int)iomodel->gridonbed[i];
+		node_onsurface=(int)iomodel->gridonsurface[i];	
+		node_onshelf=(int)iomodel->gridoniceshelf[i];	
+		node_onsheet=(int)iomodel->gridonicesheet[i];	
+
+		if (strcmp(iomodel->meshtype,"3d")==0){
+			if (isnan(iomodel->uppernodes[i])){
 				node_upper_node_id=node_id;  //nodes on surface do not have upper nodes, only themselves.
 			}
 			else{
-				node_upper_node_id=(int)model->uppernodes[i];
+				node_upper_node_id=(int)iomodel->uppernodes[i];
 			}
 		}
@@ -457,5 +457,5 @@
 		/*set single point constraints.: */
 		/*On a 3d mesh, in stokes formualtions, only stokes grids are free, the others are frozen: */
-		if (model->borderstokes[i]){ 
+		if (iomodel->borderstokes[i]){ 
 			//freeze everything except pressure
 			node->FreezeDof(1);
@@ -463,5 +463,5 @@
 			node->FreezeDof(3);
 		}
-		else if (model->gridonstokes[i]==0){
+		else if (iomodel->gridonstokes[i]==0){
 			for(k=1;k<=node_numdofs;k++){
 				node->FreezeDof(k);
@@ -485,23 +485,23 @@
 
 	/*Clean fetched data: */
-	xfree((void**)&model->deadgrids);
-	xfree((void**)&model->x);
-	xfree((void**)&model->y);
-	xfree((void**)&model->z);
-	xfree((void**)&model->thickness);
-	xfree((void**)&model->bed);
-	xfree((void**)&model->gridonbed);
-	xfree((void**)&model->gridonsurface);
-	xfree((void**)&model->uppernodes);
-	xfree((void**)&model->gridonstokes);
-	xfree((void**)&model->borderstokes);
-	xfree((void**)&model->gridonicesheet);
-	xfree((void**)&model->gridoniceshelf);
-
-
-	/*Keep partitioning information into model*/
-	model->epart=epart;
-	model->my_grids=my_grids;
-	model->my_bordergrids=my_bordergrids;
+	xfree((void**)&iomodel->deadgrids);
+	xfree((void**)&iomodel->x);
+	xfree((void**)&iomodel->y);
+	xfree((void**)&iomodel->z);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->gridonbed);
+	xfree((void**)&iomodel->gridonsurface);
+	xfree((void**)&iomodel->uppernodes);
+	xfree((void**)&iomodel->gridonstokes);
+	xfree((void**)&iomodel->borderstokes);
+	xfree((void**)&iomodel->gridonicesheet);
+	xfree((void**)&iomodel->gridoniceshelf);
+
+
+	/*Keep partitioning information into iomodel*/
+	iomodel->epart=epart;
+	iomodel->my_grids=my_grids;
+	iomodel->my_bordergrids=my_bordergrids;
 
 	/*Free ressources:*/
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp	(revision 1834)
@@ -11,8 +11,8 @@
 #include "../../shared/shared.h"
 #include "../../include/macros.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateLoadsDiagnosticStokes(DataSet** ploads, Model* model,ConstDataHandle model_handle){
+void	CreateLoadsDiagnosticStokes(DataSet** ploads, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	int i,j,counter;
@@ -58,12 +58,12 @@
 
 	/*Now, is the flag ishutter on? otherwise, do nothing: */
-	if (!model->isstokes)goto cleanup_and_return;
+	if (!iomodel->isstokes)goto cleanup_and_return;
 
 	/*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the grids
 	 * referenced by a certain load must belong to the cluster node): */
-	ModelFetchData((void**)&model->pressureload_stokes,&numberofpressureloads_stokes,NULL,model_handle,"pressureload_stokes","Matrix","Mat");
-	ModelFetchData((void**)&model->elements_type,NULL,NULL,model_handle,"elements_type","Matrix","Mat");
-	ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-	ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->pressureload_stokes,&numberofpressureloads_stokes,NULL,iomodel_handle,"pressureload_stokes","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
 
 	count=0;
@@ -74,8 +74,8 @@
 		segment_width=5;
 
-		element=(int)(*(model->pressureload_stokes+segment_width*i+segment_width-1)-1); //element is in the last column
+		element=(int)(*(iomodel->pressureload_stokes+segment_width*i+segment_width-1)-1); //element is in the last column
 
 		#ifdef _PARALLEL_
-		if (model->epart[element]!=my_rank){
+		if (iomodel->epart[element]!=my_rank){
 			/*This load does not belong to this cluster node, as it references an element 
 			 *that does not belong to this node's partition. Drop this 'i':*/
@@ -84,13 +84,13 @@
 		#endif
 	
-		icefront_mparid=model->numberofelements+1; //matlab indexing
+		icefront_mparid=iomodel->numberofelements+1; //matlab indexing
 		icefront_sid=count+1; //matlab indexing
-		icefront_eid=(int)*(model->pressureload_stokes+segment_width*i+segment_width-1); //matlab indexing
+		icefront_eid=(int)*(iomodel->pressureload_stokes+segment_width*i+segment_width-1); //matlab indexing
 		icefront_element_type=PentaEnum();
 
-		i1=(int)*(model->pressureload_stokes+segment_width*i+0);
-		i2=(int)*(model->pressureload_stokes+segment_width*i+1);
-		i3=(int)*(model->pressureload_stokes+segment_width*i+2);
-		i4=(int)*(model->pressureload_stokes+segment_width*i+3);
+		i1=(int)*(iomodel->pressureload_stokes+segment_width*i+0);
+		i2=(int)*(iomodel->pressureload_stokes+segment_width*i+1);
+		i3=(int)*(iomodel->pressureload_stokes+segment_width*i+2);
+		i4=(int)*(iomodel->pressureload_stokes+segment_width*i+3);
 	
 		icefront_node_ids[0]=i1;
@@ -99,13 +99,13 @@
 		icefront_node_ids[3]=i4;
 	
-		icefront_h[0]=model->thickness[i1-1];
-		icefront_h[1]=model->thickness[i2-1];
-		icefront_h[2]=model->thickness[i3-1];
-		icefront_h[3]=model->thickness[i4-1];
+		icefront_h[0]=iomodel->thickness[i1-1];
+		icefront_h[1]=iomodel->thickness[i2-1];
+		icefront_h[2]=iomodel->thickness[i3-1];
+		icefront_h[3]=iomodel->thickness[i4-1];
 
-		icefront_b[0]=model->bed[i1-1];
-		icefront_b[1]=model->bed[i2-1];
-		icefront_b[2]=model->bed[i3-1];
-		icefront_b[3]=model->bed[i4-1];
+		icefront_b[0]=iomodel->bed[i1-1];
+		icefront_b[1]=iomodel->bed[i2-1];
+		icefront_b[2]=iomodel->bed[i3-1];
+		icefront_b[3]=iomodel->bed[i4-1];
 	
 		icefront = new Icefront(icefront_type,icefront_sid,icefront_mparid,icefront_eid,icefront_element_type,icefront_node_ids,icefront_h,icefront_b);
@@ -116,8 +116,8 @@
 	}
 	/*Free data: */
-	xfree((void**)&model->pressureload_stokes);
-	xfree((void**)&model->elements_type);
-	xfree((void**)&model->thickness);
-	xfree((void**)&model->bed);
+	xfree((void**)&iomodel->pressureload_stokes);
+	xfree((void**)&iomodel->elements_type);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->bed);
 
 
@@ -126,21 +126,21 @@
 	//create penalties for grids on the base of icesheet. We must have wb=ub*db/dx+vb*db/dy
 
-	ModelFetchData((void**)&model->gridonbed,NULL,NULL,model_handle,"gridonbed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonicesheet,NULL,NULL,model_handle,"gridonicesheet","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonstokes,NULL,NULL,model_handle,"gridonstokes","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes","Matrix","Mat");
 	
-	for (i=0;i<model->numberofnodes;i++){
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
-	if((model->my_grids[i]==1)){
+	if((iomodel->my_grids[i]==1)){
 	#endif
 
-		if ((model->gridonbed[i]) && (model->gridonicesheet[i]) && (model->gridonstokes[i])){
+		if ((iomodel->gridonbed[i]) && (iomodel->gridonicesheet[i]) && (iomodel->gridonstokes[i])){
 
 			pengrid_id=count+1; //matlab indexing
 			pengrid_node_id=i+1;
 			pengrid_dof=1;
-			pengrid_penalty_offset=model->penalty_offset;
-			pengrid_mparid=model->numberofelements+1;//refers to the corresponding parmat property card
+			pengrid_penalty_offset=iomodel->penalty_offset;
+			pengrid_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
 
 			pengrid= new Pengrid(pengrid_id, pengrid_node_id,pengrid_mparid,pengrid_dof, pengrid_active, pengrid_penalty_offset,pengrid_thermal_steadystate);
@@ -150,5 +150,5 @@
 		}
 	#ifdef _PARALLEL_
-	} //if((model->my_grids[i]==1))
+	} //if((iomodel->my_grids[i]==1))
 	#endif
 	}
@@ -156,7 +156,7 @@
 
 
-	xfree((void**)&model->gridonbed);
-	xfree((void**)&model->gridonstokes);
-	xfree((void**)&model->gridonicesheet);
+	xfree((void**)&iomodel->gridonbed);
+	xfree((void**)&iomodel->gridonstokes);
+	xfree((void**)&iomodel->gridonicesheet);
 
 	/*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 1834)
@@ -11,8 +11,8 @@
 #include "../../objects/objects.h"
 #include "../../shared/shared.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateConstraintsDiagnosticVert(DataSet** pconstraints, Model* model,ConstDataHandle model_handle){
+void	CreateConstraintsDiagnosticVert(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
@@ -22,6 +22,6 @@
 	constraints = new DataSet(ConstraintsEnum());
 
-	/*Now, is the model running in 3d? : */
-	if (strcmp(model->meshtype,"2d")==0)goto cleanup_and_return;
+	/*Now, is the iomodel running in 3d? : */
+	if (strcmp(iomodel->meshtype,"2d")==0)goto cleanup_and_return;
 	
 	cleanup_and_return:	
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp	(revision 1834)
@@ -12,8 +12,8 @@
 #include "../../shared/shared.h"
 #include "../../MeshPartitionx/MeshPartitionx.h"
-#include "../Model.h"
-
-
-void	CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle){
+#include "../IoModel.h"
+
+
+void	CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
@@ -132,26 +132,26 @@
 	materials = new DataSet(MaterialsEnum());
 
-	/*Now, is the model running in 3d? : */
-	if (strcmp(model->meshtype,"2d")==0)goto cleanup_and_return;
+	/*Now, is the iomodel running in 3d? : */
+	if (strcmp(iomodel->meshtype,"2d")==0)goto cleanup_and_return;
 
 	#ifdef _PARALLEL_
 	/*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
-	if(strcmp(model->meshtype,"2d")==0){
+	if(strcmp(iomodel->meshtype,"2d")==0){
 		/*load elements: */
-		ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
 	}
 	else{
 		/*load elements2d: */
-		ModelFetchData((void**)&model->elements2d,NULL,NULL,model_handle,"elements2d","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
 	}
 
-	MeshPartitionx(&epart, &npart,model->numberofelements,model->numberofnodes,model->elements, model->numberofelements2d,model->numberofnodes2d,model->elements2d,model->numlayers,elements_width, model->meshtype,num_procs);
+	MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofnodes,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofnodes2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->meshtype,num_procs);
 
 	/*Free elements and elements2d: */
-	xfree((void**)&model->elements);
-	xfree((void**)&model->elements2d);
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->elements2d);
 		
 	/*Used later on: */
-	my_grids=(int*)xcalloc(model->numberofnodes,sizeof(int));
+	my_grids=(int*)xcalloc(iomodel->numberofnodes,sizeof(int));
 	#endif
 
@@ -159,17 +159,17 @@
 	/*Create 3d elements: */
 	/*Fetch data needed: */
-	ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
-	ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-	ModelFetchData((void**)&model->surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
-	ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-	ModelFetchData((void**)&model->elementoniceshelf,NULL,NULL,model_handle,"elementoniceshelf","Matrix","Mat");
-	ModelFetchData((void**)&model->elementonbed,NULL,NULL,model_handle,"elementonbed","Matrix","Mat");
-	ModelFetchData((void**)&model->elementonsurface,NULL,NULL,model_handle,"elementonsurface","Matrix","Mat");
-	ModelFetchData((void**)&model->elements_type,NULL,NULL,model_handle,"elements_type","Matrix","Mat");
-	ModelFetchData((void**)&model->melting,NULL,NULL,model_handle,"melting","Matrix","Mat");
-	ModelFetchData((void**)&model->accumulation,NULL,NULL,model_handle,"accumulation","Matrix","Mat");
-	ModelFetchData((void**)&model->elementonwater,NULL,NULL,model_handle,"elementonwater","Matrix","Mat");
-	
-	for (i=0;i<model->numberofelements;i++){
+	IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
+	
+	for (i=0;i<iomodel->numberofelements;i++){
 	#ifdef _PARALLEL_
 	/*We are using our element partition to decide which elements will be created on this node: */
@@ -181,22 +181,22 @@
 		penta_id=i+1; //matlab indexing.
 		penta_mid=i+1; //refers to the corresponding material property card
-		penta_mparid=model->numberofelements+1;//refers to the corresponding parmat property card
+		penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
 
 		/*vertices,thickness,surface,bed and drag: */
 		for(j=0;j<6;j++){
-			penta_g[j]=(int)*(model->elements+elements_width*i+j);
-			penta_h[j]=*(model->thickness+    ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_s[j]=*(model->surface+    ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_b[j]=*(model->bed+    ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_melting[j]=*(model->melting+        ((int)*(model->elements+elements_width*i+j)-1))/model->yts; 
-			penta_accumulation[j]=*(model->accumulation+        ((int)*(model->elements+elements_width*i+j)-1))/model->yts; 
+			penta_g[j]=(int)*(iomodel->elements+elements_width*i+j);
+			penta_h[j]=*(iomodel->thickness+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_s[j]=*(iomodel->surface+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_b[j]=*(iomodel->bed+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_melting[j]=*(iomodel->melting+        ((int)*(iomodel->elements+elements_width*i+j)-1))/iomodel->yts; 
+			penta_accumulation[j]=*(iomodel->accumulation+        ((int)*(iomodel->elements+elements_width*i+j)-1))/iomodel->yts; 
 		}
 
 		/*diverse: */
-		penta_shelf=(int)*(model->elementoniceshelf+i);
-		penta_onbed=(int)*(model->elementonbed+i);
-		penta_onsurface=(int)*(model->elementonsurface+i);
+		penta_shelf=(int)*(iomodel->elementoniceshelf+i);
+		penta_onbed=(int)*(iomodel->elementonbed+i);
+		penta_onsurface=(int)*(iomodel->elementonsurface+i);
 		penta_collapse=1;
-		penta_onwater=(bool)*(model->elementonwater+i);
+		penta_onwater=(bool)*(iomodel->elementonwater+i);
 
 		/*Create Penta using its constructor:*/
@@ -224,10 +224,10 @@
 		 into the grid coordinates. If we start plugging 1 into my_grids for each index[n][i] (i=0:2), then my_grids 
 		 will hold which grids belong to this partition*/
-		my_grids[(int)*(model->elements+elements_width*i+0)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+1)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+2)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+3)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+4)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+5)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+0)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+1)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+2)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+3)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+4)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+5)-1]=1;
 		#endif
 
@@ -239,29 +239,29 @@
 
 	/*Free data: */
-	xfree((void**)&model->elements);
-	xfree((void**)&model->thickness);
-	xfree((void**)&model->surface);
-	xfree((void**)&model->bed);
-	xfree((void**)&model->elementoniceshelf);
-	xfree((void**)&model->elementonbed);
-	xfree((void**)&model->elementonsurface);
-	xfree((void**)&model->elements_type);
-	xfree((void**)&model->melting);
-	xfree((void**)&model->accumulation);
-	xfree((void**)&model->elementonwater);
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->elements_type);
+	xfree((void**)&iomodel->melting);
+	xfree((void**)&iomodel->accumulation);
+	xfree((void**)&iomodel->elementonwater);
 
 
 	/*Add one constant material property to materials: */
-	matpar_mid=model->numberofelements+1; //put it at the end of the materials
-	matpar_g=model->g; 
-	matpar_rho_ice=model->rho_ice; 
-	matpar_rho_water=model->rho_water; 
-	matpar_thermalconductivity=model->thermalconductivity; 
-	matpar_heatcapacity=model->heatcapacity; 
-	matpar_latentheat=model->latentheat; 
-	matpar_beta=model->beta; 
-	matpar_meltingpoint=model->meltingpoint; 
-	matpar_mixed_layer_capacity=model->mixed_layer_capacity; 
-	matpar_thermal_exchange_velocity=model->thermal_exchange_velocity; 
+	matpar_mid=iomodel->numberofelements+1; //put it at the end of the materials
+	matpar_g=iomodel->g; 
+	matpar_rho_ice=iomodel->rho_ice; 
+	matpar_rho_water=iomodel->rho_water; 
+	matpar_thermalconductivity=iomodel->thermalconductivity; 
+	matpar_heatcapacity=iomodel->heatcapacity; 
+	matpar_latentheat=iomodel->latentheat; 
+	matpar_beta=iomodel->beta; 
+	matpar_meltingpoint=iomodel->meltingpoint; 
+	matpar_mixed_layer_capacity=iomodel->mixed_layer_capacity; 
+	matpar_thermal_exchange_velocity=iomodel->thermal_exchange_velocity; 
 
 	/*Create matpar object using its constructor: */
@@ -276,7 +276,7 @@
 		/*From the element partitioning, we can determine which grids are on the inside of this cpu's 
 		 *element partition, and which are on its border with other nodes:*/
-		gridborder=NewVec(model->numberofnodes);
-
-		for (i=0;i<model->numberofnodes;i++){
+		gridborder=NewVec(iomodel->numberofnodes);
+
+		for (i=0;i<iomodel->numberofnodes;i++){
 			if(my_grids[i])VecSetValue(gridborder,i,1,ADD_VALUES);
 		}
@@ -292,5 +292,5 @@
 		#ifdef _DEBUG_
 		if(my_rank==0){
-			for (i=0;i<model->numberofnodes;i++){
+			for (i=0;i<iomodel->numberofnodes;i++){
 				printf("Grid id %i Border grid %lf\n",i+1,my_bordergrids[i]);
 			}
@@ -308,23 +308,23 @@
 		
 	/*First fetch data: */
-	if (strcmp(model->meshtype,"3d")==0){
-		ModelFetchData((void**)&model->deadgrids,NULL,NULL,model_handle,"deadgrids","Matrix","Mat");
-		ModelFetchData((void**)&model->uppernodes,NULL,NULL,model_handle,"uppergrids","Matrix","Mat");
+	if (strcmp(iomodel->meshtype,"3d")==0){
+		IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
 	}
-	ModelFetchData((void**)&model->x,NULL,NULL,model_handle,"x","Matrix","Mat");
-	ModelFetchData((void**)&model->y,NULL,NULL,model_handle,"y","Matrix","Mat");
-	ModelFetchData((void**)&model->z,NULL,NULL,model_handle,"z","Matrix","Mat");
-	ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-	ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonbed,NULL,NULL,model_handle,"gridonbed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonsurface,NULL,NULL,model_handle,"gridonsurface","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonicesheet,NULL,NULL,model_handle,"gridonicesheet","Matrix","Mat");
-	ModelFetchData((void**)&model->gridoniceshelf,NULL,NULL,model_handle,"gridoniceshelf","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
 
 	
 	/*Get number of dofs per node: */
-	DistributeNumDofs(&node_numdofs,model->analysis_type,model->sub_analysis_type);
-
-	for (i=0;i<model->numberofnodes;i++){
+	DistributeNumDofs(&node_numdofs,iomodel->analysis_type,iomodel->sub_analysis_type);
+
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
@@ -347,19 +347,19 @@
 		#endif
 
-		node_x[0]=model->x[i];
-		node_x[1]=model->y[i];
-		node_x[2]=model->z[i];
-		node_sigma=(model->z[i]-model->bed[i])/(model->thickness[i]);
-		
-		node_onbed=(int)model->gridonbed[i];
-		node_onsurface=(int)model->gridonsurface[i];
-		node_onshelf=(int)model->gridoniceshelf[i];	
-		node_onsheet=(int)model->gridonicesheet[i];	
-	
-		if (isnan(model->uppernodes[i])){
+		node_x[0]=iomodel->x[i];
+		node_x[1]=iomodel->y[i];
+		node_x[2]=iomodel->z[i];
+		node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]);
+		
+		node_onbed=(int)iomodel->gridonbed[i];
+		node_onsurface=(int)iomodel->gridonsurface[i];
+		node_onshelf=(int)iomodel->gridoniceshelf[i];	
+		node_onsheet=(int)iomodel->gridonicesheet[i];	
+	
+		if (isnan(iomodel->uppernodes[i])){
 			node_upper_node_id=node_id;  //nodes on surface do not have upper nodes, only themselves.
 		}
 		else{
-			node_upper_node_id=(int)model->uppernodes[i];
+			node_upper_node_id=(int)iomodel->uppernodes[i];
 		}
 
@@ -382,21 +382,21 @@
 
 	/*Clean fetched data: */
-	xfree((void**)&model->deadgrids);
-	xfree((void**)&model->x);
-	xfree((void**)&model->y);
-	xfree((void**)&model->z);
-	xfree((void**)&model->thickness);
-	xfree((void**)&model->bed);
-	xfree((void**)&model->gridonbed);
-	xfree((void**)&model->gridonsurface);
-	xfree((void**)&model->uppernodes);
-	xfree((void**)&model->gridonicesheet);
-	xfree((void**)&model->gridoniceshelf);
-	
-
-	/*Keep partitioning information into model*/
-	model->epart=epart;
-	model->my_grids=my_grids;
-	model->my_bordergrids=my_bordergrids;
+	xfree((void**)&iomodel->deadgrids);
+	xfree((void**)&iomodel->x);
+	xfree((void**)&iomodel->y);
+	xfree((void**)&iomodel->z);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->gridonbed);
+	xfree((void**)&iomodel->gridonsurface);
+	xfree((void**)&iomodel->uppernodes);
+	xfree((void**)&iomodel->gridonicesheet);
+	xfree((void**)&iomodel->gridoniceshelf);
+	
+
+	/*Keep partitioning information into iomodel*/
+	iomodel->epart=epart;
+	iomodel->my_grids=my_grids;
+	iomodel->my_bordergrids=my_bordergrids;
 
 	/*Free ressources:*/
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateLoadsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateLoadsDiagnosticVert.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateLoadsDiagnosticVert.cpp	(revision 1834)
@@ -11,8 +11,8 @@
 #include "../../shared/shared.h"
 #include "../../include/macros.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateLoadsDiagnosticVert(DataSet** ploads, Model* model,ConstDataHandle model_handle){
+void	CreateLoadsDiagnosticVert(DataSet** ploads, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	DataSet*    loads    = NULL;
@@ -21,6 +21,6 @@
 	loads   = new DataSet(LoadsEnum());
 
-	/*Now, is the model running in 3d? : */
-	if (strcmp(model->meshtype,"2d")==0)goto cleanup_and_return;
+	/*Now, is the iomodel running in 3d? : */
+	if (strcmp(iomodel->meshtype,"2d")==0)goto cleanup_and_return;
 
 	cleanup_and_return:
Index: /issm/trunk/src/c/ModelProcessorx/Melting/CreateConstraintsMelting.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Melting/CreateConstraintsMelting.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Melting/CreateConstraintsMelting.cpp	(revision 1834)
@@ -11,8 +11,8 @@
 #include "../../objects/objects.h"
 #include "../../shared/shared.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateConstraintsMelting(DataSet** pconstraints, Model* model,ConstDataHandle model_handle){
+void	CreateConstraintsMelting(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
Index: /issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp	(revision 1834)
@@ -12,8 +12,8 @@
 #include "../../shared/shared.h"
 #include "../../MeshPartitionx/MeshPartitionx.h"
-#include "../Model.h"
-
-
-void	CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle){
+#include "../IoModel.h"
+
+
+void	CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
@@ -123,5 +123,5 @@
 
 	/*Width of elements: */
-	if(strcmp(model->meshtype,"2d")==0)throw ErrorException(__FUNCT__," error message: 2d temperature computations not supported yet!");
+	if(strcmp(iomodel->meshtype,"2d")==0)throw ErrorException(__FUNCT__," error message: 2d temperature computations not supported yet!");
 	elements_width=6; //penta elements
 
@@ -129,14 +129,14 @@
 	#ifdef _PARALLEL_
 	/*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
-	ModelFetchData((void**)&model->elements2d,NULL,NULL,model_handle,"elements2d","Matrix","Mat");
-
-
-	MeshPartitionx(&epart, &npart,model->numberofelements,model->numberofnodes,model->elements, model->numberofelements2d,model->numberofnodes2d,model->elements2d,model->numlayers,elements_width, model->meshtype,num_procs);
+	IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+
+
+	MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofnodes,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofnodes2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->meshtype,num_procs);
 
 	/*Free elements and elements2d: */
-	xfree((void**)&model->elements2d);
+	xfree((void**)&iomodel->elements2d);
 
 	/*Used later on: */
-	my_grids=(int*)xcalloc(model->numberofnodes,sizeof(int));
+	my_grids=(int*)xcalloc(iomodel->numberofnodes,sizeof(int));
 	#endif
 
@@ -146,22 +146,22 @@
 
 	/*Fetch data needed: */
-	ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
-	ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-	ModelFetchData((void**)&model->surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
-	ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-	ModelFetchData((void**)&model->drag,NULL,NULL,model_handle,"drag","Matrix","Mat");
-	ModelFetchData((void**)&model->p,NULL,NULL,model_handle,"p","Matrix","Mat");
-	ModelFetchData((void**)&model->q,NULL,NULL,model_handle,"q","Matrix","Mat");
-	ModelFetchData((void**)&model->elementoniceshelf,NULL,NULL,model_handle,"elementoniceshelf","Matrix","Mat");
-	ModelFetchData((void**)&model->elementonbed,NULL,NULL,model_handle,"elementonbed","Matrix","Mat");
-	ModelFetchData((void**)&model->elementonsurface,NULL,NULL,model_handle,"elementonsurface","Matrix","Mat");
-	ModelFetchData((void**)&model->elements_type,NULL,NULL,model_handle,"elements_type","Matrix","Mat");
-	ModelFetchData((void**)&model->B,NULL,NULL,model_handle,"B","Matrix","Mat");
-	ModelFetchData((void**)&model->n,NULL,NULL,model_handle,"n","Matrix","Mat");
-	ModelFetchData((void**)&model->accumulation,NULL,NULL,model_handle,"accumulation","Matrix","Mat");
-	ModelFetchData((void**)&model->melting,NULL,NULL,model_handle,"melting","Matrix","Mat");
-	ModelFetchData((void**)&model->elementonwater,NULL,NULL,model_handle,"elementonwater","Matrix","Mat");
-	
-	for (i=0;i<model->numberofelements;i++){
+	IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
+	
+	for (i=0;i<iomodel->numberofelements;i++){
 	#ifdef _PARALLEL_
 	/*We are using our element partition to decide which elements will be created on this node: */
@@ -173,33 +173,33 @@
 		penta_id=i+1; //matlab indexing.
 		penta_mid=i+1; //refers to the corresponding material property card
-		penta_mparid=model->numberofelements+1;//refers to the corresponding parmat property card
+		penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
 
 		/*vertices,thickness,surface,bed and drag: */
 		for(j=0;j<6;j++){
-			penta_g[j]=(int)*(model->elements+elements_width*i+j);
-			penta_h[j]=*(model->thickness+    ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_s[j]=*(model->surface+    ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_b[j]=*(model->bed+    ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_k[j]=*(model->drag+        ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_melting[j]=*(model->melting+        ((int)*(model->elements+elements_width*i+j)-1));
-			penta_accumulation[j]=*(model->accumulation+        ((int)*(model->elements+elements_width*i+j)-1));
+			penta_g[j]=(int)*(iomodel->elements+elements_width*i+j);
+			penta_h[j]=*(iomodel->thickness+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_s[j]=*(iomodel->surface+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_b[j]=*(iomodel->bed+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_k[j]=*(iomodel->drag+        ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_melting[j]=*(iomodel->melting+        ((int)*(iomodel->elements+elements_width*i+j)-1));
+			penta_accumulation[j]=*(iomodel->accumulation+        ((int)*(iomodel->elements+elements_width*i+j)-1));
 		}
 
 		/*basal drag:*/
-		penta_friction_type=(int)model->drag_type;
-
-		penta_p=model->p[i];
-		penta_q=model->q[i];
+		penta_friction_type=(int)iomodel->drag_type;
+
+		penta_p=iomodel->p[i];
+		penta_q=iomodel->q[i];
 
 		/*diverse: */
-		penta_shelf=(int)*(model->elementoniceshelf+i);
-		penta_onbed=(int)*(model->elementonbed+i);
-		penta_onsurface=(int)*(model->elementonsurface+i);
-		penta_meanvel=model->meanvel;
-		penta_epsvel=model->epsvel;
-		penta_onwater=(bool)*(model->elementonwater+i);
+		penta_shelf=(int)*(iomodel->elementoniceshelf+i);
+		penta_onbed=(int)*(iomodel->elementonbed+i);
+		penta_onsurface=(int)*(iomodel->elementonsurface+i);
+		penta_meanvel=iomodel->meanvel;
+		penta_epsvel=iomodel->epsvel;
+		penta_onwater=(bool)*(iomodel->elementonwater+i);
 	
 		/*viscosity_overshoot*/
-		penta_viscosity_overshoot=model->viscosity_overshoot;
+		penta_viscosity_overshoot=iomodel->viscosity_overshoot;
 		penta_collapse=1;
 
@@ -219,9 +219,9 @@
 		B_avg=0;
 		for(j=0;j<6;j++){
-			B_avg+=*(model->B+((int)*(model->elements+elements_width*i+j)-1));
+			B_avg+=*(iomodel->B+((int)*(iomodel->elements+elements_width*i+j)-1));
 		}
 		B_avg=B_avg/6;
 		matice_B= B_avg;
-		matice_n=(double)*(model->n+i);
+		matice_n=(double)*(iomodel->n+i);
 
 		/*Create matice using its constructor:*/
@@ -236,10 +236,10 @@
 		 into the grid coordinates. If we start plugging 1 into my_grids for each index[n][i] (i=0:2), then my_grids 
 		 will hold which grids belong to this partition*/
-		my_grids[(int)*(model->elements+elements_width*i+0)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+1)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+2)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+3)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+4)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+5)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+0)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+1)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+2)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+3)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+4)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+5)-1]=1;
 		#endif
 
@@ -251,34 +251,34 @@
 
 	/*Free data: */
-	xfree((void**)&model->elements);
-	xfree((void**)&model->thickness);
-	xfree((void**)&model->surface);
-	xfree((void**)&model->bed);
-	xfree((void**)&model->drag);
-	xfree((void**)&model->p);
-	xfree((void**)&model->q);
-	xfree((void**)&model->elementoniceshelf);
-	xfree((void**)&model->elementonbed);
-	xfree((void**)&model->elementonsurface);
-	xfree((void**)&model->elements_type);
-	xfree((void**)&model->n);
-	xfree((void**)&model->B);
-	xfree((void**)&model->accumulation);
-	xfree((void**)&model->melting);
-	xfree((void**)&model->elementonwater);
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->drag);
+	xfree((void**)&iomodel->p);
+	xfree((void**)&iomodel->q);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->elements_type);
+	xfree((void**)&iomodel->n);
+	xfree((void**)&iomodel->B);
+	xfree((void**)&iomodel->accumulation);
+	xfree((void**)&iomodel->melting);
+	xfree((void**)&iomodel->elementonwater);
 
 
 	/*Add one constant material property to materials: */
-	matpar_mid=model->numberofelements+1; //put it at the end of the materials
-	matpar_g=model->g; 
-	matpar_rho_ice=model->rho_ice; 
-	matpar_rho_water=model->rho_water; 
-	matpar_thermalconductivity=model->thermalconductivity; 
-	matpar_heatcapacity=model->heatcapacity; 
-	matpar_latentheat=model->latentheat; 
-	matpar_beta=model->beta; 
-	matpar_meltingpoint=model->meltingpoint; 
-	matpar_mixed_layer_capacity=model->mixed_layer_capacity; 
-	matpar_thermal_exchange_velocity=model->thermal_exchange_velocity; 
+	matpar_mid=iomodel->numberofelements+1; //put it at the end of the materials
+	matpar_g=iomodel->g; 
+	matpar_rho_ice=iomodel->rho_ice; 
+	matpar_rho_water=iomodel->rho_water; 
+	matpar_thermalconductivity=iomodel->thermalconductivity; 
+	matpar_heatcapacity=iomodel->heatcapacity; 
+	matpar_latentheat=iomodel->latentheat; 
+	matpar_beta=iomodel->beta; 
+	matpar_meltingpoint=iomodel->meltingpoint; 
+	matpar_mixed_layer_capacity=iomodel->mixed_layer_capacity; 
+	matpar_thermal_exchange_velocity=iomodel->thermal_exchange_velocity; 
 
 	/*Create matpar object using its constructor: */
@@ -293,7 +293,7 @@
 		/*From the element partitioning, we can determine which grids are on the inside of this cpu's 
 		 *element partition, and which are on its border with other nodes:*/
-		gridborder=NewVec(model->numberofnodes);
-
-		for (i=0;i<model->numberofnodes;i++){
+		gridborder=NewVec(iomodel->numberofnodes);
+
+		for (i=0;i<iomodel->numberofnodes;i++){
 			if(my_grids[i])VecSetValue(gridborder,i,1,ADD_VALUES);
 		}
@@ -309,5 +309,5 @@
 		#ifdef _DEBUG_
 		if(my_rank==0){
-			for (i=0;i<model->numberofnodes;i++){
+			for (i=0;i<iomodel->numberofnodes;i++){
 				printf("Grid id %i Border grid %lf\n",i+1,my_bordergrids[i]);
 			}
@@ -317,25 +317,25 @@
 
 	/*Partition penalties in 3d: */
-	if(strcmp(model->meshtype,"3d")==0){
+	if(strcmp(iomodel->meshtype,"3d")==0){
 	
 		/*Get penalties: */
-		ModelFetchData((void**)&model->penalties,&model->numpenalties,NULL,model_handle,"penalties","Matrix","Mat");
-
-		if(model->numpenalties){
-
-			model->penaltypartitioning=(int*)xmalloc(model->numpenalties*sizeof(int));
+		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+
+		if(iomodel->numpenalties){
+
+			iomodel->penaltypartitioning=(int*)xmalloc(iomodel->numpenalties*sizeof(int));
 			#ifdef _SERIAL_
-			for(i=0;i<model->numpenalties;i++)model->penaltypartitioning[i]=1;
+			for(i=0;i<iomodel->numpenalties;i++)iomodel->penaltypartitioning[i]=1;
 			#else
-			for(i=0;i<model->numpenalties;i++)model->penaltypartitioning[i]=-1;
-
-			for(i=0;i<model->numpenalties;i++){
-				first_grid_index=(int)(*(model->penalties+i*model->numlayers+0)-1);
+			for(i=0;i<iomodel->numpenalties;i++)iomodel->penaltypartitioning[i]=-1;
+
+			for(i=0;i<iomodel->numpenalties;i++){
+				first_grid_index=(int)(*(iomodel->penalties+i*iomodel->numlayers+0)-1);
 				if((my_grids[first_grid_index]==1) && (my_bordergrids[first_grid_index]<=1.0) ) { //this grid belongs to this node's internal partition  grids
 					/*All grids that are being penalised belong to this node's internal grid partition.:*/
-					model->penaltypartitioning[i]=1;
+					iomodel->penaltypartitioning[i]=1;
 				}
 				if(my_bordergrids[first_grid_index]>1.0) { //this grid belongs to a partition border
-					model->penaltypartitioning[i]=0;
+					iomodel->penaltypartitioning[i]=0;
 				}
 			}
@@ -344,5 +344,5 @@
 
 		/*Free penalties: */
-		xfree((void**)&model->penalties);
+		xfree((void**)&iomodel->penalties);
 	}
 
@@ -355,23 +355,23 @@
 		
 	/*First fetch data: */
-	if (strcmp(model->meshtype,"3d")==0){
-		ModelFetchData((void**)&model->deadgrids,NULL,NULL,model_handle,"deadgrids","Matrix","Mat");
-		ModelFetchData((void**)&model->uppernodes,NULL,NULL,model_handle,"uppergrids","Matrix","Mat");
+	if (strcmp(iomodel->meshtype,"3d")==0){
+		IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
 	}
-	ModelFetchData((void**)&model->x,NULL,NULL,model_handle,"x","Matrix","Mat");
-	ModelFetchData((void**)&model->y,NULL,NULL,model_handle,"y","Matrix","Mat");
-	ModelFetchData((void**)&model->z,NULL,NULL,model_handle,"z","Matrix","Mat");
-	ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-	ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonbed,NULL,NULL,model_handle,"gridonbed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonsurface,NULL,NULL,model_handle,"gridonsurface","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonicesheet,NULL,NULL,model_handle,"gridonicesheet","Matrix","Mat");
-	ModelFetchData((void**)&model->gridoniceshelf,NULL,NULL,model_handle,"gridoniceshelf","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
 
 
 	/*Get number of dofs per node: */
-	DistributeNumDofs(&node_numdofs,model->analysis_type,model->sub_analysis_type);
-
-	for (i=0;i<model->numberofnodes;i++){
+	DistributeNumDofs(&node_numdofs,iomodel->analysis_type,iomodel->sub_analysis_type);
+
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
@@ -394,20 +394,20 @@
 		#endif
 
-		node_x[0]=model->x[i];
-		node_x[1]=model->y[i];
-		node_x[2]=model->z[i];
-		node_sigma=(model->z[i]-model->bed[i])/(model->thickness[i]);
-		
-		node_onbed=(int)model->gridonbed[i];
-		node_onsurface=(int)model->gridonsurface[i];	
-		node_onshelf=(int)model->gridoniceshelf[i];	
-		node_onsheet=(int)model->gridonicesheet[i];	
-
-		if (strcmp(model->meshtype,"3d")==0){
-			if (isnan(model->uppernodes[i])){
+		node_x[0]=iomodel->x[i];
+		node_x[1]=iomodel->y[i];
+		node_x[2]=iomodel->z[i];
+		node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]);
+		
+		node_onbed=(int)iomodel->gridonbed[i];
+		node_onsurface=(int)iomodel->gridonsurface[i];	
+		node_onshelf=(int)iomodel->gridoniceshelf[i];	
+		node_onsheet=(int)iomodel->gridonicesheet[i];	
+
+		if (strcmp(iomodel->meshtype,"3d")==0){
+			if (isnan(iomodel->uppernodes[i])){
 				node_upper_node_id=node_id;  //nodes on surface do not have upper nodes, only themselves.
 			}
 			else{
-				node_upper_node_id=(int)model->uppernodes[i];
+				node_upper_node_id=(int)iomodel->uppernodes[i];
 			}
 		}
@@ -421,5 +421,5 @@
 
 		/*set single point constraints.: */
-		if (!model->gridonbed[i]){
+		if (!iomodel->gridonbed[i]){
 			for(k=1;k<=node_numdofs;k++){
 				node->FreezeDof(k);
@@ -441,20 +441,20 @@
 
 	/*Clean fetched data: */
-	xfree((void**)&model->deadgrids);
-	xfree((void**)&model->x);
-	xfree((void**)&model->y);
-	xfree((void**)&model->z);
-	xfree((void**)&model->thickness);
-	xfree((void**)&model->bed);
-	xfree((void**)&model->gridonbed);
-	xfree((void**)&model->gridonsurface);
-	xfree((void**)&model->uppernodes);
-	xfree((void**)&model->gridonicesheet);
-	xfree((void**)&model->gridoniceshelf);
-
-	/*Keep partitioning information into model*/
-	model->epart=epart;
-	model->my_grids=my_grids;
-	model->my_bordergrids=my_bordergrids;
+	xfree((void**)&iomodel->deadgrids);
+	xfree((void**)&iomodel->x);
+	xfree((void**)&iomodel->y);
+	xfree((void**)&iomodel->z);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->gridonbed);
+	xfree((void**)&iomodel->gridonsurface);
+	xfree((void**)&iomodel->uppernodes);
+	xfree((void**)&iomodel->gridonicesheet);
+	xfree((void**)&iomodel->gridoniceshelf);
+
+	/*Keep partitioning information into iomodel*/
+	iomodel->epart=epart;
+	iomodel->my_grids=my_grids;
+	iomodel->my_bordergrids=my_bordergrids;
 
 	/*Free ressources:*/
Index: /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 1834)
@@ -11,8 +11,8 @@
 #include "../../shared/shared.h"
 #include "../../include/macros.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateLoadsMelting(DataSet** ploads, Model* model,ConstDataHandle model_handle){
+void	CreateLoadsMelting(DataSet** ploads, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	int i,j,counter;
@@ -46,20 +46,20 @@
 
 	//create penalties for grids: no grid can have a temperature over the melting point
-	ModelFetchData((void**)&model->gridonbed,NULL,NULL,model_handle,"gridonbed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
 
-	for (i=0;i<model->numberofnodes;i++){
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
-	if((model->my_grids[i]==1)){
+	if((iomodel->my_grids[i]==1)){
 	#endif
 
-		if (model->gridonbed[i]){ 
+		if (iomodel->gridonbed[i]){ 
 		
 			pengrid_id=count+1; //matlab indexing
 			pengrid_node_id=i+1;
 			pengrid_dof=1;
-			pengrid_penalty_offset=model->penalty_offset;
+			pengrid_penalty_offset=iomodel->penalty_offset;
 			pengrid_active=0;
-			pengrid_mparid=model->numberofelements+1;//refers to the corresponding parmat property card
+			pengrid_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
 			
 			pengrid= new Pengrid(pengrid_id, pengrid_node_id,pengrid_mparid,pengrid_dof, pengrid_active, pengrid_penalty_offset,pengrid_thermal_steadystate);
@@ -69,8 +69,8 @@
 		}
 	#ifdef _PARALLEL_
-	} //if((model->my_grids[i]==1))
+	} //if((iomodel->my_grids[i]==1))
 	#endif
 	}
-	xfree((void**)&model->gridonbed);
+	xfree((void**)&iomodel->gridonbed);
 
 	/*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 
Index: /issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp	(revision 1834)
@@ -11,7 +11,7 @@
 #include "../../objects/objects.h"
 #include "../../shared/shared.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
-void CreateParametersMelting(DataSet** pparameters,Model* model,ConstDataHandle model_handle){
+void CreateParametersMelting(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
 	
 	Param*   param = NULL;
@@ -28,18 +28,18 @@
 
 	/* get initial melting if transient*/
-	if(model->sub_analysis_type==TransientAnalysisEnum()){
+	if(iomodel->sub_analysis_type==TransientAnalysisEnum()){
 
 		/*Get melting: */
-		ModelFetchData((void**)&melting,NULL,NULL,model_handle,"melting","Matrix","Mat");
+		IoModelFetchData((void**)&melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
 		if(melting) {
-			for(i=0;i<model->numberofnodes;i++)melting[i]=melting[i]/model->yts;   //m/s instead of m/yr
+			for(i=0;i<iomodel->numberofnodes;i++)melting[i]=melting[i]/iomodel->yts;   //m/s instead of m/yr
 		}
 		else{
-			for(i=0;i<model->numberofnodes;i++)melting[i]=0;
+			for(i=0;i<iomodel->numberofnodes;i++)melting[i]=0;
 		}
 
 		count++;
 		param= new Param(count,"m_g",DOUBLEVEC);
-		if(melting) param->SetDoubleVec(melting,model->numberofnodes);
+		if(melting) param->SetDoubleVec(melting,iomodel->numberofnodes);
 		else param->SetDoubleVec(melting,0);
 		parameters->AddObject(param);
Index: /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 1834)
@@ -11,8 +11,8 @@
 #include "../../objects/objects.h"
 #include "../../shared/shared.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateConstraintsPrognostic(DataSet** pconstraints, Model* model,ConstDataHandle model_handle){
+void	CreateConstraintsPrognostic(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
@@ -35,13 +35,13 @@
 
 	/*Fetch data: */
-	ModelFetchData((void**)&spcthickness,NULL,NULL,model_handle,"spcthickness","Matrix","Mat");
+	IoModelFetchData((void**)&spcthickness,NULL,NULL,iomodel_handle,"spcthickness","Matrix","Mat");
 
 	count=0;
 
 	/*Create spcs from x,y,z, as well as the spc values on those spcs: */
-	for (i=0;i<model->numberofnodes;i++){
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
-	if((model->my_grids[i]==1)){
+	if((iomodel->my_grids[i]==1)){
 	#endif
 
Index: /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp	(revision 1834)
@@ -12,8 +12,8 @@
 #include "../../shared/shared.h"
 #include "../../MeshPartitionx/MeshPartitionx.h"
-#include "../Model.h"
-
-
-void	CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle){
+#include "../IoModel.h"
+
+
+void	CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
@@ -146,5 +146,5 @@
 
 	/*Width of elements: */
-	if(strcmp(model->meshtype,"2d")==0){
+	if(strcmp(iomodel->meshtype,"2d")==0){
 		elements_width=3; //tria elements
 	}
@@ -155,22 +155,22 @@
 	#ifdef _PARALLEL_
 	/*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
-	if(strcmp(model->meshtype,"2d")==0){
+	if(strcmp(iomodel->meshtype,"2d")==0){
 		/*load elements: */
-		ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
 	}
 	else{
 		/*load elements2d: */
-		ModelFetchData((void**)&model->elements2d,NULL,NULL,model_handle,"elements2d","Matrix","Mat");
-	}
-
-
-	MeshPartitionx(&epart, &npart,model->numberofelements,model->numberofnodes,model->elements, model->numberofelements2d,model->numberofnodes2d,model->elements2d,model->numlayers,elements_width, model->meshtype,num_procs);
+		IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+	}
+
+
+	MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofnodes,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofnodes2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->meshtype,num_procs);
 
 	/*Free elements and elements2d: */
-	xfree((void**)&model->elements);
-	xfree((void**)&model->elements2d);
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->elements2d);
 
 	/*Used later on: */
-	my_grids=(int*)xcalloc(model->numberofnodes,sizeof(int));
+	my_grids=(int*)xcalloc(iomodel->numberofnodes,sizeof(int));
 	#endif
 
@@ -180,15 +180,15 @@
 
 	/*2d mesh: */
-	if (strcmp(model->meshtype,"2d")==0){
+	if (strcmp(iomodel->meshtype,"2d")==0){
 
 		/*Fetch data needed: */
-		ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
-		ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-		ModelFetchData((void**)&model->surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
-		ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-		ModelFetchData((void**)&model->elementoniceshelf,NULL,NULL,model_handle,"elementoniceshelf","Matrix","Mat");
-		ModelFetchData((void**)&model->elementonwater,NULL,NULL,model_handle,"elementonwater","Matrix","Mat");
-		
-		for (i=0;i<model->numberofelements;i++){
+		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
+		
+		for (i=0;i<iomodel->numberofelements;i++){
 
 		#ifdef _PARALLEL_
@@ -204,25 +204,25 @@
 
 			/*vertices offsets: */
-			tria_g[0]=(int)*(model->elements+elements_width*i+0);
-			tria_g[1]=(int)*(model->elements+elements_width*i+1);
-			tria_g[2]=(int)*(model->elements+elements_width*i+2);
+			tria_g[0]=(int)*(iomodel->elements+elements_width*i+0);
+			tria_g[1]=(int)*(iomodel->elements+elements_width*i+1);
+			tria_g[2]=(int)*(iomodel->elements+elements_width*i+2);
 
 			/*thickness,surface and bed:*/
-			tria_h[0]= *(model->thickness+ ((int)*(model->elements+elements_width*i+0)-1)); //remember, elements is an index of vertices offsets, in matlab indexing.
-			tria_h[1]=*(model->thickness+  ((int)*(model->elements+elements_width*i+1)-1)); 
-			tria_h[2]=*(model->thickness+  ((int)*(model->elements+elements_width*i+2)-1)) ;
-
-			tria_s[0]=*(model->surface+    ((int)*(model->elements+elements_width*i+0)-1)); 
-			tria_s[1]=*(model->surface+    ((int)*(model->elements+elements_width*i+1)-1)); 
-			tria_s[2]=*(model->surface+    ((int)*(model->elements+elements_width*i+2)-1)); 
-
-			tria_b[0]=*(model->bed+        ((int)*(model->elements+elements_width*i+0)-1)); 
-			tria_b[1]=*(model->bed+        ((int)*(model->elements+elements_width*i+1)-1)); 
-			tria_b[2]=*(model->bed+        ((int)*(model->elements+elements_width*i+2)-1)); 
+			tria_h[0]= *(iomodel->thickness+ ((int)*(iomodel->elements+elements_width*i+0)-1)); //remember, elements is an index of vertices offsets, in matlab indexing.
+			tria_h[1]=*(iomodel->thickness+  ((int)*(iomodel->elements+elements_width*i+1)-1)); 
+			tria_h[2]=*(iomodel->thickness+  ((int)*(iomodel->elements+elements_width*i+2)-1)) ;
+
+			tria_s[0]=*(iomodel->surface+    ((int)*(iomodel->elements+elements_width*i+0)-1)); 
+			tria_s[1]=*(iomodel->surface+    ((int)*(iomodel->elements+elements_width*i+1)-1)); 
+			tria_s[2]=*(iomodel->surface+    ((int)*(iomodel->elements+elements_width*i+2)-1)); 
+
+			tria_b[0]=*(iomodel->bed+        ((int)*(iomodel->elements+elements_width*i+0)-1)); 
+			tria_b[1]=*(iomodel->bed+        ((int)*(iomodel->elements+elements_width*i+1)-1)); 
+			tria_b[2]=*(iomodel->bed+        ((int)*(iomodel->elements+elements_width*i+2)-1)); 
 
 			/*element on iceshelf?:*/
-			tria_shelf=(int)*(model->elementoniceshelf+i);
-			tria_onwater=(bool)*(model->elementonwater+i);
-			tria_artdiff=model->artificial_diffusivity;
+			tria_shelf=(int)*(iomodel->elementoniceshelf+i);
+			tria_onwater=(bool)*(iomodel->elementonwater+i);
+			tria_artdiff=iomodel->artificial_diffusivity;
 
 			/*Create tria element using its constructor:*/
@@ -237,7 +237,7 @@
 			 into the grid coordinates. If we start plugging 1 into my_grids for each index[n][i] (i=0:2), then my_grids 
 			 will hold which grids belong to this partition*/
-			my_grids[(int)*(model->elements+elements_width*i+0)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+1)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+2)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+0)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+1)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+2)-1]=1;
 			#endif
 
@@ -250,10 +250,10 @@
 	
 		/*Free data : */
-		xfree((void**)&model->elements);
-		xfree((void**)&model->thickness);
-		xfree((void**)&model->surface);
-		xfree((void**)&model->bed);
-		xfree((void**)&model->elementoniceshelf);
-		xfree((void**)&model->elementonwater);
+		xfree((void**)&iomodel->elements);
+		xfree((void**)&iomodel->thickness);
+		xfree((void**)&iomodel->surface);
+		xfree((void**)&iomodel->bed);
+		xfree((void**)&iomodel->elementoniceshelf);
+		xfree((void**)&iomodel->elementonwater);
 
 	}
@@ -261,14 +261,14 @@
 
 		/*Fetch data needed: */
-		ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
-		ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-		ModelFetchData((void**)&model->surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
-		ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-		ModelFetchData((void**)&model->elementoniceshelf,NULL,NULL,model_handle,"elementoniceshelf","Matrix","Mat");
-		ModelFetchData((void**)&model->elementonbed,NULL,NULL,model_handle,"elementonbed","Matrix","Mat");
-		ModelFetchData((void**)&model->elementonsurface,NULL,NULL,model_handle,"elementonsurface","Matrix","Mat");
-		ModelFetchData((void**)&model->elementonwater,NULL,NULL,model_handle,"elementonwater","Matrix","Mat");
-	
-		for (i=0;i<model->numberofelements;i++){
+		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
+	
+		for (i=0;i<iomodel->numberofelements;i++){
 		#ifdef _PARALLEL_
 		/*We are using our element partition to decide which elements will be created on this node: */
@@ -284,17 +284,17 @@
 			/*vertices,thickness,surface,bed and drag: */
 			for(j=0;j<6;j++){
-				penta_g[j]=(int)*(model->elements+elements_width*i+j);
-				penta_h[j]=*(model->thickness+    ((int)*(model->elements+elements_width*i+j)-1)); 
-				penta_s[j]=*(model->surface+    ((int)*(model->elements+elements_width*i+j)-1)); 
-				penta_b[j]=*(model->bed+    ((int)*(model->elements+elements_width*i+j)-1)); 
+				penta_g[j]=(int)*(iomodel->elements+elements_width*i+j);
+				penta_h[j]=*(iomodel->thickness+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+				penta_s[j]=*(iomodel->surface+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+				penta_b[j]=*(iomodel->bed+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
 			}
 
 			/*diverse: */
-			penta_shelf=(int)*(model->elementoniceshelf+i);
-			penta_onbed=(int)*(model->elementonbed+i);
-			penta_onsurface=(int)*(model->elementonsurface+i);
+			penta_shelf=(int)*(iomodel->elementoniceshelf+i);
+			penta_onbed=(int)*(iomodel->elementonbed+i);
+			penta_onsurface=(int)*(iomodel->elementonsurface+i);
 			penta_collapse=1;
-			penta_artdiff=model->artificial_diffusivity;
-			penta_onwater=(bool)*(model->elementonwater+i);
+			penta_artdiff=iomodel->artificial_diffusivity;
+			penta_onwater=(bool)*(iomodel->elementonwater+i);
 	
 
@@ -313,10 +313,10 @@
 			 into the grid coordinates. If we start plugging 1 into my_grids for each index[n][i] (i=0:2), then my_grids 
 			 will hold which grids belong to this partition*/
-			my_grids[(int)*(model->elements+elements_width*i+0)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+1)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+2)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+3)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+4)-1]=1;
-			my_grids[(int)*(model->elements+elements_width*i+5)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+0)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+1)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+2)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+3)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+4)-1]=1;
+			my_grids[(int)*(iomodel->elements+elements_width*i+5)-1]=1;
 			#endif
 
@@ -328,12 +328,12 @@
 
 		/*Free data: */
-		xfree((void**)&model->elements);
-		xfree((void**)&model->thickness);
-		xfree((void**)&model->surface);
-		xfree((void**)&model->bed);
-		xfree((void**)&model->elementoniceshelf);
-		xfree((void**)&model->elementonbed);
-		xfree((void**)&model->elementonsurface);
-		xfree((void**)&model->elementonwater);
+		xfree((void**)&iomodel->elements);
+		xfree((void**)&iomodel->thickness);
+		xfree((void**)&iomodel->surface);
+		xfree((void**)&iomodel->bed);
+		xfree((void**)&iomodel->elementoniceshelf);
+		xfree((void**)&iomodel->elementonbed);
+		xfree((void**)&iomodel->elementonsurface);
+		xfree((void**)&iomodel->elementonwater);
 
 	} //if (strcmp(meshtype,"2d")==0)
@@ -342,7 +342,7 @@
 		/*From the element partitioning, we can determine which grids are on the inside of this cpu's 
 		 *element partition, and which are on its border with other nodes:*/
-		gridborder=NewVec(model->numberofnodes);
-
-		for (i=0;i<model->numberofnodes;i++){
+		gridborder=NewVec(iomodel->numberofnodes);
+
+		for (i=0;i<iomodel->numberofnodes;i++){
 			if(my_grids[i])VecSetValue(gridborder,i,1,ADD_VALUES);
 		}
@@ -358,5 +358,5 @@
 		#ifdef _DEBUG_
 		if(my_rank==0){
-			for (i=0;i<model->numberofnodes;i++){
+			for (i=0;i<iomodel->numberofnodes;i++){
 				printf("Grid id %i Border grid %lf\n",i+1,my_bordergrids[i]);
 			}
@@ -367,14 +367,14 @@
 	/*Add one constant material property to materials: */
 	matpar_mid=1; //put it at the end of the materials
-	matpar_g=model->g; 
-	matpar_rho_ice=model->rho_ice; 
-	matpar_rho_water=model->rho_water; 
-	matpar_thermalconductivity=model->thermalconductivity; 
-	matpar_heatcapacity=model->heatcapacity; 
-	matpar_latentheat=model->latentheat; 
-	matpar_beta=model->beta; 
-	matpar_meltingpoint=model->meltingpoint; 
-	matpar_mixed_layer_capacity=model->mixed_layer_capacity; 
-	matpar_thermal_exchange_velocity=model->thermal_exchange_velocity; 
+	matpar_g=iomodel->g; 
+	matpar_rho_ice=iomodel->rho_ice; 
+	matpar_rho_water=iomodel->rho_water; 
+	matpar_thermalconductivity=iomodel->thermalconductivity; 
+	matpar_heatcapacity=iomodel->heatcapacity; 
+	matpar_latentheat=iomodel->latentheat; 
+	matpar_beta=iomodel->beta; 
+	matpar_meltingpoint=iomodel->meltingpoint; 
+	matpar_mixed_layer_capacity=iomodel->mixed_layer_capacity; 
+	matpar_thermal_exchange_velocity=iomodel->thermal_exchange_velocity; 
 
 	/*Create matpar object using its constructor: */
@@ -387,25 +387,25 @@
 
 	/*Partition penalties in 3d: */
-	if(strcmp(model->meshtype,"3d")==0){
+	if(strcmp(iomodel->meshtype,"3d")==0){
 	
 		/*Get penalties: */
-		ModelFetchData((void**)&model->penalties,&model->numpenalties,NULL,model_handle,"penalties","Matrix","Mat");
-
-		if(model->numpenalties){
-
-			model->penaltypartitioning=(int*)xmalloc(model->numpenalties*sizeof(int));
+		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+
+		if(iomodel->numpenalties){
+
+			iomodel->penaltypartitioning=(int*)xmalloc(iomodel->numpenalties*sizeof(int));
 			#ifdef _SERIAL_
-			for(i=0;i<model->numpenalties;i++)model->penaltypartitioning[i]=1;
+			for(i=0;i<iomodel->numpenalties;i++)iomodel->penaltypartitioning[i]=1;
 			#else
-			for(i=0;i<model->numpenalties;i++)model->penaltypartitioning[i]=-1;
-
-			for(i=0;i<model->numpenalties;i++){
-				first_grid_index=(int)(*(model->penalties+i*model->numlayers+0)-1);
+			for(i=0;i<iomodel->numpenalties;i++)iomodel->penaltypartitioning[i]=-1;
+
+			for(i=0;i<iomodel->numpenalties;i++){
+				first_grid_index=(int)(*(iomodel->penalties+i*iomodel->numlayers+0)-1);
 				if((my_grids[first_grid_index]==1) && (my_bordergrids[first_grid_index]<=1.0) ) { //this grid belongs to this node's internal partition  grids
 					/*All grids that are being penalised belong to this node's internal grid partition.:*/
-					model->penaltypartitioning[i]=1;
+					iomodel->penaltypartitioning[i]=1;
 				}
 				if(my_bordergrids[first_grid_index]>1.0) { //this grid belongs to a partition border
-					model->penaltypartitioning[i]=0;
+					iomodel->penaltypartitioning[i]=0;
 				}
 			}
@@ -414,5 +414,5 @@
 
 		/*Free penalties: */
-		xfree((void**)&model->penalties);
+		xfree((void**)&iomodel->penalties);
 	}
 
@@ -425,23 +425,23 @@
 		
 	/*First fetch data: */
-	if (strcmp(model->meshtype,"3d")==0){
-		ModelFetchData((void**)&model->deadgrids,NULL,NULL,model_handle,"deadgrids","Matrix","Mat");
-		ModelFetchData((void**)&model->uppernodes,NULL,NULL,model_handle,"uppergrids","Matrix","Mat");
-	}
-	ModelFetchData((void**)&model->x,NULL,NULL,model_handle,"x","Matrix","Mat");
-	ModelFetchData((void**)&model->y,NULL,NULL,model_handle,"y","Matrix","Mat");
-	ModelFetchData((void**)&model->z,NULL,NULL,model_handle,"z","Matrix","Mat");
-	ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-	ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonbed,NULL,NULL,model_handle,"gridonbed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonsurface,NULL,NULL,model_handle,"gridonsurface","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonicesheet,NULL,NULL,model_handle,"gridonicesheet","Matrix","Mat");
-	ModelFetchData((void**)&model->gridoniceshelf,NULL,NULL,model_handle,"gridoniceshelf","Matrix","Mat");
+	if (strcmp(iomodel->meshtype,"3d")==0){
+		IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
+	}
+	IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
 
 
 	/*Get number of dofs per node: */
-	DistributeNumDofs(&node_numdofs,model->analysis_type,model->sub_analysis_type);
-
-	for (i=0;i<model->numberofnodes;i++){
+	DistributeNumDofs(&node_numdofs,iomodel->analysis_type,iomodel->sub_analysis_type);
+
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
@@ -464,20 +464,20 @@
 		#endif
 
-		node_x[0]=model->x[i];
-		node_x[1]=model->y[i];
-		node_x[2]=model->z[i];
-		node_sigma=(model->z[i]-model->bed[i])/(model->thickness[i]);
-		
-		node_onbed=(int)model->gridonbed[i];
-		node_onsurface=(int)model->gridonsurface[i];	
-		node_onshelf=(int)model->gridoniceshelf[i];	
-		node_onsheet=(int)model->gridonicesheet[i];	
-
-		if (strcmp(model->meshtype,"3d")==0){
-			if (isnan(model->uppernodes[i])){
+		node_x[0]=iomodel->x[i];
+		node_x[1]=iomodel->y[i];
+		node_x[2]=iomodel->z[i];
+		node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]);
+		
+		node_onbed=(int)iomodel->gridonbed[i];
+		node_onsurface=(int)iomodel->gridonsurface[i];	
+		node_onshelf=(int)iomodel->gridoniceshelf[i];	
+		node_onsheet=(int)iomodel->gridonicesheet[i];	
+
+		if (strcmp(iomodel->meshtype,"3d")==0){
+			if (isnan(iomodel->uppernodes[i])){
 				node_upper_node_id=node_id;  //nodes on surface do not have upper nodes, only themselves.
 			}
 			else{
-				node_upper_node_id=(int)model->uppernodes[i];
+				node_upper_node_id=(int)iomodel->uppernodes[i];
 			}
 		}
@@ -491,7 +491,7 @@
 
 		/*set single point constraints.: */
-		if (strcmp(model->meshtype,"3d")==0){
+		if (strcmp(iomodel->meshtype,"3d")==0){
 			/*On a 3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */
-			if (!model->gridonbed[i]){
+			if (!iomodel->gridonbed[i]){
 				for(k=1;k<=node_numdofs;k++){
 					node->FreezeDof(k);
@@ -514,21 +514,21 @@
 
 	/*Clean fetched data: */
-	xfree((void**)&model->deadgrids);
-	xfree((void**)&model->x);
-	xfree((void**)&model->y);
-	xfree((void**)&model->z);
-	xfree((void**)&model->thickness);
-	xfree((void**)&model->bed);
-	xfree((void**)&model->gridonbed);
-	xfree((void**)&model->gridonsurface);
-	xfree((void**)&model->uppernodes);
-	xfree((void**)&model->gridonicesheet);
-	xfree((void**)&model->gridoniceshelf);
-	
-
-	/*Keep partitioning information into model*/
-	model->epart=epart;
-	model->my_grids=my_grids;
-	model->my_bordergrids=my_bordergrids;
+	xfree((void**)&iomodel->deadgrids);
+	xfree((void**)&iomodel->x);
+	xfree((void**)&iomodel->y);
+	xfree((void**)&iomodel->z);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->gridonbed);
+	xfree((void**)&iomodel->gridonsurface);
+	xfree((void**)&iomodel->uppernodes);
+	xfree((void**)&iomodel->gridonicesheet);
+	xfree((void**)&iomodel->gridoniceshelf);
+	
+
+	/*Keep partitioning information into iomodel*/
+	iomodel->epart=epart;
+	iomodel->my_grids=my_grids;
+	iomodel->my_bordergrids=my_bordergrids;
 
 	/*Free ressources:*/
Index: /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 1834)
@@ -11,8 +11,8 @@
 #include "../../shared/shared.h"
 #include "../../include/macros.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateLoadsPrognostic(DataSet** ploads, Model* model,ConstDataHandle model_handle){
+void	CreateLoadsPrognostic(DataSet** ploads, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	DataSet*    loads    = NULL;
Index: /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp	(revision 1834)
@@ -11,7 +11,7 @@
 #include "../../objects/objects.h"
 #include "../../shared/shared.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
-void CreateParametersPrognostic(DataSet** pparameters,Model* model,ConstDataHandle model_handle){
+void CreateParametersPrognostic(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
 	
 	Param*   param = NULL;
@@ -39,17 +39,17 @@
 
 	/*Get vx and vy: */
-	ModelFetchData((void**)&vx,NULL,NULL,model_handle,"vx","Matrix","Mat");
-	ModelFetchData((void**)&vy,NULL,NULL,model_handle,"vy","Matrix","Mat");
-	ModelFetchData((void**)&vz,NULL,NULL,model_handle,"vz","Matrix","Mat");
+	IoModelFetchData((void**)&vx,NULL,NULL,iomodel_handle,"vx","Matrix","Mat");
+	IoModelFetchData((void**)&vy,NULL,NULL,iomodel_handle,"vy","Matrix","Mat");
+	IoModelFetchData((void**)&vz,NULL,NULL,iomodel_handle,"vz","Matrix","Mat");
 
-	u_g=(double*)xcalloc(model->numberofnodes*3,sizeof(double));
+	u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double));
 
-	if(vx) for(i=0;i<model->numberofnodes;i++)u_g[3*i+0]=vx[i]/model->yts;
-	if(vy) for(i=0;i<model->numberofnodes;i++)u_g[3*i+1]=vy[i]/model->yts;
-	if(vz) for(i=0;i<model->numberofnodes;i++)u_g[3*i+2]=vz[i]/model->yts;
+	if(vx) for(i=0;i<iomodel->numberofnodes;i++)u_g[3*i+0]=vx[i]/iomodel->yts;
+	if(vy) for(i=0;i<iomodel->numberofnodes;i++)u_g[3*i+1]=vy[i]/iomodel->yts;
+	if(vz) for(i=0;i<iomodel->numberofnodes;i++)u_g[3*i+2]=vz[i]/iomodel->yts;
 
 	count++;
 	param= new Param(count,"u_g",DOUBLEVEC);
-	param->SetDoubleVec(u_g,3*model->numberofnodes,3);
+	param->SetDoubleVec(u_g,3*iomodel->numberofnodes,3);
 	parameters->AddObject(param);
 
@@ -60,12 +60,12 @@
 	xfree((void**)&u_g);
 
-	/*Get pressure if 3d model: */
+	/*Get pressure if 3d iomodel: */
 	parameters->FindParam((void*)&dim,"dim");
 	if (dim==3){ 
-		ModelFetchData((void**)&pressure,NULL,NULL,model_handle,"pressure","Matrix","Mat");
+		IoModelFetchData((void**)&pressure,NULL,NULL,iomodel_handle,"pressure","Matrix","Mat");
 		
 		count++;
 		param= new Param(count,"p_g",DOUBLEVEC);
-		if(pressure) param->SetDoubleVec(pressure,model->numberofnodes,1);
+		if(pressure) param->SetDoubleVec(pressure,iomodel->numberofnodes,1);
 		else param->SetDoubleVec(pressure,0,0);
 		parameters->AddObject(param);
@@ -75,12 +75,12 @@
 	}
 
-	/*Get temperature if 3d model: */
+	/*Get temperature if 3d iomodel: */
 	parameters->FindParam((void*)&dim,"dim");
 	if (dim==3){ 
-		ModelFetchData((void**)&temperature,NULL,NULL,model_handle,"temperature","Matrix","Mat");
+		IoModelFetchData((void**)&temperature,NULL,NULL,iomodel_handle,"temperature","Matrix","Mat");
 		
 		count++;
 		param= new Param(count,"t_g",DOUBLEVEC);
-		if(temperature) param->SetDoubleVec(temperature,model->numberofnodes,1);
+		if(temperature) param->SetDoubleVec(temperature,iomodel->numberofnodes,1);
 		else param->SetDoubleVec(temperature,0,0);
 		parameters->AddObject(param);
@@ -91,9 +91,9 @@
 
 	/*Get thickness: */
-	ModelFetchData((void**)&thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
+	IoModelFetchData((void**)&thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
 	
 	count++;
 	param= new Param(count,"h_g",DOUBLEVEC);
-	if(thickness) param->SetDoubleVec(thickness,model->numberofnodes,1);
+	if(thickness) param->SetDoubleVec(thickness,iomodel->numberofnodes,1);
 	else param->SetDoubleVec(thickness,0,0);
 	parameters->AddObject(param);
@@ -103,9 +103,9 @@
 
 	/*Get surface: */
-	ModelFetchData((void**)&surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
+	IoModelFetchData((void**)&surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
 	
 	count++;
 	param= new Param(count,"s_g",DOUBLEVEC);
-	if(surface) param->SetDoubleVec(surface,model->numberofnodes,1);
+	if(surface) param->SetDoubleVec(surface,iomodel->numberofnodes,1);
 	else param->SetDoubleVec(surface,0,0);
 	parameters->AddObject(param);
@@ -115,9 +115,9 @@
 
 	/*Get bed: */
-	ModelFetchData((void**)&bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
+	IoModelFetchData((void**)&bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
 	
 	count++;
 	param= new Param(count,"b_g",DOUBLEVEC);
-	if(bed) param->SetDoubleVec(bed,model->numberofnodes,1);
+	if(bed) param->SetDoubleVec(bed,iomodel->numberofnodes,1);
 	else param->SetDoubleVec(bed,0,0);
 	parameters->AddObject(param);
@@ -127,10 +127,10 @@
 
 	/*Get melting: */
-	ModelFetchData((void**)&melting,NULL,NULL,model_handle,"melting","Matrix","Mat");
-	if(melting) for(i=0;i<model->numberofnodes;i++)melting[i]=melting[i]/model->yts;
+	IoModelFetchData((void**)&melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
+	if(melting) for(i=0;i<iomodel->numberofnodes;i++)melting[i]=melting[i]/iomodel->yts;
 	
 	count++;
 	param= new Param(count,"m_g",DOUBLEVEC);
-	if(melting) param->SetDoubleVec(melting,model->numberofnodes,1);
+	if(melting) param->SetDoubleVec(melting,iomodel->numberofnodes,1);
 	else param->SetDoubleVec(melting,0,1);
 	parameters->AddObject(param);
@@ -140,10 +140,10 @@
 
 	/*Get accumulation: */
-	ModelFetchData((void**)&accumulation,NULL,NULL,model_handle,"accumulation","Matrix","Mat");
-	if(accumulation) for(i=0;i<model->numberofnodes;i++)accumulation[i]=accumulation[i]/model->yts;
+	IoModelFetchData((void**)&accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
+	if(accumulation) for(i=0;i<iomodel->numberofnodes;i++)accumulation[i]=accumulation[i]/iomodel->yts;
 	
 	count++;
 	param= new Param(count,"a_g",DOUBLEVEC);
-	if(accumulation) param->SetDoubleVec(accumulation,model->numberofnodes,1);
+	if(accumulation) param->SetDoubleVec(accumulation,iomodel->numberofnodes,1);
 	else param->SetDoubleVec(accumulation,0,0);
 	parameters->AddObject(param);
Index: /issm/trunk/src/c/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 1834)
@@ -11,8 +11,8 @@
 #include "../../objects/objects.h"
 #include "../../shared/shared.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateConstraintsThermal(DataSet** pconstraints, Model* model,ConstDataHandle model_handle){
+void	CreateConstraintsThermal(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
@@ -35,13 +35,13 @@
 
 	/*Fetch data: */
-	ModelFetchData((void**)&spctemperature,NULL,NULL,model_handle,"spctemperature","Matrix","Mat");
+	IoModelFetchData((void**)&spctemperature,NULL,NULL,iomodel_handle,"spctemperature","Matrix","Mat");
 
 	count=0;
 
 	/*Create spcs from x,y,z, as well as the spc values on those spcs: */
-	for (i=0;i<model->numberofnodes;i++){
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
-	if((model->my_grids[i]==1)){
+	if((iomodel->my_grids[i]==1)){
 	#endif
 
Index: /issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp	(revision 1834)
@@ -12,9 +12,9 @@
 #include "../../shared/shared.h"
 #include "../../MeshPartitionx/MeshPartitionx.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 #undef __FUNCT__ 
 #define __FUNCT__ "CreateElementsNodesAndMaterialsThermal"
-void	CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle){
+void	CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
@@ -124,5 +124,5 @@
 
 	/*Width of elements: */
-	if(strcmp(model->meshtype,"2d")==0){
+	if(strcmp(iomodel->meshtype,"2d")==0){
 		throw ErrorException(__FUNCT__," 2d temperature computation not supported yet!");
 	}
@@ -132,13 +132,13 @@
 	#ifdef _PARALLEL_
 	/*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
-	ModelFetchData((void**)&model->elements2d,NULL,NULL,model_handle,"elements2d","Matrix","Mat");
-
-	MeshPartitionx(&epart, &npart,model->numberofelements,model->numberofnodes,model->elements, model->numberofelements2d,model->numberofnodes2d,model->elements2d,model->numlayers,elements_width, model->meshtype,num_procs);
+	IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+
+	MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofnodes,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofnodes2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->meshtype,num_procs);
 
 	/*Free elements and elements2d: */
-	xfree((void**)&model->elements2d);
+	xfree((void**)&iomodel->elements2d);
 
 	/*Used later on: */
-	my_grids=(int*)xcalloc(model->numberofnodes,sizeof(int));
+	my_grids=(int*)xcalloc(iomodel->numberofnodes,sizeof(int));
 	#endif
 
@@ -147,21 +147,21 @@
 
 	/*Fetch data needed: */
-	ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
-	ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-	ModelFetchData((void**)&model->surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
-	ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-	ModelFetchData((void**)&model->drag,NULL,NULL,model_handle,"drag","Matrix","Mat");
-	ModelFetchData((void**)&model->p,NULL,NULL,model_handle,"p","Matrix","Mat");
-	ModelFetchData((void**)&model->q,NULL,NULL,model_handle,"q","Matrix","Mat");
-	ModelFetchData((void**)&model->elementoniceshelf,NULL,NULL,model_handle,"elementoniceshelf","Matrix","Mat");
-	ModelFetchData((void**)&model->elementonbed,NULL,NULL,model_handle,"elementonbed","Matrix","Mat");
-	ModelFetchData((void**)&model->elementonsurface,NULL,NULL,model_handle,"elementonsurface","Matrix","Mat");
-	ModelFetchData((void**)&model->elements_type,NULL,NULL,model_handle,"elements_type","Matrix","Mat");
-	ModelFetchData((void**)&model->geothermalflux,NULL,NULL,model_handle,"geothermalflux","Matrix","Mat");
-	ModelFetchData((void**)&model->B,NULL,NULL,model_handle,"B","Matrix","Mat");
-	ModelFetchData((void**)&model->n,NULL,NULL,model_handle,"n","Matrix","Mat");
-	ModelFetchData((void**)&model->elementonwater,NULL,NULL,model_handle,"elementonwater","Matrix","Mat");
-	
-	for (i=0;i<model->numberofelements;i++){
+	IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->geothermalflux,NULL,NULL,iomodel_handle,"geothermalflux","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
+	
+	for (i=0;i<iomodel->numberofelements;i++){
 	#ifdef _PARALLEL_
 	/*We are using our element partition to decide which elements will be created on this node: */
@@ -173,33 +173,33 @@
 		penta_id=i+1; //matlab indexing.
 		penta_mid=i+1; //refers to the corresponding material property card
-		penta_mparid=model->numberofelements+1;//refers to the corresponding parmat property card
+		penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
 
 		/*vertices,thickness,surface,bed and drag: */
 		for(j=0;j<6;j++){
-			penta_g[j]=(int)*(model->elements+elements_width*i+j);
-			penta_h[j]=*(model->thickness+    ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_s[j]=*(model->surface+    ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_b[j]=*(model->bed+    ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_k[j]=*(model->drag+        ((int)*(model->elements+elements_width*i+j)-1)); 
-			penta_geothermalflux[j]=*(model->geothermalflux+        ((int)*(model->elements+elements_width*i+j)-1)); 
+			penta_g[j]=(int)*(iomodel->elements+elements_width*i+j);
+			penta_h[j]=*(iomodel->thickness+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_s[j]=*(iomodel->surface+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_b[j]=*(iomodel->bed+    ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_k[j]=*(iomodel->drag+        ((int)*(iomodel->elements+elements_width*i+j)-1)); 
+			penta_geothermalflux[j]=*(iomodel->geothermalflux+        ((int)*(iomodel->elements+elements_width*i+j)-1)); 
 		}
 
 		/*basal drag:*/
-		penta_friction_type=(int)model->drag_type;
-
-		penta_p=model->p[i];
-		penta_q=model->q[i];
+		penta_friction_type=(int)iomodel->drag_type;
+
+		penta_p=iomodel->p[i];
+		penta_q=iomodel->q[i];
 
 		/*diverse: */
-		penta_shelf=(int)*(model->elementoniceshelf+i);
-		penta_onbed=(int)*(model->elementonbed+i);
-		penta_onsurface=(int)*(model->elementonsurface+i);
-		penta_meanvel=model->meanvel;
-		penta_epsvel=model->epsvel;
-		penta_onwater=(bool)*(model->elementonwater+i);
-		penta_artdiff=model->artificial_diffusivity;
+		penta_shelf=(int)*(iomodel->elementoniceshelf+i);
+		penta_onbed=(int)*(iomodel->elementonbed+i);
+		penta_onsurface=(int)*(iomodel->elementonsurface+i);
+		penta_meanvel=iomodel->meanvel;
+		penta_epsvel=iomodel->epsvel;
+		penta_onwater=(bool)*(iomodel->elementonwater+i);
+		penta_artdiff=iomodel->artificial_diffusivity;
 
 		/*We need the field collapse for transient, so that we can use compute B with the average temperature*/
-		if (*(model->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base.
+		if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base.
 			penta_collapse=1;
 		}
@@ -224,9 +224,9 @@
 		B_avg=0;
 		for(j=0;j<6;j++){
-			B_avg+=*(model->B+((int)*(model->elements+elements_width*i+j)-1));
+			B_avg+=*(iomodel->B+((int)*(iomodel->elements+elements_width*i+j)-1));
 		}
 		B_avg=B_avg/6;
 		matice_B= B_avg;
-		matice_n=(double)*(model->n+i);
+		matice_n=(double)*(iomodel->n+i);
 
 		/*Create matice using its constructor:*/
@@ -241,10 +241,10 @@
 		 into the grid coordinates. If we start plugging 1 into my_grids for each index[n][i] (i=0:2), then my_grids 
 		 will hold which grids belong to this partition*/
-		my_grids[(int)*(model->elements+elements_width*i+0)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+1)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+2)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+3)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+4)-1]=1;
-		my_grids[(int)*(model->elements+elements_width*i+5)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+0)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+1)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+2)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+3)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+4)-1]=1;
+		my_grids[(int)*(iomodel->elements+elements_width*i+5)-1]=1;
 		#endif
 
@@ -256,32 +256,32 @@
 
 	/*Free data: */
-	xfree((void**)&model->elements);
-	xfree((void**)&model->thickness);
-	xfree((void**)&model->surface);
-	xfree((void**)&model->bed);
-	xfree((void**)&model->drag);
-	xfree((void**)&model->p);
-	xfree((void**)&model->q);
-	xfree((void**)&model->elementoniceshelf);
-	xfree((void**)&model->elementonbed);
-	xfree((void**)&model->elementonsurface);
-	xfree((void**)&model->elements_type);
-	xfree((void**)&model->geothermalflux);
-	xfree((void**)&model->n);
-	xfree((void**)&model->B);
-	xfree((void**)&model->elementonwater);
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->drag);
+	xfree((void**)&iomodel->p);
+	xfree((void**)&iomodel->q);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->elements_type);
+	xfree((void**)&iomodel->geothermalflux);
+	xfree((void**)&iomodel->n);
+	xfree((void**)&iomodel->B);
+	xfree((void**)&iomodel->elementonwater);
 
 	/*Add one constant material property to materials: */
-	matpar_mid=model->numberofelements+1; //put it at the end of the materials
-	matpar_g=model->g; 
-	matpar_rho_ice=model->rho_ice; 
-	matpar_rho_water=model->rho_water; 
-	matpar_thermalconductivity=model->thermalconductivity; 
-	matpar_heatcapacity=model->heatcapacity; 
-	matpar_latentheat=model->latentheat; 
-	matpar_beta=model->beta; 
-	matpar_meltingpoint=model->meltingpoint; 
-	matpar_mixed_layer_capacity=model->mixed_layer_capacity; 
-	matpar_thermal_exchange_velocity=model->thermal_exchange_velocity; 
+	matpar_mid=iomodel->numberofelements+1; //put it at the end of the materials
+	matpar_g=iomodel->g; 
+	matpar_rho_ice=iomodel->rho_ice; 
+	matpar_rho_water=iomodel->rho_water; 
+	matpar_thermalconductivity=iomodel->thermalconductivity; 
+	matpar_heatcapacity=iomodel->heatcapacity; 
+	matpar_latentheat=iomodel->latentheat; 
+	matpar_beta=iomodel->beta; 
+	matpar_meltingpoint=iomodel->meltingpoint; 
+	matpar_mixed_layer_capacity=iomodel->mixed_layer_capacity; 
+	matpar_thermal_exchange_velocity=iomodel->thermal_exchange_velocity; 
 
 	/*Create matpar object using its constructor: */
@@ -296,7 +296,7 @@
 		/*From the element partitioning, we can determine which grids are on the inside of this cpu's 
 		 *element partition, and which are on its border with other nodes:*/
-		gridborder=NewVec(model->numberofnodes);
-
-		for (i=0;i<model->numberofnodes;i++){
+		gridborder=NewVec(iomodel->numberofnodes);
+
+		for (i=0;i<iomodel->numberofnodes;i++){
 			if(my_grids[i])VecSetValue(gridborder,i,1,ADD_VALUES);
 		}
@@ -312,5 +312,5 @@
 		#ifdef _DEBUG_
 		if(my_rank==0){
-			for (i=0;i<model->numberofnodes;i++){
+			for (i=0;i<iomodel->numberofnodes;i++){
 				printf("Grid id %i Border grid %lf\n",i+1,my_bordergrids[i]);
 			}
@@ -320,25 +320,25 @@
 
 	/*Partition penalties in 3d: */
-	if(strcmp(model->meshtype,"3d")==0){
+	if(strcmp(iomodel->meshtype,"3d")==0){
 	
 		/*Get penalties: */
-		ModelFetchData((void**)&model->penalties,&model->numpenalties,NULL,model_handle,"penalties","Matrix","Mat");
-
-		if(model->numpenalties){
-
-			model->penaltypartitioning=(int*)xmalloc(model->numpenalties*sizeof(int));
+		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+
+		if(iomodel->numpenalties){
+
+			iomodel->penaltypartitioning=(int*)xmalloc(iomodel->numpenalties*sizeof(int));
 			#ifdef _SERIAL_
-			for(i=0;i<model->numpenalties;i++)model->penaltypartitioning[i]=1;
+			for(i=0;i<iomodel->numpenalties;i++)iomodel->penaltypartitioning[i]=1;
 			#else
-			for(i=0;i<model->numpenalties;i++)model->penaltypartitioning[i]=-1;
-
-			for(i=0;i<model->numpenalties;i++){
-				first_grid_index=(int)(*(model->penalties+i*model->numlayers+0)-1);
+			for(i=0;i<iomodel->numpenalties;i++)iomodel->penaltypartitioning[i]=-1;
+
+			for(i=0;i<iomodel->numpenalties;i++){
+				first_grid_index=(int)(*(iomodel->penalties+i*iomodel->numlayers+0)-1);
 				if((my_grids[first_grid_index]==1) && (my_bordergrids[first_grid_index]<=1.0) ) { //this grid belongs to this node's internal partition  grids
 					/*All grids that are being penalised belong to this node's internal grid partition.:*/
-					model->penaltypartitioning[i]=1;
+					iomodel->penaltypartitioning[i]=1;
 				}
 				if(my_bordergrids[first_grid_index]>1.0) { //this grid belongs to a partition border
-					model->penaltypartitioning[i]=0;
+					iomodel->penaltypartitioning[i]=0;
 				}
 			}
@@ -347,5 +347,5 @@
 
 		/*Free penalties: */
-		xfree((void**)&model->penalties);
+		xfree((void**)&iomodel->penalties);
 	}
 
@@ -358,22 +358,22 @@
 		
 	/*First fetch data: */
-	if (strcmp(model->meshtype,"3d")==0){
-		ModelFetchData((void**)&model->deadgrids,NULL,NULL,model_handle,"deadgrids","Matrix","Mat");
-		ModelFetchData((void**)&model->uppernodes,NULL,NULL,model_handle,"uppergrids","Matrix","Mat");
+	if (strcmp(iomodel->meshtype,"3d")==0){
+		IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
 	}
-	ModelFetchData((void**)&model->x,NULL,NULL,model_handle,"x","Matrix","Mat");
-	ModelFetchData((void**)&model->y,NULL,NULL,model_handle,"y","Matrix","Mat");
-	ModelFetchData((void**)&model->z,NULL,NULL,model_handle,"z","Matrix","Mat");
-	ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
-	ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonbed,NULL,NULL,model_handle,"gridonbed","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonsurface,NULL,NULL,model_handle,"gridonsurface","Matrix","Mat");
-	ModelFetchData((void**)&model->gridonicesheet,NULL,NULL,model_handle,"gridonicesheet","Matrix","Mat");
-	ModelFetchData((void**)&model->gridoniceshelf,NULL,NULL,model_handle,"gridoniceshelf","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
 
 	/*Get number of dofs per node: */
-	DistributeNumDofs(&node_numdofs,model->analysis_type,model->sub_analysis_type);
-
-	for (i=0;i<model->numberofnodes;i++){
+	DistributeNumDofs(&node_numdofs,iomodel->analysis_type,iomodel->sub_analysis_type);
+
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
@@ -394,20 +394,20 @@
 		#endif
 
-		node_x[0]=model->x[i];
-		node_x[1]=model->y[i];
-		node_x[2]=model->z[i];
-		node_sigma=(model->z[i]-model->bed[i])/(model->thickness[i]);
-		
-		node_onbed=(int)model->gridonbed[i];
-		node_onsurface=(int)model->gridonsurface[i];	
-		node_onshelf=(int)model->gridoniceshelf[i];	
-		node_onsheet=(int)model->gridonicesheet[i];	
-
-		if (strcmp(model->meshtype,"3d")==0){
-			if (isnan(model->uppernodes[i])){
+		node_x[0]=iomodel->x[i];
+		node_x[1]=iomodel->y[i];
+		node_x[2]=iomodel->z[i];
+		node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]);
+		
+		node_onbed=(int)iomodel->gridonbed[i];
+		node_onsurface=(int)iomodel->gridonsurface[i];	
+		node_onshelf=(int)iomodel->gridoniceshelf[i];	
+		node_onsheet=(int)iomodel->gridonicesheet[i];	
+
+		if (strcmp(iomodel->meshtype,"3d")==0){
+			if (isnan(iomodel->uppernodes[i])){
 				node_upper_node_id=node_id;  //nodes on surface do not have upper nodes, only themselves.
 			}
 			else{
-				node_upper_node_id=(int)model->uppernodes[i];
+				node_upper_node_id=(int)iomodel->uppernodes[i];
 			}
 		}
@@ -435,15 +435,15 @@
 
 	/*Clean fetched data: */
-	xfree((void**)&model->deadgrids);
-	xfree((void**)&model->x);
-	xfree((void**)&model->y);
-	xfree((void**)&model->z);
-	xfree((void**)&model->thickness);
-	xfree((void**)&model->bed);
-	xfree((void**)&model->gridonbed);
-	xfree((void**)&model->gridonsurface);
-	xfree((void**)&model->uppernodes);
-	xfree((void**)&model->gridonicesheet);
-	xfree((void**)&model->gridoniceshelf);
+	xfree((void**)&iomodel->deadgrids);
+	xfree((void**)&iomodel->x);
+	xfree((void**)&iomodel->y);
+	xfree((void**)&iomodel->z);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->gridonbed);
+	xfree((void**)&iomodel->gridonsurface);
+	xfree((void**)&iomodel->uppernodes);
+	xfree((void**)&iomodel->gridonicesheet);
+	xfree((void**)&iomodel->gridoniceshelf);
 	
 	cleanup_and_return:
@@ -454,8 +454,8 @@
 	*pmaterials=materials;
 
-	/*Keep partitioning information into model*/
-	model->epart=epart;
-	model->my_grids=my_grids;
-	model->my_bordergrids=my_bordergrids;
+	/*Keep partitioning information into iomodel*/
+	iomodel->epart=epart;
+	iomodel->my_grids=my_grids;
+	iomodel->my_bordergrids=my_bordergrids;
 
 	/*Free ressources:*/
Index: /issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 1834)
@@ -11,8 +11,8 @@
 #include "../../shared/shared.h"
 #include "../../include/macros.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateLoadsThermal(DataSet** ploads, Model* model,ConstDataHandle model_handle){
+void	CreateLoadsThermal(DataSet** ploads, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	int i,j,counter;
@@ -47,19 +47,19 @@
 
 	//create penalties for grids: no grid can have a temperature over the melting point
-	ModelFetchData((void**)&model->spctemperature,NULL,NULL,model_handle,"spctemperature","Matrix","Mat");
+	IoModelFetchData((void**)&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature","Matrix","Mat");
 
-	for (i=0;i<model->numberofnodes;i++){
+	for (i=0;i<iomodel->numberofnodes;i++){
 	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
-	if((model->my_grids[i]==1)){
+	if((iomodel->my_grids[i]==1)){
 	#endif
 
-		if (!model->spctemperature[2*i]){ //No penalty applied on spc grids!
+		if (!iomodel->spctemperature[2*i]){ //No penalty applied on spc grids!
 		
 			pengrid_id=count+1; //matlab indexing
 			pengrid_node_id=i+1;
-			pengrid_mparid=model->numberofelements+1;//refers to the corresponding parmat property card
+			pengrid_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
 			pengrid_dof=1;
-			pengrid_penalty_offset=model->penalty_offset;
+			pengrid_penalty_offset=iomodel->penalty_offset;
 			pengrid_active=0;
 			
@@ -70,8 +70,8 @@
 		}
 	#ifdef _PARALLEL_
-	} //if((model->my_grids[i]==1))
+	} //if((iomodel->my_grids[i]==1))
 	#endif
 	}
-	xfree((void**)&model->spctemperature);
+	xfree((void**)&iomodel->spctemperature);
 
 	/*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 
Index: /issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp	(revision 1833)
+++ /issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp	(revision 1834)
@@ -11,7 +11,7 @@
 #include "../../objects/objects.h"
 #include "../../shared/shared.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
-void CreateParametersThermal(DataSet** pparameters,Model* model,ConstDataHandle model_handle){
+void CreateParametersThermal(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
 	
 	Param*   param = NULL;
@@ -33,17 +33,17 @@
 
 	/*Get vx vy and vz: */
-	ModelFetchData((void**)&vx,NULL,NULL,model_handle,"vx","Matrix","Mat");
-	ModelFetchData((void**)&vy,NULL,NULL,model_handle,"vy","Matrix","Mat");
-	ModelFetchData((void**)&vz,NULL,NULL,model_handle,"vz","Matrix","Mat");
+	IoModelFetchData((void**)&vx,NULL,NULL,iomodel_handle,"vx","Matrix","Mat");
+	IoModelFetchData((void**)&vy,NULL,NULL,iomodel_handle,"vy","Matrix","Mat");
+	IoModelFetchData((void**)&vz,NULL,NULL,iomodel_handle,"vz","Matrix","Mat");
 
-	u_g=(double*)xcalloc(model->numberofnodes*3,sizeof(double));
+	u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double));
 
-	if(vx) for(i=0;i<model->numberofnodes;i++)u_g[3*i+0]=vx[i]/model->yts;
-	if(vy) for(i=0;i<model->numberofnodes;i++)u_g[3*i+1]=vy[i]/model->yts;
-	if(vz) for(i=0;i<model->numberofnodes;i++)u_g[3*i+2]=vz[i]/model->yts;
+	if(vx) for(i=0;i<iomodel->numberofnodes;i++)u_g[3*i+0]=vx[i]/iomodel->yts;
+	if(vy) for(i=0;i<iomodel->numberofnodes;i++)u_g[3*i+1]=vy[i]/iomodel->yts;
+	if(vz) for(i=0;i<iomodel->numberofnodes;i++)u_g[3*i+2]=vz[i]/iomodel->yts;
 
 	count++;
 	param= new Param(count,"u_g",DOUBLEVEC);
-	param->SetDoubleVec(u_g,3*model->numberofnodes,3);
+	param->SetDoubleVec(u_g,3*iomodel->numberofnodes,3);
 	parameters->AddObject(param);
 
@@ -54,9 +54,9 @@
 	
 	/*Get pressure: */
-	ModelFetchData((void**)&pressure,NULL,NULL,model_handle,"pressure","Matrix","Mat");
+	IoModelFetchData((void**)&pressure,NULL,NULL,iomodel_handle,"pressure","Matrix","Mat");
 	
 	count++;
 	param= new Param(count,"p_g",DOUBLEVEC);
-	if(pressure) param->SetDoubleVec(pressure,model->numberofnodes,1);
+	if(pressure) param->SetDoubleVec(pressure,iomodel->numberofnodes,1);
 	else param->SetDoubleVec(pressure,0,0);
 	parameters->AddObject(param);
@@ -66,12 +66,12 @@
 
 	/* get initial temperature and melting if transient*/
-	if(model->sub_analysis_type==TransientAnalysisEnum()){
+	if(iomodel->sub_analysis_type==TransientAnalysisEnum()){
 
 		/*Get melting and temperature: */
-		ModelFetchData((void**)&temperature,NULL,NULL,model_handle,"temperature","Matrix","Mat");
+		IoModelFetchData((void**)&temperature,NULL,NULL,iomodel_handle,"temperature","Matrix","Mat");
 
 		count++;
 		param= new Param(count,"t_g",DOUBLEVEC);
-		if(temperature) param->SetDoubleVec(temperature,model->numberofnodes,1);
+		if(temperature) param->SetDoubleVec(temperature,iomodel->numberofnodes,1);
 		else throw ErrorException(__FUNCT__,exprintf("Missing initial temperature"));
 		parameters->AddObject(param);
