Index: /issm/trunk/src/c/ModelProcessorx/CreateDataSets.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/CreateDataSets.cpp	(revision 1837)
+++ /issm/trunk/src/c/ModelProcessorx/CreateDataSets.cpp	(revision 1838)
@@ -1,4 +1,4 @@
 /*!\file: CreateDataSets
- * \brief general driver for creating all datasets that make a finite element model
+ * \brief general driver for creating all datasets that make a finite element iomodel
  */ 
 
@@ -12,117 +12,117 @@
 #define __FUNCT__ "CreateElementsNodesAndMaterials"
 
-#include "./Model.h"
+#include "./IoModel.h"
 #include "../shared/shared.h"
 #include "../EnumDefinitions/EnumDefinitions.h"
 
 
-void CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,DataSet** pparameters,Model* model,ConstDataHandle model_handle){
+void CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
+
 
 	/*create parameters common to all solutions: */
-	CreateParameters(pparameters,model,model_handle);
-	CreateParametersQmu(pparameters,model,model_handle);
+	CreateParameters(pparameters,iomodel,iomodel_handle);
+	CreateParametersQmu(pparameters,iomodel,iomodel_handle);
 
 	/*This is just a high level driver: */
-	if (model->analysis_type==ControlAnalysisEnum()){
+	if (iomodel->analysis_type==ControlAnalysisEnum()){
 
-		if (model->sub_analysis_type==HorizAnalysisEnum()){
+		if (iomodel->sub_analysis_type==HorizAnalysisEnum()){
 
-			CreateElementsNodesAndMaterialsDiagnosticHoriz(pelements,pnodes,pmaterials, model,model_handle);
-			CreateConstraintsDiagnosticHoriz(pconstraints,model,model_handle);
-			CreateLoadsDiagnosticHoriz(ploads,model,model_handle);
-			CreateParametersControl(pparameters,model,model_handle);
+			CreateElementsNodesAndMaterialsDiagnosticHoriz(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+			CreateConstraintsDiagnosticHoriz(pconstraints,iomodel,iomodel_handle);
+			CreateLoadsDiagnosticHoriz(ploads,iomodel,iomodel_handle);
+			CreateParametersControl(pparameters,iomodel,iomodel_handle);
 
 		}
-		else if (model->sub_analysis_type==VertAnalysisEnum()){
+		else if (iomodel->sub_analysis_type==VertAnalysisEnum()){
 
-			CreateElementsNodesAndMaterialsDiagnosticVert(pelements,pnodes,pmaterials, model,model_handle);
-			CreateConstraintsDiagnosticVert(pconstraints,model,model_handle);
-			CreateLoadsDiagnosticVert(ploads,model,model_handle);
+			CreateElementsNodesAndMaterialsDiagnosticVert(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+			CreateConstraintsDiagnosticVert(pconstraints,iomodel,iomodel_handle);
+			CreateLoadsDiagnosticVert(ploads,iomodel,iomodel_handle);
 
 		}
-		else if (model->sub_analysis_type==StokesAnalysisEnum()){
+		else if (iomodel->sub_analysis_type==StokesAnalysisEnum()){
 
-			CreateElementsNodesAndMaterialsDiagnosticStokes(pelements,pnodes,pmaterials, model,model_handle);
-			CreateConstraintsDiagnosticStokes(pconstraints,model,model_handle);
-			CreateLoadsDiagnosticStokes(ploads,model,model_handle);
-			CreateParametersControl(pparameters,model,model_handle);
+			CreateElementsNodesAndMaterialsDiagnosticStokes(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+			CreateConstraintsDiagnosticStokes(pconstraints,iomodel,iomodel_handle);
+			CreateLoadsDiagnosticStokes(ploads,iomodel,iomodel_handle);
+			CreateParametersControl(pparameters,iomodel,iomodel_handle);
 
 		}
-		else if (model->sub_analysis_type==HutterAnalysisEnum()){
+		else if (iomodel->sub_analysis_type==HutterAnalysisEnum()){
 
-			CreateElementsNodesAndMaterialsDiagnosticHutter(pelements,pnodes,pmaterials, model,model_handle);
-			CreateConstraintsDiagnosticHutter(pconstraints,model,model_handle);
-			CreateLoadsDiagnosticHutter(ploads,model,model_handle);
-			CreateParametersControl(pparameters,model,model_handle);
+			CreateElementsNodesAndMaterialsDiagnosticHutter(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+			CreateConstraintsDiagnosticHutter(pconstraints,iomodel,iomodel_handle);
+			CreateLoadsDiagnosticHutter(ploads,iomodel,iomodel_handle);
+			CreateParametersControl(pparameters,iomodel,iomodel_handle);
 
 		}
 
 	}
-	else if (model->analysis_type==DiagnosticAnalysisEnum()){
+	else if (iomodel->analysis_type==DiagnosticAnalysisEnum()){
 
-		if (model->sub_analysis_type==HorizAnalysisEnum()){
+		if (iomodel->sub_analysis_type==HorizAnalysisEnum()){
 			
-			CreateElementsNodesAndMaterialsDiagnosticHoriz(pelements,pnodes,pmaterials, model,model_handle);
-			CreateConstraintsDiagnosticHoriz(pconstraints,model,model_handle);
-			CreateLoadsDiagnosticHoriz(ploads,model,model_handle);
-			CreateParametersDiagnosticHoriz(pparameters,model,model_handle);
+			CreateElementsNodesAndMaterialsDiagnosticHoriz(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+			CreateConstraintsDiagnosticHoriz(pconstraints,iomodel,iomodel_handle);
+			CreateLoadsDiagnosticHoriz(ploads,iomodel,iomodel_handle);
+			CreateParametersDiagnosticHoriz(pparameters,iomodel,iomodel_handle);
 				
 		}
-		else if (model->sub_analysis_type==VertAnalysisEnum()){
+		else if (iomodel->sub_analysis_type==VertAnalysisEnum()){
 		
-			CreateElementsNodesAndMaterialsDiagnosticVert(pelements,pnodes,pmaterials, model,model_handle);
-			CreateConstraintsDiagnosticVert(pconstraints,model,model_handle);
-			CreateLoadsDiagnosticVert(ploads,model,model_handle);
+			CreateElementsNodesAndMaterialsDiagnosticVert(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+			CreateConstraintsDiagnosticVert(pconstraints,iomodel,iomodel_handle);
+			CreateLoadsDiagnosticVert(ploads,iomodel,iomodel_handle);
 			
 		}
-		else if (model->sub_analysis_type==StokesAnalysisEnum()){
+		else if (iomodel->sub_analysis_type==StokesAnalysisEnum()){
 
-			CreateElementsNodesAndMaterialsDiagnosticStokes(pelements,pnodes,pmaterials, model,model_handle);
-			CreateConstraintsDiagnosticStokes(pconstraints,model,model_handle);
-			CreateLoadsDiagnosticStokes(ploads,model,model_handle);
+			CreateElementsNodesAndMaterialsDiagnosticStokes(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+			CreateConstraintsDiagnosticStokes(pconstraints,iomodel,iomodel_handle);
+			CreateLoadsDiagnosticStokes(ploads,iomodel,iomodel_handle);
 			
 		}
-		else if (model->sub_analysis_type==HutterAnalysisEnum()){
+		else if (iomodel->sub_analysis_type==HutterAnalysisEnum()){
 
-			CreateElementsNodesAndMaterialsDiagnosticHutter(pelements,pnodes,pmaterials, model,model_handle);
-			CreateConstraintsDiagnosticHutter(pconstraints,model,model_handle);
-			CreateLoadsDiagnosticHutter(ploads,model,model_handle);
+			CreateElementsNodesAndMaterialsDiagnosticHutter(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+			CreateConstraintsDiagnosticHutter(pconstraints,iomodel,iomodel_handle);
+			CreateLoadsDiagnosticHutter(ploads,iomodel,iomodel_handle);
 			
 		}
 	}
-	else if (model->analysis_type==SlopeComputeAnalysisEnum()){
+	else if (iomodel->analysis_type==SlopeComputeAnalysisEnum()){
 
-		CreateElementsNodesAndMaterialsSlopeCompute(pelements,pnodes,pmaterials, model,model_handle);
-		CreateConstraintsSlopeCompute(pconstraints,model,model_handle);
-		CreateLoadsSlopeCompute(ploads,model,model_handle);
+		CreateElementsNodesAndMaterialsSlopeCompute(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+		CreateConstraintsSlopeCompute(pconstraints,iomodel,iomodel_handle);
+		CreateLoadsSlopeCompute(ploads,iomodel,iomodel_handle);
 	
 	}
-	else if (model->analysis_type==ThermalAnalysisEnum()){
+	else if (iomodel->analysis_type==ThermalAnalysisEnum()){
 
-		CreateElementsNodesAndMaterialsThermal(pelements,pnodes,pmaterials, model,model_handle);
-		CreateConstraintsThermal(pconstraints,model,model_handle);
-		CreateLoadsThermal(ploads,model,model_handle);
-		CreateParametersThermal(pparameters,model,model_handle);
+		CreateElementsNodesAndMaterialsThermal(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+		CreateConstraintsThermal(pconstraints,iomodel,iomodel_handle);
+		CreateLoadsThermal(ploads,iomodel,iomodel_handle);
+		CreateParametersThermal(pparameters,iomodel,iomodel_handle);
 					
 	}
-	else if (model->analysis_type==MeltingAnalysisEnum()){
+	else if (iomodel->analysis_type==MeltingAnalysisEnum()){
 			
-		CreateElementsNodesAndMaterialsMelting(pelements,pnodes,pmaterials, model,model_handle);
-		CreateConstraintsMelting(pconstraints,model,model_handle);
-		CreateLoadsMelting(ploads,model,model_handle);
-		CreateParametersMelting(pparameters,model,model_handle);
+		CreateElementsNodesAndMaterialsMelting(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+		CreateConstraintsMelting(pconstraints,iomodel,iomodel_handle);
+		CreateLoadsMelting(ploads,iomodel,iomodel_handle);
+		CreateParametersMelting(pparameters,iomodel,iomodel_handle);
 	}
-	else if (model->analysis_type==PrognosticAnalysisEnum()){
+	else if (iomodel->analysis_type==PrognosticAnalysisEnum()){
 
-		CreateElementsNodesAndMaterialsPrognostic(pelements,pnodes,pmaterials, model,model_handle);
-		CreateConstraintsPrognostic(pconstraints,model,model_handle);
-		CreateLoadsPrognostic(ploads,model,model_handle);
-		CreateParametersPrognostic(pparameters,model,model_handle);
+		CreateElementsNodesAndMaterialsPrognostic(pelements,pnodes,pmaterials, iomodel,iomodel_handle);
+		CreateConstraintsPrognostic(pconstraints,iomodel,iomodel_handle);
+		CreateLoadsPrognostic(ploads,iomodel,iomodel_handle);
+		CreateParametersPrognostic(pparameters,iomodel,iomodel_handle);
 					
 	}
 	else{
-		throw ErrorException(__FUNCT__,exprintf("%s%i%s%i%s"," analysis_type: ",model->analysis_type," sub_analysis_type: ",model->sub_analysis_type," not supported yet!"));
+		throw ErrorException(__FUNCT__,exprintf("%s%i%s%i%s"," analysis_type: ",iomodel->analysis_type," sub_analysis_type: ",iomodel->sub_analysis_type," not supported yet!"));
 	}
-
 			
 }
Index: /issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp	(revision 1837)
+++ /issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp	(revision 1838)
@@ -12,7 +12,7 @@
 #include "../shared/shared.h"
 #include "../MeshPartitionx/MeshPartitionx.h"
-#include "./Model.h"
-
-void CreateParameters(DataSet** pparameters,Model* model,ConstDataHandle model_handle){
+#include "./IoModel.h"
+
+void CreateParameters(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
 	
 	int i;
@@ -31,14 +31,14 @@
 	count++;
 	param= new Param(count,"analysis_type",INTEGER);
-	param->SetInteger(model->analysis_type);
+	param->SetInteger(iomodel->analysis_type);
 	parameters->AddObject(param);
 
 	count++;
 	param= new Param(count,"sub_analysis_type",INTEGER);
-	param->SetInteger(model->sub_analysis_type);
+	param->SetInteger(iomodel->sub_analysis_type);
 	parameters->AddObject(param);
 
 	//dimension 2d or 3d:
-	if (strcmp(model->meshtype,"2d")==0)dim=2;
+	if (strcmp(iomodel->meshtype,"2d")==0)dim=2;
 	else dim=3;
 
@@ -51,10 +51,10 @@
 	count++;
 	param= new Param(count,"ishutter",INTEGER);
-	param->SetInteger(model->ishutter);
+	param->SetInteger(iomodel->ishutter);
 	parameters->AddObject(param);
 
 	count++;
 	param= new Param(count,"ismacayealpattyn",INTEGER);
-	param->SetInteger(model->ismacayealpattyn);
+	param->SetInteger(iomodel->ismacayealpattyn);
 	parameters->AddObject(param);
 
@@ -62,10 +62,16 @@
 	count++;
 	param= new Param(count,"isstokes",INTEGER);
-	param->SetInteger(model->isstokes);
+	param->SetInteger(iomodel->isstokes);
+	parameters->AddObject(param);
+
+	//control: thermal static
+	count++;
+	param= new Param(count,"thermalstatic",INTEGER);
+	param->SetInteger(iomodel->thermalstatic);
 	parameters->AddObject(param);
 
 	/*debug: */
 	param= new Param(count,"debug",INTEGER);
-	param->SetInteger(model->debug);
+	param->SetInteger(iomodel->debug);
 	parameters->AddObject(param);
 
@@ -73,5 +79,5 @@
 	count++;
 	param= new Param(count,"eps_res",DOUBLE);
-	param->SetDouble(model->eps_res);
+	param->SetDouble(iomodel->eps_res);
 	parameters->AddObject(param);
 
@@ -79,5 +85,5 @@
 	count++;
 	param= new Param(count,"eps_rel",DOUBLE);
-	param->SetDouble(model->eps_rel);
+	param->SetDouble(iomodel->eps_rel);
 	parameters->AddObject(param);
 
@@ -85,5 +91,5 @@
 	count++;
 	param= new Param(count,"eps_abs",DOUBLE);
-	param->SetDouble(model->eps_abs);
+	param->SetDouble(iomodel->eps_abs);
 	parameters->AddObject(param);
 
@@ -91,5 +97,5 @@
 	count++;
 	param= new Param(count,"yts",DOUBLE);
-	param->SetDouble(model->yts);
+	param->SetDouble(iomodel->yts);
 	parameters->AddObject(param);
 
@@ -97,5 +103,5 @@
 	count++;
 	param= new Param(count,"dt",DOUBLE);
-	param->SetDouble(model->dt);
+	param->SetDouble(iomodel->dt);
 	parameters->AddObject(param);
 
@@ -103,5 +109,5 @@
 	count++;
 	param= new Param(count,"ndt",DOUBLE);
-	param->SetDouble(model->ndt);
+	param->SetDouble(iomodel->ndt);
 	parameters->AddObject(param);
 
@@ -109,5 +115,5 @@
 	count++;
 	param= new Param(count,"penalty_offset",DOUBLE);
-	param->SetDouble(model->penalty_offset);
+	param->SetDouble(iomodel->penalty_offset);
 	parameters->AddObject(param);
 
@@ -115,5 +121,5 @@
 	count++;
 	param= new Param(count,"sparsity",DOUBLE);
-	param->SetDouble(model->sparsity);
+	param->SetDouble(iomodel->sparsity);
 	parameters->AddObject(param);
 
@@ -121,5 +127,5 @@
 	count++;
 	param= new Param(count,"lowmem",INTEGER);
-	param->SetInteger(model->lowmem);
+	param->SetInteger(iomodel->lowmem);
 	parameters->AddObject(param);
 
@@ -127,5 +133,5 @@
 	count++;
 	param= new Param(count,"connectivity",INTEGER);
-	param->SetInteger(model->connectivity);
+	param->SetInteger(iomodel->connectivity);
 	parameters->AddObject(param);
 
@@ -133,5 +139,5 @@
 	count++;
 	param= new Param(count,"beta",DOUBLE);
-	param->SetDouble(model->beta);
+	param->SetDouble(iomodel->beta);
 	parameters->AddObject(param);
 
@@ -139,5 +145,5 @@
 	count++;
 	param= new Param(count,"meltingpoint",DOUBLE);
-	param->SetDouble(model->meltingpoint);
+	param->SetDouble(iomodel->meltingpoint);
 	parameters->AddObject(param);
 
@@ -145,5 +151,5 @@
 	count++;
 	param= new Param(count,"latentheat",DOUBLE);
-	param->SetDouble(model->latentheat);
+	param->SetDouble(iomodel->latentheat);
 	parameters->AddObject(param);
 
@@ -151,5 +157,5 @@
 	count++;
 	param= new Param(count,"heatcapacity",DOUBLE);
-	param->SetDouble(model->heatcapacity);
+	param->SetDouble(iomodel->heatcapacity);
 	parameters->AddObject(param);
 
@@ -157,5 +163,5 @@
 	count++;
 	param= new Param(count,"penalty_melting",DOUBLE);
-	param->SetDouble(model->penalty_melting);
+	param->SetDouble(iomodel->penalty_melting);
 	parameters->AddObject(param);
 
@@ -163,5 +169,5 @@
 	count++;
 	param= new Param(count,"min_thermal_constraints",INTEGER);
-	param->SetInteger(model->min_thermal_constraints);
+	param->SetInteger(iomodel->min_thermal_constraints);
 	parameters->AddObject(param);
 
@@ -169,5 +175,5 @@
 	count++;
 	param= new Param(count,"stokesreconditioning",DOUBLE);
-	param->SetDouble(model->stokesreconditioning);
+	param->SetDouble(iomodel->stokesreconditioning);
 	parameters->AddObject(param);
 
@@ -175,5 +181,5 @@
 	count++;
 	param= new Param(count,"waitonlock",INTEGER);
-	param->SetInteger(model->waitonlock);
+	param->SetInteger(iomodel->waitonlock);
 	parameters->AddObject(param);
 
@@ -181,5 +187,5 @@
 	count++;
 	param= new Param(count,"solverstring",STRING);
-	param->SetString(model->solverstring);
+	param->SetString(iomodel->solverstring);
 	parameters->AddObject(param);
 
@@ -187,5 +193,5 @@
 	count++;
 	param= new Param(count,"plot",INTEGER);
-	param->SetInteger(model->plot);
+	param->SetInteger(iomodel->plot);
 	parameters->AddObject(param);
 
@@ -193,15 +199,15 @@
 	count++;
 	param= new Param(count,"numberofnodes",INTEGER);
-	param->SetInteger(model->numberofnodes);
+	param->SetInteger(iomodel->numberofnodes);
 	parameters->AddObject(param);
 
 	/*Deal with numberofdofspernode: */
-	DistributeNumDofs(&numberofdofspernode,model->analysis_type,model->sub_analysis_type);
+	DistributeNumDofs(&numberofdofspernode,iomodel->analysis_type,iomodel->sub_analysis_type);
 
 	count++;
 	param= new Param(count,"numberofdofspernode",INTEGER);
 	param->SetInteger(numberofdofspernode);
-	parameters->AddObject(param);
-
+	parameters->AddObject(param)
+		;
 	/*numrifts: */
 	ModelFetchData((void**)&model->riftinfo,&model->numrifts,NULL,model_handle,"riftinfo","Matrix","Mat");
Index: /issm/trunk/src/c/ModelProcessorx/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/IoModel.cpp	(revision 1838)
+++ /issm/trunk/src/c/ModelProcessorx/IoModel.cpp	(revision 1838)
@@ -0,0 +1,393 @@
+/*! \file IoModel.cpp
+ * \brief  IoModel structure that mirrors the matlab workspace structure. Servers for the serial 
+ * and parallel runs.
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../shared/shared.h"
+#include "../io/io.h"
+#include "../include/globals.h"
+#include "../include/macros.h"
+
+#include <string.h>
+#include "stdio.h"
+
+#include "./IoModel.h"
+
+
+/*!--------------------------------------------------
+	NewIoModel
+  --------------------------------------------------*/
+
+IoModel* NewIoModel(void) {
+	/*! create a new IoModel object */
+	IoModel* iomodel=NULL;
+
+	iomodel=(IoModel*)xmalloc(sizeof(IoModel));
+
+	/*!initialize all pointers to 0: */
+	iomodel->name=NULL;
+	iomodel->repository=NULL;
+	iomodel->meshtype=NULL;
+	iomodel->analysis_type=0;
+	iomodel->sub_analysis_type=0;
+	iomodel->qmu_analysis=0;
+	iomodel->solverstring=NULL;
+	iomodel->numberofresponses=0;
+	iomodel->numberofvariables=0;
+	iomodel->qmu_npart=0; 
+	iomodel->numberofelements=0;
+	iomodel->numberofnodes=0;
+	iomodel->x=NULL; 
+	iomodel->y=NULL;
+	iomodel->z=NULL;
+	iomodel->elements=NULL;
+	iomodel->elements_type=NULL;
+	iomodel->numberofnodes2d=0;
+	iomodel->elements2d=NULL;
+	iomodel->deadgrids=NULL;
+	iomodel->numlayers=0;
+	iomodel->uppernodes=NULL;
+	iomodel->gridonhutter=NULL;
+	iomodel->gridonmacayeal=NULL;
+	iomodel->gridonpattyn=NULL;
+	
+	iomodel->vx_obs=NULL;
+	iomodel->vy_obs=NULL;
+	iomodel->vx=NULL;
+	iomodel->vy=NULL;
+	iomodel->vz=NULL;
+	iomodel->pressure=NULL;
+	iomodel->temperature=NULL;
+	iomodel->melting=NULL;
+	iomodel->geothermalflux=NULL;
+	iomodel->elementonbed=NULL;
+	iomodel->elementonsurface=NULL;
+	iomodel->gridonbed=NULL;
+	iomodel->gridonsurface=NULL;
+	iomodel->gridonstokes=NULL;
+	iomodel->borderstokes=NULL;
+	iomodel->thickness=NULL;
+	iomodel->surface=NULL;
+	iomodel->bed=NULL;
+	iomodel->elementoniceshelf=NULL;
+	iomodel->elementonwater=NULL;
+	iomodel->gridonicesheet=NULL;
+	iomodel->gridoniceshelf=NULL;
+
+	iomodel->drag_type=0;
+	iomodel->drag=NULL;
+	iomodel->p=NULL;
+	iomodel->q=NULL;
+	
+	
+	iomodel->numberofpressureloads=0;
+	iomodel->numberofpressureloads_stokes=0;
+	iomodel->pressureload=NULL;
+	iomodel->pressureload_stokes=NULL;
+	iomodel-> spcvelocity=NULL;
+	iomodel-> spctemperature=NULL;
+	iomodel-> spcthickness=NULL;
+	
+	/*!materials: */
+	iomodel->rho_water=0;
+	iomodel->rho_ice=0;
+	iomodel->g=0;
+	iomodel->n=NULL;
+	iomodel->B=NULL;
+
+	/*!control methods: */
+	iomodel->control_type=NULL;
+	iomodel->thermalstatic=0;
+
+	/*!solution parameters: */
+	iomodel->fit=NULL;
+	iomodel->meanvel=0;
+	iomodel->epsvel=0;
+	iomodel->artificial_diffusivity=0;
+	iomodel->nsteps=0;
+	iomodel->tolx=0;
+	iomodel->maxiter=NULL;
+	iomodel->mincontrolconstraint=0;
+	iomodel->maxcontrolconstraint=0;
+	iomodel->debug=0;
+	iomodel->plot=0;
+	iomodel->eps_res=0;
+	iomodel->eps_rel=0;
+	iomodel->eps_abs=0;
+	iomodel->dt=0;
+	iomodel->ndt=0;
+	iomodel->penalty_offset=0;
+	iomodel->penalty_melting=0;
+	iomodel->penalty_lock=0;
+	iomodel->sparsity=0;
+	iomodel->connectivity=0;
+	iomodel->lowmem=0;
+	iomodel->optscal=NULL;
+	iomodel->yts=0;
+	iomodel->viscosity_overshoot=0;
+	iomodel->stokesreconditioning=0;
+	iomodel->waitonlock=0;
+
+	/*!thermal parameters: */
+	iomodel->beta=0;
+	iomodel->meltingpoint=0;
+	iomodel->latentheat=0;
+	iomodel->heatcapacity=0;
+	iomodel->thermalconductivity=0;
+	iomodel->min_thermal_constraints=0;
+	iomodel->mixed_layer_capacity=0;
+	iomodel->thermal_exchange_velocity=0;
+
+	
+	iomodel->numrifts=0;
+	iomodel->riftinfo=NULL;
+
+	/*!penalties: */
+	iomodel->numpenalties=0;
+	iomodel->penalties=NULL;
+	iomodel->penaltypartitioning=NULL;
+
+	/*!basal: */
+	iomodel->accumulation=NULL;
+
+	/*elements type: */
+	iomodel->ishutter=0;
+	iomodel->ismacayealpattyn=0;
+	iomodel->isstokes=0;
+
+
+	iomodel->epart=NULL;
+	iomodel->npart=NULL;
+	iomodel->my_grids=NULL;
+	iomodel->my_bordergrids=NULL;
+
+	return iomodel;
+}
+
+
+/*!--------------------------------------------------
+	DeleteIoModel
+  --------------------------------------------------*/
+
+void DeleteIoModel(IoModel** piomodel){
+
+	/*!Recover structure: */
+	IoModel* iomodel = *piomodel;
+	
+	int i;
+
+	/*!Two cases here: 
+	 * - serial mode: matlab's memory manager will take care of delete iomodel when returning from Imp. Do nothing here, so as not to confuse 
+	 *                the memory manager.
+     * - in parallel, anything the io layer does (FetchData) did needs to be erased explicitely in the iomodel.
+	 */
+
+	#ifdef _PARALLEL_
+	xfree((void**)&iomodel->x);
+	xfree((void**)&iomodel->y);
+	xfree((void**)&iomodel->z);
+	xfree((void**)&iomodel->elements);
+	xfree((void**)&iomodel->elements_type);
+	xfree((void**)&iomodel->gridonhutter);
+	xfree((void**)&iomodel->gridonmacayeal);
+	if (strcmp(iomodel->meshtype,"3d")==0){
+		xfree((void**)&iomodel->elements2d);
+		xfree((void**)&iomodel->deadgrids);
+		xfree((void**)&iomodel->uppernodes);
+		xfree((void**)&iomodel->gridonpattyn);
+	}
+	xfree((void**)&iomodel->solverstring);
+	xfree((void**)&iomodel->elementonbed);
+	xfree((void**)&iomodel->elementonsurface);
+	xfree((void**)&iomodel->gridonbed);
+	xfree((void**)&iomodel->gridonsurface);
+	xfree((void**)&iomodel->gridonstokes);
+	xfree((void**)&iomodel->borderstokes);
+	xfree((void**)&iomodel->thickness);
+	xfree((void**)&iomodel->surface);
+	xfree((void**)&iomodel->bed);
+	xfree((void**)&iomodel->vx_obs);
+	xfree((void**)&iomodel->vy_obs);
+	xfree((void**)&iomodel->vx);
+	xfree((void**)&iomodel->vy);
+	xfree((void**)&iomodel->vz);
+	xfree((void**)&iomodel->pressure);
+	xfree((void**)&iomodel->temperature);
+	xfree((void**)&iomodel->drag);
+	xfree((void**)&iomodel->p);
+	xfree((void**)&iomodel->q);
+	xfree((void**)&iomodel->elementoniceshelf);
+	xfree((void**)&iomodel->elementonwater);
+	xfree((void**)&iomodel->gridonicesheet);
+	xfree((void**)&iomodel->gridoniceshelf);
+	xfree((void**)&iomodel->pressureload);
+	xfree((void**)&iomodel->pressureload_stokes);
+	xfree((void**)&iomodel->spcvelocity);
+	xfree((void**)&iomodel->spcthickness);
+	xfree((void**)&iomodel->spctemperature);
+	xfree((void**)&iomodel->geothermalflux);
+	xfree((void**)&iomodel->melting);
+	xfree((void**)&iomodel->accumulation);
+	xfree((void**)&iomodel->B);
+	xfree((void**)&iomodel->n);
+	xfree((void**)&iomodel->fit);
+	xfree((void**)&iomodel->optscal);
+	xfree((void**)&iomodel->maxiter);
+
+
+	/*!Delete structure fields: */
+	xfree((void**)&iomodel->repository);
+	xfree((void**)&iomodel->meshtype);
+	xfree((void**)&iomodel->name);
+	
+	xfree((void**)&iomodel->riftinfo);
+	
+	xfree((void**)&iomodel->penalties);
+	xfree((void**)&iomodel->penaltypartitioning);
+	
+	xfree((void**)&iomodel->control_type);
+	
+	xfree((void**)&iomodel->epart);
+	xfree((void**)&iomodel->npart);
+	xfree((void**)&iomodel->my_grids);
+	xfree((void**)&iomodel->my_bordergrids);
+	
+	/*!Delete entire structure: */
+	xfree((void**)piomodel);
+	#endif
+}
+
+/*!--------------------------------------------------
+	IoModelInit
+  --------------------------------------------------*/
+
+#undef __FUNCT__ 
+#define __FUNCT__ "IoModelInit"
+
+int	IoModelInit(IoModel** piomodel,ConstDataHandle iomodel_handle){
+
+	int i,j;
+	
+	/*output: */
+	IoModel* iomodel=NULL;
+
+	/*Allocate iomodel: */
+	iomodel=NewIoModel();
+
+	/*In IoModelInit, we get all the data that is not difficult to get, and that is small: */
+	IoModelFetchData((void**)&iomodel->name,NULL,NULL,iomodel_handle,"name","String",NULL); 
+	IoModelFetchData((void**)&iomodel->analysis_type,NULL,NULL,iomodel_handle,"analysis_type","Integer",NULL); 
+	IoModelFetchData((void**)&iomodel->sub_analysis_type,NULL,NULL,iomodel_handle,"sub_analysis_type","Integer",NULL); 
+	IoModelFetchData((void**)&iomodel->qmu_analysis,NULL,NULL,iomodel_handle,"qmu_analysis","Integer",NULL); 
+	IoModelFetchData((void**)&iomodel->meshtype,NULL,NULL,iomodel_handle,"type","String",NULL);
+	/*!Get numberofelements and numberofnodes: */
+	IoModelFetchData((void**)&iomodel->numberofnodes,NULL,NULL,iomodel_handle,"numberofgrids","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->numberofelements,NULL,NULL,iomodel_handle,"numberofelements","Integer",NULL);
+	/*!In case we are running 3d, we are going to need the collapsed and non-collapsed 2d meshes, from which the 3d mesh was extruded: */
+	if (strcmp(iomodel->meshtype,"3d")==0){
+	
+		/*!Deal with 2d mesh: */
+		IoModelFetchData((void**)&iomodel->numberofelements2d,NULL,NULL,iomodel_handle,"numberofelements2d","Integer",NULL);
+		IoModelFetchData((void**)&iomodel->numberofnodes2d,NULL,NULL,iomodel_handle,"numberofgrids2d","Integer",NULL);
+		IoModelFetchData((void**)&iomodel->numlayers,NULL,NULL,iomodel_handle,"numlayers","Integer",NULL);
+	}
+
+
+	/*elements type: */
+	IoModelFetchData((void**)&iomodel->ishutter,NULL,NULL,iomodel_handle,"ishutter","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->ismacayealpattyn,NULL,NULL,iomodel_handle,"ismacayealpattyn","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->isstokes,NULL,NULL,iomodel_handle,"isstokes","Integer",NULL);
+
+	/*!Get drag_type, drag and p,q: */
+	IoModelFetchData((void**)&iomodel->drag_type,NULL,NULL,iomodel_handle,"drag_type","Integer",NULL);
+
+	/*!Get materials: */
+	IoModelFetchData((void**)&iomodel->rho_water,NULL,NULL,iomodel_handle,"rho_water","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->rho_ice,NULL,NULL,iomodel_handle,"rho_ice","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->g,NULL,NULL,iomodel_handle,"g","Scalar",NULL);
+
+	/*Get control parameters: */
+	IoModelFetchData((void**)&iomodel->control_type,NULL,NULL,iomodel_handle,"control_type","String",NULL); 
+	IoModelFetchData((void**)&iomodel->thermalstatic,NULL,NULL,iomodel_handle,"thermalstatic","Integer",NULL); 
+
+	/*!Get solution parameters: */
+	IoModelFetchData((void**)&iomodel->yts,NULL,NULL,iomodel_handle,"yts","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->meanvel,NULL,NULL,iomodel_handle,"meanvel","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->epsvel,NULL,NULL,iomodel_handle,"epsvel","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->debug,NULL,NULL,iomodel_handle,"debug","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->plot,NULL,NULL,iomodel_handle,"plot","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->artificial_diffusivity,NULL,NULL,iomodel_handle,"artificial_diffusivity","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->nsteps,NULL,NULL,iomodel_handle,"nsteps","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->tolx,NULL,NULL,iomodel_handle,"tolx","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->mincontrolconstraint,NULL,NULL,iomodel_handle,"mincontrolconstraint","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->maxcontrolconstraint,NULL,NULL,iomodel_handle,"maxcontrolconstraint","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->eps_res,NULL,NULL,iomodel_handle,"eps_res","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->eps_rel,NULL,NULL,iomodel_handle,"eps_rel","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->eps_abs,NULL,NULL,iomodel_handle,"eps_abs","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->dt,NULL,NULL,iomodel_handle,"dt","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->ndt,NULL,NULL,iomodel_handle,"ndt","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->penalty_offset,NULL,NULL,iomodel_handle,"penalty_offset","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->penalty_melting,NULL,NULL,iomodel_handle,"penalty_melting","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->penalty_lock,NULL,NULL,iomodel_handle,"penalty_lock","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->sparsity,NULL,NULL,iomodel_handle,"sparsity","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->connectivity,NULL,NULL,iomodel_handle,"connectivity","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->lowmem,NULL,NULL,iomodel_handle,"lowmem","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->solverstring,NULL,NULL,iomodel_handle,"solverstring","String",NULL);
+	IoModelFetchData((void**)&iomodel->viscosity_overshoot,NULL,NULL,iomodel_handle,"viscosity_overshoot","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->stokesreconditioning,NULL,NULL,iomodel_handle,"stokesreconditioning","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->waitonlock,NULL,NULL,iomodel_handle,"waitonlock","Integer",NULL);
+
+	/*!Get thermal parameters: */
+	IoModelFetchData((void**)&iomodel->beta,NULL,NULL,iomodel_handle,"beta","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->meltingpoint,NULL,NULL,iomodel_handle,"meltingpoint","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->latentheat,NULL,NULL,iomodel_handle,"latentheat","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->heatcapacity,NULL,NULL,iomodel_handle,"heatcapacity","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->thermalconductivity,NULL,NULL,iomodel_handle,"thermalconductivity","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->min_thermal_constraints,NULL,NULL,iomodel_handle,"min_thermal_constraints","Integer",NULL);
+	IoModelFetchData((void**)&iomodel->mixed_layer_capacity,NULL,NULL,iomodel_handle,"mixed_layer_capacity","Scalar",NULL);
+	IoModelFetchData((void**)&iomodel->thermal_exchange_velocity,NULL,NULL,iomodel_handle,"thermal_exchange_velocity","Scalar",NULL);
+
+	/*qmu: */
+	if(iomodel->qmu_analysis){
+		IoModelFetchData((void**)&iomodel->numberofvariables,NULL,NULL,iomodel_handle,"numberofvariables","Integer",NULL);
+		IoModelFetchData((void**)&iomodel->numberofresponses,NULL,NULL,iomodel_handle,"numberofresponses","Integer",NULL);
+		IoModelFetchData((void**)&iomodel->qmu_npart,NULL,NULL,iomodel_handle,"npart","Integer",NULL);
+	}
+
+	/*Assign output pointers: */
+	*piomodel=iomodel;
+
+	return 1;
+}
+
+/*!--------------------------------------------------
+	IoModelEcho
+  --------------------------------------------------*/
+void IoModelEcho(IoModel* iomodel,int which_part,int rank) {
+
+	//which_part  determines what gets echoed, otherwise, we'll get too much output.
+	//1-> penalties
+
+	int i,j;
+
+	if(which_part==1 && my_rank==rank && (strcmp(iomodel->meshtype,"3d")==0)){
+		printf("IoModel penalties: \n");
+		printf("   number of penalties: %i\n",iomodel->numpenalties);
+		printf("   grids: \n");
+
+		for(i=0;i<iomodel->numpenalties;i++){
+			for(j=0;j<iomodel->numlayers;j++){
+				printf("%i ",(int)*(iomodel->penalties+iomodel->numlayers*i+j));
+			}
+			printf("\n");
+		}
+	}
+	
+	return;
+}
Index: /issm/trunk/src/c/ModelProcessorx/IoModel.h
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/IoModel.h	(revision 1838)
+++ /issm/trunk/src/c/ModelProcessorx/IoModel.h	(revision 1838)
@@ -0,0 +1,235 @@
+/* \file IoModel.h
+ * \brief  Header file defining the IoModel structure and processing of input data.
+ * \sa IoModel.cpp
+ */
+
+#ifndef _IOMODEL_H
+#define _IOMODEL_H
+
+#include "../io/io.h"
+#include "../DataSet/DataSet.h"
+#include "../toolkits/toolkits.h"
+
+#define RIFTINFOSIZE 10
+
+struct IoModel {
+
+	char*   name;
+	char*   repository;
+	char*   meshtype;
+	int     analysis_type;
+	int     sub_analysis_type;
+	int     qmu_analysis;
+	char*   solverstring;
+
+	/*2d mesh: */
+	int     numberofelements;
+	int     numberofnodes;
+	double* x;
+	double* y;
+	double* z;
+	double* elements;
+	double* elements_type;
+
+	/*3d mesh: */
+	int     numberofnodes2d;
+	int     numberofelements2d;
+	double* elements2d;
+	double* deadgrids;
+	int     numlayers;
+	double* uppernodes;
+
+	/*elements type: */
+	int     ishutter;
+	int     ismacayealpattyn;
+	int     isstokes;
+	double* gridonhutter;
+	double* gridonmacayeal;
+	double* gridonpattyn;
+
+	/*results: */
+	double* vx;
+	double* vy;
+	double* vz;
+	double* pressure;
+	double* temperature;
+
+	/*observations: */
+	double*  vx_obs;
+	double*  vy_obs;
+
+	/*qmu: */
+	int      numberofresponses;
+	int      numberofvariables;
+	int      qmu_npart;
+
+	/*geometry: */
+	double* elementonbed;
+	double* elementonsurface;
+	double* gridonbed;
+	double* gridonsurface;
+	double* gridonstokes;
+	double* borderstokes;
+	double* thickness;
+	double* surface;
+	double* bed;
+	double* elementoniceshelf;
+	double* elementonwater;
+	double* gridonicesheet;
+	double* gridoniceshelf;
+
+	/*friction: */
+	int     drag_type;
+	double* drag;
+	double* p;
+	double* q;
+
+	/*boundary conditions: */
+	int     numberofpressureloads;
+	int     numberofpressureloads_stokes;
+	double* pressureload;
+	double* pressureload_stokes;
+	double* spcvelocity;
+	double* spctemperature;
+	double* spcthickness;
+	double* geothermalflux;
+	
+	/*materials: */
+	double  rho_water,rho_ice;
+	double  g;
+	double* B;
+	double* n;
+
+	/*control methods: */
+	char*	control_type;
+	int     thermalstatic;
+
+	/*solution parameters: */
+	double* fit;
+	double  meanvel,epsvel;
+	int     artificial_diffusivity;
+	int     nsteps;
+	double  tolx;
+	double* maxiter;
+	double  mincontrolconstraint;
+	double  maxcontrolconstraint;
+	int     debug;
+	int     plot;
+	double  eps_res;
+	double  eps_rel;
+	double  eps_abs;
+	double  dt,ndt;
+	double  penalty_offset;
+	double  penalty_melting;
+	int     penalty_lock;
+	double  sparsity;
+	int     connectivity;
+	int     lowmem;
+	double* optscal;
+	double  yts;
+	double  viscosity_overshoot;
+	double  stokesreconditioning;
+	int     waitonlock;
+
+	/*thermal parameters: */
+	double beta;
+	double meltingpoint;
+	double latentheat;
+	double  heatcapacity,thermalconductivity;
+	int    min_thermal_constraints;
+	double mixed_layer_capacity;
+	double thermal_exchange_velocity;
+
+	/*rifts: */
+	int      numrifts;
+	double*  riftinfo;
+
+	/*penalties: */
+	int      numpenalties;
+	double*  penalties;
+	
+	/*basal: */
+	double*  melting;
+	double*  accumulation;
+
+
+	/*exterior data: */
+	int* epart; /*!element partitioning.*/
+	int* npart; /*!node partitioning.*/
+	int* my_grids; /*! grids that belong to this cpu*/
+	double* my_bordergrids; /*! grids that belong to this cpu, and some other cpu also*/
+	int*     penaltypartitioning;
+
+};
+
+
+
+	/*constructor and destructor: */
+	IoModel*	NewIoModel(void);
+	void    DeleteIoModel( IoModel** pthis);
+
+	/*Echo: */
+	void    IoModelEcho(IoModel* iomodel,int which_part,int rank);
+
+	/*Initialization with matlab workspace data, or marshall binary data: */
+	int	    IoModelInit(IoModel** piomodel,ConstDataHandle iomodel_handle);
+
+	/*Creation of fem datasets: general drivers*/
+	void    CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void    CreateParameters(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
+
+	
+	/*Create of fem datasets: specialised drivers: */
+	
+	/*diagnostic horizontal*/
+	void	CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void	CreateConstraintsDiagnosticHoriz(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void    CreateLoadsDiagnosticHoriz(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
+	void    CreateParametersDiagnosticHoriz(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
+
+	/*diagnostic vertical*/
+	void	CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void	CreateConstraintsDiagnosticVert(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void    CreateLoadsDiagnosticVert(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
+
+	/*diagnostic hutter*/
+	void	CreateElementsNodesAndMaterialsDiagnosticHutter(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void	CreateConstraintsDiagnosticHutter(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void    CreateLoadsDiagnosticHutter(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
+
+	/*diagnostic stokes*/
+	void	CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void	CreateConstraintsDiagnosticStokes(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void    CreateLoadsDiagnosticStokes(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
+
+	/*slope compute*/
+	void	CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void	CreateConstraintsSlopeCompute(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void    CreateLoadsSlopeCompute(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
+
+	/*control:*/
+	void    CreateParametersControl(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
+
+	/*thermal:*/
+	void	CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void	CreateConstraintsThermal(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void    CreateLoadsThermal(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
+	void    CreateParametersThermal(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
+
+	/*melting:*/
+	void	CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void	CreateConstraintsMelting(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void    CreateLoadsMelting(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
+	void    CreateParametersMelting(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
+
+	/*prognostic:*/
+	void	CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void	CreateConstraintsPrognostic(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
+	void    CreateLoadsPrognostic(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
+	void    CreateParametersPrognostic(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
+
+	/*qmu: */
+	void CreateParametersQmu(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
+
+
+#endif  /* _IOMODEL_H */
Index: sm/trunk/src/c/ModelProcessorx/Model.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Model.cpp	(revision 1837)
+++ 	(revision )
@@ -1,391 +1,0 @@
-/*! \file Model.cpp
- * \brief  Model structure that mirrors the matlab workspace structure. Servers for the serial 
- * and parallel runs.
- */
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "../shared/shared.h"
-#include "../io/io.h"
-#include "../include/globals.h"
-#include "../include/macros.h"
-
-#include <string.h>
-#include "stdio.h"
-
-#include "./Model.h"
-
-
-/*!--------------------------------------------------
-	NewModel
-  --------------------------------------------------*/
-
-Model* NewModel(void) {
-	/*! create a new Model object */
-	Model* model=NULL;
-
-	model=(Model*)xmalloc(sizeof(Model));
-
-	/*!initialize all pointers to 0: */
-	model->name=NULL;
-	model->repository=NULL;
-	model->meshtype=NULL;
-	model->analysis_type=0;
-	model->sub_analysis_type=0;
-	model->qmu_analysis=0;
-	model->solverstring=NULL;
-	model->numberofresponses=0;
-	model->numberofvariables=0;
-	model->qmu_npart=0; 
-	model->numberofelements=0;
-	model->numberofnodes=0;
-	model->x=NULL; 
-	model->y=NULL;
-	model->z=NULL;
-	model->elements=NULL;
-	model->elements_type=NULL;
-	model->numberofnodes2d=0;
-	model->elements2d=NULL;
-	model->deadgrids=NULL;
-	model->numlayers=0;
-	model->uppernodes=NULL;
-	model->gridonhutter=NULL;
-	model->gridonmacayeal=NULL;
-	model->gridonpattyn=NULL;
-	
-	model->vx_obs=NULL;
-	model->vy_obs=NULL;
-	model->vx=NULL;
-	model->vy=NULL;
-	model->vz=NULL;
-	model->pressure=NULL;
-	model->temperature=NULL;
-	model->melting=NULL;
-	model->geothermalflux=NULL;
-	model->elementonbed=NULL;
-	model->elementonsurface=NULL;
-	model->gridonbed=NULL;
-	model->gridonsurface=NULL;
-	model->gridonstokes=NULL;
-	model->borderstokes=NULL;
-	model->thickness=NULL;
-	model->surface=NULL;
-	model->bed=NULL;
-	model->elementoniceshelf=NULL;
-	model->elementonwater=NULL;
-	model->gridonicesheet=NULL;
-	model->gridoniceshelf=NULL;
-
-	model->drag_type=0;
-	model->drag=NULL;
-	model->p=NULL;
-	model->q=NULL;
-	
-	
-	model->numberofpressureloads=0;
-	model->numberofpressureloads_stokes=0;
-	model->pressureload=NULL;
-	model->pressureload_stokes=NULL;
-	model-> spcvelocity=NULL;
-	model-> spctemperature=NULL;
-	model-> spcthickness=NULL;
-	
-	/*!materials: */
-	model->rho_water=0;
-	model->rho_ice=0;
-	model->g=0;
-	model->n=NULL;
-	model->B=NULL;
-
-	/*!control methods: */
-	model->control_type=NULL;
-
-	/*!solution parameters: */
-	model->fit=NULL;
-	model->meanvel=0;
-	model->epsvel=0;
-	model->artificial_diffusivity=0;
-	model->nsteps=0;
-	model->tolx=0;
-	model->maxiter=NULL;
-	model->mincontrolconstraint=0;
-	model->maxcontrolconstraint=0;
-	model->debug=0;
-	model->plot=0;
-	model->eps_res=0;
-	model->eps_rel=0;
-	model->eps_abs=0;
-	model->dt=0;
-	model->ndt=0;
-	model->penalty_offset=0;
-	model->penalty_melting=0;
-	model->penalty_lock=0;
-	model->sparsity=0;
-	model->connectivity=0;
-	model->lowmem=0;
-	model->optscal=NULL;
-	model->yts=0;
-	model->viscosity_overshoot=0;
-	model->stokesreconditioning=0;
-	model->waitonlock=0;
-
-	/*!thermal parameters: */
-	model->beta=0;
-	model->meltingpoint=0;
-	model->latentheat=0;
-	model->heatcapacity=0;
-	model->thermalconductivity=0;
-	model->min_thermal_constraints=0;
-	model->mixed_layer_capacity=0;
-	model->thermal_exchange_velocity=0;
-
-	
-	model->numrifts=0;
-	model->riftinfo=NULL;
-
-	/*!penalties: */
-	model->numpenalties=0;
-	model->penalties=NULL;
-	model->penaltypartitioning=NULL;
-
-	/*!basal: */
-	model->accumulation=NULL;
-
-	/*elements type: */
-	model->ishutter=0;
-	model->ismacayealpattyn=0;
-	model->isstokes=0;
-
-
-	model->epart=NULL;
-	model->npart=NULL;
-	model->my_grids=NULL;
-	model->my_bordergrids=NULL;
-
-	return model;
-}
-
-
-/*!--------------------------------------------------
-	DeleteModel
-  --------------------------------------------------*/
-
-void DeleteModel(Model** pmodel){
-
-	/*!Recover structure: */
-	Model* model = *pmodel;
-	
-	int i;
-
-	/*!Two cases here: 
-	 * - serial mode: matlab's memory manager will take care of delete model when returning from Imp. Do nothing here, so as not to confuse 
-	 *                the memory manager.
-     * - in parallel, anything the io layer does (FetchData) did needs to be erased explicitely in the model.
-	 */
-
-	#ifdef _PARALLEL_
-	xfree((void**)&model->x);
-	xfree((void**)&model->y);
-	xfree((void**)&model->z);
-	xfree((void**)&model->elements);
-	xfree((void**)&model->elements_type);
-	xfree((void**)&model->gridonhutter);
-	xfree((void**)&model->gridonmacayeal);
-	if (strcmp(model->meshtype,"3d")==0){
-		xfree((void**)&model->elements2d);
-		xfree((void**)&model->deadgrids);
-		xfree((void**)&model->uppernodes);
-		xfree((void**)&model->gridonpattyn);
-	}
-	xfree((void**)&model->solverstring);
-	xfree((void**)&model->elementonbed);
-	xfree((void**)&model->elementonsurface);
-	xfree((void**)&model->gridonbed);
-	xfree((void**)&model->gridonsurface);
-	xfree((void**)&model->gridonstokes);
-	xfree((void**)&model->borderstokes);
-	xfree((void**)&model->thickness);
-	xfree((void**)&model->surface);
-	xfree((void**)&model->bed);
-	xfree((void**)&model->vx_obs);
-	xfree((void**)&model->vy_obs);
-	xfree((void**)&model->vx);
-	xfree((void**)&model->vy);
-	xfree((void**)&model->vz);
-	xfree((void**)&model->pressure);
-	xfree((void**)&model->temperature);
-	xfree((void**)&model->drag);
-	xfree((void**)&model->p);
-	xfree((void**)&model->q);
-	xfree((void**)&model->elementoniceshelf);
-	xfree((void**)&model->elementonwater);
-	xfree((void**)&model->gridonicesheet);
-	xfree((void**)&model->gridoniceshelf);
-	xfree((void**)&model->pressureload);
-	xfree((void**)&model->pressureload_stokes);
-	xfree((void**)&model->spcvelocity);
-	xfree((void**)&model->spcthickness);
-	xfree((void**)&model->spctemperature);
-	xfree((void**)&model->geothermalflux);
-	xfree((void**)&model->melting);
-	xfree((void**)&model->accumulation);
-	xfree((void**)&model->B);
-	xfree((void**)&model->n);
-	xfree((void**)&model->fit);
-	xfree((void**)&model->optscal);
-	xfree((void**)&model->maxiter);
-
-
-	/*!Delete structure fields: */
-	xfree((void**)&model->repository);
-	xfree((void**)&model->meshtype);
-	xfree((void**)&model->name);
-	
-	xfree((void**)&model->riftinfo);
-	
-	xfree((void**)&model->penalties);
-	xfree((void**)&model->penaltypartitioning);
-	
-	xfree((void**)&model->control_type);
-	
-	xfree((void**)&model->epart);
-	xfree((void**)&model->npart);
-	xfree((void**)&model->my_grids);
-	xfree((void**)&model->my_bordergrids);
-	
-	/*!Delete entire structure: */
-	xfree((void**)pmodel);
-	#endif
-}
-
-/*!--------------------------------------------------
-	ModelInit
-  --------------------------------------------------*/
-
-#undef __FUNCT__ 
-#define __FUNCT__ "ModelInit"
-
-int	ModelInit(Model** pmodel,ConstDataHandle model_handle){
-
-	int i,j;
-	
-	/*output: */
-	Model* model=NULL;
-
-	/*Allocate model: */
-	model=NewModel();
-
-	/*In ModelInit, we get all the data that is not difficult to get, and that is small: */
-	ModelFetchData((void**)&model->name,NULL,NULL,model_handle,"name","String",NULL); 
-	ModelFetchData((void**)&model->analysis_type,NULL,NULL,model_handle,"analysis_type","Integer",NULL); 
-	ModelFetchData((void**)&model->sub_analysis_type,NULL,NULL,model_handle,"sub_analysis_type","Integer",NULL); 
-	ModelFetchData((void**)&model->qmu_analysis,NULL,NULL,model_handle,"qmu_analysis","Integer",NULL); 
-	ModelFetchData((void**)&model->meshtype,NULL,NULL,model_handle,"type","String",NULL);
-	/*!Get numberofelements and numberofnodes: */
-	ModelFetchData((void**)&model->numberofnodes,NULL,NULL,model_handle,"numberofgrids","Integer",NULL);
-	ModelFetchData((void**)&model->numberofelements,NULL,NULL,model_handle,"numberofelements","Integer",NULL);
-	/*!In case we are running 3d, we are going to need the collapsed and non-collapsed 2d meshes, from which the 3d mesh was extruded: */
-	if (strcmp(model->meshtype,"3d")==0){
-	
-		/*!Deal with 2d mesh: */
-		ModelFetchData((void**)&model->numberofelements2d,NULL,NULL,model_handle,"numberofelements2d","Integer",NULL);
-		ModelFetchData((void**)&model->numberofnodes2d,NULL,NULL,model_handle,"numberofgrids2d","Integer",NULL);
-		ModelFetchData((void**)&model->numlayers,NULL,NULL,model_handle,"numlayers","Integer",NULL);
-	}
-
-
-	/*elements type: */
-	ModelFetchData((void**)&model->ishutter,NULL,NULL,model_handle,"ishutter","Integer",NULL);
-	ModelFetchData((void**)&model->ismacayealpattyn,NULL,NULL,model_handle,"ismacayealpattyn","Integer",NULL);
-	ModelFetchData((void**)&model->isstokes,NULL,NULL,model_handle,"isstokes","Integer",NULL);
-
-	/*!Get drag_type, drag and p,q: */
-	ModelFetchData((void**)&model->drag_type,NULL,NULL,model_handle,"drag_type","Integer",NULL);
-
-	/*!Get materials: */
-	ModelFetchData((void**)&model->rho_water,NULL,NULL,model_handle,"rho_water","Scalar",NULL);
-	ModelFetchData((void**)&model->rho_ice,NULL,NULL,model_handle,"rho_ice","Scalar",NULL);
-	ModelFetchData((void**)&model->g,NULL,NULL,model_handle,"g","Scalar",NULL);
-
-	/*Get control parameters: */
-	ModelFetchData((void**)&model->control_type,NULL,NULL,model_handle,"control_type","String",NULL); 
-
-	/*!Get solution parameters: */
-	ModelFetchData((void**)&model->yts,NULL,NULL,model_handle,"yts","Scalar",NULL);
-	ModelFetchData((void**)&model->meanvel,NULL,NULL,model_handle,"meanvel","Scalar",NULL);
-	ModelFetchData((void**)&model->epsvel,NULL,NULL,model_handle,"epsvel","Scalar",NULL);
-	ModelFetchData((void**)&model->debug,NULL,NULL,model_handle,"debug","Integer",NULL);
-	ModelFetchData((void**)&model->plot,NULL,NULL,model_handle,"plot","Integer",NULL);
-	ModelFetchData((void**)&model->artificial_diffusivity,NULL,NULL,model_handle,"artificial_diffusivity","Integer",NULL);
-	ModelFetchData((void**)&model->nsteps,NULL,NULL,model_handle,"nsteps","Integer",NULL);
-	ModelFetchData((void**)&model->tolx,NULL,NULL,model_handle,"tolx","Scalar",NULL);
-	ModelFetchData((void**)&model->mincontrolconstraint,NULL,NULL,model_handle,"mincontrolconstraint","Scalar",NULL);
-	ModelFetchData((void**)&model->maxcontrolconstraint,NULL,NULL,model_handle,"maxcontrolconstraint","Scalar",NULL);
-	ModelFetchData((void**)&model->eps_res,NULL,NULL,model_handle,"eps_res","Scalar",NULL);
-	ModelFetchData((void**)&model->eps_rel,NULL,NULL,model_handle,"eps_rel","Scalar",NULL);
-	ModelFetchData((void**)&model->eps_abs,NULL,NULL,model_handle,"eps_abs","Scalar",NULL);
-	ModelFetchData((void**)&model->dt,NULL,NULL,model_handle,"dt","Scalar",NULL);
-	ModelFetchData((void**)&model->ndt,NULL,NULL,model_handle,"ndt","Scalar",NULL);
-	ModelFetchData((void**)&model->penalty_offset,NULL,NULL,model_handle,"penalty_offset","Scalar",NULL);
-	ModelFetchData((void**)&model->penalty_melting,NULL,NULL,model_handle,"penalty_melting","Scalar",NULL);
-	ModelFetchData((void**)&model->penalty_lock,NULL,NULL,model_handle,"penalty_lock","Integer",NULL);
-	ModelFetchData((void**)&model->sparsity,NULL,NULL,model_handle,"sparsity","Scalar",NULL);
-	ModelFetchData((void**)&model->connectivity,NULL,NULL,model_handle,"connectivity","Integer",NULL);
-	ModelFetchData((void**)&model->lowmem,NULL,NULL,model_handle,"lowmem","Integer",NULL);
-	ModelFetchData((void**)&model->solverstring,NULL,NULL,model_handle,"solverstring","String",NULL);
-	ModelFetchData((void**)&model->viscosity_overshoot,NULL,NULL,model_handle,"viscosity_overshoot","Scalar",NULL);
-	ModelFetchData((void**)&model->stokesreconditioning,NULL,NULL,model_handle,"stokesreconditioning","Scalar",NULL);
-	ModelFetchData((void**)&model->waitonlock,NULL,NULL,model_handle,"waitonlock","Integer",NULL);
-
-	/*!Get thermal parameters: */
-	ModelFetchData((void**)&model->beta,NULL,NULL,model_handle,"beta","Scalar",NULL);
-	ModelFetchData((void**)&model->meltingpoint,NULL,NULL,model_handle,"meltingpoint","Scalar",NULL);
-	ModelFetchData((void**)&model->latentheat,NULL,NULL,model_handle,"latentheat","Scalar",NULL);
-	ModelFetchData((void**)&model->heatcapacity,NULL,NULL,model_handle,"heatcapacity","Scalar",NULL);
-	ModelFetchData((void**)&model->thermalconductivity,NULL,NULL,model_handle,"thermalconductivity","Scalar",NULL);
-	ModelFetchData((void**)&model->min_thermal_constraints,NULL,NULL,model_handle,"min_thermal_constraints","Integer",NULL);
-	ModelFetchData((void**)&model->mixed_layer_capacity,NULL,NULL,model_handle,"mixed_layer_capacity","Scalar",NULL);
-	ModelFetchData((void**)&model->thermal_exchange_velocity,NULL,NULL,model_handle,"thermal_exchange_velocity","Scalar",NULL);
-
-	/*qmu: */
-	if(model->qmu_analysis){
-		ModelFetchData((void**)&model->numberofvariables,NULL,NULL,model_handle,"numberofvariables","Integer",NULL);
-		ModelFetchData((void**)&model->numberofresponses,NULL,NULL,model_handle,"numberofresponses","Integer",NULL);
-		ModelFetchData((void**)&model->qmu_npart,NULL,NULL,model_handle,"npart","Integer",NULL);
-	}
-
-	/*Assign output pointers: */
-	*pmodel=model;
-
-	return 1;
-}
-
-/*!--------------------------------------------------
-	ModelEcho
-  --------------------------------------------------*/
-void ModelEcho(Model* model,int which_part,int rank) {
-
-	//which_part  determines what gets echoed, otherwise, we'll get too much output.
-	//1-> penalties
-
-	int i,j;
-
-	if(which_part==1 && my_rank==rank && (strcmp(model->meshtype,"3d")==0)){
-		printf("Model penalties: \n");
-		printf("   number of penalties: %i\n",model->numpenalties);
-		printf("   grids: \n");
-
-		for(i=0;i<model->numpenalties;i++){
-			for(j=0;j<model->numlayers;j++){
-				printf("%i ",(int)*(model->penalties+model->numlayers*i+j));
-			}
-			printf("\n");
-		}
-	}
-	
-	return;
-}
Index: sm/trunk/src/c/ModelProcessorx/Model.h
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Model.h	(revision 1837)
+++ 	(revision )
@@ -1,234 +1,0 @@
-/* \file Mode.h
- * \brief  Header file defining the Model structure and processing of input data.
- * \sa Model.cpp
- */
-
-#ifndef _MODEL_H
-#define _MODEL_H
-
-#include "../io/io.h"
-#include "../DataSet/DataSet.h"
-#include "../toolkits/toolkits.h"
-
-#define RIFTINFOSIZE 11
-
-struct Model {
-
-	char*   name;
-	char*   repository;
-	char*   meshtype;
-	int     analysis_type;
-	int     sub_analysis_type;
-	int     qmu_analysis;
-	char*   solverstring;
-
-	/*2d mesh: */
-	int     numberofelements;
-	int     numberofnodes;
-	double* x;
-	double* y;
-	double* z;
-	double* elements;
-	double* elements_type;
-
-	/*3d mesh: */
-	int     numberofnodes2d;
-	int     numberofelements2d;
-	double* elements2d;
-	double* deadgrids;
-	int     numlayers;
-	double* uppernodes;
-
-	/*elements type: */
-	int     ishutter;
-	int     ismacayealpattyn;
-	int     isstokes;
-	double* gridonhutter;
-	double* gridonmacayeal;
-	double* gridonpattyn;
-
-	/*results: */
-	double* vx;
-	double* vy;
-	double* vz;
-	double* pressure;
-	double* temperature;
-
-	/*observations: */
-	double*  vx_obs;
-	double*  vy_obs;
-
-	/*qmu: */
-	int      numberofresponses;
-	int      numberofvariables;
-	int      qmu_npart;
-
-	/*geometry: */
-	double* elementonbed;
-	double* elementonsurface;
-	double* gridonbed;
-	double* gridonsurface;
-	double* gridonstokes;
-	double* borderstokes;
-	double* thickness;
-	double* surface;
-	double* bed;
-	double* elementoniceshelf;
-	double* elementonwater;
-	double* gridonicesheet;
-	double* gridoniceshelf;
-
-	/*friction: */
-	int     drag_type;
-	double* drag;
-	double* p;
-	double* q;
-
-	/*boundary conditions: */
-	int     numberofpressureloads;
-	int     numberofpressureloads_stokes;
-	double* pressureload;
-	double* pressureload_stokes;
-	double* spcvelocity;
-	double* spctemperature;
-	double* spcthickness;
-	double* geothermalflux;
-	
-	/*materials: */
-	double  rho_water,rho_ice;
-	double  g;
-	double* B;
-	double* n;
-
-	/*control methods: */
-	char*	control_type;
-
-	/*solution parameters: */
-	double* fit;
-	double  meanvel,epsvel;
-	int     artificial_diffusivity;
-	int     nsteps;
-	double  tolx;
-	double* maxiter;
-	double  mincontrolconstraint;
-	double  maxcontrolconstraint;
-	int     debug;
-	int     plot;
-	double  eps_res;
-	double  eps_rel;
-	double  eps_abs;
-	double  dt,ndt;
-	double  penalty_offset;
-	double  penalty_melting;
-	int     penalty_lock;
-	double  sparsity;
-	int     connectivity;
-	int     lowmem;
-	double* optscal;
-	double  yts;
-	double  viscosity_overshoot;
-	double  stokesreconditioning;
-	int     waitonlock;
-
-	/*thermal parameters: */
-	double beta;
-	double meltingpoint;
-	double latentheat;
-	double  heatcapacity,thermalconductivity;
-	int    min_thermal_constraints;
-	double mixed_layer_capacity;
-	double thermal_exchange_velocity;
-
-	/*rifts: */
-	int      numrifts;
-	double*  riftinfo;
-
-	/*penalties: */
-	int      numpenalties;
-	double*  penalties;
-	
-	/*basal: */
-	double*  melting;
-	double*  accumulation;
-
-
-	/*exterior data: */
-	int* epart; /*!element partitioning.*/
-	int* npart; /*!node partitioning.*/
-	int* my_grids; /*! grids that belong to this cpu*/
-	double* my_bordergrids; /*! grids that belong to this cpu, and some other cpu also*/
-	int*     penaltypartitioning;
-
-};
-
-
-
-	/*constructor and destructor: */
-	Model*	NewModel(void);
-	void    DeleteModel( Model** pthis);
-
-	/*Echo: */
-	void    ModelEcho(Model* model,int which_part,int rank);
-
-	/*Initialization with matlab workspace data, or marshall binary data: */
-	int	    ModelInit(Model** pmodel,ConstDataHandle model_handle);
-
-	/*Creation of fem datasets: general drivers*/
-	void    CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,DataSet** pparameters,Model* model,ConstDataHandle model_handle);
-	void    CreateParameters(DataSet** pparameters,Model* model,ConstDataHandle model_handle);
-
-	
-	/*Create of fem datasets: specialised drivers: */
-	
-	/*diagnostic horizontal*/
-	void	CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle);
-	void	CreateConstraintsDiagnosticHoriz(DataSet** pconstraints,Model* model,ConstDataHandle model_handle);
-	void    CreateLoadsDiagnosticHoriz(DataSet** ploads, Model* model, ConstDataHandle model_handle);
-	void    CreateParametersDiagnosticHoriz(DataSet** pparameters,Model* model,ConstDataHandle model_handle);
-
-	/*diagnostic vertical*/
-	void	CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle);
-	void	CreateConstraintsDiagnosticVert(DataSet** pconstraints,Model* model,ConstDataHandle model_handle);
-	void    CreateLoadsDiagnosticVert(DataSet** ploads, Model* model, ConstDataHandle model_handle);
-
-	/*diagnostic hutter*/
-	void	CreateElementsNodesAndMaterialsDiagnosticHutter(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle);
-	void	CreateConstraintsDiagnosticHutter(DataSet** pconstraints,Model* model,ConstDataHandle model_handle);
-	void    CreateLoadsDiagnosticHutter(DataSet** ploads, Model* model, ConstDataHandle model_handle);
-
-	/*diagnostic stokes*/
-	void	CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle);
-	void	CreateConstraintsDiagnosticStokes(DataSet** pconstraints,Model* model,ConstDataHandle model_handle);
-	void    CreateLoadsDiagnosticStokes(DataSet** ploads, Model* model, ConstDataHandle model_handle);
-
-	/*slope compute*/
-	void	CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle);
-	void	CreateConstraintsSlopeCompute(DataSet** pconstraints,Model* model,ConstDataHandle model_handle);
-	void    CreateLoadsSlopeCompute(DataSet** ploads, Model* model, ConstDataHandle model_handle);
-
-	/*control:*/
-	void    CreateParametersControl(DataSet** pparameters,Model* model,ConstDataHandle model_handle);
-
-	/*thermal:*/
-	void	CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle);
-	void	CreateConstraintsThermal(DataSet** pconstraints,Model* model,ConstDataHandle model_handle);
-	void    CreateLoadsThermal(DataSet** ploads, Model* model, ConstDataHandle model_handle);
-	void    CreateParametersThermal(DataSet** pparameters,Model* model,ConstDataHandle model_handle);
-
-	/*melting:*/
-	void	CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle);
-	void	CreateConstraintsMelting(DataSet** pconstraints,Model* model,ConstDataHandle model_handle);
-	void    CreateLoadsMelting(DataSet** ploads, Model* model, ConstDataHandle model_handle);
-	void    CreateParametersMelting(DataSet** pparameters,Model* model,ConstDataHandle model_handle);
-
-	/*prognostic:*/
-	void	CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle);
-	void	CreateConstraintsPrognostic(DataSet** pconstraints,Model* model,ConstDataHandle model_handle);
-	void    CreateLoadsPrognostic(DataSet** ploads, Model* model, ConstDataHandle model_handle);
-	void    CreateParametersPrognostic(DataSet** pparameters,Model* model,ConstDataHandle model_handle);
-
-	/*qmu: */
-	void CreateParametersQmu(DataSet** pparameters,Model* model,ConstDataHandle model_handle);
-
-
-#endif  /* _MODEL_H */
