Index: issm/trunk/src/c/parallel/transient.cpp
===================================================================
--- issm/trunk/src/c/parallel/transient.cpp	(revision 1719)
+++ issm/trunk/src/c/parallel/transient.cpp	(revision 1820)
@@ -26,6 +26,6 @@
 	int   qmu_analysis=0;
 
-	/*Fem models : */
-	FemModel femmodels[8];
+	/*Model: */
+	Model* model=NULL;
 	int dim=-1;
 
@@ -65,42 +65,45 @@
 	fid=pfopen(inputfilename,"rb");
 
+	/*Initialize model structure: */
+	model=new Model();
+
 	_printf_("read and create finite element model:\n");
 	_printf_("\n   reading diagnostic horiz model data:\n");
-	CreateFemModel(&femmodels[0],fid,DiagnosticAnalysisEnum(),HorizAnalysisEnum());
+	CreateFemModel(model->DiagnosticHorizontal(),fid,DiagnosticAnalysisEnum(),HorizAnalysisEnum());
 	_printf_("\n   reading diagnostic vert model data:\n");
-	CreateFemModel(&femmodels[1],fid,DiagnosticAnalysisEnum(),VertAnalysisEnum());
+	CreateFemModel(model->DiagnosticVertical(),fid,DiagnosticAnalysisEnum(),VertAnalysisEnum());
 	_printf_("\n   reading diagnostic stokes model data:\n");
-	CreateFemModel(&femmodels[2],fid,DiagnosticAnalysisEnum(),StokesAnalysisEnum());
+	CreateFemModel(model->DiagnosticStokes(),fid,DiagnosticAnalysisEnum(),StokesAnalysisEnum());
 	_printf_("\n   reading diagnostic hutter model data:\n");
-	CreateFemModel(&femmodels[3],fid,DiagnosticAnalysisEnum(),HutterAnalysisEnum());
+	CreateFemModel(model->DiagnosticHutter(),fid,DiagnosticAnalysisEnum(),HutterAnalysisEnum());
 	_printf_("\n   reading surface and bed slope computation model data:\n");
-	CreateFemModel(&femmodels[4],fid,SlopeComputeAnalysisEnum(),NoneAnalysisEnum());
+	CreateFemModel(model->Slope(),fid,SlopeComputeAnalysisEnum(),NoneAnalysisEnum());
 	_printf_("\n   reading prognositc model data:\n");
-	CreateFemModel(&femmodels[5],fid,PrognosticAnalysisEnum(),NoneAnalysisEnum());
+	CreateFemModel(model->Prognostic(),fid,PrognosticAnalysisEnum(),NoneAnalysisEnum());
 	
 	/*Do we run in 3d?, in which case we need thermal and melting also:*/
-	femmodels[0].parameters->FindParam((void*)&dim,"dim");
+	model->DiagnosticHorizontal()->parameters->FindParam((void*)&dim,"dim");
 	if(dim==3){
 		_printf_("read and create thermal finite element model:\n");
-		CreateFemModel(&femmodels[6],fid,ThermalAnalysisEnum(),TransientAnalysisEnum());
+		CreateFemModel(model->Thermal(),fid,ThermalAnalysisEnum(),TransientAnalysisEnum());
 		_printf_("read and create melting finite element model:\n");
-		CreateFemModel(&femmodels[7],fid,MeltingAnalysisEnum(),TransientAnalysisEnum());
+		CreateFemModel(model->Melting(),fid,MeltingAnalysisEnum(),TransientAnalysisEnum());
 	}
 
 	_printf_("initialize inputs:\n");
 	inputs=new ParameterInputs;
-	femmodels[5].parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+	model->Thermal()->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
 	
-	femmodels[5].parameters->FindParam((void*)&u_g,"u_g");
+	model->Thermal()->parameters->FindParam((void*)&u_g,"u_g");
 	inputs->Add("velocity",u_g,3,numberofnodes);
 
-	femmodels[5].parameters->FindParam((void*)&m_g,"m_g");
+	model->Thermal()->parameters->FindParam((void*)&m_g,"m_g");
 	inputs->Add("melting",m_g,1,numberofnodes);
 
-	femmodels[5].parameters->FindParam((void*)&a_g,"a_g");
+	model->Thermal()->parameters->FindParam((void*)&a_g,"a_g");
 	inputs->Add("accumulation",a_g,1,numberofnodes);
 
-	femmodels[5].parameters->FindParam((void*)&dt,"dt");
-	femmodels[5].parameters->FindParam((void*)&yts,"yts");
+	model->Thermal()->parameters->FindParam((void*)&dt,"dt");
+	model->Thermal()->parameters->FindParam((void*)&yts,"yts");
 	inputs->Add("dt",dt*yts);
 	
@@ -109,10 +112,10 @@
 
 	/*are we running the solution sequence, or a qmu wrapper around it? : */
-	femmodels[5].parameters->FindParam((void*)&qmu_analysis,"qmu_analysis");
+	model->Thermal()->parameters->FindParam((void*)&qmu_analysis,"qmu_analysis");
 	if(!qmu_analysis){
 
 		/*run diagnostic analysis: */
 		_printf_("call computational core:\n");
-		transient_core(results,femmodels,inputs);
+		transient_core(results,model,inputs);
 	}
 	else{
@@ -121,5 +124,5 @@
 
 		#ifdef _HAVE_DAKOTA_ 
-		Qmux(&femmodels[0],inputs,TransientAnalysisEnum(),NoneAnalysisEnum());
+		Qmux(model,inputs,TransientAnalysisEnum(),NoneAnalysisEnum());
 	 	#else
 		throw ErrorException(__FUNCT__," Dakota not present, cannot do qmu!");
@@ -132,5 +135,5 @@
 
 	_printf_("process results:\n");
-	ProcessResults(&results,&femmodels[0],TransientAnalysisEnum());
+	ProcessResults(&results,model,TransientAnalysisEnum());
 	
 	_printf_("write results to disk:\n");
@@ -138,5 +141,5 @@
 
 	_printf_("write lock file:\n");
-	femmodels[0].parameters->FindParam((void*)&waitonlock,"waitonlock");
+	model->DiagnosticHorizontal()->parameters->FindParam((void*)&waitonlock,"waitonlock");
 	if (waitonlock){
 		WriteLockFile(lockname);
