Index: /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateConstraintsSlopeCompute.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateConstraintsSlopeCompute.cpp	(revision 1832)
+++ /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateConstraintsSlopeCompute.cpp	(revision 1833)
@@ -11,8 +11,8 @@
 #include "../../objects/objects.h"
 #include "../../shared/shared.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateConstraintsSlopeCompute(DataSet** pconstraints, Model* model,ConstDataHandle model_handle){
+void	CreateConstraintsSlopeCompute(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
@@ -23,5 +23,5 @@
 
 	/*Now, is the flag isstokes on? otherwise, do nothing: */
-	if (!model->isstokes)goto cleanup_and_return;
+	if (!iomodel->isstokes)goto cleanup_and_return;
 	
 	cleanup_and_return:	
Index: /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp	(revision 1832)
+++ /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp	(revision 1833)
@@ -12,8 +12,8 @@
 #include "../../shared/shared.h"
 #include "../../MeshPartitionx/MeshPartitionx.h"
-#include "../Model.h"
-
-
-void	CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle){
+#include "../IoModel.h"
+
+
+void	CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 
@@ -124,8 +124,8 @@
 
 	/*Now, is the flag isstokes on? otherwise, do nothing: */
-	if (!model->isstokes & !model->ishutter)goto cleanup_and_return;
+	if (!iomodel->isstokes & !iomodel->ishutter)goto cleanup_and_return;
 
 	/*Width of elements: */
-	if(strcmp(model->meshtype,"2d")==0){
+	if(strcmp(iomodel->meshtype,"2d")==0){
 		elements_width=3; //tria elements
 	}
@@ -136,23 +136,23 @@
 	#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
 
@@ -162,13 +162,13 @@
 
 	/*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->surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
-		ModelFetchData((void**)&model->elementonwater,NULL,NULL,model_handle,"elementonwater","Matrix","Mat");
-		ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
-		
-		for (i=0;i<model->numberofelements;i++){
+		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+		
+		for (i=0;i<iomodel->numberofelements;i++){
 
 		#ifdef _PARALLEL_
@@ -184,19 +184,19 @@
 
 			/*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);
 
 			/*surface and bed:*/
-			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_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 water? : */
-			tria_onwater=(bool)*(model->elementonwater+i);
+			tria_onwater=(bool)*(iomodel->elementonwater+i);
 
 			/*Create tria element using its constructor:*/
@@ -211,7 +211,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
 
@@ -224,8 +224,8 @@
 	
 		/*Free data : */
-		xfree((void**)&model->elements);
-		xfree((void**)&model->surface);
-		xfree((void**)&model->bed);
-		xfree((void**)&model->elementonwater);
+		xfree((void**)&iomodel->elements);
+		xfree((void**)&iomodel->surface);
+		xfree((void**)&iomodel->bed);
+		xfree((void**)&iomodel->elementonwater);
 
 	}
@@ -233,11 +233,11 @@
 
 		/*Fetch data needed: */
-		ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","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->elementonbed,NULL,NULL,model_handle,"elementonbed","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->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+		IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","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: */
@@ -254,12 +254,12 @@
 			/*vertices,thickness,surface,bed and drag: */
 			for(j=0;j<6;j++){
-				penta_g[j]=(int)*(model->elements+elements_width*i+j);
-				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_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_onbed=(int)*(model->elementonbed+i);
-			penta_onwater=(bool)*(model->elementonwater+i);
+			penta_onbed=(int)*(iomodel->elementonbed+i);
+			penta_onwater=(bool)*(iomodel->elementonwater+i);
 
 			/*Create Penta using its constructor:*/
@@ -278,10 +278,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
 
@@ -293,9 +293,9 @@
 
 		/*Free data: */
-		xfree((void**)&model->elements);
-		xfree((void**)&model->surface);
-		xfree((void**)&model->bed);
-		xfree((void**)&model->elementonbed);
-		xfree((void**)&model->elementonwater);
+		xfree((void**)&iomodel->elements);
+		xfree((void**)&iomodel->surface);
+		xfree((void**)&iomodel->bed);
+		xfree((void**)&iomodel->elementonbed);
+		xfree((void**)&iomodel->elementonwater);
 
 	} //if (strcmp(meshtype,"2d")==0)
@@ -304,7 +304,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);
 		}
@@ -320,5 +320,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]);
 			}
@@ -328,25 +328,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;
 				}
 			}
@@ -355,5 +355,5 @@
 
 		/*Free penalties: */
-		xfree((void**)&model->penalties);
+		xfree((void**)&iomodel->penalties);
 	}
 
@@ -366,23 +366,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:*/
@@ -405,20 +405,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];
 			}
 		}
@@ -432,7 +432,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]==0){
+			if (iomodel->gridonbed[i]==0){
 				for(k=1;k<=node_numdofs;k++){
 					node->FreezeDof(k);
@@ -455,21 +455,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/SlopeCompute/CreateLoadsSlopeCompute.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateLoadsSlopeCompute.cpp	(revision 1832)
+++ /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateLoadsSlopeCompute.cpp	(revision 1833)
@@ -11,8 +11,8 @@
 #include "../../shared/shared.h"
 #include "../../include/macros.h"
-#include "../Model.h"
+#include "../IoModel.h"
 
 
-void	CreateLoadsSlopeCompute(DataSet** ploads, Model* model,ConstDataHandle model_handle){
+void	CreateLoadsSlopeCompute(DataSet** ploads, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	DataSet*    loads    = NULL;
@@ -22,5 +22,5 @@
 
 	/*Now, is the flag isstokes on? otherwise, do nothing: */
-	if (!model->isstokes)goto cleanup_and_return;
+	if (!iomodel->isstokes)goto cleanup_and_return;
 
 	cleanup_and_return:
