Index: /issm/trunk/cron/configs/linux64_local
===================================================================
--- /issm/trunk/cron/configs/linux64_local	(revision 2332)
+++ /issm/trunk/cron/configs/linux64_local	(revision 2333)
@@ -77,3 +77,3 @@
 #by Matlab and nightlyrun.m
 
-NROPTIONS="'analysis_type',{'diagnostic'},'control',1"
+NROPTIONS=""
Index: /issm/trunk/src/c/ComputePressurex/ComputePressurex.cpp
===================================================================
--- /issm/trunk/src/c/ComputePressurex/ComputePressurex.cpp	(revision 2332)
+++ /issm/trunk/src/c/ComputePressurex/ComputePressurex.cpp	(revision 2333)
@@ -13,12 +13,16 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void	ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, int numberofnodes){
+void	ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials,DataSet* parameters){
 
 	int i;
 
 	int  found=0;
+	double numberofnodes;
 
 	/*output: */
 	Vec p_g=NULL;
+
+	/*Recover numberofnodes: */
+    parameters->FindParam(&numberofnodes,"numberofnodes");
 
 	/*Allocate p_g on numberofnodes (only 1 dof): */
@@ -26,5 +30,6 @@
 
 	/*Get elements configured: */
-	elements->Configure(elements,loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Call on dataset driver: */
Index: /issm/trunk/src/c/ComputePressurex/ComputePressurex.h
===================================================================
--- /issm/trunk/src/c/ComputePressurex/ComputePressurex.h	(revision 2332)
+++ /issm/trunk/src/c/ComputePressurex/ComputePressurex.h	(revision 2333)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-void	ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, int numberofnodes);
+void	ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials,  DataSet* parameters);
 
 #endif  /* _COMPUTEPRESSUREX_H */
Index: /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp
===================================================================
--- /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 2332)
+++ /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 2333)
@@ -13,5 +13,5 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-int	ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes,DataSet* materials){
+int	ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes,DataSet* materials,DataSet* parameters){
 
 	int noerr=1;
@@ -24,7 +24,8 @@
 
 
-	elements->Configure(elements,loads,nodes,materials);
-	loads->Configure(elements,loads,nodes,materials);
-	nodes->Configure(elements,loads,nodes,materials);
+	elements->Configure(elements,loads,nodes,materials,parameters);
+	loads->Configure(elements,loads,nodes,materials,parameters);
+	nodes->Configure(elements,loads,nodes,materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	return noerr;
Index: /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h
===================================================================
--- /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h	(revision 2332)
+++ /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h	(revision 2333)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-int		ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* materials);
+int		ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* materials, DataSet* parameters);
 
 #endif  /* _CONFIGUREOBJECTSX_H */
Index: /issm/trunk/src/c/DataSet/DataSet.cpp
===================================================================
--- /issm/trunk/src/c/DataSet/DataSet.cpp	(revision 2332)
+++ /issm/trunk/src/c/DataSet/DataSet.cpp	(revision 2333)
@@ -235,4 +235,10 @@
 			dataset->AddObject(param);
 		}
+		else if(enum_type==NumparEnum()){
+			Numpar* numpar=NULL;
+			numpar=new Numpar();
+			numpar->Demarshall(&marshalled_dataset);
+			dataset->AddObject(numpar);
+		}
 		else if(enum_type==TriaEnum()){
 			Tria* tria=NULL;
@@ -315,7 +321,9 @@
 
 }
-		
-int   DataSet::FindParam(void* pvalue, char* name){
-
+
+#undef __FUNCT__ 
+#define __FUNCT__ "DataSet::FindParam"
+int   DataSet::FindParam(double* pscalar, char* name){
+	
 	/*Go through a dataset, and find a Param* object 
 	 *which parameter name is "name" : */
@@ -336,5 +344,5 @@
 			if (strcmp(param->GetParameterName(),name)==0){
 				/*Ok, this is the one! Recover the value of this parameter: */
-				param->GetParameterValue(pvalue);
+				param->GetParameterValue(pscalar);
 				found=1;
 				break;
@@ -345,4 +353,197 @@
 }
 
+#undef __FUNCT__ 
+#define __FUNCT__ "DataSet::FindParam"
+int   DataSet::FindParam(int* pinteger,char* name){
+	
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum()){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if (strcmp(param->GetParameterName(),name)==0){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pinteger);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "DataSet::FindParam"
+int   DataSet::FindParam(char** pstring,char* name){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum()){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if (strcmp(param->GetParameterName(),name)==0){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pstring);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+#undef __FUNCT__ 
+#define __FUNCT__ "DataSet::FindParam"
+int   DataSet::FindParam(char*** pstringarray,int* pM,char* name){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum()){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if (strcmp(param->GetParameterName(),name)==0){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pstringarray);
+				if(pM)*pM=param->GetM();
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+#undef __FUNCT__ 
+#define __FUNCT__ "DataSet::FindParam"
+int   DataSet::FindParam(double** pdoublearray,int* pM, int* pN,char* name){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum()){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if (strcmp(param->GetParameterName(),name)==0){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pdoublearray);
+				if(pM)param->GetM();
+				if(pN)param->GetN();
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+#undef __FUNCT__ 
+#define __FUNCT__ "DataSet::FindParam"
+int   DataSet::FindParam(Vec* pvec,char* name){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum()){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if (strcmp(param->GetParameterName(),name)==0){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pvec);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+#undef __FUNCT__ 
+#define __FUNCT__ "DataSet::FindParam"
+int   DataSet::FindParam(Mat* pmat,char* name){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum()){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if (strcmp(param->GetParameterName(),name)==0){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pmat);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "DataSet::FindResult"
 int   DataSet::FindResult(Vec* presult,char* name){
 
@@ -888,5 +1089,5 @@
 
 
-void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials){
+void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials,DataSet* parameters){
 
 	vector<Object*>::iterator object;
@@ -894,4 +1095,5 @@
 	Load* load=NULL;
 	Node* node=NULL;
+	Numpar* numpar=NULL;
 
 	for ( object=objects.begin() ; object < objects.end(); object++ ){
@@ -900,5 +1102,5 @@
 
 			element=(Element*)(*object);
-			element->Configure(loads,nodes,materials);
+			element->Configure(loads,nodes,materials,parameters);
 		}
 		if(EnumIsLoad((*object)->Enum())){
@@ -912,4 +1114,9 @@
 			node=(Node*)(*object);
 			node->Configure(nodes);
+		}
+		
+		if((*object)->Enum()==NumparEnum()){
+			numpar=(Numpar*)(*object);
+			numpar->Configure(parameters);
 		}
 
Index: /issm/trunk/src/c/DataSet/DataSet.h
===================================================================
--- /issm/trunk/src/c/DataSet/DataSet.h	(revision 2332)
+++ /issm/trunk/src/c/DataSet/DataSet.h	(revision 2333)
@@ -44,5 +44,11 @@
 		int   DeleteObject(int id);
 		int   Size();
-		int   FindParam(void* pvalue, char* name);
+		int   FindParam(double* pscalar, char* name);
+		int   FindParam(int* pinteger,char* name);
+		int   FindParam(char** pstring,char* name);
+		int   FindParam(char*** pstringarray,int* pM,char* name);
+		int   FindParam(double** pdoublearray,int* pM,int* pN,char* name);
+		int   FindParam(Vec* pvec,char* name);
+		int   FindParam(Mat* pmat,char* name);
 		int   FindResult(Vec* presult,char* name);
 		Object* FindParamObject(char* name);
@@ -58,5 +64,5 @@
 		void  FlagNodeSets(Vec pv_g, Vec pv_m, Vec pv_n, Vec pv_f, Vec pv_s);
 		void  clear();
-		void  Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials);
+		void  Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials,DataSet* parameters);
 		Object* GetObjectByOffset(int offset);
 		Object* GetObjectById(int* poffset,int eid);
Index: /issm/trunk/src/c/Dofx/Dofx.cpp
===================================================================
--- /issm/trunk/src/c/Dofx/Dofx.cpp	(revision 2332)
+++ /issm/trunk/src/c/Dofx/Dofx.cpp	(revision 2333)
@@ -35,9 +35,9 @@
 
 	/*First, recover number of grids from parameters: */
-	found=params->FindParam((void*)&numberofnodes,"numberofnodes");
+	found=params->FindParam(&numberofnodes,"numberofnodes");
 	if(!found)throw ErrorException(__FUNCT__," could not find numberofnodes in parameters");
 
 	/*Recover number of dofs per node: */
-	found=params->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
+	found=params->FindParam(&numberofdofspernode,"numberofdofspernode");
 	if(!found)throw ErrorException(__FUNCT__," could not find numberofdofspernode in parameters");
 
Index: /issm/trunk/src/c/Dux/Dux.cpp
===================================================================
--- /issm/trunk/src/c/Dux/Dux.cpp	(revision 2332)
+++ /issm/trunk/src/c/Dux/Dux.cpp	(revision 2333)
@@ -13,5 +13,5 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,
 			ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
 
@@ -24,5 +24,6 @@
 
 	/*First, get elements and loads configured: */
-	elements->Configure(elements,loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Get size of matrix: */
Index: /issm/trunk/src/c/Dux/Dux.h
===================================================================
--- /issm/trunk/src/c/Dux/Dux.h	(revision 2332)
+++ /issm/trunk/src/c/Dux/Dux.h	(revision 2333)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters, 
 			ParameterInputs* inputs,int analysis_type,int sub_analysis_type);
 
Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp	(revision 2332)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp	(revision 2333)
@@ -81,4 +81,5 @@
 int MaticeEnum(void){                   return          441; }
 int MatparEnum(void){                   return          442; }
+int NumparEnum(void){                   return          443; }
 /*Inputs: */
 int InputEnum(void){                    return          450; }
Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 2332)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 2333)
@@ -82,4 +82,5 @@
 int MaticeEnum(void);
 int MatparEnum(void);
+int NumparEnum(void);
 /*Inputs: */
 int InputEnum(void);
Index: /issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.cpp
===================================================================
--- /issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.cpp	(revision 2332)
+++ /issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.cpp	(revision 2333)
@@ -13,11 +13,12 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,char* fieldname){
+void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* fieldname){
 
 	double* field_serial=NULL;
 
 	/*First, get elements and nodes configured: */
-	elements->Configure(elements,loads, nodes, materials);
-	nodes->Configure(elements,loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	nodes->Configure(elements,loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Serialize field: */
Index: /issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.h
===================================================================
--- /issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.h	(revision 2332)
+++ /issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.h	(revision 2333)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,char* fieldname);
+void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* fieldname);
 
 #endif  /* _FIELDDEPTHAVERAGEX_H */
Index: /issm/trunk/src/c/FieldExtrudex/FieldExtrudex.cpp
===================================================================
--- /issm/trunk/src/c/FieldExtrudex/FieldExtrudex.cpp	(revision 2332)
+++ /issm/trunk/src/c/FieldExtrudex/FieldExtrudex.cpp	(revision 2333)
@@ -13,11 +13,12 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,char* field_name,int collapse){
+void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* field_name,int collapse){
 
 	double* field_serial=NULL;
 
 	/*First, get elements and nodes configured: */
-	elements->Configure(elements,loads, nodes, materials);
-	nodes->Configure(elements,loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	nodes->Configure(elements,loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Serialize field: */
Index: /issm/trunk/src/c/FieldExtrudex/FieldExtrudex.h
===================================================================
--- /issm/trunk/src/c/FieldExtrudex/FieldExtrudex.h	(revision 2332)
+++ /issm/trunk/src/c/FieldExtrudex/FieldExtrudex.h	(revision 2333)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,char* field_name, int collapse);
+void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* field_name, int collapse);
 
 #endif  /* _FIELDEXTRUDEX_H */
Index: /issm/trunk/src/c/Gradjx/Gradjx.cpp
===================================================================
--- /issm/trunk/src/c/Gradjx/Gradjx.cpp	(revision 2332)
+++ /issm/trunk/src/c/Gradjx/Gradjx.cpp	(revision 2333)
@@ -13,5 +13,5 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,
 			ParameterInputs* inputs,int analysis_type,int sub_analysis_type,char* control_type){
 
@@ -20,5 +20,6 @@
 
 	/*First, get elements and loads configured: */
-	elements->Configure(elements,loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Allocate grad_g: */
Index: /issm/trunk/src/c/Gradjx/Gradjx.h
===================================================================
--- /issm/trunk/src/c/Gradjx/Gradjx.h	(revision 2332)
+++ /issm/trunk/src/c/Gradjx/Gradjx.h	(revision 2333)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,  DataSet* parameters,
 			ParameterInputs* inputs,int analysis_type,int sub_analysis_type,char* control_type);
 
Index: /issm/trunk/src/c/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp
===================================================================
--- /issm/trunk/src/c/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp	(revision 2332)
+++ /issm/trunk/src/c/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp	(revision 2333)
@@ -117,18 +117,18 @@
 		/*Get indices i and j that form a square around the currant triangle*/
 		if (yflip){
-			i1=floor((y_tria_max-y_grid_max)/yposting)-1;
-			i2= ceil((y_tria_min-y_grid_max)/yposting);
+			i1=(int)floor((y_tria_max-y_grid_max)/yposting)-1;
+			i2= (int)ceil((y_tria_min-y_grid_max)/yposting);
 		}
 		else{
-			i1=floor((y_tria_min-y_grid_min)/yposting)-1;
-			i2= ceil((y_tria_max-y_grid_min)/yposting);
+			i1=(int)floor((y_tria_min-y_grid_min)/yposting)-1;
+			i2= (int)ceil((y_tria_max-y_grid_min)/yposting);
 		}
 		if (xflip){
-			j1=floor((x_tria_max-x_grid_max)/xposting)-1;
-			j2= ceil((x_tria_min-x_grid_max)/xposting);
+			j1=(int)floor((x_tria_max-x_grid_max)/xposting)-1;
+			j2= (int)ceil((x_tria_min-x_grid_max)/xposting);
 		}
 		else{
-			j1=floor((x_tria_min-x_grid_min)/xposting)-1;
-			j2= ceil((x_tria_max-x_grid_min)/xposting);
+			j1=(int)floor((x_tria_min-x_grid_min)/xposting)-1;
+			j2= (int)ceil((x_tria_max-x_grid_min)/xposting);
 		}
 
Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 2332)
+++ /issm/trunk/src/c/Makefile.am	(revision 2333)
@@ -60,4 +60,6 @@
 					./objects/Matpar.h\
 					./objects/Matpar.cpp\
+					./objects/Numpar.h\
+					./objects/Numpar.cpp\
 					./objects/Input.h\
 					./objects/Input.cpp\
@@ -170,13 +172,8 @@
 					./io/WriteData.cpp\
 					./io/WriteDataToDisk.cpp\
-					./io/SerialFetchData.cpp\
-					./io/ParallelFetchData.cpp\
-					./io/ParallelFetchInteger.cpp\
-					./io/ParallelFetchMat.cpp\
-					./io/ParallelFetchScalar.cpp\
-					./io/ParallelFetchString.cpp\
 					./io/IoModelFetchData.cpp\
 					./io/WriteNodeSets.cpp\
 					./io/WriteParams.cpp\
+					./io/FetchParams.cpp\
 					./io/FetchNodeSets.cpp\
 					./io/ParameterInputsInit.cpp\
@@ -359,4 +356,6 @@
 					./objects/Matpar.h\
 					./objects/Matpar.cpp\
+					./objects/Numpar.h\
+					./objects/Numpar.cpp\
 					./objects/Input.h\
 					./objects/Input.cpp\
@@ -467,10 +466,4 @@
 					./io/WriteData.cpp\
 					./io/WriteDataToDisk.cpp\
-					./io/SerialFetchData.cpp\
-					./io/ParallelFetchData.cpp\
-					./io/ParallelFetchInteger.cpp\
-					./io/ParallelFetchMat.cpp\
-					./io/ParallelFetchScalar.cpp\
-					./io/ParallelFetchString.cpp\
 					./io/IoModelFetchData.cpp\
 					./io/WriteNodeSets.cpp\
Index: /issm/trunk/src/c/MassFluxx/MassFluxx.cpp
===================================================================
--- /issm/trunk/src/c/MassFluxx/MassFluxx.cpp	(revision 2332)
+++ /issm/trunk/src/c/MassFluxx/MassFluxx.cpp	(revision 2333)
@@ -13,6 +13,5 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
-		double* segments,int num_segments,double* ug){
+void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,DataSet* parameters,  double* segments,int num_segments,double* ug){
 
 	int i,j;
@@ -28,6 +27,7 @@
 
 	/*First, get elements and loads configured: */
-	elements->Configure(elements,loads, nodes, materials);
-	loads->Configure(elements, loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	loads->Configure(elements, loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Go through segments, and then elements, and figure out which elements belong to a segment. 
Index: /issm/trunk/src/c/MassFluxx/MassFluxx.h
===================================================================
--- /issm/trunk/src/c/MassFluxx/MassFluxx.h	(revision 2332)
+++ /issm/trunk/src/c/MassFluxx/MassFluxx.h	(revision 2333)
@@ -10,5 +10,5 @@
 
 /* local prototypes: */
-void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,double* segments,int num_segments,double* ug);
+void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,double* segments,int num_segments,double* ug);
 
 
Index: /issm/trunk/src/c/Misfitx/Misfitx.cpp
===================================================================
--- /issm/trunk/src/c/Misfitx/Misfitx.cpp	(revision 2332)
+++ /issm/trunk/src/c/Misfitx/Misfitx.cpp	(revision 2333)
@@ -13,5 +13,5 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,DataSet* parameters,
 			ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
 	
@@ -21,5 +21,6 @@
 	
 	/*First, get elements and loads configured: */
-	elements->Configure(elements,loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Compute gradients: */
Index: /issm/trunk/src/c/Misfitx/Misfitx.h
===================================================================
--- /issm/trunk/src/c/Misfitx/Misfitx.h	(revision 2332)
+++ /issm/trunk/src/c/Misfitx/Misfitx.h	(revision 2333)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
+void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters, 
 			ParameterInputs* inputs,int analysis_type,int sub_analysis_type);
 
Index: /issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 2333)
@@ -45,6 +45,6 @@
 	//control analysis?
 	count++;
-	param= new Param(count,"control_analysis",INTEGER);
-	param->SetInteger(iomodel->control_analysis);
+	param= new Param(count,"control_analysis",DOUBLE);
+	param->SetDouble(iomodel->control_analysis);
 	parameters->AddObject(param);
 	
@@ -66,12 +66,12 @@
 		/*control_steady: */
 		count++;
-		param= new Param(count,"control_steady",INTEGER);
-		param->SetInteger(0);
+		param= new Param(count,"control_steady",DOUBLE);
+		param->SetDouble(0);
 		parameters->AddObject(param);
 
 		/*nsteps: */
 		count++;
-		param= new Param(count,"nsteps",INTEGER);
-		param->SetInteger(iomodel->nsteps);
+		param= new Param(count,"nsteps",DOUBLE);
+		param->SetDouble(iomodel->nsteps);
 		parameters->AddObject(param);
 
@@ -119,8 +119,8 @@
 
 		/*Now, recover fit, optscal and maxiter as vectors: */
-		IoModelFetchData((void**)&iomodel->fit,NULL,NULL,iomodel_handle,"fit","Matrix","Mat");
-		IoModelFetchData((void**)&iomodel->cm_jump,NULL,NULL,iomodel_handle,"cm_jump","Matrix","Mat");
-		IoModelFetchData((void**)&iomodel->optscal,NULL,NULL,iomodel_handle,"optscal","Matrix","Mat");
-		IoModelFetchData((void**)&iomodel->maxiter,NULL,NULL,iomodel_handle,"maxiter","Matrix","Mat");
+		IoModelFetchData(&iomodel->fit,NULL,NULL,iomodel_handle,"fit");
+		IoModelFetchData(&iomodel->cm_jump,NULL,NULL,iomodel_handle,"cm_jump");
+		IoModelFetchData(&iomodel->optscal,NULL,NULL,iomodel_handle,"optscal");
+		IoModelFetchData(&iomodel->maxiter,NULL,NULL,iomodel_handle,"maxiter");
 
 		count++;
@@ -150,10 +150,10 @@
 
 		/*Get vx, vx_obs, vy, vy_obs, and the parameter value: */
-		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");
-		IoModelFetchData((void**)&vx_obs,NULL,NULL,iomodel_handle,"vx_obs","Matrix","Mat");
-		IoModelFetchData((void**)&vy_obs,NULL,NULL,iomodel_handle,"vy_obs","Matrix","Mat");
-		IoModelFetchData((void**)&control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type,"Matrix","Mat");
+		IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx");
+		IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy");
+		IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz");
+		IoModelFetchData(&vx_obs,NULL,NULL,iomodel_handle,"vx_obs");
+		IoModelFetchData(&vy_obs,NULL,NULL,iomodel_handle,"vy_obs");
+		IoModelFetchData(&control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type);
 
 		u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double));
Index: /issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp	(revision 2333)
@@ -20,5 +20,6 @@
 	DataSet* parameters = NULL;
 	Param*   param = NULL;
-	int      count=1;
+	Numpar*  numpar=NULL;
+	int      count=0;
 	int      numberofdofspernode;
 	int      dim;
@@ -33,16 +34,24 @@
 	/*Initialize dataset: */
 	parameters   = new DataSet(ParametersEnum());
-	
+
+	//solution parameters: always 1'st, to speed-up its lookup by elements..
+	count++;
+	numpar= new Numpar(count,
+			iomodel->meanvel, iomodel->epsvel, iomodel->artdiff, iomodel->viscosity_overshoot, iomodel->stokesreconditioning, iomodel->cm_noisedampening);
+	parameters->AddObject(numpar);
+
+
 	//analysis and subanalysis
 	count++;
-	param= new Param(count,"analysis_type",INTEGER);
-	param->SetInteger(iomodel->analysis_type);
-	parameters->AddObject(param);
-
-	count++;
-	param= new Param(count,"sub_analysis_type",INTEGER);
-	param->SetInteger(iomodel->sub_analysis_type);
-	parameters->AddObject(param);
-
+	param= new Param(count,"analysis_type",DOUBLE);
+	param->SetDouble(iomodel->analysis_type);
+	parameters->AddObject(param);
+
+	count++;
+	param= new Param(count,"sub_analysis_type",DOUBLE);
+	param->SetDouble(iomodel->sub_analysis_type);
+	parameters->AddObject(param);
+
+	
 	//dimension 2d or 3d:
 	if (strcmp(iomodel->meshtype,"2d")==0)dim=2;
@@ -50,28 +59,29 @@
 
 	count++;
-	param= new Param(count,"dim",INTEGER);
-	param->SetInteger(dim);
+	param= new Param(count,"dim",DOUBLE);
+	param->SetDouble(dim);
 	parameters->AddObject(param);
 
 	//elements types
 	count++;
-	param= new Param(count,"ishutter",INTEGER);
-	param->SetInteger(iomodel->ishutter);
-	parameters->AddObject(param);
-
-	count++;
-	param= new Param(count,"ismacayealpattyn",INTEGER);
-	param->SetInteger(iomodel->ismacayealpattyn);
-	parameters->AddObject(param);
-
-
-	count++;
-	param= new Param(count,"isstokes",INTEGER);
-	param->SetInteger(iomodel->isstokes);
+	param= new Param(count,"ishutter",DOUBLE);
+	param->SetDouble(iomodel->ishutter);
+	parameters->AddObject(param);
+
+	count++;
+	param= new Param(count,"ismacayealpattyn",DOUBLE);
+	param->SetDouble(iomodel->ismacayealpattyn);
+	parameters->AddObject(param);
+
+
+	count++;
+	param= new Param(count,"isstokes",DOUBLE);
+	param->SetDouble(iomodel->isstokes);
 	parameters->AddObject(param);
 
 	/*verbose: */
-	param= new Param(count,"verbose",INTEGER);
-	param->SetInteger(iomodel->verbose);
+	count++;
+	param= new Param(count,"verbose",DOUBLE);
+	param->SetDouble(iomodel->verbose);
 	parameters->AddObject(param);
 
@@ -126,12 +136,12 @@
 	/*lowmem: */
 	count++;
-	param= new Param(count,"lowmem",INTEGER);
-	param->SetInteger(iomodel->lowmem);
+	param= new Param(count,"lowmem",DOUBLE);
+	param->SetDouble(iomodel->lowmem);
 	parameters->AddObject(param);
 
 	/*connectivity: */
 	count++;
-	param= new Param(count,"connectivity",INTEGER);
-	param->SetInteger(iomodel->connectivity);
+	param= new Param(count,"connectivity",DOUBLE);
+	param->SetDouble(iomodel->connectivity);
 	parameters->AddObject(param);
 
@@ -160,4 +170,22 @@
 	parameters->AddObject(param);
 
+	/*meanvel: */
+	count++;
+	param= new Param(count,"meanvel",DOUBLE);
+	param->SetDouble(iomodel->meanvel);
+	parameters->AddObject(param);
+	
+	/*artdiff: */
+	count++;
+	param= new Param(count,"artdiff",DOUBLE);
+	param->SetDouble(iomodel->artdiff);
+	parameters->AddObject(param);
+	
+	/*epsvel: */
+	count++;
+	param= new Param(count,"epsvel",DOUBLE);
+	param->SetDouble(iomodel->epsvel);
+	parameters->AddObject(param);
+
 	/*penalty_melting: */
 	count++;
@@ -168,12 +196,12 @@
 	/*min_thermal_constraints: */
 	count++;
-	param= new Param(count,"min_thermal_constraints",INTEGER);
-	param->SetInteger(iomodel->min_thermal_constraints);
+	param= new Param(count,"min_thermal_constraints",DOUBLE);
+	param->SetDouble(iomodel->min_thermal_constraints);
 	parameters->AddObject(param);
 
 	/*stabilize_constraints: */
 	count++;
-	param= new Param(count,"stabilize_constraints",INTEGER);
-	param->SetInteger(iomodel->stabilize_constraints);
+	param= new Param(count,"stabilize_constraints",DOUBLE);
+	param->SetDouble(iomodel->stabilize_constraints);
 	parameters->AddObject(param);
 
@@ -184,8 +212,20 @@
 	parameters->AddObject(param);
 
+	/*viscosity_overshoot: */
+	count++;
+	param= new Param(count,"viscosity_overshoot",DOUBLE);
+	param->SetDouble(iomodel->viscosity_overshoot);
+	parameters->AddObject(param);
+
+	/*cm_noisedampening: */
+	count++;
+	param= new Param(count,"cm_noisedampening",DOUBLE);
+	param->SetDouble(iomodel->cm_noisedampening);
+	parameters->AddObject(param);
+
 	/*waitonlock: */
 	count++;
-	param= new Param(count,"waitonlock",INTEGER);
-	param->SetInteger(iomodel->waitonlock);
+	param= new Param(count,"waitonlock",DOUBLE);
+	param->SetDouble(iomodel->waitonlock);
 	parameters->AddObject(param);
 
@@ -198,12 +238,12 @@
 	/*plot: */
 	count++;
-	param= new Param(count,"plot",INTEGER);
-	param->SetInteger(iomodel->plot);
+	param= new Param(count,"plot",DOUBLE);
+	param->SetDouble(iomodel->plot);
 	parameters->AddObject(param);
 
 	/*numberofgrids: */
 	count++;
-	param= new Param(count,"numberofnodes",INTEGER);
-	param->SetInteger(iomodel->numberofnodes);
+	param= new Param(count,"numberofnodes",DOUBLE);
+	param->SetDouble(iomodel->numberofnodes);
 	parameters->AddObject(param);
 
@@ -212,13 +252,13 @@
 
 	count++;
-	param= new Param(count,"numberofdofspernode",INTEGER);
-	param->SetInteger(numberofdofspernode);
+	param= new Param(count,"numberofdofspernode",DOUBLE);
+	param->SetDouble(numberofdofspernode);
 	parameters->AddObject(param)
 		;
 	/*numrifts: */
-	IoModelFetchData((void**)&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo","Matrix","Mat");
-	count++;
-	param= new Param(count,"numrifts",INTEGER);
-	param->SetInteger(iomodel->numrifts);
+	IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo");
+	count++;
+	param= new Param(count,"numrifts",DOUBLE);
+	param->SetDouble(iomodel->numrifts);
 	parameters->AddObject(param);
 	xfree((void**)&iomodel->riftinfo); 
@@ -227,6 +267,6 @@
 	/*parameteroutput: */
 	count++;
-	param= new Param(count,"numoutput",INTEGER);
-	param->SetInteger(iomodel->numoutput);
+	param= new Param(count,"numoutput",DOUBLE);
+	param->SetDouble(iomodel->numoutput);
 	parameters->AddObject(param);
 
@@ -238,5 +278,5 @@
 		for(i=0;i<iomodel->numoutput;i++){
 			pfield2=mxGetCell(pfield,i);
-			FetchData((void**)&descriptor,NULL,NULL,pfield2,"String",NULL);
+			FetchData(&descriptor,pfield2);
 			parameteroutput[i]=descriptor;
 		}
@@ -245,5 +285,5 @@
 		for(i=0;i<iomodel->numoutput;i++){
 			sprintf(tag,"%s%i","parameteroutput_",i);
-			IoModelFetchData((void**)&descriptor,NULL,NULL,iomodel_handle,tag,"String",NULL);
+			IoModelFetchData(&descriptor,iomodel_handle,tag);
 			parameteroutput[i]=descriptor;
 		}
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp	(revision 2333)
@@ -47,6 +47,6 @@
 
 	/*Fetch data: */
-	IoModelFetchData((void**)&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity","Matrix","Mat");
-	IoModelFetchData((void**)&gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");
+	IoModelFetchData(&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity");
+	IoModelFetchData(&gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
 
 	count=0;
@@ -96,5 +96,5 @@
 	/*First fetch penalties: */
 	if (strcmp(iomodel->meshtype,"3d")==0){
-		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+		IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
 	}
 
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp	(revision 2333)
@@ -52,4 +52,5 @@
 	int tria_mid;
 	int tria_mparid;
+	int tria_numparid;
 	int tria_g[3];
 	double tria_h[3];
@@ -64,8 +65,4 @@
 	double tria_q;
 	int    tria_shelf;
-	double tria_meanvel;/*!scaling ratio for velocities*/
-	double tria_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
-	double tria_viscosity_overshoot;
-	int    tria_artdiff; 
 	bool   tria_onwater; 
 	
@@ -79,4 +76,5 @@
 	int penta_mid;
 	int penta_mparid;
+	int penta_numparid;
 	int penta_g[6];
 	double penta_h[6];
@@ -90,14 +88,9 @@
 	int penta_onbed;
 	int penta_onsurface;
-	double penta_meanvel;/*!scaling ratio for velocities*/
-	double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
 	int penta_collapse;
 	double penta_melting[6];
 	double penta_accumulation[6];
 	double penta_geothermalflux[6];
-	int penta_artdiff;
 	int penta_thermal_steadystate;
-	double penta_viscosity_overshoot;
-	double penta_stokesreconditioning;
 	bool   penta_onwater;
 
@@ -165,9 +158,9 @@
 	if(strcmp(iomodel->meshtype,"2d")==0){
 		/*load elements: */
-		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
 	}
 	else{
 		/*load elements2d: */
-		IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
 	}
 
@@ -180,5 +173,5 @@
 
 	/*Deal with rifts, they have to be included into one partition only, not several: */
-	IoModelFetchData((void**)&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo","Matrix","Mat");
+	IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo");
 
 	for(i=0;i<iomodel->numrifts;i++){
@@ -202,18 +195,18 @@
 
 		/*Fetch data needed: */
-		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->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","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(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+		IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+		IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+		IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+		IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
+		IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
+		IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
+		IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+		IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+		IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+		IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
+		IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
+		IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
+		IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
 		
 		for (i=0;i<iomodel->numberofelements;i++){
@@ -230,4 +223,5 @@
 				tria_mid=i+1; //refers to the corresponding material property card
 				tria_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
+				tria_numparid=1;
 
 				/*vertices offsets: */
@@ -272,12 +266,6 @@
 				tria_onwater=(bool)*(iomodel->elementonwater+i);
 
-				tria_meanvel=iomodel->meanvel;
-				tria_epsvel=iomodel->epsvel;
-
-				/*viscosity_overshoot*/
-				tria_viscosity_overshoot=iomodel->viscosity_overshoot;
-
 				/*Create tria element using its constructor:*/
-				tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater);
+				tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater);
 
 				/*Add tria element to elements dataset: */
@@ -339,20 +327,20 @@
 
 		/*Fetch data needed: */
-		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");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+		IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+		IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+		IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+		IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
+		IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
+		IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
+		IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+		IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+		IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+		IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+		IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
+		IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
+		IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
+		IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
+		IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
 		
 		for (i=0;i<iomodel->numberofelements;i++){
@@ -368,4 +356,5 @@
 				penta_mid=i+1; //refers to the corresponding material property card
 				penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
+				penta_numparid=1;
 
 				/*vertices,thickness,surface,bed and drag: */
@@ -390,11 +379,6 @@
 				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=iomodel->viscosity_overshoot;
-
 				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;
@@ -406,8 +390,8 @@
 
 				/*Create Penta using its constructor:*/
-				penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
-						penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
-						penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
-						penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater); 
+				penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
+						penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
+						penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
+						penta_thermal_steadystate,penta_onwater); 
 
 				/*Add penta element to elements dataset: */
@@ -524,5 +508,5 @@
 	
 		/*Get penalties: */
-		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+		IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
 
 		if(iomodel->numpenalties){
@@ -560,17 +544,17 @@
 	/*First fetch data: */
 	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->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","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(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
+		IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
+	}
+	IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
+	IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
+	IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
+	IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
+	IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
+	IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
 
 	/*Get number of dofs per node: */
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 2333)
@@ -79,8 +79,8 @@
 	/*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): */
-	IoModelFetchData((void**)&iomodel->pressureload,&iomodel->numberofpressureloads,NULL,iomodel_handle,"pressureload","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");
+	IoModelFetchData(&iomodel->pressureload,&iomodel->numberofpressureloads,NULL,iomodel_handle,"pressureload");
+	IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
 
 	/*First load data:*/
@@ -157,9 +157,9 @@
 	/*Create penpair loads also for rift grids, so that they don't penetrate one another, if needed: */
 	/*First fetch rifts: */
-	IoModelFetchData((void**)&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo","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->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
-	IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
+	IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
 	
 	if(iomodel->numrifts){
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateParametersDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateParametersDiagnosticHoriz.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateParametersDiagnosticHoriz.cpp	(revision 2333)
@@ -34,7 +34,7 @@
 
 	/*Get vx and vy: */
-	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");
+	IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy");
+	IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz");
 
 	ug=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double));
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp	(revision 2333)
@@ -45,5 +45,5 @@
 	
 	/*Fetch data: */
-	IoModelFetchData((void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");
+	IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
 
 	/*vx and vy are spc'd if we are not on gridonhutter: */
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp	(revision 2333)
@@ -53,4 +53,5 @@
 	int   sing_mid;
 	int   sing_mparid;
+	int   sing_numparid;
 	int   sing_g;
 	double sing_h,sing_k;
@@ -60,4 +61,5 @@
 	int   beam_mid;
 	int   beam_mparid;
+	int   beam_numparid;
 	int   beam_g[2];
 	double beam_h[2];
@@ -122,9 +124,9 @@
 	if(strcmp(iomodel->meshtype,"2d")==0){
 		/*load elements: */
-		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
 	}
 	else{
 		/*load elements2d: */
-		IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
 	}
 
@@ -141,5 +143,5 @@
 	#ifdef _PARALLEL_
 	if(strcmp(iomodel->meshtype,"2d")==0){
-		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
 		for (i=0;i<iomodel->numberofelements;i++){
 			if(my_rank==epart[i]){ 
@@ -156,5 +158,5 @@
 	}
 	else{
-		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
 		for (i=0;i<iomodel->numberofelements;i++){
 			if(my_rank==epart[i]){ 
@@ -198,14 +200,14 @@
 
 	/*Fetch data temporarily needed: */
-	IoModelFetchData((void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","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->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
-	IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
-	IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
-	IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","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(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
+	IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
+	IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
+	IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
 
 	/*2d mesh: */
@@ -224,4 +226,5 @@
 				sing_mid=i+1; //refers to the corresponding material property card
 				sing_mparid=iomodel->numberofnodes+1;//refers to the corresponding matpar property card
+				sing_numparid=1;
 				sing_g=i+1;
 				sing_h=iomodel->thickness[i];
@@ -229,5 +232,5 @@
 
 				/*Create sing element using its constructor:*/
-				sing=new Sing(sing_id, sing_mid, sing_mparid, sing_g, sing_h, sing_k);
+				sing=new Sing(sing_id, sing_mid, sing_mparid, sing_numparid, sing_g, sing_h, sing_k);
 
 				/*Add tria element to elements dataset: */
@@ -268,4 +271,5 @@
 					beam_mid=i+1; //refers to the corresponding material property card
 					beam_mparid=iomodel->numberofnodes-iomodel->numberofnodes2d+1;//refers to the corresponding matpar property card
+					beam_numparid=1;
 					beam_g[0]=i+1;
 					beam_g[1]=(int)iomodel->uppernodes[i]; //grid that lays right on top
@@ -282,5 +286,5 @@
 
 					/*Create beam element ubeam its constructor:*/
-					beam=new Beam(beam_id, beam_mid, beam_mparid, beam_g, beam_h, beam_s,beam_b,beam_k,beam_onbed);
+					beam=new Beam(beam_id, beam_mid, beam_mparid, beam_numparid,beam_g, beam_h, beam_s,beam_b,beam_k,beam_onbed);
 
 					/*Add tria element to elements dataset: */
@@ -347,17 +351,17 @@
 	/*First fetch data: */
 	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->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","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(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
+		IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
+	}
+	IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
+	IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
+	IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
+	IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
+	IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
+	IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
 	
 	/*Get number of dofs per node: */
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp	(revision 2333)
@@ -37,5 +37,5 @@
 
 	/*Fetch data: */
-	IoModelFetchData((void**)&gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes","Matrix","Mat");
+	IoModelFetchData(&gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");
 
 	count=0;
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp	(revision 2333)
@@ -58,4 +58,5 @@
 	int penta_mid;
 	int penta_mparid;
+	int penta_numparid;
 	int penta_g[6];
 	double penta_h[6];
@@ -69,14 +70,9 @@
 	int penta_onbed;
 	int penta_onsurface;
-	double penta_meanvel;/*!scaling ratio for velocities*/
-	double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
 	int penta_collapse=0;
 	double penta_melting[6];
 	double penta_accumulation[6];
 	double penta_geothermalflux[6];
-	int penta_artdiff;
 	int penta_thermal_steadystate;
-	double penta_viscosity_overshoot;
-	double penta_stokesreconditioning;
 	bool   penta_onwater;
 
@@ -139,9 +135,9 @@
 	if(strcmp(iomodel->meshtype,"2d")==0){
 		/*load elements: */
-		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
 	}
 	else{
 		/*load elements2d: */
-		IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
 	}
 
@@ -169,20 +165,20 @@
 
 		/*Fetch data needed: */
-		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");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+		IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+		IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+		IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+		IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
+		IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
+		IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
+		IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+		IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+		IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+		IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+		IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
+		IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
+		IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
+		IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
+		IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
 	
 		for (i=0;i<iomodel->numberofelements;i++){
@@ -197,4 +193,5 @@
 			penta_mid=i+1; //refers to the corresponding material property card
 			penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
+			penta_numparid=1;
 
 			/*vertices,thickness,surface,bed and drag: */
@@ -219,22 +216,13 @@
 			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=iomodel->viscosity_overshoot;
-
-			/*stokesreconditioning: */
-			penta_stokesreconditioning=iomodel->stokesreconditioning;
-
-			
 			if (*(iomodel->elements_type+2*i+1)==StokesFormulationEnum()){
 			
 				/*Create Penta using its constructor:*/
-				penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
-						penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
-						penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
-						penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater); 
+				penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
+						penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
+						penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
+						penta_thermal_steadystate,penta_onwater); 
 
 				/*Add penta element to elements dataset: */
@@ -353,5 +341,5 @@
 	
 		/*Get penalties: */
-		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+		IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
 
 		if(iomodel->numpenalties){
@@ -389,18 +377,18 @@
 	/*First fetch data: */
 	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");
+		IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
+		IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
+	}
+	IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
+	IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
+	IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
+	IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
+	IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
+	IoModelFetchData(&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");
+	IoModelFetchData(&iomodel->borderstokes,NULL,NULL,iomodel_handle,"borderstokes");
 
 
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp	(revision 2333)
@@ -63,8 +63,8 @@
 	/*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): */
-	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");
+	IoModelFetchData(&iomodel->pressureload_stokes,&numberofpressureloads_stokes,NULL,iomodel_handle,"pressureload_stokes");
+	IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
 
 	count=0;
@@ -127,7 +127,7 @@
 	//create penalties for grids on the base of icesheet. We must have wb=ub*db/dx+vb*db/dy
 
-	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");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
+	IoModelFetchData(&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");
 	
 	for (i=0;i<iomodel->numberofnodes;i++){
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 2333)
@@ -37,5 +37,5 @@
 
 	/*Fetch data: */
-	IoModelFetchData((void**)&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity","Matrix","Mat");
+	IoModelFetchData(&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity");
 
 	count=0;
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp	(revision 2333)
@@ -57,4 +57,5 @@
 	int penta_mid;
 	int penta_mparid;
+	int penta_numparid;
 	int penta_g[6];
 	double penta_h[6];
@@ -68,6 +69,4 @@
 	int penta_onbed;
 	int penta_onsurface;
-	double penta_meanvel;/*!scaling ratio for velocities*/
-	double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
 	int penta_collapse;
 	double penta_melting[6];
@@ -139,9 +138,9 @@
 	if(strcmp(iomodel->meshtype,"2d")==0){
 		/*load elements: */
-		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
 	}
 	else{
 		/*load elements2d: */
-		IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
 	}
 
@@ -159,15 +158,15 @@
 	/*Create 3d elements: */
 	/*Fetch data needed: */
-	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");
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+	IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+	IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+	IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
+	IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
 	
 	for (i=0;i<iomodel->numberofelements;i++){
@@ -182,4 +181,5 @@
 		penta_mid=i+1; //refers to the corresponding material property card
 		penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
+		penta_numparid=1;
 
 		/*vertices,thickness,surface,bed and drag: */
@@ -201,8 +201,8 @@
 
 		/*Create Penta using its constructor:*/
-		penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
-				penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
-				penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
-				penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater); 
+		penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
+				penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
+				penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
+				penta_thermal_steadystate,penta_onwater); 
 
 		/*Add penta element to elements dataset: */
@@ -309,16 +309,16 @@
 	/*First fetch data: */
 	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(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
+		IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
 	}
-	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(&iomodel->x,NULL,NULL,iomodel_handle,"x");
+	IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
+	IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
+	IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
+	IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
 
 	
Index: /issm/trunk/src/c/ModelProcessorx/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/IoModel.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/IoModel.cpp	(revision 2333)
@@ -135,4 +135,5 @@
 	iomodel->yts=0;
 	iomodel->viscosity_overshoot=0;
+	iomodel->artdiff=0;
 	iomodel->stokesreconditioning=0;
 	iomodel->waitonlock=0;
@@ -290,88 +291,89 @@
 
 	/*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->control_analysis,NULL,NULL,iomodel_handle,"control_analysis","Integer",NULL); 
-	IoModelFetchData((void**)&iomodel->meshtype,NULL,NULL,iomodel_handle,"type","String",NULL);
+	IoModelFetchData(&iomodel->name,iomodel_handle,"name"); 
+	IoModelFetchData(&iomodel->analysis_type,iomodel_handle,"analysis_type"); 
+	IoModelFetchData(&iomodel->sub_analysis_type,iomodel_handle,"sub_analysis_type"); 
+	IoModelFetchData(&iomodel->qmu_analysis,iomodel_handle,"qmu_analysis"); 
+	IoModelFetchData(&iomodel->control_analysis,iomodel_handle,"control_analysis"); 
+	IoModelFetchData(&iomodel->meshtype,iomodel_handle,"type");
 	/*!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);
+	IoModelFetchData(&iomodel->numberofnodes,iomodel_handle,"numberofgrids");
+	IoModelFetchData(&iomodel->numberofelements,iomodel_handle,"numberofelements");
 	/*!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);
+		IoModelFetchData(&iomodel->numberofelements2d,iomodel_handle,"numberofelements2d");
+		IoModelFetchData(&iomodel->numberofnodes2d,iomodel_handle,"numberofgrids2d");
+		IoModelFetchData(&iomodel->numlayers,iomodel_handle,"numlayers");
 	}
 
 
 	/*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);
+	IoModelFetchData(&iomodel->ishutter,iomodel_handle,"ishutter");
+	IoModelFetchData(&iomodel->ismacayealpattyn,iomodel_handle,"ismacayealpattyn");
+	IoModelFetchData(&iomodel->isstokes,iomodel_handle,"isstokes");
 
 	/*!Get drag_type, drag and p,q: */
-	IoModelFetchData((void**)&iomodel->drag_type,NULL,NULL,iomodel_handle,"drag_type","Integer",NULL);
+	IoModelFetchData(&iomodel->drag_type,iomodel_handle,"drag_type");
 
 	/*!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);
+	IoModelFetchData(&iomodel->rho_water,iomodel_handle,"rho_water");
+	IoModelFetchData(&iomodel->rho_ice,iomodel_handle,"rho_ice");
+	IoModelFetchData(&iomodel->g,iomodel_handle,"g");
 
 	/*Get control parameters: */
-	IoModelFetchData((void**)&iomodel->control_type,NULL,NULL,iomodel_handle,"control_type","String",NULL); 
+	IoModelFetchData(&iomodel->control_type,iomodel_handle,"control_type"); 
 
 	/*!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->verbose,NULL,NULL,iomodel_handle,"verbose","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->eps_cm,NULL,NULL,iomodel_handle,"eps_cm","Scalar",NULL);
-	IoModelFetchData((void**)&iomodel->tolx,NULL,NULL,iomodel_handle,"tolx","Scalar",NULL);
-	IoModelFetchData((void**)&iomodel->cm_noisedampening,NULL,NULL,iomodel_handle,"cm_noisedampening","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);
+	IoModelFetchData(&iomodel->yts,iomodel_handle,"yts");
+	IoModelFetchData(&iomodel->meanvel,iomodel_handle,"meanvel");
+	IoModelFetchData(&iomodel->epsvel,iomodel_handle,"epsvel");
+	IoModelFetchData(&iomodel->verbose,iomodel_handle,"verbose");
+	IoModelFetchData(&iomodel->plot,iomodel_handle,"plot");
+	IoModelFetchData(&iomodel->artificial_diffusivity,iomodel_handle,"artificial_diffusivity");
+	IoModelFetchData(&iomodel->nsteps,iomodel_handle,"nsteps");
+	IoModelFetchData(&iomodel->eps_cm,iomodel_handle,"eps_cm");
+	IoModelFetchData(&iomodel->tolx,iomodel_handle,"tolx");
+	IoModelFetchData(&iomodel->cm_noisedampening,iomodel_handle,"cm_noisedampening");
+	IoModelFetchData(&iomodel->mincontrolconstraint,iomodel_handle,"mincontrolconstraint");
+	IoModelFetchData(&iomodel->maxcontrolconstraint,iomodel_handle,"maxcontrolconstraint");
+	IoModelFetchData(&iomodel->eps_res,iomodel_handle,"eps_res");
+	IoModelFetchData(&iomodel->eps_rel,iomodel_handle,"eps_rel");
+	IoModelFetchData(&iomodel->eps_abs,iomodel_handle,"eps_abs");
+	IoModelFetchData(&iomodel->dt,iomodel_handle,"dt");
+	IoModelFetchData(&iomodel->ndt,iomodel_handle,"ndt");
+	IoModelFetchData(&iomodel->penalty_offset,iomodel_handle,"penalty_offset");
+	IoModelFetchData(&iomodel->penalty_melting,iomodel_handle,"penalty_melting");
+	IoModelFetchData(&iomodel->penalty_lock,iomodel_handle,"penalty_lock");
+	IoModelFetchData(&iomodel->sparsity,iomodel_handle,"sparsity");
+	IoModelFetchData(&iomodel->connectivity,iomodel_handle,"connectivity");
+	IoModelFetchData(&iomodel->lowmem,iomodel_handle,"lowmem");
+	IoModelFetchData(&iomodel->solverstring,iomodel_handle,"solverstring");
+	IoModelFetchData(&iomodel->viscosity_overshoot,iomodel_handle,"viscosity_overshoot");
+	IoModelFetchData(&iomodel->artdiff,iomodel_handle,"artificial_diffusivity");
+	IoModelFetchData(&iomodel->stokesreconditioning,iomodel_handle,"stokesreconditioning");
+	IoModelFetchData(&iomodel->waitonlock,iomodel_handle,"waitonlock");
 
 	/*!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->stabilize_constraints,NULL,NULL,iomodel_handle,"stabilize_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);
+	IoModelFetchData(&iomodel->beta,iomodel_handle,"beta");
+	IoModelFetchData(&iomodel->meltingpoint,iomodel_handle,"meltingpoint");
+	IoModelFetchData(&iomodel->latentheat,iomodel_handle,"latentheat");
+	IoModelFetchData(&iomodel->heatcapacity,iomodel_handle,"heatcapacity");
+	IoModelFetchData(&iomodel->thermalconductivity,iomodel_handle,"thermalconductivity");
+	IoModelFetchData(&iomodel->min_thermal_constraints,iomodel_handle,"min_thermal_constraints");
+	IoModelFetchData(&iomodel->stabilize_constraints,iomodel_handle,"stabilize_constraints");
+	IoModelFetchData(&iomodel->mixed_layer_capacity,iomodel_handle,"mixed_layer_capacity");
+	IoModelFetchData(&iomodel->thermal_exchange_velocity,iomodel_handle,"thermal_exchange_velocity");
 	
 	/*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);
+		IoModelFetchData(&iomodel->numberofvariables,iomodel_handle,"numberofvariables");
+		IoModelFetchData(&iomodel->numberofresponses,iomodel_handle,"numberofresponses");
+		IoModelFetchData(&iomodel->qmu_npart,iomodel_handle,"npart");
 	}
 	
 	/*parameter output : */
-	IoModelFetchData((void**)&iomodel->numoutput,NULL,NULL,iomodel_handle,"numoutput","Integer",NULL);
+	IoModelFetchData(&iomodel->numoutput,iomodel_handle,"numoutput");
 
 	/*Assign output pointers: */
Index: /issm/trunk/src/c/ModelProcessorx/IoModel.h
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/IoModel.h	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/IoModel.h	(revision 2333)
@@ -102,4 +102,12 @@
 	double* n;
 
+	/*numerical parameters: */
+	double  meanvel;
+	double 	epsvel;
+	int     artdiff;
+	double  viscosity_overshoot;
+	double  stokesreconditioning;
+	double  cm_noisedampening;
+
 	/*control methods: */
 	char*	control_type;
@@ -108,5 +116,4 @@
 	double* fit;
 	double* cm_jump;
-	double  meanvel,epsvel;
 	int     artificial_diffusivity;
 	int     nsteps;
@@ -114,5 +121,4 @@
 	double  tolx;
 	double* maxiter;
-	double  cm_noisedampening;
 	double  mincontrolconstraint;
 	double  maxcontrolconstraint;
@@ -131,6 +137,4 @@
 	double* optscal;
 	double  yts;
-	double  viscosity_overshoot;
-	double  stokesreconditioning;
 	int     waitonlock;
 
Index: /issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp	(revision 2333)
@@ -57,4 +57,5 @@
 	int penta_mid;
 	int penta_mparid;
+	int penta_numparid;
 	int penta_g[6];
 	double penta_h[6];
@@ -68,14 +69,9 @@
 	int penta_onbed;
 	int penta_onsurface;
-	double penta_meanvel;/*!scaling ratio for velocities*/
-	double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
 	int penta_collapse;
 	double penta_melting[6];
 	double penta_accumulation[6];
 	double penta_geothermalflux[6];
-	int penta_artdiff;
 	int penta_thermal_steadystate;
-	double penta_viscosity_overshoot;
-	double penta_stokesreconditioning;
 	bool   penta_onwater;
 
@@ -129,5 +125,5 @@
 	#ifdef _PARALLEL_
 	/*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
-	IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+	IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
 
 
@@ -146,20 +142,20 @@
 
 	/*Fetch data needed: */
-	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");
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
+	IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
+	IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+	IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+	IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+	IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
+	IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
+	IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
+	IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
 	
 	for (i=0;i<iomodel->numberofelements;i++){
@@ -174,4 +170,5 @@
 		penta_mid=i+1; //refers to the corresponding material property card
 		penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
+		penta_numparid=1;
 
 		/*vertices,thickness,surface,bed and drag: */
@@ -196,17 +193,12 @@
 		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=iomodel->viscosity_overshoot;
 		penta_collapse=1;
 
 		/*Create Penta using its constructor:*/
-		penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
-				penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
-				penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
-				penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater); 
+		penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
+				penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
+				penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
+				penta_thermal_steadystate,penta_onwater); 
 
 		/*Add penta element to elements dataset: */
@@ -320,5 +312,5 @@
 	
 		/*Get penalties: */
-		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+		IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
 
 		if(iomodel->numpenalties){
@@ -356,16 +348,16 @@
 	/*First fetch data: */
 	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(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
+		IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
 	}
-	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(&iomodel->x,NULL,NULL,iomodel_handle,"x");
+	IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
+	IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
+	IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
+	IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
 
 
Index: /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 2333)
@@ -50,5 +50,5 @@
 
 	//create penalties for grids: no grid can have a temperature over the melting point
-	IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
 
 	for (i=0;i<iomodel->numberofnodes;i++){
Index: /issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp	(revision 2333)
@@ -34,5 +34,5 @@
 
 		/*Get melting: */
-		IoModelFetchData((void**)&melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
+		IoModelFetchData(&melting,NULL,NULL,iomodel_handle,"melting");
 		if(melting) {
 			for(i=0;i<iomodel->numberofnodes;i++)melting[i]=melting[i]/iomodel->yts;   //m/s instead of m/yr
Index: /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 2333)
@@ -35,5 +35,5 @@
 
 	/*Fetch data: */
-	IoModelFetchData((void**)&spcthickness,NULL,NULL,iomodel_handle,"spcthickness","Matrix","Mat");
+	IoModelFetchData(&spcthickness,NULL,NULL,iomodel_handle,"spcthickness");
 
 	count=0;
Index: /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp	(revision 2333)
@@ -52,4 +52,5 @@
 	int tria_mid;
 	int tria_mparid;
+	int tria_numparid;
 	int tria_g[3];
 	double tria_h[3];
@@ -64,8 +65,4 @@
 	double tria_q;
 	int    tria_shelf;
-	double tria_meanvel;/*!scaling ratio for velocities*/
-	double tria_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
-	double tria_viscosity_overshoot; 
-	int    tria_artdiff; 
 	bool   tria_onwater; 
 
@@ -80,4 +77,5 @@
 	int penta_mid;
 	int penta_mparid;
+	int penta_numparid;
 	int penta_g[6];
 	double penta_h[6];
@@ -91,14 +89,9 @@
 	int penta_onbed;
 	int penta_onsurface;
-	double penta_meanvel;/*!scaling ratio for velocities*/
-	double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
 	int penta_collapse;
 	double penta_melting[6];
 	double penta_accumulation[6];
 	double penta_geothermalflux[6];
-	int penta_artdiff;
 	int penta_thermal_steadystate;
-	double penta_viscosity_overshoot;
-	double penta_stokesreconditioning;
 	bool   penta_onwater;
 
@@ -157,9 +150,9 @@
 	if(strcmp(iomodel->meshtype,"2d")==0){
 		/*load elements: */
-		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
 	}
 	else{
 		/*load elements2d: */
-		IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
 	}
 
@@ -183,10 +176,10 @@
 
 		/*Fetch data needed: */
-		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");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+		IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+		IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+		IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+		IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+		IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
 		
 		for (i=0;i<iomodel->numberofelements;i++){
@@ -202,4 +195,5 @@
 			tria_mid=-1; //no need for materials
 			tria_mparid=-1; //no need for materials
+			tria_numparid=1;
 
 			/*vertices offsets: */
@@ -224,8 +218,7 @@
 			tria_shelf=(int)*(iomodel->elementoniceshelf+i);
 			tria_onwater=(bool)*(iomodel->elementonwater+i);
-			tria_artdiff=iomodel->artificial_diffusivity;
 
 			/*Create tria element using its constructor:*/
-			tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater);
+			tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater);
 
 			/*Add tria element to elements dataset: */
@@ -261,12 +254,12 @@
 
 		/*Fetch data needed: */
-		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");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+		IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+		IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+		IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+		IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+		IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+		IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+		IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
 	
 		for (i=0;i<iomodel->numberofelements;i++){
@@ -281,4 +274,5 @@
 			penta_mid=-1; 
 			penta_mparid=-1; //no need for materials
+			penta_numparid=1;
 
 			/*vertices,thickness,surface,bed and drag: */
@@ -295,13 +289,12 @@
 			penta_onsurface=(int)*(iomodel->elementonsurface+i);
 			penta_collapse=1;
-			penta_artdiff=iomodel->artificial_diffusivity;
 			penta_onwater=(bool)*(iomodel->elementonwater+i);
 	
 
 			/*Create Penta using its constructor:*/
-			penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
-					penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
-					penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
-					penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater); 
+			penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
+					penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
+					penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
+					penta_thermal_steadystate,penta_onwater); 
 
 			/*Add penta element to elements dataset: */
@@ -390,5 +383,5 @@
 	
 		/*Get penalties: */
-		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+		IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
 
 		if(iomodel->numpenalties){
@@ -426,16 +419,16 @@
 	/*First fetch data: */
 	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(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
+		IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
+	}
+	IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
+	IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
+	IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
+	IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
+	IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
 
 
Index: /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp	(revision 2333)
@@ -39,7 +39,7 @@
 
 	/*Get vx and vy: */
-	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");
+	IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy");
+	IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz");
 
 	u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double));
@@ -61,7 +61,7 @@
 
 	/*Get pressure if 3d iomodel: */
-	parameters->FindParam((void*)&dim,"dim");
+	parameters->FindParam(&dim,"dim");
 	if (dim==3){ 
-		IoModelFetchData((void**)&pressure,NULL,NULL,iomodel_handle,"pressure","Matrix","Mat");
+		IoModelFetchData(&pressure,NULL,NULL,iomodel_handle,"pressure");
 		
 		count++;
@@ -76,7 +76,7 @@
 
 	/*Get temperature if 3d iomodel: */
-	parameters->FindParam((void*)&dim,"dim");
+	parameters->FindParam(&dim,"dim");
 	if (dim==3){ 
-		IoModelFetchData((void**)&temperature,NULL,NULL,iomodel_handle,"temperature","Matrix","Mat");
+		IoModelFetchData(&temperature,NULL,NULL,iomodel_handle,"temperature");
 		
 		count++;
@@ -91,5 +91,5 @@
 
 	/*Get thickness: */
-	IoModelFetchData((void**)&thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
+	IoModelFetchData(&thickness,NULL,NULL,iomodel_handle,"thickness");
 	
 	count++;
@@ -103,5 +103,5 @@
 
 	/*Get surface: */
-	IoModelFetchData((void**)&surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
+	IoModelFetchData(&surface,NULL,NULL,iomodel_handle,"surface");
 	
 	count++;
@@ -115,5 +115,5 @@
 
 	/*Get bed: */
-	IoModelFetchData((void**)&bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
+	IoModelFetchData(&bed,NULL,NULL,iomodel_handle,"bed");
 	
 	count++;
@@ -127,5 +127,5 @@
 
 	/*Get melting: */
-	IoModelFetchData((void**)&melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
+	IoModelFetchData(&melting,NULL,NULL,iomodel_handle,"melting");
 	if(melting) for(i=0;i<iomodel->numberofnodes;i++)melting[i]=melting[i]/iomodel->yts;
 	
@@ -140,5 +140,5 @@
 
 	/*Get accumulation: */
-	IoModelFetchData((void**)&accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
+	IoModelFetchData(&accumulation,NULL,NULL,iomodel_handle,"accumulation");
 	if(accumulation) for(i=0;i<iomodel->numberofnodes;i++)accumulation[i]=accumulation[i]/iomodel->yts;
 	
Index: /issm/trunk/src/c/ModelProcessorx/Qmu/CreateParametersQmu.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Qmu/CreateParametersQmu.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Qmu/CreateParametersQmu.cpp	(revision 2333)
@@ -60,6 +60,6 @@
 	//qmu analysis?
 	count++;
-	param= new Param(count,"qmu_analysis",INTEGER);
-	param->SetInteger(iomodel->qmu_analysis);
+	param= new Param(count,"qmu_analysis",DOUBLE);
+	param->SetDouble(iomodel->qmu_analysis);
 	parameters->AddObject(param);
 
@@ -94,6 +94,6 @@
 		//npart
 		count++;
-		param= new Param(count,"qmu_npart",INTEGER);
-		param->SetInteger(iomodel->qmu_npart);
+		param= new Param(count,"qmu_npart",DOUBLE);
+		param->SetDouble(iomodel->qmu_npart);
 		parameters->AddObject(param);
 
@@ -110,5 +110,5 @@
 		for(i=0;i<iomodel->numberofvariables;i++){
 			pfield2=mxGetCell(pfield,i);
-			FetchData((void**)&descriptor,NULL,NULL,pfield2,"String",NULL);
+			FetchData(&descriptor,pfield2);
 			variabledescriptors[i]=descriptor;
 		}
@@ -117,5 +117,5 @@
 		for(i=0;i<iomodel->numberofvariables;i++){
 			sprintf(tag,"%s%i","variabledescriptor",i);
-			IoModelFetchData((void**)&descriptor,NULL,NULL,iomodel_handle,tag,"String",NULL);
+			IoModelFetchData(&descriptor,iomodel_handle,tag);
 			variabledescriptors[i]=descriptor;
 		}
@@ -138,5 +138,5 @@
 		for(i=0;i<iomodel->numberofresponses;i++){
 			pfield2=mxGetCell(pfield,i);
-			FetchData((void**)&descriptor,NULL,NULL,pfield2,"String",NULL);
+			FetchData(&descriptor,pfield2);
 			responsedescriptors[i]=descriptor;
 		}
@@ -147,5 +147,5 @@
 		for(i=0;i<iomodel->numberofresponses;i++){
 			sprintf(tag,"%s%i","responsedescriptor",i);
-			IoModelFetchData((void**)&descriptor,NULL,NULL,iomodel_handle,tag,"String",NULL);
+			IoModelFetchData(&descriptor,iomodel_handle,tag);
 			responsedescriptors[i]=descriptor;
 		}
@@ -171,14 +171,14 @@
 
 		/*partition grids in iomodel->qmu_npart parts, unless a partition is already present: */
-		IoModelFetchData((void**)&dpart,NULL,NULL,iomodel_handle,"part","Matrix","Mat");
+		IoModelFetchData(&dpart,NULL,NULL,iomodel_handle,"part");
 
 		if(!dpart){
 
 			if(strcmp(iomodel->meshtype,"2d")==0){
-				IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+				IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
 				elements_width=3; //tria elements
 			}
 			else{
-				IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+				IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
 				elements_width=6; //penta elements
 			}
@@ -206,5 +206,5 @@
 
 				//Fetch data: 
-				IoModelFetchData((void**)&dakota_parameter,NULL,NULL,iomodel_handle,descriptor,"Matrix","Mat");
+				IoModelFetchData(&dakota_parameter,NULL,NULL,iomodel_handle,descriptor);
 
 				//Add parameter
@@ -227,5 +227,5 @@
 
 				/*We need the qmu_mass_flux_segments to be able to compute the mass flux: */
-				IoModelFetchData((void**)&qmu_mass_flux_segments,&num_qmu_mass_flux_segments,NULL,iomodel_handle,"qmu_mass_flux_segments","Matrix","Mat");
+				IoModelFetchData(&qmu_mass_flux_segments,&num_qmu_mass_flux_segments,NULL,iomodel_handle,"qmu_mass_flux_segments");
 
 				#ifdef _PARALLEL_
Index: /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp	(revision 2333)
@@ -48,4 +48,5 @@
 	int tria_mid;
 	int tria_mparid;
+	int tria_numparid;
 	int tria_g[3];
 	double tria_h[3];
@@ -60,8 +61,4 @@
 	double tria_q;
 	int    tria_shelf;
-	double tria_meanvel;/*!scaling ratio for velocities*/
-	double tria_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
-	double tria_viscosity_overshoot; 
-	int    tria_artdiff; 
 	bool   tria_onwater; 
 
@@ -71,4 +68,5 @@
 	int penta_mid;
 	int penta_mparid;
+	int penta_numparid;
 	int penta_g[6];
 	double penta_h[6];
@@ -82,14 +80,9 @@
 	int penta_onbed;
 	int penta_onsurface;
-	double penta_meanvel;/*!scaling ratio for velocities*/
-	double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
 	int penta_collapse;
 	double penta_melting[6];
 	double penta_accumulation[6];
 	double penta_geothermalflux[6];
-	int penta_artdiff;
 	int penta_thermal_steadystate;
-	double penta_viscosity_overshoot;
-	double penta_stokesreconditioning;
 	bool   penta_onwater;
 
@@ -138,9 +131,9 @@
 	if(strcmp(iomodel->meshtype,"2d")==0){
 		/*load elements: */
-		IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
 	}
 	else{
 		/*load elements2d: */
-		IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+		IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
 	}
 
@@ -165,8 +158,8 @@
 
 		/*Fetch data needed: */
-		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");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+		IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+		IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
+		IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
 		
 		for (i=0;i<iomodel->numberofelements;i++){
@@ -182,4 +175,5 @@
 			tria_mid=-1; //no materials
 			tria_mparid=-1; //no materials
+			tria_numparid=1; //no materials
 
 			/*vertices offsets: */
@@ -201,5 +195,5 @@
 
 			/*Create tria element using its constructor:*/
-			tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater);
+			tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater);
 
 			/*Add tria element to elements dataset: */
@@ -233,9 +227,9 @@
 
 		/*Fetch data needed: */
-		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");
+		IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+		IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+		IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+		IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+		IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
 	
 		for (i=0;i<iomodel->numberofelements;i++){
@@ -250,4 +244,5 @@
 			penta_mid=-1; //no materials
 			penta_mparid=-1; //no materials
+			penta_numparid=1; //no materials
 			
 
@@ -264,8 +259,8 @@
 
 			/*Create Penta using its constructor:*/
-			penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
-					penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
-					penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
-					penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater); 
+			penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
+					penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
+					penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
+					penta_thermal_steadystate,penta_onwater); 
 
 			/*Add penta element to elements dataset: */
@@ -331,5 +326,5 @@
 	
 		/*Get penalties: */
-		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+		IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
 
 		if(iomodel->numpenalties){
@@ -367,16 +362,16 @@
 	/*First fetch data: */
 	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(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
+		IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
+	}
+	IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
+	IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
+	IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
+	IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
+	IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
 
 
Index: /issm/trunk/src/c/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 2333)
@@ -38,5 +38,5 @@
 
 	/*Fetch data: */
-	IoModelFetchData((void**)&spctemperature,NULL,NULL,iomodel_handle,"spctemperature","Matrix","Mat");
+	IoModelFetchData(&spctemperature,NULL,NULL,iomodel_handle,"spctemperature");
 
 	count=0;
Index: /issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp	(revision 2333)
@@ -58,4 +58,5 @@
 	int penta_mid;
 	int penta_mparid;
+	int penta_numparid;
 	int penta_g[6];
 	double penta_h[6];
@@ -69,14 +70,9 @@
 	int penta_onbed;
 	int penta_onsurface;
-	double penta_meanvel;/*!scaling ratio for velocities*/
-	double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
 	int penta_collapse;
 	double penta_melting[6];
 	double penta_accumulation[6];
 	double penta_geothermalflux[6];
-	int penta_artdiff;
 	int penta_thermal_steadystate;
-	double penta_viscosity_overshoot;
-	double penta_stokesreconditioning;
 	bool   penta_onwater;
 
@@ -131,5 +127,5 @@
 	#ifdef _PARALLEL_
 	/*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
-	IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
+	IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
 
 	MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofnodes,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofnodes2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->meshtype,num_procs);
@@ -146,19 +142,19 @@
 
 	/*Fetch data needed: */
-	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");
+	IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
+	IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
+	IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
+	IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
+	IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
+	IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
+	IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
+	IoModelFetchData(&iomodel->geothermalflux,NULL,NULL,iomodel_handle,"geothermalflux");
+	IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
+	IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
+	IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
 	
 	for (i=0;i<iomodel->numberofelements;i++){
@@ -173,4 +169,5 @@
 		penta_mid=i+1; //refers to the corresponding material property card
 		penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
+		penta_numparid=1;
 
 		/*vertices,thickness,surface,bed and drag: */
@@ -194,8 +191,5 @@
 		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*/
@@ -209,8 +203,8 @@
 
 		/*Create Penta using its constructor:*/
-		penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
-				penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
-				penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
-				penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater); 
+		penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
+				penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
+				penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
+				penta_thermal_steadystate,penta_onwater); 
 
 		/*Add penta element to elements dataset: */
@@ -322,5 +316,5 @@
 	
 		/*Get penalties: */
-		IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
+		IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
 
 		if(iomodel->numpenalties){
@@ -358,16 +352,16 @@
 	/*First fetch data: */
 	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(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
+		IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
 	}
-	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(&iomodel->x,NULL,NULL,iomodel_handle,"x");
+	IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
+	IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
+	IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
+	IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
+	IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
+	IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
+	IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
+	IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
 
 	/*Get number of dofs per node: */
Index: /issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 2333)
@@ -51,5 +51,5 @@
 
 	//create penalties for grids: no grid can have a temperature over the melting point
-	IoModelFetchData((void**)&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature","Matrix","Mat");
+	IoModelFetchData(&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature");
 
 	for (i=0;i<iomodel->numberofnodes;i++){
Index: /issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp	(revision 2332)
+++ /issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp	(revision 2333)
@@ -36,7 +36,7 @@
 
 	/*Get vx vy and vz: */
-	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");
+	IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx");
+	IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy");
+	IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz");
 
 	u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double));
@@ -57,5 +57,5 @@
 	
 	/*Get pressure: */
-	IoModelFetchData((void**)&pressure,NULL,NULL,iomodel_handle,"pressure","Matrix","Mat");
+	IoModelFetchData(&pressure,NULL,NULL,iomodel_handle,"pressure");
 	
 	count++;
@@ -72,5 +72,5 @@
 
 		/*Get melting and temperature: */
-		IoModelFetchData((void**)&temperature,NULL,NULL,iomodel_handle,"temperature","Matrix","Mat");
+		IoModelFetchData(&temperature,NULL,NULL,iomodel_handle,"temperature");
 
 		count++;
Index: /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp	(revision 2332)
+++ /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp	(revision 2333)
@@ -15,5 +15,5 @@
 
 void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes,
-		DataSet* loads,DataSet* materials, ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
+		DataSet* loads,DataSet* materials,  DataSet* parameters,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
 
 	int i;
@@ -27,5 +27,5 @@
 
 	/*First, get loads configured: */
-	loads->Configure(elements, loads, nodes, materials);
+	loads->Configure(elements, loads, nodes, materials,parameters);
 
 	/*Do we have penalties linked to rifts? In this case, run our special rifts penalty 
Index: /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.h
===================================================================
--- /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.h	(revision 2332)
+++ /issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.h	(revision 2333)
@@ -11,5 +11,5 @@
 /* local prototypes: */
 void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes,
-		DataSet* loads,DataSet* materials, ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 
+		DataSet* loads,DataSet* materials,  DataSet* parameters,ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 
 
 #endif  /* _PENALTYCONSTRAINTSX_H */
Index: /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
===================================================================
--- /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp	(revision 2332)
+++ /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp	(revision 2333)
@@ -13,5 +13,5 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
+void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,
 		int kflag,int pflag,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
 	
@@ -23,6 +23,7 @@
 	
 	/*First, get elements and loads configured: */
-	elements->Configure(elements,loads, nodes, materials);
-	loads->Configure(elements, loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	loads->Configure(elements, loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Now, figure out maximum value of K_gg, so that we can penalize it correctly: */
Index: /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.h
===================================================================
--- /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.h	(revision 2332)
+++ /issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.h	(revision 2333)
@@ -10,5 +10,5 @@
 
 /* local prototypes: */
-void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
+void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,
 		int kflag,int pflag,ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 
 
Index: /issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp
===================================================================
--- /issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp	(revision 2332)
+++ /issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp	(revision 2333)
@@ -34,5 +34,5 @@
 
 	/*Some parameters needed: */
-	parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+	parameters->FindParam(&numberofnodes,"numberofnodes");
 
 	/*serialize partition vector: */
Index: /issm/trunk/src/c/Qmux/DakotaResponses.cpp
===================================================================
--- /issm/trunk/src/c/Qmux/DakotaResponses.cpp	(revision 2332)
+++ /issm/trunk/src/c/Qmux/DakotaResponses.cpp	(revision 2333)
@@ -262,9 +262,9 @@
 			if(!param)throw ErrorException(__FUNCT__," could not find qmu_mass_flux_segments to compute mass_flux");
 			
-			param->GetParameterValue((void*)&segments);
+			param->GetParameterValue(&segments);
 			num_segments=param->GetM();
 
 			/*call mass flux module: */
-			MassFluxx(&mass_flux,femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,segments,num_segments,ug_serial);
+			MassFluxx(&mass_flux,femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,femmodel->parameters,segments,num_segments,ug_serial);
 			
 			if(my_rank==0)responses[i]=mass_flux;
Index: /issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp
===================================================================
--- /issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp	(revision 2332)
+++ /issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp	(revision 2333)
@@ -69,5 +69,5 @@
 	/*Recover partitioning for dakota: */
 	model->FindParam(&qmu_npart,"qmu_npart");
-	model->FindParam(&qmu_part,"qmu_part");
+	model->FindParam(&qmu_part,NULL,NULL,"qmu_part");
 	#ifdef _ISSM_DEBUG_
 	for(i=0;i<numresponses;i++){
Index: /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.cpp
===================================================================
--- /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.cpp	(revision 2332)
+++ /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.cpp	(revision 2333)
@@ -13,5 +13,5 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
+void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,
 		int kflag,int pflag,int connectivity,int numberofdofspernode,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
 	
@@ -29,6 +29,7 @@
 
 	/*First, get elements and loads configured: */
-	elements->Configure(elements,loads, nodes, materials);
-	loads->Configure(elements, loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	loads->Configure(elements, loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Get size of matrix: */
Index: /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.h
===================================================================
--- /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.h	(revision 2332)
+++ /issm/trunk/src/c/SystemMatricesx/SystemMatricesx.h	(revision 2333)
@@ -10,5 +10,5 @@
 
 /* local prototypes: */
-void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
+void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,
 		int kflag,int pflag,int connectivity,int numberofdofspernode,ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 
 
Index: /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.cpp
===================================================================
--- /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.cpp	(revision 2332)
+++ /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.cpp	(revision 2333)
@@ -13,5 +13,5 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-int UpdateFromInputsx( DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, ParameterInputs* inputs) {
+int UpdateFromInputsx( DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,ParameterInputs* inputs) {
 
 	int noerr=1;
@@ -23,7 +23,8 @@
 
 	/*First, get elements and loads configured: */
-	elements->Configure(elements,loads, nodes, materials);
-	loads->Configure(elements, loads, nodes, materials);
-	nodes->Configure(elements, loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	loads->Configure(elements, loads, nodes, materials,parameters);
+	nodes->Configure(elements, loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Update elements, nodes, loads and materials from inputs: */
Index: /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.h
===================================================================
--- /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.h	(revision 2332)
+++ /issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.h	(revision 2333)
@@ -10,5 +10,5 @@
 
 /* local prototypes: */
-int		UpdateFromInputsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, ParameterInputs* inputs);
+int		UpdateFromInputsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials,  DataSet* parameters,ParameterInputs* inputs);
 
 #endif  /* _UPDATEFROMINPUTSXX_H */
Index: /issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.cpp
===================================================================
--- /issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.cpp	(revision 2332)
+++ /issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.cpp	(revision 2333)
@@ -15,5 +15,5 @@
 
 void UpdateGeometryx(Vec* poutthickness,Vec* poutbed,Vec* poutsurface, 
-		DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials, 
+		DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters,
 		Vec vec_newthickness,Vec vec_bed,Vec vec_surface){
 
@@ -46,7 +46,8 @@
 
 	/*First, get elements and loads configured: */
-	elements->Configure(elements,loads, nodes, materials);
-	materials->Configure(elements, loads, nodes, materials);
-	loads->Configure(elements, loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	materials->Configure(elements, loads, nodes, materials,parameters);
+	loads->Configure(elements, loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*Serialize inputs :*/
Index: /issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.h
===================================================================
--- /issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.h	(revision 2332)
+++ /issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.h	(revision 2333)
@@ -11,5 +11,5 @@
 /* local prototypes: */
 void UpdateGeometryx(Vec* poutthickness,Vec* poutbed,Vec* poutsurface, 
-		DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials,
+		DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters,
 		Vec newthickness,Vec bed,Vec surface);
 
Index: /issm/trunk/src/c/UpdateNodePositionsx/UpdateNodePositionsx.cpp
===================================================================
--- /issm/trunk/src/c/UpdateNodePositionsx/UpdateNodePositionsx.cpp	(revision 2332)
+++ /issm/trunk/src/c/UpdateNodePositionsx/UpdateNodePositionsx.cpp	(revision 2333)
@@ -13,5 +13,5 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, Vec thickness,Vec bed){
+void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters,Vec thickness,Vec bed){
 
 	/*intermediary: */
@@ -20,7 +20,8 @@
 
 	/*First, get elements and loads configured: */
-	elements->Configure(elements,loads, nodes, materials);
-	loads->Configure(elements, loads, nodes, materials);
-	nodes->Configure(elements, loads, nodes, materials);
+	elements->Configure(elements,loads, nodes, materials,parameters);
+	loads->Configure(elements, loads, nodes, materials,parameters);
+	nodes->Configure(elements, loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes, materials,parameters);
 
 	/*serialize inputs: */
Index: /issm/trunk/src/c/UpdateNodePositionsx/UpdateNodePositionsx.h
===================================================================
--- /issm/trunk/src/c/UpdateNodePositionsx/UpdateNodePositionsx.h	(revision 2332)
+++ /issm/trunk/src/c/UpdateNodePositionsx/UpdateNodePositionsx.h	(revision 2333)
@@ -10,5 +10,5 @@
 
 /* local prototypes: */
-void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, Vec thickness,Vec bed);
+void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials,  DataSet* parameters,Vec thickness,Vec bed);
 
 #endif  /* _UPDATENODEPOSITIONSXX_H */
Index: /issm/trunk/src/c/include/types.h
===================================================================
--- /issm/trunk/src/c/include/types.h	(revision 2332)
+++ /issm/trunk/src/c/include/types.h	(revision 2333)
@@ -16,4 +16,5 @@
 typedef FILE* DataHandle; 
 #endif
+enum param_type { STRING, INTEGER, STRINGARRAY, DOUBLE, DOUBLEVEC, DOUBLEMAT, PETSCVEC, PETSCMAT };
 
 #endif //ifndef _TYPES_H_
Index: /issm/trunk/src/c/io/FetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/FetchData.cpp	(revision 2332)
+++ /issm/trunk/src/c/io/FetchData.cpp	(revision 2333)
@@ -10,20 +10,352 @@
 
 #include "./io.h"
+#include "../shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__ "FetchData"
+
+
+
+/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
+													  Serial Fetch Data Routines, all overloaded.
+**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
 
 #ifdef _SERIAL_
 
 #include <mex.h>
-void FetchData(void** pdata,int* pM,int* pN,const mxArray* pdataref,char* data_type,char* sub_data_type){
+
+void FetchData(DataSet** pdataset,const mxArray* dataref){
+
+	/*output*/
+	DataSet* outdataset=NULL;
+	char*    outdataset_buffer=NULL;
+	int      outdataset_size;
+
+	/*First, check that our reference is a double, otherwise, error out: */
+	if (mxIsDouble(dataref)){
+			
+		/*We need to copy the data pointed by dataref, so that our dataset is not actually a pointer!:*/
+		if (!mxIsEmpty(dataref)){
+			outdataset_buffer=(char*)mxGetPr(dataref);
+			outdataset_size=mxGetM(dataref)*mxGetN(dataref);
+			if(outdataset_size)outdataset=DataSetDemarshall(outdataset_buffer);
+		}
+	}
+	else{
+		if (mxIsEmpty(dataref)){
+			/*Nothing to pick up. Just initialize pointer to NULL, and warn the server we are not uploading anything: */
+			outdataset_size=0;
+			outdataset=NULL;
+		}
+		else{
+			/*This is an error: we don't have the correct input!: */
+			throw ErrorException(__FUNCT__,"  wrong input parameter!");
+		}
+	}
+
+	/*Assign output pointers:*/
+	*pdataset=outdataset;
+}
+
+void FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref){
+
+	double*  outmatrix=NULL;
+	int      outmatrix_rows,outmatrix_cols;
+
+	if(mxIsEmpty(dataref) ){
+		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+		outmatrix_rows=0;
+		outmatrix_cols=0;
+		outmatrix=NULL;
+	}
+	else if (mxIsDouble(dataref) ){
+
+		/*Check dataref is not pointing to NaN: */
+		if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){
+			outmatrix_rows=0;
+			outmatrix_cols=0;
+			outmatrix=NULL;
+		}
+		else{
+
+			/*Convert matlab matrix to double* matrix: */
+			MatlabMatrixToDoubleMatrix(&outmatrix,&outmatrix_rows,&outmatrix_cols,dataref);
+		}
+	}
+	else{
+		/*This is an error: we don't have the correct input!: */
+		throw ErrorException(__FUNCT__,"wrong input parameter");
+	}
+
+			
+	/*Assign output pointers:*/
+	*pmatrix=outmatrix;
+	if (pM)*pM=outmatrix_rows;
+	if (pN)*pN=outmatrix_cols;
+
+
+}
+
+void FetchData(Mat* pmatrix,const mxArray* dataref){
 	
-	SerialFetchData(pdata,pM,pN,pdataref,data_type,sub_data_type);
-
-}
+	Mat outmatrix=NULL;
+	int dummy=0;
+
+	if(mxIsEmpty(dataref) ){
+		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+		outmatrix=NULL;
+	}
+	else if (mxIsDouble(dataref) ){
+
+		/*Check dataref is not pointing to NaN: */
+		if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){
+			outmatrix=NULL;
+		}
+		else{
+
+			/*Convert matlab matrix to petsc matrix: */
+			MatlabMatrixToPetscMatrix(&outmatrix,&dummy,&dummy,dataref);
+		}
+	}
+	else{
+		/*This is an error: we don't have the correct input!: */
+		throw ErrorException(__FUNCT__,"wrong input parameter");
+	}
+
+	/*Assign output pointers:*/
+	*pmatrix=outmatrix;
+}
+
+void FetchData(double** pvector,int* pM,const mxArray* dataref){
+
+	double* outvector=NULL;
+	int outvector_rows;
+
+	if(mxIsEmpty(dataref)){
+		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+		outvector_rows=0;
+		outvector=NULL;
+	}
+	else if (mxIsDouble(dataref) ){
+
+		/*Convert matlab vector to double*  vector: */
+		MatlabVectorToDoubleVector(&outvector,&outvector_rows,dataref);
+
+	}
+	else{
+		/*This is an error: we don't have the correct input!: */
+		throw ErrorException(__FUNCT__,"wrong input parameter");
+	}
+
+	/*Assign output pointers:*/
+	*pvector=outvector;
+	if (pM)*pM=outvector_rows;
+}
+
+void FetchData(Vec* pvector,const mxArray* dataref){
+
+	Vec vector=NULL;
+	int dummy;
+
+	if(mxIsEmpty(dataref)){
+		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+		vector=NULL;
+	}
+	else if (mxIsDouble(dataref) ){
+
+		/*Convert matlab vector to petsc vector: */
+		MatlabVectorToPetscVector(&vector,&dummy,dataref);
+	}
+	else{
+		/*This is an error: we don't have the correct input!: */
+		throw ErrorException(__FUNCT__,"wrong input parameter");
+	}
+
+	/*Assign output pointers:*/
+	*pvector=vector;
+}
+
+void FetchData(char** pstring,const mxArray* dataref){
+
+	char* outstring=NULL;
+
+
+	/*Ok, the string should be coming directly from the matlab workspace: */
+	if (!mxIsChar(dataref)){
+		throw ErrorException(__FUNCT__,"input data_type is not a string!");
+	}
+	else{
+		/*Recover the string:*/
+		int stringlen;
+		
+		stringlen = mxGetM(dataref)*mxGetN(dataref)+1;
+		outstring = (char*)xmalloc(sizeof(mxChar)*stringlen);
+		mxGetString(dataref,outstring,stringlen);
+	}
+
+	/*Assign output pointers:*/
+	*pstring=outstring;
+}
+
+void FetchData(double* pscalar,const mxArray* dataref){
+
+	double scalar;
+
+	if (!mxIsDouble(dataref)){
+		throw ErrorException(__FUNCT__,"input data_type is not a scalar!");
+	}
+	else{
+		/*Recover the double: */
+		scalar=mxGetScalar(dataref);
+	}
+
+	/*Assign output pointers:*/
+	*pscalar=scalar;
+}
+
+void FetchData(int* pinteger,const mxArray* dataref){
+
+	int integer;
+
+	if (!mxIsDouble(dataref)){
+		throw ErrorException(__FUNCT__,"input data_type is not a scalar!");
+	}
+	else{
+		/*Recover the double: */
+		integer=(int)mxGetScalar(dataref);
+	}
+
+	/*Assign output pointers:*/
+	*pinteger=integer;
+}
+
+
 #endif
 
 #if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
-void FetchData(void** pdata,int* pM,int* pN,FILE* fid,char* data_type,char* sub_data_type){
-
-	ParallelFetchData(pdata,pM,pN,fid, data_type,sub_data_type);
-
-}
+
+/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
+													  Parallel Fetch Data Routines, all overloaded.
+**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
+
+void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid){
+
+	extern int my_rank;
+	extern int num_procs;
+
+	/*output: */
+	int M,N;
+	double* matrix=NULL;
+	
+	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
+	/*numberofelements: */
+	if(my_rank==0){  
+		if(fread(&M,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__,"could not read number of rows for matrix ");
+	}
+
+	MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	if(my_rank==0){  
+		if(fread(&N,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__,"  could not read number of columns for matrix ");
+	}
+	MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	/*Now allocate matrix: */
+	if(M*N){
+		matrix=(double*)xmalloc(M*N*sizeof(double));
+
+		/*Read matrix on node 0, then broadcast: */
+		if(my_rank==0){  
+			if(fread(matrix,M*N*sizeof(double),1,fid)!=1) throw ErrorException(__FUNCT__," could not read matrix ");
+		}
+		
+		MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+	}
+
+
+	/*Assign output pointers: */
+	*pmatrix=matrix;
+	if (pM)*pM=M;
+	if (pN)*pN=N;
+
+}
+
+void FetchData(char** pstring,FILE* fid){
+
+	extern int my_rank;
+	extern int num_procs;
+
+	/*output: */
+	char* string=NULL;
+	int   string_size;
+
+	/*We have to read a string from disk. First read the dimensions of the string, then the string: */
+	if(my_rank==0){  
+		if(fread(&string_size,sizeof(int),1,fid)!=1)throw ErrorException(__FUNCT__," could not read length of string ");
+	}
+
+	MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	/*Now allocate string: */
+	if(string_size){
+		string=(char*)xmalloc((string_size+1)*sizeof(char));
+		string[string_size]='\0';
+
+		/*Read string on node 0, then broadcast: */
+		if(my_rank==0){  
+			if(fread(string,string_size*sizeof(char),1,fid)!=1)throw ErrorException(__FUNCT__,"  could not read string ");
+		}
+		MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
+	}
+	else{
+		string=(char*)xmalloc(sizeof(char));
+		string[0]='\0';
+	}
+
+
+	/*Assign output pointers: */
+	*pstring=string;
+}
+
+
+void FetchData(double* pscalar,FILE* fid){
+
+	extern int my_rank;
+	extern int num_procs;
+
+	/*output: */
+	double   scalar;
+
+	/*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */
+	if(my_rank==0){
+		if(fread(&scalar,sizeof(double),1,fid)!=1)throw ErrorException(__FUNCT__," could not read scalar ");
+	}
+	MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
+
+	/*Assign output pointers: */
+	*pscalar=scalar;
+		 
+}
+
+void FetchData(int* pinteger,FILE* fid){
+
+	extern int my_rank;
+	extern int num_procs;
+
+	/*output: */
+	int   integer;
+
+	/*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
+	if(my_rank==0){  
+		if(fread(&integer,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__," could not read integer ");
+	}
+
+	MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
+
+	/*Assign output pointers: */
+	*pinteger=integer;
+
+}
+
+
 #endif
Index: /issm/trunk/src/c/io/FetchNodeSets.cpp
===================================================================
--- /issm/trunk/src/c/io/FetchNodeSets.cpp	(revision 2332)
+++ /issm/trunk/src/c/io/FetchNodeSets.cpp	(revision 2333)
@@ -37,8 +37,8 @@
 	else{
 
-		FetchData((void**)&pv_m,NULL,NULL,mxGetField(dataref,0,"pv_m"),"Vector","Vec");
-		FetchData((void**)&pv_n,NULL,NULL,mxGetField(dataref,0,"pv_n"),"Vector","Vec");
-		FetchData((void**)&pv_f,NULL,NULL,mxGetField(dataref,0,"pv_f"),"Vector","Vec");
-		FetchData((void**)&pv_s,NULL,NULL,mxGetField(dataref,0,"pv_s"),"Vector","Vec");
+		FetchData(&pv_m,NULL,mxGetField(dataref,0,"pv_m"));
+		FetchData(&pv_n,NULL,mxGetField(dataref,0,"pv_n"));
+		FetchData(&pv_f,NULL,mxGetField(dataref,0,"pv_f"));
+		FetchData(&pv_s,NULL,mxGetField(dataref,0,"pv_s"));
 		
 		gsize=(int)mxGetScalar(mxGetField(dataref,0,"gsize"));
Index: /issm/trunk/src/c/io/FetchParams.cpp
===================================================================
--- /issm/trunk/src/c/io/FetchParams.cpp	(revision 2333)
+++ /issm/trunk/src/c/io/FetchParams.cpp	(revision 2333)
@@ -0,0 +1,150 @@
+/* \file FetchParams.c:
+ * \brief: interface for fetching  matlab parameters into a "C" dataset 
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+
+#ifdef _SERIAL_
+
+#include <mex.h>
+
+#include "../objects/Param.h"
+#include "./io.h"
+#include "../shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "FetchParams"
+
+void FetchParams(DataSet** pparameters, DataHandle dataref){
+
+	int i,j,count;
+
+	/*output: */
+	Param* param=NULL;
+	Numpar*  numpar=NULL;
+	DataSet* parameters=NULL;
+
+	/*intermediary: */
+	int M,N;
+	double* tmatrix=NULL;
+	double* matrix=NULL;
+	char**  stringarray=NULL;
+	int nfields;
+	char* name=NULL;
+	mxArray* pfield=NULL;
+	mxArray* pfield2=NULL;
+
+
+	/*First, create parameters : */
+	parameters=new DataSet();
+
+	/*Then, create Numpar object, before building the params objects: */
+	numpar= new Numpar(1);
+	parameters->AddObject(numpar);
+
+	/*now, go through matlab params structure, and create Param object for each field: */
+
+	nfields=mxGetNumberOfFields(dataref);
+
+	for(count=0;count<nfields;count++){
+
+		/*Get i'th field: */
+		name=(char*)mxGetFieldNameByNumber(dataref,count);
+		pfield=mxGetFieldByNumber(dataref,0,count);
+
+		/*Check type of field: */
+		if (mxIsDouble(pfield)){
+			/*could be  DOUBLE, DOUBLEVEC or DOUBLEMAT, depends on dimensions: */
+
+			M=mxGetM(pfield);
+			N=mxGetN(pfield);
+
+			if (M==0 | N==0){
+				throw ErrorException(__FUNCT__,exprintf("%s%s%i%s%i%s%i%s",__FUNCT__," error message: array in parameters structure field ",count," is of size (",M,",",N,")"));
+			}
+
+			if (M==1 && N==1){
+
+				/*we have a simple scalar: */
+				param= new Param(count+1,name,DOUBLE);
+				param->SetDouble(*mxGetPr(pfield));
+				parameters->AddObject(param);
+
+			}
+			else{
+				if (N==1){
+					
+					/*vector: */
+					param= new Param(count+1,name,DOUBLEVEC);
+					param->SetDoubleVec(mxGetPr(pfield),M,1);
+					parameters->AddObject(param);
+
+				}
+				else{
+
+					/*matrix: first, transpose, then plug into Param */
+					matrix=mxGetPr(pfield);
+					tmatrix=(double*)xmalloc(M*N*sizeof(double));
+					for (i=0;i<M;i++){
+						for(j=0;j<N;j++){
+							*(tmatrix+N*i+j)=*(matrix+M*j+i);
+						}
+					}
+
+					param= new Param(count+1,name,DOUBLEMAT);
+					param->SetDoubleMat(tmatrix,M,N);
+					parameters->AddObject(param);
+	
+					/*Free ressources:*/
+					xfree((void**)&tmatrix);
+
+				}
+			}
+
+		}
+		else if (mxIsChar(pfield)){
+			
+			/* string: */
+			param= new Param(count+1,"name",STRING);
+			param->SetString((char*)mxGetChars(pfield));
+			parameters->AddObject(param);
+
+		}
+		else if (mxIsCell(pfield)){
+
+			/*string array: */
+			M=mxGetM(pfield);
+			stringarray=(char**)xmalloc(M*sizeof(char*));
+
+			for(i=0;i<M;i++){
+				char* descriptor=NULL;
+				pfield2=mxGetCell(pfield,i);
+				FetchData(&descriptor,pfield2);
+				stringarray[i]=descriptor;
+			}
+		
+			param= new Param(count+1,name,STRINGARRAY);
+			param->SetStringArray(stringarray,M);
+			parameters->AddObject(param);
+
+			/*Free ressources:*/
+			for(i=0;i<M;i++){
+				char* descriptor=stringarray[i];
+				xfree((void**)&descriptor);
+			}
+			xfree((void**)&stringarray);
+
+		}
+		else throw ErrorException(__FUNCT__,exprintf("%s%s%i",__FUNCT__," error message: unknow type in parameters structure field ",i));
+	}
+
+	/*Assign output pointers:*/
+	*pparameters=parameters;
+
+}
+#endif
Index: sm/trunk/src/c/io/HeaderAddToDataSetRef.c
===================================================================
--- /issm/trunk/src/c/io/HeaderAddToDataSetRef.c	(revision 2332)
+++ 	(revision )
@@ -1,97 +1,0 @@
-/*
- * HeaderAddToDataSetRef.c
- *     Description:  This function adds a header structure to a dataset reference. This is 
- *     normally done in WriteDataSet, but modules don't call WriteDataSet when the data 
- *     returned is remote. In these cases, we call HeaderAddToDataSetRef. Why do we call 
- *     this other function instead of WriteDataSet? Because for ex in modules View and 
- *     Rmg, remote data is not downloaded, and WriteDataSet would not be able to retrieve 
- *     M,N, nnz, isempty, issparse from the input dataset  reference, only garbage. 
- */
-
-/* hosting environment: */
-#include "../include/cielo.h"
-
-
-int HeaderAddToDataSetRef(mxArray* pdatasetref,double M,double N,double nnz,double IsEmpty,double IsSparse){
-
-	int noerr=1;
-	int i;
-	
-	/*Header variables*/
-	int nfields=5;
-	const	char*	fnames[nfields];
-	mwSize		onebyone[2] = {1,1};
-	mwSize		ndim=2;
-	mxArray* pmxa_header=NULL;
-	double* pM=NULL;
-	double* pN=NULL;
-	double* pnnz=NULL;
-	double* pIsEmpty=NULL;
-	double* pIsSparse=NULL;
-	mxArray* pmxa_M=NULL;
-	mxArray* pmxa_N=NULL;
-	mxArray* pmxa_nnz=NULL;
-	mxArray* pmxa_IsEmpty=NULL;
-	mxArray* pmxa_IsSparse=NULL;
-
-
-	
-	
-	fnames[0] = "M";
-	fnames[1] = "N";
-	fnames[2] = "nnz";
-	fnames[3] = "isempty";
-	fnames[4] = "issparse";
-	
-	pmxa_header=mxCreateStructArray( ndim,onebyone,nfields,fnames);
-
-	pM=(double*)xcalloc(1,sizeof(double));
-	pN=(double*)xcalloc(1,sizeof(double));
-	pnnz=(double*)xcalloc(1,sizeof(double));
-	pIsEmpty=(double*)xcalloc(1,sizeof(double));
-	pIsSparse=(double*)xcalloc(1,sizeof(double));
-
-	*pM=M;
-	*pN=N;
-	*pnnz=nnz;
-	*pIsEmpty=IsEmpty;
-	*pIsSparse=IsSparse;
-	
-	pmxa_M = mxCreateDoubleMatrix(1,1,mxREAL);
-	mxSetM(pmxa_M,1);
-	mxSetN(pmxa_M,1);
-	mxSetPr(pmxa_M,pM);
-	
-	pmxa_N = mxCreateDoubleMatrix(1,1,mxREAL);
-	mxSetM(pmxa_N,1);
-	mxSetN(pmxa_N,1);
-	mxSetPr(pmxa_N,pN);
-
-	pmxa_nnz = mxCreateDoubleMatrix(1,1,mxREAL);
-	mxSetM(pmxa_nnz,1);
-	mxSetN(pmxa_nnz,1);
-	mxSetPr(pmxa_nnz,pnnz);
-
-
-	pmxa_IsEmpty = mxCreateDoubleMatrix(1,1,mxREAL);
-	mxSetM(pmxa_IsEmpty,1);
-	mxSetN(pmxa_IsEmpty,1);
-	mxSetPr(pmxa_IsEmpty,pIsEmpty);
-
-	pmxa_IsSparse = mxCreateDoubleMatrix(1,1,mxREAL);
-	mxSetM(pmxa_IsSparse,1);
-	mxSetN(pmxa_IsSparse,1);
-	mxSetPr(pmxa_IsSparse,pIsSparse);
-	
-	mxSetField( pmxa_header, 0, "M",     pmxa_M);
-	mxSetField( pmxa_header, 0, "N",     pmxa_N);
-	mxSetField( pmxa_header, 0, "nnz",     pmxa_nnz);
-	mxSetField( pmxa_header, 0, "isempty",     pmxa_IsEmpty);
-	mxSetField( pmxa_header, 0, "issparse",     pmxa_IsSparse);
-
-	/*Add header to pOuputStructure*/
-	mxAddField(pdatasetref,"header");
-	mxSetField(pdatasetref,0,"header",pmxa_header);
-
-	return noerr;
-}
Index: /issm/trunk/src/c/io/IoModelFetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/IoModelFetchData.cpp	(revision 2332)
+++ /issm/trunk/src/c/io/IoModelFetchData.cpp	(revision 2333)
@@ -13,37 +13,71 @@
 #include "../shared/shared.h"
 
-void  IoModelFetchData(void** pdata,int* pM,int* pN,ConstDataHandle model_handle,char* data_name,char* data_type,char* sub_data_type){
+
+
+#ifdef _SERIAL_
+/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
+													  Serial IoModelFetch Data Routines, all overloaded.
+**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
+
+void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){
+
+	FetchData(pdataset,mxGetAssignedField(model_handle,0,data_name));
+
+}
+void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){
 	
+	FetchData(pmatrix,pM,pN,mxGetAssignedField(model_handle,0,data_name));
+
+}
+void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){
+	
+	FetchData(pmatrix,mxGetAssignedField(model_handle,0,data_name));
+
+}
+void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){
+	
+	FetchData(pvector,pM,mxGetAssignedField(model_handle,0,data_name));
+
+}
+void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){
+	
+	FetchData(pvector,mxGetAssignedField(model_handle,0,data_name));
+
+}
+void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){
+	
+	FetchData(pstring,mxGetAssignedField(model_handle,0,data_name));
+
+}
+void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){
+	
+	FetchData(pscalar,mxGetAssignedField(model_handle,0,data_name));
+
+}
+void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){
+
+	FetchData(pinteger,mxGetAssignedField(model_handle,0,data_name));
+}
+#endif
+
+
+
+/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
+													  Parallel IoModelFetch Data Routines, all overloaded.
+**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
+#ifdef _PARALLEL_
+FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name){
 
 	extern int my_rank;
 	extern int num_procs;
-
+	
 	int string_size;
 	int record_length;
 	char* string=NULL;
-
-	/*Why this routine? To make IoModel management simpler. FetchData is enough for regular I/O, but here, we are dealing with 
-	 * I/O that can act on the model matlab array (in case we are running serially), or I/O on the binary file when running 
-	 * in parallel. On a matlab model array, it is easy to find the data with name "data_name", but not in a binary file. We 
-	 * are abstracting all of this with one function, operating on the DataHandle object. */
-
 	char* repository=NULL;
 	FILE* fid=NULL;
 	int found=0;
 
-	/*Ok, on the matlab side: */
-	#ifdef _SERIAL_
-
-	/*The typical model_handle is a const mxArray*, to which FetchData is applied. But here, we are dealing with a structure, the 
-	 *model. Therefore, we are looking to fetch a certain field of this data. So get this field first, and then feed it to the 
-	 FetchData routine. : */
-
-	FetchData((void**)pdata,pM,pN,mxGetAssignedField(model_handle,0,data_name),data_type,sub_data_type);
-
-	#else
-
-	/*In parallel, we have a FetchData, which will recover data, but it will do a good job provided the FILE* descriptor 
-	 * is pointing to the start of the data we want. Here, we have to go looking for the beginning of this data. */
-
+	/*Go find in the binary file, the position of the data we want to fetch: */
 	if(my_rank==0){
 	
@@ -93,6 +127,49 @@
 	if(!found)throw ErrorException(__FUNCT__,exprintf("%s %s ","could not find data with name",data_name));
 
-	/*We are at the correct position! Go for it: */
-	FetchData((void**)pdata,pM,pN,fid,data_type,sub_data_type);
-	#endif
+	return fid;
 }
+
+void  IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name){
+	
+	FILE* fid=NULL;
+	
+	/*Set file pointer to beginning of the data: */
+	fid=SetFilePointerToData(model_handle,data_name);
+	
+	/*Now fetch: */
+	FetchData(pmatrix,pM,pN,fid);
+
+}
+void  IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){
+
+	FILE* fid=NULL;
+	
+	/*Set file pointer to beginning of the data: */
+	fid=SetFilePointerToData(model_handle,data_name);
+	
+	/*Now fetch: */
+	FetchData(pstring,fid);
+}
+
+void  IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){
+
+	FILE* fid=NULL;
+	
+	/*Set file pointer to beginning of the data: */
+	fid=SetFilePointerToData(model_handle,data_name);
+	
+	/*Now fetch: */
+	FetchData(pscalar,fid);
+}
+
+void  IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){
+
+	FILE* fid=NULL;
+	
+	/*Set file pointer to beginning of the data: */
+	fid=SetFilePointerToData(model_handle,data_name);
+	
+	/*Now fetch: */
+	FetchData(pinteger,fid);
+}
+#endif
Index: sm/trunk/src/c/io/ParallelFetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/ParallelFetchData.cpp	(revision 2332)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/*
- * ParallelFetchData.c
- */
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-
-#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
-
-#include "./io.h"
-#include "../include/macros.h"
-#include "../shared/shared.h"
-
-
-#undef __FUNCT__
-#define __FUNCT__ "ParallelFetchData"
-
-void ParallelFetchData(void** pdata,int* pM,int* pN,FILE* fid, char* data_type,char* sub_data_type){
-
-	/*Branch according to data type and sub_data_type: */
-	if (strcmp(data_type,"Matrix")==0){
-
-		if (strcmp(sub_data_type,"Mat")==0){
-			ParallelFetchMat((double**)pdata,pM,pN,fid);
-		}
-		else throw ErrorException(__FUNCT__,exprintf("%s%s%s%s%s"," sub_data_type ",sub_data_type," for ",data_type," type not supported yet!"));
-	}
-	else if (strcmp(data_type,"String")==0){
-
-		/*Call ParallelFetchString: */
-		ParallelFetchString((char**)pdata,fid);
-
-
-	}
-	else if (strcmp(data_type,"Scalar")==0){
-
-		/*Call ParallelFetchScalar. Cast pdata from a (void**) to a (double*), because we are not going to allocate a scalar,
-		 *just dereference the double*.: */
-		ParallelFetchScalar((double*)pdata,fid);
-
-	}
-	else if (strcmp(data_type,"Integer")==0){
-
-		/*Call ParallelFetchInteger. Cast pdata from a (void**) to a (int*), because we are not going to allocate an integer,
-		 *just dereference the int*.: */
-		ParallelFetchInteger((int*)pdata,fid);
-	
-	}
-	else throw ErrorException(__FUNCT__,exprintf("%s%s%s"," data_type ",data_type," not supported yet!"));
-}
-
-#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
-
Index: sm/trunk/src/c/io/ParallelFetchInteger.cpp
===================================================================
--- /issm/trunk/src/c/io/ParallelFetchInteger.cpp	(revision 2332)
+++ 	(revision )
@@ -1,41 +1,0 @@
-
-/*
-   ParallelFetchInteger.c
- */
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "stdio.h"
-#include "../toolkits/toolkits.h"
-#include "../shared/shared.h"
-
-#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
-
-#undef __FUNCT__
-#define __FUNCT__ "ParallelFetchInteger"
-void ParallelFetchInteger(int* pinteger,FILE* fid){
-
-	/*error management*/
-	extern int my_rank;
-	extern int num_procs;
-
-	/*output: */
-	int   integer;
-
-	/*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
-	if(my_rank==0){  
-		if(fread(&integer,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__," could not read integer ");
-	}
-
-	MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 
-
-	/*Assign output pointers: */
-	*pinteger=integer;
-
-}
-
-#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
Index: sm/trunk/src/c/io/ParallelFetchMat.cpp
===================================================================
--- /issm/trunk/src/c/io/ParallelFetchMat.cpp	(revision 2332)
+++ 	(revision )
@@ -1,62 +1,0 @@
-
-/*
-   ParallelFetchMat.c
- */
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "stdio.h"
-#include "../shared/shared.h"
-
-#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
-
-#undef __FUNCT__
-#define __FUNCT__ "ParallelFetchMat"
-#define CLEANUP ParallelFetchMatLocalCleanup();
-
-void ParallelFetchMat(double** pmatrix,int* pmatrix_rows,int* pmatrix_cols,FILE* fid){
-
-	/*output: */
-	int matrix_rows,matrix_cols;
-	double* matrix=NULL;
-	extern int my_rank;
-	extern int num_procs;
-
-	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
-	/*numberofelements: */
-	if(my_rank==0){  
-		if(fread(&matrix_rows,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__,"could not read number of rows for matrix ");
-	}
-
-	MPI_Bcast(&matrix_rows,1,MPI_INT,0,MPI_COMM_WORLD); 
-
-	if(my_rank==0){  
-		if(fread(&matrix_cols,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__,"  could not read number of columns for matrix ");
-	}
-	MPI_Bcast(&matrix_cols,1,MPI_INT,0,MPI_COMM_WORLD); 
-
-	/*Now allocate matrix: */
-	if(matrix_rows*matrix_cols){
-		matrix=(double*)xmalloc(matrix_rows*matrix_cols*sizeof(double));
-
-		/*Read matrix on node 0, then broadcast: */
-		if(my_rank==0){  
-			if(fread(matrix,matrix_rows*matrix_cols*sizeof(double),1,fid)!=1) throw ErrorException(__FUNCT__," could not read matrix ");
-		}
-		
-		MPI_Bcast(matrix,matrix_rows*matrix_cols,MPI_DOUBLE,0,MPI_COMM_WORLD); 
-	}
-
-
-	/*Assign output pointers: */
-	if (pmatrix)*pmatrix=matrix;
-	if (pmatrix_rows)*pmatrix_rows=matrix_rows;
-	if (pmatrix_cols)*pmatrix_cols=matrix_cols;
-
-}
-
-#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
Index: sm/trunk/src/c/io/ParallelFetchScalar.cpp
===================================================================
--- /issm/trunk/src/c/io/ParallelFetchScalar.cpp	(revision 2332)
+++ 	(revision )
@@ -1,38 +1,0 @@
-
-/*
-   ParallelFetchScalar.c
- */
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "stdio.h"
-#include "../shared/shared.h"
-#include "../toolkits/toolkits.h"
-
-#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
-
-#undef __FUNCT__
-#define __FUNCT__ "ParallelFetchScalar"
-
-void ParallelFetchScalar(double* pscalar,FILE* fid){
-
-	/*output: */
-	double   scalar;
-	extern int my_rank;
-	extern int num_procs;
-
-	/*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */
-	if(my_rank==0){
-		if(fread(&scalar,sizeof(double),1,fid)!=1)throw ErrorException(__FUNCT__," could not read scalar ");
-	}
-	MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 
-
-	/*Assign output pointers: */
-	*pscalar=scalar;
-}
-
-#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
Index: sm/trunk/src/c/io/ParallelFetchString.cpp
===================================================================
--- /issm/trunk/src/c/io/ParallelFetchString.cpp	(revision 2332)
+++ 	(revision )
@@ -1,55 +1,0 @@
-
-/*
-   ParallelFetchString.c
- */
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
-
-#include "stdio.h"
-#include "../shared/shared.h"
-
-#undef __FUNCT__
-#define __FUNCT__ "ParallelFetchString"
-
-void ParallelFetchString(char** pstring,FILE* fid){
-
-	/*output: */
-	char* string=NULL;
-	int   string_size;
-	extern int my_rank;
-	extern int num_procs;
-
-	/*We have to read a string from disk. First read the dimensions of the string, then the string: */
-	if(my_rank==0){  
-		if(fread(&string_size,sizeof(int),1,fid)!=1)throw ErrorException(__FUNCT__," could not read length of string ");
-	}
-
-	MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 
-
-	/*Now allocate string: */
-	if(string_size){
-		string=(char*)xmalloc((string_size+1)*sizeof(char));
-		string[string_size]='\0';
-
-		/*Read string on node 0, then broadcast: */
-		if(my_rank==0){  
-			if(fread(string,string_size*sizeof(char),1,fid)!=1)throw ErrorException(__FUNCT__,"  could not read string ");
-		}
-		MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 
-	}
-	else{
-		string=(char*)xmalloc(sizeof(char));
-		string[0]='\0';
-	}
-
-
-	/*Assign output pointers: */
-	*pstring=string;
-}
-#endif //#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
Index: sm/trunk/src/c/io/SerialFetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/SerialFetchData.cpp	(revision 2332)
+++ 	(revision )
@@ -1,212 +1,0 @@
-/*  \file * SerialFetchData.c
- *  \brief fetch data from the matlab workspace, and pass it to the "x" code layer
- */
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "../shared/shared.h"
-
-#ifdef _SERIAL_
-
-#undef __FUNCT__ 
-#define __FUNCT__ "SerialFetchData"
-
-void SerialFetchData(void** pdata,int* pM,int* pN,const mxArray* mxdata,char* data_type,char* sub_data_type){
-
-	
-	int i,j;
-
-
-	/*output*/
-	DataSet* outdataset=NULL;
-	char*    outdataset_buffer=NULL;
-	int      outdataset_size;
-
-	double*  outmatrix=NULL;
-	Mat      outpetscmatrix=NULL;
-	double*  outmatrix_workspace=NULL;;
-	int      outmatrix_rows,outmatrix_cols;
-	int      petsc;
-
-	double*  outvector=NULL;
-	Vec      outpetscvector=NULL;
-	double*  outvector_workspace=NULL;
-	int      outvector_rows;
-
-	char*    outstring=NULL;
-	double   outscalar;
-	
-	/*First branch on the type of data. Allowed types are DataSet, Matrix, Vector, Integer, Scalar and String. Matrix and Vector will 
-	 * behave the same way on the client side, differently on the server side. : */
-	if (strcmp(data_type,"DataSet")==0){
-
-		/*First, check that our reference is a double, otherwise, error out: */
-		if (mxIsDouble(mxdata)){
-			/*We need to copy the data pointed by mxdata, so that our dataset is not actually a pointer!:*/
-			if (!mxIsEmpty(mxdata)){
-				outdataset_buffer=(char*)mxGetPr(mxdata);
-				outdataset_size=mxGetM(mxdata)*mxGetN(mxdata);
-				if(outdataset_size)outdataset=DataSetDemarshall(outdataset_buffer);
-			}
-		}
-		else{
-			if (mxIsEmpty(mxdata)){
-				/*Nothing to pick up. Just initialize pointer to NULL, and warn the server we are not uploading anything: */
-				outdataset_size=0;
-				outdataset=NULL;
-			}
-			else{
-				/*This is an error: we don't have the correct input!: */
-				throw ErrorException(__FUNCT__,"  wrong input parameter!");
-			}
-		}
-	}
-	else if (strcmp(data_type,"Matrix")==0){
-	
-		if(mxIsEmpty(mxdata) ){
-			/*Nothing to pick up. Just initialize matrix pointer to NULL: */
-			outmatrix_rows=0;
-			outmatrix_cols=0;
-			outmatrix=NULL;
-			petsc=0;
-		}
-		else if (mxIsDouble(mxdata) ){
-
-			/*Check mxdata is not pointing to NaN: */
-			if ( mxIsNaN(*(mxGetPr(mxdata))) && (mxGetM(mxdata)==1) && (mxGetN(mxdata)==1) ){
-				outmatrix_rows=0;
-				outmatrix_cols=0;
-				outmatrix=NULL;
-				petsc=0;
-			}
-			else{
-
-				/*Look at the sub_type: do we want a double* matrix (Mat) or a petsc matrix (PM)?*/
-				if (sub_data_type && strcmp(sub_data_type,"Mat")==0){
-					/*Convert matlab matrix to double* matrix: */
-					MatlabMatrixToDoubleMatrix(&outmatrix,&outmatrix_rows,&outmatrix_cols,mxdata);
-					petsc=0;
-				}
-				else{
-					/*Convert matlab matrix to petsc matrix: */
-					MatlabMatrixToPetscMatrix(&outpetscmatrix,&outmatrix_rows,&outmatrix_cols,mxdata);
-					petsc=1;
-				}
-			}
-		}
-		else{
-			/*This is an error: we don't have the correct input!: */
-			throw ErrorException(__FUNCT__,"wrong input parameter");
-		}
-	}
-	else if (strcmp(data_type,"Vector")==0){
-
-		if(mxIsEmpty(mxdata)){
-			/*Nothing to pick up. Just initialize matrix pointer to NULL: */
-			outvector_rows=0;
-			outvector=NULL;
-			petsc=0;
-		}
-		else if (mxIsDouble(mxdata) ){
-
-			/*Look at the sub_type: do we want a double* matrix (Vec) or a petsc vector (PV)?*/
-			if (sub_data_type && strcmp(sub_data_type,"Vec")==0){
-				/*Convert matlab vector to double*  vector: */
-				MatlabVectorToDoubleVector(&outvector,&outvector_rows,mxdata);
-				petsc=0;
-			}
-			else{
-				/*Convert matlab vector to petsc vector: */
-				MatlabVectorToPetscVector(&outpetscvector,&outvector_rows,mxdata);
-				petsc=1;
-			}
-		}
-		else{
-			/*This is an error: we don't have the correct input!: */
-			throw ErrorException(__FUNCT__,"wrong input parameter");
-		}
-	}
-	else if (strcmp(data_type,"String")==0){
-		/*Ok, the string should be coming directly from the matlab workspace: */
-		if (!mxIsChar(mxdata)){
-			throw ErrorException(__FUNCT__,"input data_type is not a string!");
-		}
-		else{
-			/*Recover the string:*/
-			int stringlen;
-			
-			stringlen = mxGetM(mxdata)*mxGetN(mxdata)+1;
-			outstring = (char*)xmalloc(sizeof(mxChar)*stringlen);
-			mxGetString(mxdata,outstring,stringlen);
-		}
-	}
-	else if ((strcmp(data_type,"Scalar")==0) || (strcmp(data_type,"Integer")==0)){
-		/*The scalar should be coming directly from the matlab workspace. But we are fetching a scalar, not an array of scalars, 
-		 *we  therefore don't want to dynamically allocate the scalar. Therefore, we are going to do some pointer gymnastics here. 
-		 *We assume that  pdata, which is cast as a (void**) pointer, is actually a (double*), we can do that, because void pointers
-		 *can be cast to anything!: */
-		if (!mxIsDouble(mxdata)){
-			throw ErrorException(__FUNCT__,"input data_type is not a scalar!");
-		}
-		else{
-			/*Recover the double: */
-			outscalar=mxGetScalar(mxdata);
-		}
-	}
-	else{
-		throw ErrorException(__FUNCT__,"incorrect data type data_type only \"Matrix\", \"DataSet\", \"Vector\", \"Scalar\",\"Integer\"  and \"String\" are allowed");
-	}
-
-
-	/*Assign output pointers: */
-	
-	if(strcmp(data_type,"DataSet")==0){
-		*pdata=(void*)outdataset;
-		if (pM)*pM=outdataset_size;
-		if (pN)*pN=1;
-	}
-	if(strcmp(data_type,"Matrix")==0){
-		if (petsc){
-			*pdata=(void*)outpetscmatrix;
-		}
-		else{
-			*pdata=(void*)outmatrix;
-		}
-		if (pM)*pM=outmatrix_rows;
-		if (pN)*pN=outmatrix_cols;
-	}
-	if(strcmp(data_type,"Vector")==0){
-		if(petsc){
-			*pdata=(void*)outpetscvector;
-		}
-		else{
-			*pdata=(void*)outvector;
-		}
-		if (pM)*pM=outvector_rows;
-		if (pN)*pN=1;
-	}
-	if(strcmp(data_type,"String")==0){
-		*pdata=(void*)outstring;
-		if (pM)*pM=strlen(outstring)+1;
-		if (pN)*pN=1;
-	}
-	if(strcmp(data_type,"Scalar")==0){
-		/*some pointer gymnastics: */
-		double* pdouble=(double*)pdata; /*Yes, this is not a mistake, as said before, we do not want to dynamically allocate a scalar!*/
-		*pdouble=outscalar;
-		if (pM)*pM=1;
-		if (pN)*pN=1;
-	}
-	if(strcmp(data_type,"Integer")==0){
-		/*same as Scalar, except we cast the result to an integer: */
-		int* pinteger=(int*)pdata; /*Yes, this is not a mistake, as said before, we do not want to dynamically allocate a scalar, or an integer!*/
-		*pinteger=(int)outscalar; /*cast the double to an integer*/
-		if (pM)*pM=1;
-		if (pN)*pN=1;
-	}
-}
-#endif //#ifndef _PARALLEL_
Index: /issm/trunk/src/c/io/WriteParams.cpp
===================================================================
--- /issm/trunk/src/c/io/WriteParams.cpp	(revision 2332)
+++ /issm/trunk/src/c/io/WriteParams.cpp	(revision 2333)
@@ -48,5 +48,5 @@
 
 	/*Recover data from the parameters dataset: */
-	nfields=(mwSize)parameters->Size();
+	nfields=(mwSize)parameters->Size()-1; //don't include Numpar
 
 	fnames=(const char**)xmalloc(nfields*sizeof(char*));
@@ -54,5 +54,5 @@
 	/*Build structure in matlab workspace with all the parameter fields: */
 	for(i=0;i<nfields;i++){
-		param=(Param*)parameters->GetObjectByOffset(i);
+		param=(Param*)parameters->GetObjectByOffset(i+1);
 		fnames[i]=(const char*)xmalloc((strlen(param->GetParameterName())+1)*sizeof(char));
 		strcpy((char*)fnames[i],param->GetParameterName());
@@ -64,24 +64,24 @@
 	for(i=0;i<nfields;i++){
 
-		param=(Param*)parameters->GetObjectByOffset(i);
+		param=(Param*)parameters->GetObjectByOffset(i+1);
 		
 		switch(param->GetType()){
 			case INTEGER:
-				param->GetParameterValue((void*)&integer);
+				param->GetParameterValue(&integer);
 				mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)integer));
 				break;
 
 			case DOUBLE:
-				param->GetParameterValue((void*)&ddouble);
+				param->GetParameterValue(&ddouble);
 				mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)ddouble));
 				break;
 
 			case STRING:
-				param->GetParameterValue((void*)&string);
+				param->GetParameterValue(&string);
 				mxSetField( dataref, 0, param->GetParameterName(),mxCreateString(string));
 				break;
 
 			case STRINGARRAY:
-				param->GetParameterValue((void*)&stringarray);
+				param->GetParameterValue(&stringarray);
 				M=param->GetM();
 				dims[0]=M;
@@ -96,5 +96,5 @@
 
 			case DOUBLEVEC:
-				param->GetParameterValue((void*)&doublevec);
+				param->GetParameterValue(&doublevec);
 				M=param->GetM();
 				pfield=mxCreateDoubleMatrix(0,0,mxREAL);
@@ -106,5 +106,5 @@
 
 			case DOUBLEMAT:
-				param->GetParameterValue((void*)&doublemat);
+				param->GetParameterValue(&doublemat);
 				M=param->GetM();
 				N=param->GetN();
@@ -119,5 +119,5 @@
 		
 			case PETSCVEC:
-				param->GetParameterValue((void*)&vec);
+				param->GetParameterValue(&vec);
 				VecToMPISerial(&serial_vec,vec);
 				VecFree(&vec);
@@ -131,5 +131,5 @@
 		
 			case PETSCMAT:
-				param->GetParameterValue((void*)&mat);
+				param->GetParameterValue(&mat);
 				MatToSerial(&serial_mat,mat);
 				MatFree(&mat);
Index: /issm/trunk/src/c/io/io.h
===================================================================
--- /issm/trunk/src/c/io/io.h	(revision 2332)
+++ /issm/trunk/src/c/io/io.h	(revision 2333)
@@ -13,10 +13,9 @@
 class DataSet;
 
-void FetchData(void** pdata,int* pM,int* pN,ConstDataHandle data_handle,char* data_type,char* sub_data_type);
-void IoModelFetchData(void** pdata,int* pM,int* pN,ConstDataHandle model_handle,char* data_name,char* data_type,char* sub_data_type);
+FILE* pfopen(char* filename,char* format);
+void  pfclose(FILE* fid,char* filename);
 
-/*Serial: */
 #ifdef _SERIAL_
-/*Write: */
+
 void WriteData(mxArray** pdataref,DataSet* dataset);
 void WriteData(mxArray** pdataref,Mat matrix);
@@ -28,27 +27,58 @@
 void WriteData(mxArray** pdataref,char* string);
 void WriteData(mxArray** pdataref,DofVec* vector);
+
 void WriteNodeSets(DataHandle* pdataref,NodeSets* nodesets);
 void WriteParams(DataHandle* pdataref,DataSet* parameters);
 
-/*Fetch: */
-void SerialFetchData(void** pdata,int* pM,int* pN,ConstDataHandle data_handle,char* data_type,char* sub_data_type);
+void FetchData(DataSet** pdataset,const mxArray* dataref);
+void FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref);
+void FetchData(Mat* pmatrix,const mxArray* dataref);
+void FetchData(double** pvector,int* pM,const mxArray* dataref);
+void FetchData(Vec* pvector,const mxArray* dataref);
+void FetchData(char** pstring,const mxArray* dataref);
+void FetchData(double* pscalar,const mxArray* dataref);
+void FetchData(int* pinteger,const mxArray* dataref);
+
+
+void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name);
+void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name);
+void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name);
+void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name);
+void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name);
+void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name);
+void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name);
+void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name);
+
 void FetchNodeSets(NodeSets** pnodesets,ConstDataHandle dataref);
+void FetchParams(DataSet** pparameters, DataHandle dataref);
+
 #endif
 
-/*Parallel: */
+
+
+
+
 #ifdef _PARALLEL_
-void ParallelFetchData(void** pdata,int* pM,int* pN,DataHandle data_handle, char* data_type,char* sub_data_type);
-void ParallelFetchMat(double** pdata,int* pM,int* pN,DataHandle data_handle);
-void ParallelFetchString(char** pdata,DataHandle data_handle);
-void ParallelFetchScalar(double* pdata,DataHandle data_handle);
-void ParallelFetchInteger(int* pdata,DataHandle data_handle);
+void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid);
+void FetchData(char** pstring,FILE* fid);
+void FetchData(double* pscalar,FILE* fid);
+void FetchData(int* pinteger,FILE* fid);
+
+
+FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name);
+void  IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name);
+void  IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name);
+void  IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name);
+void  IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name);
+
+void WriteData(int* pdummy,void* data,char* data_type);
 void WriteDataToDisk(void* data,int* pM,int* pN,char* datatype,FILE* fid);
-void WriteData(int* pdummy,void* data,char* data_type);
+
 #endif
 
-/*File I/O: */
-FILE* pfopen(char* filename,char* format);
-void  pfclose(FILE* fid,char* filename);
 
-#endif	/* _IMDB_H */
 
+
+
+
+#endif	/* _IO_H_ */
Index: /issm/trunk/src/c/objects/Beam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Beam.cpp	(revision 2332)
+++ /issm/trunk/src/c/objects/Beam.cpp	(revision 2333)
@@ -26,5 +26,5 @@
 }
 		
-Beam::Beam(int beam_id, int beam_mid, int beam_mparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed){
+Beam::Beam(int beam_id, int beam_mid, int beam_mparid, int beam_numparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed){
 
 	int i;
@@ -33,4 +33,5 @@
 	mid=beam_mid;
 	mparid=beam_mparid;
+	numparid=beam_numparid;
 	for(i=0;i<2;i++){
 		node_ids[i]=beam_g[i];
@@ -46,4 +47,6 @@
 	matpar=NULL;
 	matpar_offset=UNDEF;
+	numpar=NULL;
+	numpar_offset=UNDEF;
 	onbed=beam_onbed;
 	
@@ -127,4 +130,7 @@
 	memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
 	memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
+	memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
+	memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
 	memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
 	memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s);
@@ -148,4 +154,7 @@
 		+sizeof(matpar)
 		+sizeof(matpar_offset)
+		+sizeof(numparid)
+		+sizeof(numpar)
+		+sizeof(numpar_offset)
 		+sizeof(h)
 		+sizeof(s)
@@ -181,4 +190,7 @@
 	memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
 	memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
+	memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
+	memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
 	memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
 	memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s);
@@ -211,5 +223,5 @@
 #undef __FUNCT__ 
 #define __FUNCT__ "Beam::Configure"
-void  Beam::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin){
+void  Beam::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin,void* pparametersin){
 
 	int i;
@@ -218,4 +230,5 @@
 	DataSet* nodesin=NULL;
 	DataSet* materialsin=NULL;
+	DataSet* parametersin=NULL;
 
 	/*Recover pointers :*/
@@ -223,4 +236,5 @@
 	nodesin=(DataSet*)pnodesin;
 	materialsin=(DataSet*)pmaterialsin;
+	parametersin=(DataSet*)pparametersin;
 
 	/*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */
@@ -230,4 +244,7 @@
 	ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin);
 	ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin);
+
+	/*Same for numpar: */
+	ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin);
 
 }
Index: /issm/trunk/src/c/objects/Beam.h
===================================================================
--- /issm/trunk/src/c/objects/Beam.h	(revision 2332)
+++ /issm/trunk/src/c/objects/Beam.h	(revision 2333)
@@ -33,4 +33,8 @@
 		Matpar* matpar; 
 		int   matpar_offset;
+
+		int numparid;
+		Numpar* numpar; 
+		int   numpar_offset;
 					
 		double h[2];
@@ -44,5 +48,5 @@
 
 		Beam();
-		Beam(int beam_id, int beam_mid, int beam_mparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed);
+		Beam(int beam_id, int beam_mid, int beam_mparid, int beam_numparid,int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed);
 		~Beam();
 
@@ -56,5 +60,5 @@
 		int   GetId(); 
 		int   MyRank();
-		void  Configure(void* loads,void* nodes,void* materials);
+		void  Configure(void* loads,void* nodes,void* materials,void* parameters);
 		void  CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type);
 		void  CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type);
Index: /issm/trunk/src/c/objects/Element.h
===================================================================
--- /issm/trunk/src/c/objects/Element.h	(revision 2332)
+++ /issm/trunk/src/c/objects/Element.h	(revision 2333)
@@ -24,5 +24,5 @@
 		virtual char* GetName()=0;
 		virtual void  Demarshall(char** pmarshalled_dataset)=0;
-		virtual void  Configure(void* loads,void* nodes,void* materials)=0;
+		virtual void  Configure(void* loads,void* nodes,void* materials,void* parameters)=0;
 		virtual void  CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type)=0;
 		virtual void  CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type)=0;
Index: /issm/trunk/src/c/objects/FemModel.cpp
===================================================================
--- /issm/trunk/src/c/objects/FemModel.cpp	(revision 2332)
+++ /issm/trunk/src/c/objects/FemModel.cpp	(revision 2333)
@@ -177,11 +177,60 @@
 }
 
-#undef __FUNCT__
-#define __FUNCT__ "FemModel::FindParam"
-int FemModel::FindParam(void* pparameter,char* parametername){
-	
-	return parameters->FindParam(pparameter,parametername);
-
-}
+
+#undef __FUNCT__
+#define __FUNCT__ "FemModel::FindParam"
+int FemModel::FindParam(double* pscalar,char* name){
+	
+	return parameters->FindParam(pscalar,name);
+
+}
+#undef __FUNCT__
+#define __FUNCT__ "FemModel::FindParam"
+int FemModel::FindParam(int* pinteger,char* name){
+	
+	return parameters->FindParam(pinteger,name);
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "FemModel::FindParam"
+int FemModel::FindParam(char** pstring,char* name){
+	
+	return parameters->FindParam(pstring,name);
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "FemModel::FindParam"
+int FemModel::FindParam(char*** pstringarray,int* pM,char* name){
+	
+	return parameters->FindParam(pstringarray,pM,name);
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "FemModel::FindParam"
+int FemModel::FindParam(double** pdoublearray,int* pM,int* pN,char* name){
+	
+	return parameters->FindParam(pdoublearray,pM,pN,name);
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "FemModel::FindParam"
+int FemModel::FindParam(Vec* pvec,char* name){
+	
+	return parameters->FindParam(pvec,name);
+
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "FemModel::FindParam"
+int FemModel::FindParam(Mat* pmat,char* name){
+	
+	return parameters->FindParam(pmat,name);
+
+}
+
 
 /*access to internal data: */
Index: /issm/trunk/src/c/objects/FemModel.h
===================================================================
--- /issm/trunk/src/c/objects/FemModel.h	(revision 2332)
+++ /issm/trunk/src/c/objects/FemModel.h	(revision 2333)
@@ -53,5 +53,11 @@
 		Object* copy();
 		
-		int FindParam(void* pparameter,char* parametername);
+		int FindParam(double* pscalar,char* name);
+		int FindParam(int* pinteger,char* name);
+		int FindParam(char** pstring,char* name);
+		int FindParam(char*** pstringarray,int* pM,char* name);
+		int FindParam(double** pdoublearray,int* pM, int* pN,char* name);
+		int FindParam(Vec* pvec,char* name);
+		int FindParam(Mat* pmat,char* name);
 		DataSet* get_elements(void);
 		DataSet* get_nodes(void);
Index: /issm/trunk/src/c/objects/Model.cpp
===================================================================
--- /issm/trunk/src/c/objects/Model.cpp	(revision 2332)
+++ /issm/trunk/src/c/objects/Model.cpp	(revision 2333)
@@ -106,5 +106,5 @@
 
 	_printf_("   configuring element and loads:\n");
-	ConfigureObjectsx(elements, loads, nodes, materials);
+	ConfigureObjectsx(elements, loads, nodes, materials,parameters);
 
 	_printf_("   process parameters:\n");
@@ -184,5 +184,5 @@
 
 	_printf_("   configuring element and loads:\n");
-	ConfigureObjectsx(elements, loads, nodes, materials);
+	ConfigureObjectsx(elements, loads, nodes, materials,parameters);
 
 	_printf_("   process parameters:\n");
@@ -216,5 +216,5 @@
 	if(!femmodel)return 0;
 
-	femmodel->FindParam((void*)pparameter,parametername);
+	femmodel->FindParam(pparameter,parametername);
 
 }
@@ -231,9 +231,9 @@
 	if(!femmodel)return 0;
 	
-	femmodel->FindParam((void*)pparameter,parametername);
-
-
-}
-int   Model::FindParam(double** pparameter,char* parametername){
+	femmodel->FindParam(pparameter,parametername);
+
+
+}
+int   Model::FindParam(double** pparameter,int* pM, int *pN,char* parametername){
 	
 	FemModel* femmodel=NULL;
@@ -247,5 +247,5 @@
 	if(!femmodel)return 0;
 	
-	femmodel->FindParam((void*)pparameter,parametername);
+	femmodel->FindParam(pparameter,pM, pN,parametername);
 
 
@@ -263,5 +263,5 @@
 	if(!femmodel)return 0;
 	
-	femmodel->FindParam((void*)pparameter,parametername);
+	femmodel->FindParam(pparameter,parametername);
 
 }
@@ -277,5 +277,5 @@
 
 	/*extract our parameter from the found formulation: */
-	femmodel->FindParam((void*)pparameter,parametername);
+	femmodel->FindParam(pparameter,parametername);
 }
 
@@ -290,9 +290,9 @@
 
 	/*extract our parameter from the found formulation: */
-	femmodel->FindParam((void*)pparameter,parametername);
-}
-
-
-int   Model::FindParam(double** pparameter,char* parametername,int analysis_type,int sub_analysis_type){
+	femmodel->FindParam(pparameter,parametername);
+}
+
+
+int   Model::FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type,int sub_analysis_type){
 
 	FemModel* femmodel=NULL;
@@ -304,5 +304,5 @@
 
 	/*extract our parameter from the found formulation: */
-	femmodel->FindParam((void*)pparameter,parametername);
+	femmodel->FindParam(pparameter,pM, pN,parametername);
 }
 
@@ -317,5 +317,5 @@
 
 	/*extract our parameter from the found formulation: */
-	femmodel->FindParam((void*)pparameter,parametername);
+	femmodel->FindParam(pparameter,parametername);
 }
 
@@ -330,5 +330,5 @@
 
 	/*extract our parameter from the found formulation: */
-	femmodel->FindParam((void*)pparameter,parametername);
+	femmodel->FindParam(pparameter,parametername);
 }
 
@@ -343,9 +343,9 @@
 
 	/*extract our parameter from the found formulation: */
-	femmodel->FindParam((void*)pparameter,parametername);
-}
-
-
-int   Model::FindParam(double** pparameter,char* parametername,int analysis_type){
+	femmodel->FindParam(pparameter,parametername);
+}
+
+
+int   Model::FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type){
 
 	FemModel* femmodel=NULL;
@@ -357,5 +357,5 @@
 
 	/*extract our parameter from the found formulation: */
-	femmodel->FindParam((void*)pparameter,parametername);
+	femmodel->FindParam(pparameter,pM,pN,parametername);
 }
 
@@ -370,5 +370,5 @@
 
 	/*extract our parameter from the found formulation: */
-	femmodel->FindParam((void*)pparameter,parametername);
+	femmodel->FindParam(pparameter,parametername);
 }	
 
@@ -390,6 +390,6 @@
 
 		femmodel=(FemModel*)femmodels->GetObjectByOffset(i);
-		femmodel->FindParam((void*)&femmodel_analysis_type,"analysis_type");
-		femmodel->FindParam((void*)&femmodel_sub_analysis_type,"sub_analysis_type");
+		femmodel->FindParam(&femmodel_analysis_type,"analysis_type");
+		femmodel->FindParam(&femmodel_sub_analysis_type,"sub_analysis_type");
 
 		if((analysis_type==femmodel_analysis_type) && (sub_analysis_type==femmodel_sub_analysis_type)){
@@ -420,5 +420,5 @@
 
 		femmodel=(FemModel*)femmodels->GetObjectByOffset(i);
-		femmodel->FindParam((void*)&femmodel_analysis_type,"analysis_type");
+		femmodel->FindParam(&femmodel_analysis_type,"analysis_type");
 
 		if((analysis_type==femmodel_analysis_type)){
Index: /issm/trunk/src/c/objects/Model.h
===================================================================
--- /issm/trunk/src/c/objects/Model.h	(revision 2332)
+++ /issm/trunk/src/c/objects/Model.h	(revision 2333)
@@ -35,15 +35,15 @@
 		int   FindParam(int* pparameter,char* parametername);
 		int   FindParam(double* pparameter,char* parametername);
-		int   FindParam(double** pparameter,char* parametername);
+		int   FindParam(double** pparameter,int* pM,int* pN,char* parametername);
 		int   FindParam(char** pparameter,char* parametername);
 
 		int   FindParam(int* pparameter,char* parametername,int analysis_type,int sub_analysis_type);
 		int   FindParam(double* pparameter,char* parametername,int analysis_type,int sub_analysis_type);
-		int   FindParam(double** pparameter,char* parametername,int analysis_type,int sub_analysis_type);
+		int   FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type,int sub_analysis_type);
 		int   FindParam(char** pparameter,char* parametername,int analysis_type,int sub_analysis_type);
 
 		int   FindParam(int* pparameter,char* parametername,int analysis_type);
 		int   FindParam(double* pparameter,char* parametername,int analysis_type);
-		int   FindParam(double** pparameter,char* parametername,int analysis_type);
+		int   FindParam(double** pparameter,int* pM,int* pN,char* parametername,int analysis_type);
 		int   FindParam(char** pparameter,char* parametername,int analysis_type);
 
Index: /issm/trunk/src/c/objects/Numpar.cpp
===================================================================
--- /issm/trunk/src/c/objects/Numpar.cpp	(revision 2333)
+++ /issm/trunk/src/c/objects/Numpar.cpp	(revision 2333)
@@ -0,0 +1,205 @@
+/*!\file Numpar.c
+ * \brief: implementation of the Numpar object
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include "./Numpar.h"
+#include <string.h>
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../shared/shared.h"
+#include "../DataSet/DataSet.h"
+#include "../include/typedefs.h"
+
+
+Numpar::Numpar(){
+	return;
+}
+
+Numpar::Numpar(int numpar_id){
+	id=numpar_id;
+
+	meanvel=UNDEF;
+	epsvel=UNDEF;
+	artdiff=UNDEF;
+	viscosity_overshoot=UNDEF;
+	stokesreconditioning=UNDEF;
+	cm_noisedampening=UNDEF;
+
+	return;
+}
+Numpar::~Numpar(){
+	return;
+}
+
+Numpar::Numpar(int    numpar_id, double numpar_meanvel, double numpar_epsvel, int    numpar_artdiff, double numpar_viscosity_overshoot, double numpar_stokesreconditioning, double numpar_cm_noisedampening){
+
+	id=numpar_id;
+	meanvel=numpar_meanvel;
+	epsvel=numpar_epsvel;
+	artdiff=numpar_artdiff;
+	viscosity_overshoot=numpar_viscosity_overshoot;
+	stokesreconditioning=numpar_stokesreconditioning;
+	cm_noisedampening=numpar_cm_noisedampening;
+	
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "Numpar::Echo"
+void Numpar::Echo(void){
+
+	printf("Numpar:\n");
+	printf("   id: %i\n",id);
+	printf("   meanvel: %g\n",meanvel);
+	printf("   epsvel: %g\n",epsvel);
+	printf("   artdiff: %i\n",artdiff);
+	printf("   viscosity_overshoot: %g\n",viscosity_overshoot);
+	printf("   stokesreconditioning: %g\n",stokesreconditioning);
+	printf("   cm_noisedampening: %g\n",cm_noisedampening);
+}
+
+#undef __FUNCT__
+#define __FUNCT__ "Numpar::DeepEcho"
+void Numpar::DeepEcho(void){
+
+	printf("Numpar:\n");
+	printf("   id: %i\n",id);
+	printf("   meanvel: %g\n",meanvel);
+	printf("   epsvel: %g\n",epsvel);
+	printf("   artdiff: %i\n",artdiff);
+	printf("   viscosity_overshoot: %g\n",viscosity_overshoot);
+	printf("   stokesreconditioning: %g\n",stokesreconditioning);
+	printf("   cm_noisedampening: %g\n",cm_noisedampening);
+}
+
+
+void  Numpar::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Numpar: */
+	enum_type=NumparEnum();
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Numpar data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
+	memcpy(marshalled_dataset,&epsvel,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
+	memcpy(marshalled_dataset,&artdiff,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
+	memcpy(marshalled_dataset,&viscosity_overshoot,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
+	memcpy(marshalled_dataset,&stokesreconditioning,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);
+	memcpy(marshalled_dataset,&cm_noisedampening,sizeof(cm_noisedampening));marshalled_dataset+=sizeof(cm_noisedampening);
+	
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+		
+int   Numpar::MarshallSize(){
+	return sizeof(id)
+		+sizeof(meanvel)
+		+sizeof(epsvel)
+		+sizeof(artdiff)
+		+sizeof(viscosity_overshoot)
+		+sizeof(stokesreconditioning)
+		+sizeof(cm_noisedampening)
+		+sizeof(int); //sizeof(int) for enum type
+}
+
+char* Numpar::GetName(void){
+	return "beam";
+}
+
+void  Numpar::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
+	memcpy(&epsvel,marshalled_dataset,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
+	memcpy(&artdiff,marshalled_dataset,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
+	memcpy(&viscosity_overshoot,marshalled_dataset,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
+	memcpy(&stokesreconditioning,marshalled_dataset,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);
+	memcpy(&cm_noisedampening,marshalled_dataset,sizeof(cm_noisedampening));marshalled_dataset+=sizeof(cm_noisedampening);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+int Numpar::Enum(void){
+
+	return NumparEnum();
+
+}
+int    Numpar::GetId(void){ return id; }
+
+int    Numpar::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Numpar::Configure"
+void  Numpar::Configure(void* pparametersin){
+
+	DataSet* parameters=NULL;
+
+	/*Recover virtual pointer:*/
+	parameters=(DataSet*)pparametersin;
+
+	/*Go through parameters dataset, and find the Param object corresponding to our fields, 
+	 * and update the fields: */
+	if(!parameters->FindParam(&meanvel,"meanvel"))throw ErrorException(__FUNCT__," error message: could not update meanvel field");
+	if(!parameters->FindParam(&epsvel,"epsvel"))throw ErrorException(__FUNCT__," error message: could not update epsvel field");
+	if(!parameters->FindParam(&artdiff,"artdiff"))throw ErrorException(__FUNCT__," error message: could not update artdiff field");
+	if(!parameters->FindParam(&viscosity_overshoot,"viscosity_overshoot"))throw ErrorException(__FUNCT__," error message: could not update viscosity_overshoot field");
+	if(!parameters->FindParam(&stokesreconditioning,"stokesreconditioning"))throw ErrorException(__FUNCT__," error message: could not update stokesreconditioning field");
+	if(!parameters->FindParam(&cm_noisedampening,"cm_noisedampening"))throw ErrorException(__FUNCT__," error message: could not update cm_noisedampening field");
+
+	return;
+}
+
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Numpar::UpdateFromInputs"
+void  Numpar::UpdateFromInputs(void* vinputs){
+
+	ParameterInputs* inputs=NULL;
+
+	/*recover pointers: */
+	inputs=(ParameterInputs*)vinputs;
+
+	/*Update internal data if inputs holds new values: */
+	inputs->Recover("meanvel",&meanvel);
+	inputs->Recover("epsvel",&epsvel);
+	inputs->Recover("artdiff",&artdiff);
+	inputs->Recover("viscosity_overshoot",&viscosity_overshoot);
+	inputs->Recover("stokesreconditioning",&stokesreconditioning);
+	inputs->Recover("cm_noisedampening",&cm_noisedampening);
+
+}
+		
+Object* Numpar::copy() {
+	
+	return new Numpar(*this); 
+
+}
+
Index: /issm/trunk/src/c/objects/Numpar.h
===================================================================
--- /issm/trunk/src/c/objects/Numpar.h	(revision 2333)
+++ /issm/trunk/src/c/objects/Numpar.h	(revision 2333)
@@ -0,0 +1,45 @@
+/*! \file Numpar.h 
+ *  \brief: header file for numpar object
+ */
+
+#ifndef _NUMPAR_H_
+#define _NUMPAR_H_
+
+#include "./Object.h"
+
+class Numpar: public Object{
+
+	private: 
+		int    id;
+	
+	public:
+
+		/*parameters are made public, as they will be accessed quite often: */
+		double meanvel;
+		double epsvel;
+		int    artdiff;
+		double viscosity_overshoot;
+		double stokesreconditioning;
+		double cm_noisedampening;
+
+		Numpar();
+		Numpar(int id);
+		Numpar(int    id, double meanvel, double epsvel, int    artdiff, double viscosity_overshoot, double stokesreconditioning, double cm_noisedampening);
+		~Numpar();
+
+		/*object derived functionality: */
+		void  Echo();
+		void  DeepEcho();
+		int   GetId(); 
+		int   MyRank();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		char* GetName();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
+
+		void  Configure(void* pparametersin);
+		void  UpdateFromInputs(void* vinputs);
+};
+#endif  /* _NUMPAR_H */
Index: /issm/trunk/src/c/objects/Param.cpp
===================================================================
--- /issm/trunk/src/c/objects/Param.cpp	(revision 2332)
+++ /issm/trunk/src/c/objects/Param.cpp	(revision 2333)
@@ -116,8 +116,4 @@
 			break;
 	
-		case INTEGER:
-			printf("   integer value: %i\n",integer);
-			break;
-	
 		case DOUBLE:
 			printf("   double value: %g\n",ddouble);
@@ -175,8 +171,4 @@
 			}
 	
-		case INTEGER:
-			printf("   integer value: %i\n",integer);
-			break;
-	
 		case DOUBLE:
 			printf("   double value: %g\n",ddouble);
@@ -254,7 +246,4 @@
 			break;
 
-		case INTEGER:
-			memcpy(marshalled_dataset,&integer,sizeof(integer));marshalled_dataset+=sizeof(integer);
-			break;
 		case DOUBLE:
 			memcpy(marshalled_dataset,&ddouble,sizeof(ddouble));marshalled_dataset+=sizeof(ddouble);
@@ -343,7 +332,4 @@
 			break;
 
-		case INTEGER:
-			size+= sizeof(integer);
-			break;
 		case DOUBLE:
 			size+= sizeof(ddouble);
@@ -411,5 +397,5 @@
 				for(i=0;i<M;i++){
 					int size;
-					memcpy(&size,marshalled_dataset,sizeof(integer));marshalled_dataset+=sizeof(integer);
+					memcpy(&size,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
 					tempstring=(char*)xmalloc(size);
 					memcpy(tempstring,marshalled_dataset,size);marshalled_dataset+=size;
@@ -417,8 +403,4 @@
 				}
 			}
-			break;
-
-		case INTEGER:
-			memcpy(&integer,marshalled_dataset,sizeof(integer));marshalled_dataset+=sizeof(integer);
 			break;
 
@@ -510,74 +492,107 @@
 }
 
-void  Param::GetParameterValue(void* pvalue){ 
+#undef __FUNCT__ 
+#define __FUNCT__ "GetParameterValue"
+void  Param::GetParameterValue(double* pdouble){
+
+	if(type!=DOUBLE)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a double from a param with type",type));
+	*pdouble=ddouble;
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GetParameterValue"
+void  Param::GetParameterValue(int* pinteger){
+	
+	if(type!=DOUBLE)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover an integer from a param with type",type));
+	*pinteger=(int)ddouble;
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GetParameterValue"
+void  Param::GetParameterValue(char** pstring){
+	
+	char*  outstring=NULL;
+	
+	if(type!=STRING)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a string from a param with type",type));
+	outstring=(char*)xmalloc((strlen(string)+1)*sizeof(char));
+	strcpy(outstring,string);
+	*pstring=outstring;
+
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GetParameterValue"
+void  Param::GetParameterValue(char*** pstringarray){
 
 	int i;
-
-	if (type==STRING){
-		char** pstring=(char**)pvalue; //a little dangerous, but hey!
-		char*  outstring=NULL;
-		outstring=(char*)xmalloc((strlen(string)+1)*sizeof(char));
-		strcpy(outstring,string);
-		*pstring=outstring;
-	}
-	else if (type==STRINGARRAY){
-		char*** pstringarray=(char***)pvalue; //a little dangerous, but hey!
-		char**  outstringarray=NULL;
-		outstringarray=(char**)xmalloc(M*sizeof(char*));
-		for(i=0;i<M;i++){
-			char* outstring=(char*)xmalloc((strlen(stringarray[i])+1)*sizeof(char));
-			strcpy(outstring,stringarray[i]);
-			outstringarray[i]=outstring;
+	if(type!=STRINGARRAY)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a string array from a param with type",type));
+
+	char**  outstringarray=NULL;
+	outstringarray=(char**)xmalloc(M*sizeof(char*));
+	for(i=0;i<M;i++){
+		char* outstring=(char*)xmalloc((strlen(stringarray[i])+1)*sizeof(char));
+		strcpy(outstring,stringarray[i]);
+		outstringarray[i]=outstring;
+	}
+	*pstringarray=outstringarray;
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GetParameterValue"
+	
+void  Param::GetParameterValue(double** pdoublearray){
+	
+
+	double* outdoublearray=NULL;
+	
+	if((type!=DOUBLEVEC) & (type!=DOUBLEMAT)) throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a double array from a param with type",type));
+	
+	if(type==DOUBLEVEC){
+
+		if(M){
+			outdoublearray=(double*)xmalloc(M*sizeof(double));
+			memcpy(outdoublearray,doublevec,M*sizeof(double));
 		}
-		*pstringarray=outstringarray;
-	}
-	else if(type==INTEGER){
-		int* pinteger=(int*)pvalue;
-		*pinteger=integer;
-	}
-	else if(type==DOUBLE){
-		double* pdouble=(double*)pvalue;
-		*pdouble=ddouble;
-	}
-	else if(type==DOUBLEVEC){
-		double** pdoublevec=(double**)pvalue;
-		double* outdoublevec=NULL;
-		if(M){
-			outdoublevec=(double*)xmalloc(M*sizeof(double));
-			memcpy(outdoublevec,doublevec,M*sizeof(double));
+	}
+	
+	if(type==DOUBLEMAT){
+	
+		if(M*N){
+			outdoublearray=(double*)xmalloc(M*N*sizeof(double));
+			memcpy(outdoublearray,doublemat,M*N*sizeof(double));
 		}
-		*pdoublevec=outdoublevec;
-	}
-	else if(type==DOUBLEMAT){
-		double** pdoublemat=(double**)pvalue;
-		double* outdoublemat=NULL;
-		if(M*N){
-			outdoublemat=(double*)xmalloc(M*N*sizeof(double));
-			memcpy(outdoublemat,doublemat,M*N*sizeof(double));
-		}
-		*pdoublemat=outdoublemat;
-	}
-	else if(type==PETSCVEC){
-		Vec* pvec=(Vec*)pvalue;
-		Vec  outvec=NULL;
-		if(vec){
-			VecDuplicate(vec,&outvec);
-			VecCopy(vec,outvec);
-		}
-		*pvec=outvec;
-	}
-	else if(type==PETSCMAT){
-		Mat* pmat=(Mat*)pvalue;
-		Mat  outmat=NULL;
-		if(mat){
-			MatDuplicate(mat,MAT_COPY_VALUES,&outmat);
-		}
-		*pmat=outmat;
-	}
-	else{
-		_printf_("%s%s%i\n",__FUNCT__," error message: unknow type ",type);
-		abort();
-	}
-	return;
+	}
+
+	*pdoublearray=outdoublearray;
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GetParameterValue"
+void  Param::GetParameterValue(Vec* pvec){
+	
+	Vec  outvec=NULL;
+	
+	if(type!=PETSCVEC)  throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a Petsc vec from a param with type",type));
+
+	if(vec){
+		VecDuplicate(vec,&outvec);
+		VecCopy(vec,outvec);
+	}
+	*pvec=outvec;
+}
+
+#undef __FUNCT__ 
+#define __FUNCT__ "GetParameterValue"
+
+void  Param::GetParameterValue(Mat* pmat){
+	
+	Mat  outmat=NULL;
+	
+	if(type!=PETSCMAT)  throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a Petsc mat from a param with type",type));
+	
+	if(mat){
+		MatDuplicate(mat,MAT_COPY_VALUES,&outmat);
+	}
+	*pmat=outmat;
 }
 
@@ -608,9 +623,10 @@
 
 #undef __FUNCT__
-#define __FUNCT__ "SetInteger"
-void  Param::SetInteger(int value){
-	if (type!=INTEGER) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set integer for type",type));
-	integer=value;
-}
+#define __FUNCT__ "SetDouble"
+void  Param::SetDouble(int value){
+	if (type!=DOUBLE) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set double for type",type));
+	ddouble=(double)value;
+}
+
 
 #undef __FUNCT__
Index: /issm/trunk/src/c/objects/Param.h
===================================================================
--- /issm/trunk/src/c/objects/Param.h	(revision 2332)
+++ /issm/trunk/src/c/objects/Param.h	(revision 2333)
@@ -8,8 +8,8 @@
 #include "./Object.h"
 #include "../toolkits/toolkits.h"
+#include "../include/types.h"
 
 #define PARAMSTRING 200 //max string length
 
-enum param_type { STRING, STRINGARRAY, INTEGER, DOUBLE, DOUBLEVEC, DOUBLEMAT, PETSCVEC, PETSCMAT };
 
 class Param: public Object{
@@ -20,5 +20,4 @@
 		int  type; /*! param type, from enum above*/
 		
-		int  integer;
 		double ddouble;
 		char  string[PARAMSTRING];
@@ -48,12 +47,19 @@
 		
 		void  SetDouble(double value);
+		void  SetDouble(int  value);
 		void  SetDoubleVec(double* value,int size);
 		void  SetDoubleVec(double* value,int size,int ndof);
 		void  SetDoubleMat(double* value,int M,int N);
 		void  SetVec(Vec value);
-		void  SetInteger(int value);
 		void  SetString(char* value);
 		void  SetStringArray(char** value,int size);
-		void  GetParameterValue(void* pvalue);
+
+		void  GetParameterValue(double* pdouble);
+		void  GetParameterValue(int* pinteger);
+		void  GetParameterValue(char** pstring);
+		void  GetParameterValue(char*** pstringarray);
+		void  GetParameterValue(double** pdoublearray);
+		void  GetParameterValue(Vec* pvec);
+		void  GetParameterValue(Mat* pmat);
 		
 		int   GetId(); 
Index: /issm/trunk/src/c/objects/ParameterInputs.cpp
===================================================================
--- /issm/trunk/src/c/objects/ParameterInputs.cpp	(revision 2332)
+++ /issm/trunk/src/c/objects/ParameterInputs.cpp	(revision 2333)
@@ -295,5 +295,5 @@
 
 	/*retrive some necessary parameters first: */
-	found=parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+	found=parameters->FindParam(&numberofnodes,"numberofnodes");
 	if(!found)throw ErrorException(__FUNCT__,"coud not find numberofnodes in parameters dataset!");
 
@@ -321,5 +321,5 @@
 
 			/*Now, pick up the parameter corresponding to root: */
-			found=parameters->FindParam((void*)&parameter,root);
+			found=parameters->FindParam(&parameter,NULL,NULL,root);
 			if(!found)throw ErrorException(__FUNCT__,exprintf("%s%s%s"," could not find parameter ",root," for Dakota input update"));
 			
Index: /issm/trunk/src/c/objects/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Penta.cpp	(revision 2332)
+++ /issm/trunk/src/c/objects/Penta.cpp	(revision 2333)
@@ -19,8 +19,7 @@
 	return;
 }
-Penta::Penta( int penta_id, int penta_mid, int penta_mparid, int penta_node_ids[6], double penta_h[6], double penta_s[6], double penta_b[6], double penta_k[6], int penta_friction_type, 
-				double penta_p, double penta_q, int penta_shelf, int penta_onbed, int penta_onsurface, double penta_meanvel,double penta_epsvel, 
-				int penta_collapse, double penta_melting[6], double penta_accumulation[6], double penta_geothermalflux[6], 
-				int penta_artdiff, int penta_thermal_steadystate,double penta_viscosity_overshoot,double penta_stokesreconditioning,bool penta_onwater){
+Penta::Penta( int penta_id, int penta_mid, int penta_mparid, int penta_numparid, int penta_node_ids[6], double penta_h[6], double penta_s[6], double penta_b[6], double penta_k[6], int penta_friction_type, 
+				double penta_p, double penta_q, int penta_shelf, int penta_onbed, int penta_onsurface,  int penta_collapse, double penta_melting[6], double penta_accumulation[6], double penta_geothermalflux[6], 
+				 int penta_thermal_steadystate,bool penta_onwater){
 	
 	int i;
@@ -29,4 +28,5 @@
 	mid = penta_mid; 
 	mparid = penta_mparid; 
+	numparid=penta_numparid;
 
 	for(i =0;i<6;i++){
@@ -46,4 +46,6 @@
 	matpar=NULL;
 	matpar_offset=UNDEF;
+	numpar=NULL;
+	numpar_offset=UNDEF;
 
 	friction_type = penta_friction_type; 
@@ -54,11 +56,6 @@
 	onwater = penta_onwater; 
 	onsurface = penta_onsurface; 
-	meanvel = penta_meanvel;
-	epsvel = penta_epsvel; 
 	collapse = penta_collapse; 
-	artdiff = penta_artdiff; 
 	thermal_steadystate = penta_thermal_steadystate;
-	viscosity_overshoot = penta_viscosity_overshoot;
-	stokesreconditioning = penta_stokesreconditioning;
 
 	return;
@@ -92,6 +89,4 @@
 	printf("   onwater: %i\n",onwater);
 	printf("   onsurface: %i\n",onsurface);
-	printf("   meanvel: %g\n",meanvel);
-	printf("   epsvel: %g\n",epsvel);
 	printf("   collapse: %i\n",collapse);
 	
@@ -99,8 +94,5 @@
 	printf("   accumulation=[%g,%g,%g,%g,%g,%g]\n",accumulation[0],accumulation[1],accumulation[2],accumulation[3],accumulation[4],accumulation[5]);
 	printf("   geothermalflux=[%g,%g,%g,%g,%g,%g]\n",geothermalflux[0],geothermalflux[1],geothermalflux[2],geothermalflux[3],geothermalflux[4],geothermalflux[5]);
-	printf("   artdiff: %i\n",artdiff);
 	printf("   thermal_steadystate: %i\n",thermal_steadystate);
-	printf("   viscosity_overshoot: %i\n",viscosity_overshoot);
-	printf("   stokesreconditioning: %i\n",stokesreconditioning);
 	return;
 }
@@ -129,6 +121,4 @@
 	printf("   onwater: %i\n",onwater);
 	printf("   onsurface: %i\n",onsurface);
-	printf("   meanvel: %g\n",meanvel);
-	printf("   epsvel: %g\n",epsvel);
 	printf("   collapse: %i\n",collapse);
 	
@@ -136,8 +126,5 @@
 	printf("   accumulation=[%i,%i,%i,%i,%i,%i]\n",accumulation[0],accumulation[1],accumulation[2],accumulation[3],accumulation[4],accumulation[5]);
 	printf("   geothermalflux=[%i,%i,%i,%i,%i,%i]\n",geothermalflux[0],geothermalflux[1],geothermalflux[2],geothermalflux[3],geothermalflux[4],geothermalflux[5]);
-	printf("   artdiff: %i\n",artdiff);
 	printf("   thermal_steadystate: %i\n",thermal_steadystate);
-	printf("   viscosity_overshoot: %i\n",viscosity_overshoot);
-	printf("   stokesreconditioning: %i\n",stokesreconditioning);
 	return;
 }
@@ -167,4 +154,7 @@
 	memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
 	memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
+	memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
+	memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
 	memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
 	memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s);
@@ -178,14 +168,9 @@
 	memcpy(marshalled_dataset,&onwater,sizeof(onwater));marshalled_dataset+=sizeof(onwater);
 	memcpy(marshalled_dataset,&onsurface,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface);
-	memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
-	memcpy(marshalled_dataset,&epsvel,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
 	memcpy(marshalled_dataset,&collapse,sizeof(collapse));marshalled_dataset+=sizeof(collapse);
 	memcpy(marshalled_dataset,&melting,sizeof(melting));marshalled_dataset+=sizeof(melting);
 	memcpy(marshalled_dataset,&accumulation,sizeof(accumulation));marshalled_dataset+=sizeof(accumulation);
 	memcpy(marshalled_dataset,&geothermalflux,sizeof(geothermalflux));marshalled_dataset+=sizeof(geothermalflux);
-	memcpy(marshalled_dataset,&artdiff,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
 	memcpy(marshalled_dataset,&thermal_steadystate,sizeof(thermal_steadystate));marshalled_dataset+=sizeof(thermal_steadystate);
-	memcpy(marshalled_dataset,&viscosity_overshoot,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
-	memcpy(marshalled_dataset,&stokesreconditioning,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);
 	
 	*pmarshalled_dataset=marshalled_dataset;
@@ -205,4 +190,7 @@
 		sizeof(matpar)+
 		sizeof(matpar_offset)+
+		+sizeof(numparid)+
+		+sizeof(numpar)+
+		+sizeof(numpar_offset)+
 		sizeof(h)+
 		sizeof(s)+
@@ -216,14 +204,9 @@
 		sizeof(onwater)+
 		sizeof(onsurface)+
-		sizeof(meanvel)+
-		sizeof(epsvel)+
 		sizeof(collapse)+
 		sizeof(melting)+
 		sizeof(accumulation)+
 		sizeof(geothermalflux)+
-		sizeof(artdiff)+
 		sizeof(thermal_steadystate) +
-		sizeof(viscosity_overshoot) +
-		sizeof(stokesreconditioning) +
 		sizeof(int); //sizeof(int) for enum type
 }
@@ -254,4 +237,7 @@
 	memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
 	memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
+	memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
+	memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
 	memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
 	memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s);
@@ -265,14 +251,9 @@
 	memcpy(&onwater,marshalled_dataset,sizeof(onwater));marshalled_dataset+=sizeof(onwater);
 	memcpy(&onsurface,marshalled_dataset,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface);
-	memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
-	memcpy(&epsvel,marshalled_dataset,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
 	memcpy(&collapse,marshalled_dataset,sizeof(collapse));marshalled_dataset+=sizeof(collapse);
 	memcpy(&melting,marshalled_dataset,sizeof(melting));marshalled_dataset+=sizeof(melting);
 	memcpy(&accumulation,marshalled_dataset,sizeof(accumulation));marshalled_dataset+=sizeof(accumulation);
 	memcpy(&geothermalflux,marshalled_dataset,sizeof(geothermalflux));marshalled_dataset+=sizeof(geothermalflux);
-	memcpy(&artdiff,marshalled_dataset,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
 	memcpy(&thermal_steadystate,marshalled_dataset,sizeof(thermal_steadystate));marshalled_dataset+=sizeof(thermal_steadystate);
-	memcpy(&viscosity_overshoot,marshalled_dataset,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
-	memcpy(&stokesreconditioning,marshalled_dataset,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);
 
 	/*nodes and materials are not pointing to correct objects anymore:*/
@@ -300,5 +281,5 @@
 #undef __FUNCT__ 
 #define __FUNCT__ "Penta::Configure"
-void  Penta::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin){
+void  Penta::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin,void* pparametersin){
 
 	int i;
@@ -307,4 +288,5 @@
 	DataSet* nodesin=NULL;
 	DataSet* materialsin=NULL;
+	DataSet* parametersin=NULL;
 
 	/*Recover pointers :*/
@@ -312,4 +294,5 @@
 	nodesin=(DataSet*)pnodesin;
 	materialsin=(DataSet*)pmaterialsin;
+	parametersin=(DataSet*)pparametersin;
 
 	/*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */
@@ -319,4 +302,7 @@
 	ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin);
 	ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin);
+
+	/*Same for numpar: */
+	ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin);
 
 }
@@ -576,5 +562,5 @@
 				  onto this scalar matrix, so that we win some computational time: */
 				
-				newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
+				newviscosity=viscosity+numpar->viscosity_overshoot*(viscosity-oldviscosity);
 				D_scalar=newviscosity*gauss_weight*Jdet;
 				for (i=0;i<5;i++){
@@ -915,5 +901,5 @@
 			}
 			for (i=6;i<8;i++){
-				D[i][i]=-D_scalar*stokesreconditioning;
+				D[i][i]=-D_scalar*numpar->stokesreconditioning;
 			}
 
@@ -1012,7 +998,7 @@
 			DLStokes[9][8]=-viscosity*gauss_weight*Jdet2d*bed_normal[0]/2.0;
 			DLStokes[10][10]=-viscosity*gauss_weight*Jdet2d*bed_normal[1]/2.0;
-			DLStokes[11][11]=stokesreconditioning*gauss_weight*Jdet2d*bed_normal[0];
-			DLStokes[12][12]=stokesreconditioning*gauss_weight*Jdet2d*bed_normal[1];
-			DLStokes[13][13]=stokesreconditioning*gauss_weight*Jdet2d*bed_normal[2];
+			DLStokes[11][11]=numpar->stokesreconditioning*gauss_weight*Jdet2d*bed_normal[0];
+			DLStokes[12][12]=numpar->stokesreconditioning*gauss_weight*Jdet2d*bed_normal[1];
+			DLStokes[13][13]=numpar->stokesreconditioning*gauss_weight*Jdet2d*bed_normal[2];
 
 			/*  Do the triple product tL*D*L: */
@@ -1397,5 +1383,5 @@
 	tria_node_offsets[2]=node_offsets[g2];
 
-	tria= new Tria(id,mid,mparid,tria_node_ids,tria_h,tria_s,tria_b,tria_k, tria_melting, tria_accumulation, tria_geothermalflux,friction_type,p,q,shelf,meanvel,epsvel,viscosity_overshoot,artdiff,onwater);
+	tria= new Tria(id,mid,mparid,numparid,tria_node_ids,tria_h,tria_s,tria_b,tria_k, tria_melting, tria_accumulation, tria_geothermalflux,friction_type,p,q,shelf,onwater);
 
 	tria->NodeConfiguration(tria_node_ids,tria_nodes,tria_node_offsets);
@@ -3223,5 +3209,5 @@
 			}
 			for (i=6;i<8;i++){
-				D[i][i]=-D_scalar*stokesreconditioning;
+				D[i][i]=-D_scalar*numpar->stokesreconditioning;
 			}
 
@@ -3583,7 +3569,7 @@
 
 			/*Artifficial diffusivity*/
-			if(artdiff){
+			if(numpar->artdiff){
 				/*Build K: */
-				D_scalar=gauss_weight*Jdet/(pow(u,2)+pow(v,2)+epsvel);
+				D_scalar=gauss_weight*Jdet/(pow(u,2)+pow(v,2)+numpar->epsvel);
 				if(dt){
 					D_scalar=D_scalar*dt;
Index: /issm/trunk/src/c/objects/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Penta.h	(revision 2332)
+++ /issm/trunk/src/c/objects/Penta.h	(revision 2333)
@@ -32,4 +32,8 @@
 		Matpar* matpar; 
 		int   matpar_offset;
+
+		int numparid;
+		Numpar* numpar; 
+		int   numpar_offset;
 	
 
@@ -46,21 +50,15 @@
 		int    onbed;
 		int    onsurface;
-		bool    onwater;
-		double meanvel;/*!scaling ratio for velocities*/
-		double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
+		bool   onwater;
 		int    collapse;
 		double geothermalflux[6];
-		int    artdiff;
 		int    thermal_steadystate;
-		double viscosity_overshoot;
-		double stokesreconditioning;
 	
 	public:
 
 		Penta();
-		Penta( int id, int mid, int mparid, int node_ids[6], double h[6], double s[6], double b[6], double k[6], int    friction_type, 
-				double p, double q, int    shelf, int    onbed, int    onsurface, double meanvel,double epsvel, 
-				int    collapse, double melting[6], double accumulation[6], double geothermalflux[6], 
-				int    artdiff, int    thermal_steadystate,double viscosity_overshoot,double stokesreconditioning,bool onwater);
+		Penta( int id, int mid, int mparid, int numparid, int node_ids[6], double h[6], double s[6], double b[6], double k[6], int    friction_type, 
+				double p, double q, int    shelf, int    onbed, int    onsurface,  int    collapse, double melting[6], double accumulation[6], double geothermalflux[6], 
+				int    thermal_steadystate,bool onwater);
 		~Penta();
 
@@ -74,5 +72,5 @@
 		int   GetId(); 
 		int   MyRank();
-		void  Configure(void* loads,void* nodes,void* materials);
+		void  Configure(void* loads,void* nodes,void* materials,void* parameters);
 		void  CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type);
 		void  CreateKMatrixDiagnosticHoriz( Mat Kgg, void* inputs, int analysis_type,int sub_analysis_type);
Index: /issm/trunk/src/c/objects/Sing.cpp
===================================================================
--- /issm/trunk/src/c/objects/Sing.cpp	(revision 2332)
+++ /issm/trunk/src/c/objects/Sing.cpp	(revision 2333)
@@ -26,13 +26,17 @@
 }
 		
-Sing::Sing(int sing_id, int sing_mid, int sing_mparid, int sing_g, double sing_h, double sing_k){
+Sing::Sing(int sing_id, int sing_mid, int sing_mparid, int sing_numparid,int sing_g, double sing_h, double sing_k){
 
 	id=sing_id;
 	mid=sing_mid;
 	mparid=sing_mparid;
+	numparid=sing_numparid;
 
 	node_id=sing_g;
 	node_offset=UNDEF;
 	node=NULL;
+
+	numpar=NULL;
+	numpar_offset=UNDEF;
 	
 	h=sing_h;
@@ -43,4 +47,7 @@
 	matpar=NULL;
 	matpar_offset=UNDEF;
+
+	numpar=NULL;
+	numpar_offset=UNDEF;
 
 	return;
@@ -116,4 +123,7 @@
 	memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
 	memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
+	memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
+	memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
 	memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
 	memcpy(marshalled_dataset,&k,sizeof(k));marshalled_dataset+=sizeof(k);
@@ -134,4 +144,7 @@
 		+sizeof(matpar)
 		+sizeof(matpar_offset)
+		+sizeof(numparid)
+		+sizeof(numpar)
+		+sizeof(numpar_offset)
 		+sizeof(h)
 		+sizeof(k)
@@ -164,4 +177,7 @@
 	memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
 	memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
+	memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
+	memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
 	memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
 	memcpy(&k,marshalled_dataset,sizeof(k));marshalled_dataset+=sizeof(k);
@@ -191,5 +207,5 @@
 #undef __FUNCT__ 
 #define __FUNCT__ "Sing::Configure"
-void  Sing::Configure(void* ploadsin, void* pnodesin,void* pmaterialsin){
+void  Sing::Configure(void* ploadsin, void* pnodesin,void* pmaterialsin,void* pparametersin){
 
 	int i;
@@ -197,8 +213,10 @@
 	DataSet* nodesin=NULL;
 	DataSet* materialsin=NULL;
+	DataSet* parametersin=NULL;
 
 	/*Recover pointers :*/
 	nodesin=(DataSet*)pnodesin;
 	materialsin=(DataSet*)pmaterialsin;
+	parametersin=(DataSet*)pparametersin;
 
 	/*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */
@@ -208,4 +226,7 @@
 	ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin);
 	ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin);
+
+	/*Same for numpar: */
+	ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin);
 
 }
Index: /issm/trunk/src/c/objects/Sing.h
===================================================================
--- /issm/trunk/src/c/objects/Sing.h	(revision 2332)
+++ /issm/trunk/src/c/objects/Sing.h	(revision 2333)
@@ -32,4 +32,8 @@
 		Matpar* matpar; 
 		int   matpar_offset;
+
+		int numparid;
+		Numpar* numpar; 
+		int   numpar_offset;
 	
 		double h;
@@ -39,5 +43,5 @@
 
 		Sing();
-		Sing(int sing_id, int sing_mid, int sing_mparid, int sing_g, double sing_h, double sing_k);
+		Sing(int sing_id, int sing_mid, int sing_mparid, int sing_numparid,int sing_g, double sing_h, double sing_k);
 		~Sing();
 
@@ -51,5 +55,5 @@
 		int   GetId(); 
 		int   MyRank();
-		void  Configure(void* loads,void* nodes,void* materials);
+		void  Configure(void* loads,void* nodes,void* materials,void* parameters);
 		void  CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type);
 		void  CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type);
Index: /issm/trunk/src/c/objects/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Tria.cpp	(revision 2332)
+++ /issm/trunk/src/c/objects/Tria.cpp	(revision 2333)
@@ -32,7 +32,6 @@
 }
 
-Tria::Tria(int tria_id,int tria_mid,int tria_mparid,int tria_node_ids[3],double tria_h[3],double tria_s[3],double tria_b[3],double tria_k[3],double tria_melting[3],
-				double tria_accumulation[3],double tria_geothermalflux[3],int tria_friction_type,double tria_p,double tria_q,int tria_shelf,double tria_meanvel,double tria_epsvel,
-				double tria_viscosity_overshoot,int tria_artdiff,bool tria_onwater){
+Tria::Tria(int tria_id,int tria_mid,int tria_mparid,int tria_numparid,int tria_node_ids[3],double tria_h[3],double tria_s[3],double tria_b[3],double tria_k[3],double tria_melting[3],
+				double tria_accumulation[3],double tria_geothermalflux[3],int tria_friction_type,double tria_p,double tria_q,int tria_shelf, bool tria_onwater){
 	
 	int i;
@@ -41,4 +40,5 @@
 	mid=tria_mid;
 	mparid=tria_mparid;
+	numparid=tria_numparid;
 	for(i=0;i<3;i++){
 		node_ids[i]=tria_node_ids[i];
@@ -57,14 +57,12 @@
 	matpar=NULL;
 	matpar_offset=UNDEF;
+	numpar=NULL;
+	numpar_offset=UNDEF;
 	friction_type=tria_friction_type;
 	p=tria_p;
 	q=tria_q;
 	shelf=tria_shelf;
-	meanvel=tria_meanvel;
-	epsvel=tria_epsvel;
 	onbed=1;
 	onwater=tria_onwater;
-	viscosity_overshoot=tria_viscosity_overshoot;
-	artdiff=tria_artdiff;
 	
 	return;
@@ -95,10 +93,6 @@
 	printf("   q: %g\n",q);
 	printf("   shelf: %i\n",shelf);
-	printf("   meanvel: %g\n",meanvel);
-	printf("   epsvel: %g\n",epsvel);
 	printf("   onbed: %i\n",onbed);
 	printf("   onwater: %i\n",onwater);
-	printf("   viscosity_overshoot=%g\n",viscosity_overshoot);
-	printf("   artdiff=%g\n",artdiff);
 	printf("   nodes: \n");
 	if(nodes[0])nodes[0]->Echo();
@@ -134,10 +128,6 @@
 	printf("   q: %g\n",q);
 	printf("   shelf: %i\n",shelf);
-	printf("   meanvel: %g\n",meanvel);
-	printf("   epsvel: %g\n",epsvel);
 	printf("   onbed: %i\n",onbed);
 	printf("   onwater: %i\n",onwater);
-	printf("   viscosity_overshoot=%g\n",viscosity_overshoot);
-	printf("   artdiff=%g\n",artdiff);
 	printf("   nodes: \n");
 	if(nodes[0])nodes[0]->Echo();
@@ -174,4 +164,7 @@
 	memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
 	memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
+	memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
+	memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
 	memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
 	memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s);
@@ -187,8 +180,4 @@
 	memcpy(marshalled_dataset,&q,sizeof(q));marshalled_dataset+=sizeof(q);
 	memcpy(marshalled_dataset,&shelf,sizeof(shelf));marshalled_dataset+=sizeof(shelf);
-	memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
-	memcpy(marshalled_dataset,&epsvel,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
-	memcpy(marshalled_dataset,&viscosity_overshoot,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
-	memcpy(marshalled_dataset,&artdiff,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
 	
 	*pmarshalled_dataset=marshalled_dataset;
@@ -207,4 +196,7 @@
 		+sizeof(matpar)
 		+sizeof(matpar_offset)
+		+sizeof(numparid)
+		+sizeof(numpar)
+		+sizeof(numpar_offset)
 		+sizeof(h)
 		+sizeof(s)
@@ -220,8 +212,4 @@
 		+sizeof(q)
 		+sizeof(shelf)
-		+sizeof(meanvel)
-		+sizeof(epsvel)
-		+sizeof(viscosity_overshoot)
-		+sizeof(artdiff)
 		+sizeof(int); //sizeof(int) for enum type
 }
@@ -252,4 +240,7 @@
 	memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
 	memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
+	memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
+	memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
+	memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
 	memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
 	memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s);
@@ -265,8 +256,4 @@
 	memcpy(&q,marshalled_dataset,sizeof(q));marshalled_dataset+=sizeof(q);
 	memcpy(&shelf,marshalled_dataset,sizeof(shelf));marshalled_dataset+=sizeof(shelf);
-	memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
-	memcpy(&epsvel,marshalled_dataset,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
-	memcpy(&viscosity_overshoot,marshalled_dataset,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
-	memcpy(&artdiff,marshalled_dataset,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
 
 	/*nodes and materials are not pointing to correct objects anymore:*/
@@ -274,4 +261,5 @@
 	matice=NULL;
 	matpar=NULL;
+	numpar=NULL;
 
 	/*return: */
@@ -294,5 +282,5 @@
 #undef __FUNCT__ 
 #define __FUNCT__ "Tria::Configure"
-void  Tria::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin){
+void  Tria::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin,void* pparametersin){
 
 	int i;
@@ -301,4 +289,5 @@
 	DataSet* nodesin=NULL;
 	DataSet* materialsin=NULL;
+	DataSet* parametersin=NULL;
 
 	/*Recover pointers :*/
@@ -306,4 +295,5 @@
 	nodesin=(DataSet*)pnodesin;
 	materialsin=(DataSet*)pmaterialsin;
+	parametersin=(DataSet*)pparametersin;
 
 	/*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */
@@ -313,4 +303,7 @@
 	ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin);
 	ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin);
+
+	/*Same for numpar: */
+	ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin);
 
 }
@@ -479,5 +472,5 @@
 		/* Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant 
 		   onto this scalar matrix, so that we win some computational time: */
-		newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
+		newviscosity=viscosity+numpar->viscosity_overshoot*(viscosity-oldviscosity);
 		D_scalar=newviscosity*thickness*gauss_weight*Jdet;
 
@@ -645,5 +638,5 @@
 
 	//Create Artificial diffusivity once for all if requested
-	if(artdiff){
+	if(numpar->artdiff){
 		//Get the Jacobian determinant
 		gauss_l1l2l3[0]=1.0/3.0; gauss_l1l2l3[1]=1.0/3.0; gauss_l1l2l3[2]=1.0/3.0;
@@ -724,5 +717,5 @@
 		for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_thickness2[i][j];
 		
-		if(artdiff){
+		if(numpar->artdiff){
 			
 			/* Compute artificial diffusivity */
@@ -2083,6 +2076,6 @@
 		/*We are using a relative misfit: */
 		for (i=0;i<numgrids;i++){
-			scalex=pow(meanvel/(obs_vx_list[i]+epsvel),2);
-			scaley=pow(meanvel/(obs_vy_list[i]+epsvel),2);
+			scalex=pow(numpar->meanvel/(obs_vx_list[i]+numpar->epsvel),2);
+			scaley=pow(numpar->meanvel/(obs_vy_list[i]+numpar->epsvel),2);
 			if(obs_vx_list[i]==0)scalex=0;
 			if(obs_vy_list[i]==0)scaley=0;
@@ -2094,7 +2087,7 @@
 		/*We are using a logarithmic misfit: */
 		for (i=0;i<numgrids;i++){
-			velocity_mag=sqrt(pow(vx_list[i],2)+pow(vy_list[i],2))+epsvel; //epsvel to avoid velocity being nil.
-			obs_velocity_mag=sqrt(pow(obs_vx_list[i],2)+pow(obs_vy_list[i],2))+epsvel; //epsvel to avoid observed velocity being nil.
-			scale=-8*pow(meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag);
+			velocity_mag=sqrt(pow(vx_list[i],2)+pow(vy_list[i],2))+numpar->epsvel; //epsvel to avoid velocity being nil.
+			obs_velocity_mag=sqrt(pow(obs_vx_list[i],2)+pow(obs_vy_list[i],2))+numpar->epsvel; //epsvel to avoid observed velocity being nil.
+			scale=-8*pow(numpar->meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag);
 			logarithmicx_list[i]=scale*vx_list[i];
 			logarithmicy_list[i]=scale*vy_list[i];
@@ -2255,5 +2248,4 @@
 	double  lambda,mu;
 	double  bed,thickness,Neff;
-	double  cm_noisedampening;
 	
 	/*drag: */
@@ -2300,7 +2292,4 @@
 	if(!inputs->Recover("adjoint",&adjxadjy_list[0][0],2,dofs2,numgrids,(void**)nodes)){
 		throw ErrorException(__FUNCT__,"missing adjoint input parameter");
-	}
-	if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){
-		throw ErrorException(__FUNCT__,"missing cm_noisedampening");
 	}
 
@@ -2407,5 +2396,5 @@
 			grade_g_gaussian[i]=
 			  -2*drag*alpha_complement*((lambda*vx+mu*vy))*Jdet*gauss_weight*l1l2l3[i]                         //standard term dJ/dki
-			  +cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);  // regularization term d/dki(1/2*(dk/dx)^2)
+			  +numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);  // regularization term d/dki(1/2*(dk/dx)^2)
 		}
 		
@@ -2469,5 +2458,4 @@
 	double  bed_normal[3];
 	double  dk[NDOF2]; 
-	double  cm_noisedampening;
 
 	/*drag: */
@@ -2510,7 +2498,4 @@
 	if(!inputs->Recover("adjoint",&adjxyz_list[0][0],3,dofs3,numgrids,(void**)nodes)){
 		throw ErrorException(__FUNCT__,"missing adjoint input parameter");
-	}
-	if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){
-		throw ErrorException(__FUNCT__,"missing cm_noisedampening");
 	}
 
@@ -2634,5 +2619,5 @@
 
 			//Add regularization term
-			grade_g_gaussian[i]+=cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
+			grade_g_gaussian[i]+=numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
 		}
 
@@ -2741,5 +2726,4 @@
 	int     dofs[1]={0};
 	double  dk[NDOF2]; 
-	double  cm_noisedampening;
 	
 	ParameterInputs* inputs=NULL;
@@ -2763,7 +2747,4 @@
 	if(!inputs->Recover("adjoint",&adjxadjy_list[0][0],2,dofs2,numgrids,(void**)nodes)){
 		throw ErrorException(__FUNCT__,"missing adjoint input parameter");
-	}
-	if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){
-		throw ErrorException(__FUNCT__,"missing cm_noisedampening");
 	}
 
@@ -2828,5 +2809,5 @@
 
 			//Add regularization term
-			grade_g_gaussian[i]+=cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
+			grade_g_gaussian[i]+=numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
 		}
 
@@ -2890,5 +2871,4 @@
 	double  dk[NDOF2]; 
 	double  dB[NDOF2]; 
-	double  cm_noisedampening;
 
 	/* Jacobian: */
@@ -2919,7 +2899,4 @@
 	if(!inputs->Recover("velocity",&vxvy_list[0][0],2,dofs2,numgrids,(void**)nodes)){
 		throw ErrorException(__FUNCT__,"missing velocity input parameter");
-	}
-	if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){
-		throw ErrorException(__FUNCT__,"missing cm_noisedampening");
 	}
 
@@ -2942,6 +2919,6 @@
 		/*We are using a relative misfit: */
 		for (i=0;i<numgrids;i++){
-			scalex=pow(meanvel/(obs_vx_list[i]+epsvel),(double)2);
-			scaley=pow(meanvel/(obs_vy_list[i]+epsvel),(double)2);
+			scalex=pow(numpar->meanvel/(obs_vx_list[i]+numpar->epsvel),(double)2);
+			scaley=pow(numpar->meanvel/(obs_vy_list[i]+numpar->epsvel),(double)2);
 			if(obs_vx_list[i]==0)scalex=0;
 			if(obs_vy_list[i]==0)scaley=0;
@@ -2952,7 +2929,7 @@
 		/*We are using a logarithmic misfit: */
 		for (i=0;i<numgrids;i++){
-			velocity_mag=sqrt(pow(vx_list[i],(double)2)+pow(vy_list[i],(double)2))+epsvel; //epsvel to avoid velocity being nil.
-			obs_velocity_mag=sqrt(pow(obs_vx_list[i],(double)2)+pow(obs_vy_list[i],(double)2))+epsvel; //epsvel to avoid observed velocity being nil.
-			logarithmic_list[i]=4*pow(meanvel,(double)2)*pow(log(velocity_mag/obs_velocity_mag),(double)2);
+			velocity_mag=sqrt(pow(vx_list[i],(double)2)+pow(vy_list[i],(double)2))+numpar->epsvel; //epsvel to avoid velocity being nil.
+			obs_velocity_mag=sqrt(pow(obs_vx_list[i],(double)2)+pow(obs_vy_list[i],(double)2))+numpar->epsvel; //epsvel to avoid observed velocity being nil.
+			logarithmic_list[i]=4*pow(numpar->meanvel,(double)2)*pow(log(velocity_mag/obs_velocity_mag),(double)2);
 		}
 	}
@@ -2991,5 +2968,5 @@
 		if (strcmp(control_type,"drag")==0 & !shelf){
 			GetParameterDerivativeValue(&dk[0], &k[0],&xyz_list[0][0], gauss_l1l2l3);
-			Jelem+=cm_noisedampening*1/2*(pow(dk[0],2)+pow(dk[1],2))*Jdet*gauss_weight;
+			Jelem+=numpar->cm_noisedampening*1/2*(pow(dk[0],2)+pow(dk[1],2))*Jdet*gauss_weight;
 			if (id==1){
 				printf("id=%i value=%g k=[%g %g %g]\n",id,(pow(dk[0],2)+pow(dk[1],2)),k[0],k[1],k[2]);
@@ -3002,5 +2979,5 @@
 			B=matice->GetB();
 			GetParameterDerivativeValue(&dB[0], &B[0],&xyz_list[0][0], gauss_l1l2l3);
-			Jelem+=cm_noisedampening*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight;
+			Jelem+=numpar->cm_noisedampening*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight;
 		}
 		*/
Index: /issm/trunk/src/c/objects/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Tria.h	(revision 2332)
+++ /issm/trunk/src/c/objects/Tria.h	(revision 2333)
@@ -11,4 +11,5 @@
 #include "./Matice.h"
 #include "./Matpar.h"
+#include "./Numpar.h"
 #include "./ParameterInputs.h"
 
@@ -33,4 +34,8 @@
 		Matpar* matpar; 
 		int   matpar_offset;
+
+		int numparid;
+		Numpar* numpar; 
+		int   numpar_offset;
 	
 		double h[3];
@@ -45,16 +50,11 @@
 		double q;
 		int    shelf;
-		double meanvel;/*!scaling ratio for velocities*/
-		double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
 		int    onbed;
 		bool   onwater;
-		double viscosity_overshoot;
-		int    artdiff;
 
 	public:
 
 		Tria();
-		Tria(int id,int mid,int mparid,int node_ids[3],double h[3],double s[3],double b[3],double k[3],double melting[3],double accumulation[3],double geothermalflux[3],
-				int friction_type,double p,double q,int shelf,double meanvel,double epsvel,double viscosity_overshoot,int artdiff,bool onwater);
+		Tria(int id,int mid,int mparid,int numparid,int node_ids[3],double h[3],double s[3],double b[3],double k[3],double melting[3],double accumulation[3],double geothermalflux[3],int friction_type,double p,double q,int shelf,bool onwater);
 		~Tria();
 
@@ -68,5 +68,5 @@
 		int   GetId(); 
 		int   MyRank();
-		void  Configure(void* loads,void* nodes,void* materials);
+		void  Configure(void* loads,void* nodes,void* materials,void* parameters);
 		void  CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type);
 		void  CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type);
Index: /issm/trunk/src/c/parallel/ControlInitialization.cpp
===================================================================
--- /issm/trunk/src/c/parallel/ControlInitialization.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/ControlInitialization.cpp	(revision 2333)
@@ -70,7 +70,7 @@
 
 	//specific parameters for specific models
-	fem_dh->FindParam((void*)&numberofdofspernode_dh,"numberofdofspernode");
-	fem_sl->FindParam((void*)&numberofdofspernode_sl,"numberofdofspernode");
-	fem_ds->FindParam((void*)&numberofdofspernode_ds,"numberofdofspernode");
+	fem_dh->FindParam(&numberofdofspernode_dh,"numberofdofspernode");
+	fem_sl->FindParam(&numberofdofspernode_sl,"numberofdofspernode");
+	fem_ds->FindParam(&numberofdofspernode_ds,"numberofdofspernode");
 
 	/*if no Stokes, assign output and return*/
@@ -86,6 +86,6 @@
 	diagnostic_core_linear(&slopex,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum());
 	diagnostic_core_linear(&slopey,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum());
-	FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopex",0);
-	FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopey",0);
+	FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0);
+	FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopey",0);
 
 	//Add in inputs
@@ -100,5 +100,5 @@
 	diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum());
 	if(verbose)_printf_("%s\n"," extruding horizontal velocities...");
-	VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh-> materials,"velocity",1);
+	VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh-> materials,fem_dh->parameters,"velocity",1);
 
 	//vertical velocity
@@ -116,5 +116,5 @@
 	//Create 4d u_g
 	if(verbose)_printf_("%s\n"," computing pressure according to Pattyn...");
-	ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials, numberofnodes);
+	ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials, fem_dh->parameters);
 	VecScale(pg,1.0/stokesreconditioning);
 	ug_stokes=NewVec(fem_ds->nodesets->GetGSize());
Index: /issm/trunk/src/c/parallel/DakotaResponses.cpp
===================================================================
--- /issm/trunk/src/c/parallel/DakotaResponses.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/DakotaResponses.cpp	(revision 2333)
@@ -27,5 +27,5 @@
 
 	/*some data needed across the responses: */
-	found=fem->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+	found=fem->parameters->FindParam(&numberofnodes,"numberofnodes");
 	if(!found)throw ErrorException(__FUNCT__," could not find numberofnodes in fem model");
 
@@ -41,5 +41,5 @@
 			double min_vel=0;
 		
-			found=results->FindResult((void*)&vel,"vel");
+			found=results->FindResult(&vel,"vel");
 			if(!found)throw ErrorException(__FUNCT__," could not find vel to compute min_vel");
 
@@ -56,5 +56,5 @@
 			double max_vel=0;
 
-			found=results->FindResult((void*)&vel,"vel");
+			found=results->FindResult(&vel,"vel");
 			if(!found)throw ErrorException(__FUNCT__," could not find vel to compute max_vel");
 
@@ -69,5 +69,5 @@
 			double min_vx=0;
 			
-			found=results->FindResult((void*)&vx,"vx");
+			found=results->FindResult(&vx,"vx");
 			if(!found)throw ErrorException(__FUNCT__," could not find vx to compute min_vx");
 
@@ -82,5 +82,5 @@
 			double max_vx=0;
 			
-			found=results->FindResult((void*)&vx,"vx");
+			found=results->FindResult(&vx,"vx");
 			if(!found)throw ErrorException(__FUNCT__," could not find vx to compute max_vx");
 
@@ -95,5 +95,5 @@
 			double max_abs_vx=0;
 			
-			found=results->FindResult((void*)&vx,"vx");
+			found=results->FindResult(&vx,"vx");
 			if(!found)throw ErrorException(__FUNCT__," could not find vx to compute max_abs_vx");
 
@@ -108,5 +108,5 @@
 			double min_vy=0;
 			
-			found=results->FindResult((void*)&vy,"vy");
+			found=results->FindResult(&vy,"vy");
 			if(!found)throw ErrorException(__FUNCT__," could not find vy to compute min_vy");
 
@@ -121,5 +121,5 @@
 			double max_vy=0;
 			
-			found=results->FindResult((void*)&vy,"vy");
+			found=results->FindResult(&vy,"vy");
 			if(!found)throw ErrorException(__FUNCT__," could not find vy to compute max_vy");
 
@@ -134,5 +134,5 @@
 			double max_abs_vy=0;
 			
-			found=results->FindResult((void*)&vy,"vy");
+			found=results->FindResult(&vy,"vy");
 			if(!found)throw ErrorException(__FUNCT__," could not find vy to compute max_abs_vy");
 
@@ -147,5 +147,5 @@
 			double min_vz=0;
 			
-			found=results->FindResult((void*)&vz,"vz");
+			found=results->FindResult(&vz,"vz");
 			if(!found)throw ErrorException(__FUNCT__," could not find vz to compute min_vz");
 
@@ -160,5 +160,5 @@
 			double max_vz=0;
 			
-			found=results->FindResult((void*)&vz,"vz");
+			found=results->FindResult(&vz,"vz");
 			if(!found)throw ErrorException(__FUNCT__," could not find vz to compute max_vz");
 
@@ -173,5 +173,5 @@
 			double max_abs_vz=0;
 			
-			found=results->FindResult((void*)&vz,"vz");
+			found=results->FindResult(&vz,"vz");
 			if(!found)throw ErrorException(__FUNCT__," could not find vz to compute max_abs_vz");
 
Index: /issm/trunk/src/c/parallel/ProcessResults.cpp
===================================================================
--- /issm/trunk/src/c/parallel/ProcessResults.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/ProcessResults.cpp	(revision 2333)
@@ -126,12 +126,12 @@
 				/*ok, 2 dofs, on number of nodes: */
 				if(ismacayealpattyn){
-					fem_dh->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+					fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes");
 					VecToMPISerial(&partition,fem_dh->partition->vector);
-					fem_dh->parameters->FindParam((void*)&yts,"yts");
+					fem_dh->parameters->FindParam(&yts,"yts");
 				}
 				else{
-					fem_dhu->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+					fem_dhu->parameters->FindParam(&numberofnodes,"numberofnodes");
 					VecToMPISerial(&partition,fem_dhu->partition->vector);
-					fem_dhu->parameters->FindParam((void*)&yts,"yts");
+					fem_dhu->parameters->FindParam(&yts,"yts");
 				}
 				vx=(double*)xmalloc(numberofnodes*sizeof(double));
@@ -152,12 +152,12 @@
 					/*ok, 3 dofs, on number of nodes: */
 					if(ismacayealpattyn){
-						fem_dh->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+						fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes");
 						VecToMPISerial(&partition,fem_dh->partition->vector);
-						fem_dh->parameters->FindParam((void*)&yts,"yts");
+						fem_dh->parameters->FindParam(&yts,"yts");
 					}
 					else{
-						fem_dhu->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+						fem_dhu->parameters->FindParam(&numberofnodes,"numberofnodes");
 						VecToMPISerial(&partition,fem_dhu->partition->vector);
-						fem_dhu->parameters->FindParam((void*)&yts,"yts");
+						fem_dhu->parameters->FindParam(&yts,"yts");
 					}
 					vx=(double*)xmalloc(numberofnodes*sizeof(double));
@@ -175,7 +175,7 @@
 				else{
 					/* 4 dofs on number of nodes. discard pressure: */
-					fem_ds->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+					fem_ds->parameters->FindParam(&numberofnodes,"numberofnodes");
 					VecToMPISerial(&partition,fem_ds->partition->vector);
-					fem_ds->parameters->FindParam((void*)&yts,"yts");
+					fem_ds->parameters->FindParam(&yts,"yts");
 					vx=(double*)xmalloc(numberofnodes*sizeof(double));
 					vy=(double*)xmalloc(numberofnodes*sizeof(double));
@@ -220,14 +220,14 @@
 			if(!isstokes){
 				if(ismacayealpattyn){
-					fem_dh->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+					fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes");
 					VecToMPISerial(&partition,fem_dh->partition->vector);
 				}
 				else{
-					fem_dhu->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+					fem_dhu->parameters->FindParam(&numberofnodes,"numberofnodes");
 					VecToMPISerial(&partition,fem_dhu->partition->vector);
 				}
 			}
 			else{
-				fem_ds->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+				fem_ds->parameters->FindParam(&numberofnodes,"numberofnodes");
 				VecToMPISerial(&partition,fem_ds->partition->vector);
 			}
@@ -253,5 +253,5 @@
 			result->GetField(&t_g);
 			VecToMPISerial(&t_g_serial,t_g);
-			fem_t->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+			fem_t->parameters->FindParam(&numberofnodes,"numberofnodes");
 			VecToMPISerial(&partition,fem_t->partition->vector);
 
@@ -276,6 +276,6 @@
 			result->GetField(&m_g);
 			VecToMPISerial(&m_g_serial,m_g);
-			fem_t->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
-			fem_t->parameters->FindParam((void*)&yts,"yts");
+			fem_t->parameters->FindParam(&numberofnodes,"numberofnodes");
+			fem_t->parameters->FindParam(&yts,"yts");
 			VecToMPISerial(&partition,fem_t->partition->vector);
 
@@ -300,5 +300,5 @@
 			result->GetField(&h_g);
 			VecToMPISerial(&h_g_serial,h_g);
-			fem_p->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+			fem_p->parameters->FindParam(&numberofnodes,"numberofnodes");
 			VecToMPISerial(&partition,fem_p->partition->vector);
 
@@ -323,5 +323,5 @@
 			result->GetField(&s_g);
 			VecToMPISerial(&s_g_serial,s_g);
-			fem_p->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+			fem_p->parameters->FindParam(&numberofnodes,"numberofnodes");
 			VecToMPISerial(&partition,fem_p->partition->vector);
 
@@ -346,5 +346,5 @@
 			result->GetField(&b_g);
 			VecToMPISerial(&b_g_serial,b_g);
-			fem_p->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+			fem_p->parameters->FindParam(&numberofnodes,"numberofnodes");
 			VecToMPISerial(&partition,fem_p->partition->vector);
 
@@ -368,5 +368,5 @@
 			/*easy, param_g is of size numberofnodes, on 1 dof, just repartition: */
 			result->GetField(&param_g);
-			fem_dh->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+			fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes");
 			VecToMPISerial(&partition,fem_dh->partition->vector);
 
@@ -388,5 +388,5 @@
 		else if(strcmp(result->GetFieldName(),"riftproperties")==0){
 			result->GetField(&riftproperties);
-			fem_dh->parameters->FindParam((void*)&numrifts,"numrifts");
+			fem_dh->parameters->FindParam(&numrifts,"numrifts");
 			VecToMPISerial(&riftproperties_serial,riftproperties);
 			
Index: /issm/trunk/src/c/parallel/control_core.cpp
===================================================================
--- /issm/trunk/src/c/parallel/control_core.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/control_core.cpp	(revision 2333)
@@ -63,13 +63,13 @@
 	model->FindParam(&nsteps,"nsteps");
 	model->FindParam(&control_type,"control_type");
-	model->FindParam(&fit,"fit");
-	model->FindParam(&optscal,"optscal");
-	model->FindParam(&maxiter,"maxiter");
-	model->FindParam(&cm_jump,"cm_jump");
+	model->FindParam(&fit,NULL,NULL,"fit");
+	model->FindParam(&optscal,NULL,NULL,"optscal");
+	model->FindParam(&maxiter,NULL,NULL,"maxiter");
+	model->FindParam(&cm_jump,NULL,NULL,"cm_jump");
 	model->FindParam(&eps_cm,"eps_cm");
 	model->FindParam(&tolx,"tolx");
 	model->FindParam(&mincontrolconstraint,"mincontrolconstraint");
 	model->FindParam(&maxcontrolconstraint,"maxcontrolconstraint");
-	model->FindParam(&param_g,"param_g");
+	model->FindParam(&param_g,NULL,NULL,"param_g");
 	model->FindParam(&analysis_type,"analysis_type");
 	model->FindParam(&sub_analysis_type,"sub_analysis_type");
@@ -106,5 +106,5 @@
 	
 		/*Update parameters: */
-		UpdateFromInputsx(fem_model->elements,fem_model->nodes,fem_model->loads, fem_model->materials,inputs);
+		UpdateFromInputsx(fem_model->elements,fem_model->nodes,fem_model->loads, fem_model->materials,fem_model->parameters,inputs);
 
 		_printf_("%s\n","      computing gradJ...");
Index: /issm/trunk/src/c/parallel/convergence.cpp
===================================================================
--- /issm/trunk/src/c/parallel/convergence.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/convergence.cpp	(revision 2333)
@@ -34,9 +34,9 @@
 
 	/*get convergence options*/
-	parameters->FindParam((void*)&eps_res,"eps_res");
-	parameters->FindParam((void*)&eps_rel,"eps_rel");
-	parameters->FindParam((void*)&eps_abs,"eps_abs");
-	parameters->FindParam((void*)&yts,"yts");
-	parameters->FindParam((void*)&verbose,"verbose");
+	parameters->FindParam(&eps_res,"eps_res");
+	parameters->FindParam(&eps_rel,"eps_rel");
+	parameters->FindParam(&eps_abs,"eps_abs");
+	parameters->FindParam(&yts,"yts");
+	parameters->FindParam(&verbose,"verbose");
 
 	/*Display solver caracteristics*/
Index: /issm/trunk/src/c/parallel/diagnostic.cpp
===================================================================
--- /issm/trunk/src/c/parallel/diagnostic.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/diagnostic.cpp	(revision 2333)
@@ -91,8 +91,8 @@
 
 	_printf_("initialize inputs:\n");
-	model->FindParam(&u_g_initial,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
+	model->FindParam(&u_g_initial,NULL,NULL,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
 	model->FindParam(&numberofnodes,"numberofnodes");
 	if(control_analysis){
-		model->FindParam(&u_g_obs,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
+		model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
 	}
 
@@ -102,5 +102,5 @@
 		model->FindParam(&cm_noisedampening,"cm_noisedampening");
 		inputs->Add("cm_noisedampening",cm_noisedampening);
-		model->FindParam(&u_g_obs,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
+		model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
 		inputs->Add("velocity_obs",u_g_obs,2,numberofnodes);
 	}
Index: /issm/trunk/src/c/parallel/diagnostic_core.cpp
===================================================================
--- /issm/trunk/src/c/parallel/diagnostic_core.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/diagnostic_core.cpp	(revision 2333)
@@ -80,11 +80,11 @@
 
 	//specific parameters for specific models
-	fem_dh->FindParam((void*)&numberofdofspernode_dh,"numberofdofspernode");
-	fem_sl->FindParam((void*)&numberofdofspernode_sl,"numberofdofspernode");
-	fem_ds->FindParam((void*)&numberofdofspernode_ds,"numberofdofspernode");
+	fem_dh->FindParam(&numberofdofspernode_dh,"numberofdofspernode");
+	fem_sl->FindParam(&numberofdofspernode_sl,"numberofdofspernode");
+	fem_ds->FindParam(&numberofdofspernode_ds,"numberofdofspernode");
 
 	//for qmu analysis, be sure the velocity input we are starting from  is the one in the parameters: */
 	if(qmu_analysis){
-		model->FindParam(&u_g_initial,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
+		model->FindParam(&u_g_initial,NULL,NULL,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
 		inputs->Add("velocity",u_g_initial,3,numberofnodes);
 	}
@@ -99,6 +99,6 @@
 		
 			if(verbose)_printf_("%s\n","extruding slopes in 3d...");
-			FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopex",0);
-			FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopex",0);
+			FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0);
+			FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0);
 		}
 
@@ -112,5 +112,5 @@
 
 		if(verbose)_printf_("%s\n"," computing pressure according to MacAyeal...");
-		ComputePressurex( &pg,fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials, numberofnodes);
+		ComputePressurex( &pg,fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials, fem_dhu->parameters);
 
 		if(verbose)_printf_("%s\n"," update boundary conditions for macyeal pattyn using hutter results...");
@@ -130,5 +130,5 @@
 		if(dim==2){
 			if(verbose)_printf_("%s\n"," computing pressure according to MacAyeal...");
-			ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials, numberofnodes);
+			ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials, fem_dh->parameters);
 		}
 
@@ -139,5 +139,5 @@
 
 		if(verbose)_printf_("%s\n"," extruding horizontal velocities...");
-		VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh->materials,"velocity",1);
+		VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh->materials,fem_dh->parameters,"velocity",1);
 
 		if(verbose)_printf_("%s\n"," computing vertical velocities...");
@@ -153,5 +153,5 @@
 
 		if(verbose)_printf_("%s\n"," computing pressure according to Pattyn...");
-		ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials, numberofnodes);
+		ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials,fem_dh->parameters);
 		
 		if (isstokes){
@@ -163,6 +163,6 @@
 			diagnostic_core_linear(&slopex,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum());
 			diagnostic_core_linear(&slopey,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum());
-			FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopex",0);
-			FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopey",0);
+			FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0);
+			FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopey",0);
 
 			inputs->Add("bedslopex",slopex,numberofdofspernode_sl,numberofnodes);
Index: /issm/trunk/src/c/parallel/diagnostic_core_linear.cpp
===================================================================
--- /issm/trunk/src/c/parallel/diagnostic_core_linear.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/diagnostic_core_linear.cpp	(revision 2333)
@@ -31,19 +31,19 @@
 	/*Recover parameters: */
 	kflag=1; pflag=1;
-	fem->parameters->FindParam((void*)&connectivity,"connectivity");
-	fem->parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
-	fem->parameters->FindParam((void*)&verbose,"verbose");
-	fem->parameters->FindParam((void*)&solver_string,"solverstring");
+	fem->parameters->FindParam(&connectivity,"connectivity");
+	fem->parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
+	fem->parameters->FindParam(&verbose,"verbose");
+	fem->parameters->FindParam(&solver_string,"solverstring");
 
 	/*Update parameters: */
-	UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials,inputs);
+	UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials,fem->parameters,inputs);
 		
 	//*Generate system matrices
 	if (verbose) _printf_("   Generating matrices\n");
-	SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
+	SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
 
 	if (verbose) _printf_("   Generating penalty matrices\n");
 	//*Generate penalty system matrices
-	PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,inputs,analysis_type,sub_analysis_type); 
+	PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type); 
 
 	/*!Reduce matrix from g to f size:*/
Index: /issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp	(revision 2333)
@@ -42,8 +42,8 @@
 	/*Recover parameters: */
 	kflag=1; pflag=1;
-	fem->FindParam((void*)&connectivity,"connectivity");
-	fem->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
-	fem->FindParam((void*)&numberofnodes,"numberofnodes");
-	fem->FindParam((void*)&solver_string,"solverstring");
+	fem->FindParam(&connectivity,"connectivity");
+	fem->FindParam(&numberofdofspernode,"numberofdofspernode");
+	fem->FindParam(&numberofnodes,"numberofnodes");
+	fem->FindParam(&solver_string,"solverstring");
 	fem->FindParam(&verbose,"verbose");
 
@@ -79,13 +79,13 @@
 
 		/*Update parameters: */
-		UpdateFromInputsx(fem->elements,fem->nodes,loads, fem->materials,inputs);
+		UpdateFromInputsx(fem->elements,fem->nodes,loads, fem->materials,fem->parameters,inputs);
 
 		if (verbose) _printf_("   Generating matrices\n");
 		//*Generate system matrices
-		SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
+		SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
 
 		if (verbose) _printf_("   Generating penalty matrices\n");
 		//*Generate penalty system matrices
-		PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,loads,fem->materials,kflag,pflag,inputs,analysis_type,sub_analysis_type); 
+		PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type); 
 
 		if (verbose) _printf_("   reducing matrix from g to f set\n");
@@ -116,5 +116,5 @@
 		if (old_ug) inputs->Add("old_velocity",old_ug,numberofdofspernode,numberofnodes);
 		inputs->Add("velocity",ug,numberofdofspernode,numberofnodes);
-		PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,loads,fem->materials,inputs,analysis_type,sub_analysis_type); 
+		PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type); 
 
 		if(verbose)_printf_("   number of unstable constraints: %i\n",num_unstable_constraints);
@@ -149,5 +149,5 @@
 		kflag=1; pflag=0; //stiffness generation only
 	
-		SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
+		SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
 		Reducematrixfromgtofx(&Kff,&Kfs,Kgg,fem->Gmn,fem->nodesets);
 		MatFree(&Kgg);VecFree(&pg);
Index: /issm/trunk/src/c/parallel/gradjcompute_core.cpp
===================================================================
--- /issm/trunk/src/c/parallel/gradjcompute_core.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/gradjcompute_core.cpp	(revision 2333)
@@ -53,14 +53,14 @@
 	/*some parameters:*/
 	femmodel=model->GetActiveFormulation();
-	femmodel->parameters->FindParam((void*)&analysis_type,"analysis_type");
-	femmodel->parameters->FindParam((void*)&sub_analysis_type,"sub_analysis_type");
-	femmodel->parameters->FindParam((void*)&control_steady,"control_steady");
-	femmodel->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
-	femmodel->parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
-	femmodel->parameters->FindParam((void*)&solverstring,"solverstring");
-	femmodel->parameters->FindParam((void*)&control_type,"control_type");
-	femmodel->parameters->FindParam((void*)&extrude_param,"extrude_param");
-	femmodel->parameters->FindParam((void*)&verbose,"verbose");
-	femmodel->parameters->FindParam((void*)&dim,"dim");
+	femmodel->parameters->FindParam(&analysis_type,"analysis_type");
+	femmodel->parameters->FindParam(&sub_analysis_type,"sub_analysis_type");
+	femmodel->parameters->FindParam(&control_steady,"control_steady");
+	femmodel->parameters->FindParam(&numberofnodes,"numberofnodes");
+	femmodel->parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
+	femmodel->parameters->FindParam(&solverstring,"solverstring");
+	femmodel->parameters->FindParam(&control_type,"control_type");
+	femmodel->parameters->FindParam(&extrude_param,"extrude_param");
+	femmodel->parameters->FindParam(&verbose,"verbose");
+	femmodel->parameters->FindParam(&dim,"dim");
 
 	_printf_("%s\n","      recover solution for this stiffness and right hand side:");
@@ -70,5 +70,5 @@
 
 	_printf_("%s\n","      buid Du, difference between observed velocity and model velocity:");
-	Dux( &du_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,inputs,analysis_type,sub_analysis_type);
+	Dux( &du_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,femmodel->parameters,inputs,analysis_type,sub_analysis_type);
 
 	_printf_("%s\n","      reduce adjoint load from g-set to f-set:");
@@ -88,5 +88,5 @@
 	inputs->Add("adjoint",lambda_g_double,numberofdofspernode,numberofnodes);
 
-	Gradjx( &grad_g, numberofnodes,femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials, 
+	Gradjx( &grad_g, numberofnodes,femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials,femmodel->parameters, 
 				inputs,analysis_type,sub_analysis_type,control_type);
 
@@ -94,5 +94,5 @@
 
 		_printf_("%s\n","      extruding gradient...");
-		FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,"gradj",0);
+		FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,femmodel->parameters,"gradj",0);
 	}
 
Index: /issm/trunk/src/c/parallel/objectivefunctionC.cpp
===================================================================
--- /issm/trunk/src/c/parallel/objectivefunctionC.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/objectivefunctionC.cpp	(revision 2333)
@@ -65,15 +65,15 @@
 
 	gsize=femmodel->nodesets->GetGSize();
-	femmodel->parameters->FindParam((void*)&optscal,"optscal");
-	femmodel->parameters->FindParam((void*)&mincontrolconstraint,"mincontrolconstraint");
-	femmodel->parameters->FindParam((void*)&maxcontrolconstraint,"maxcontrolconstraint");
-	femmodel->parameters->FindParam((void*)&control_type,"control_type");
-	femmodel->parameters->FindParam((void*)&fit,"fit");
-	femmodel->parameters->FindParam((void*)&analysis_type,"analysis_type");
-	femmodel->parameters->FindParam((void*)&sub_analysis_type,"sub_analysis_type");
-	femmodel->parameters->FindParam((void*)&control_steady,"control_steady");
-	femmodel->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
-	femmodel->parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
-	femmodel->parameters->FindParam((void*)&isstokes,"isstokes");
+	femmodel->parameters->FindParam(&optscal,NULL,NULL,"optscal");
+	femmodel->parameters->FindParam(&fit,NULL,NULL,"fit");
+	femmodel->parameters->FindParam(&mincontrolconstraint,"mincontrolconstraint");
+	femmodel->parameters->FindParam(&maxcontrolconstraint,"maxcontrolconstraint");
+	femmodel->parameters->FindParam(&control_type,"control_type");
+	femmodel->parameters->FindParam(&analysis_type,"analysis_type");
+	femmodel->parameters->FindParam(&sub_analysis_type,"sub_analysis_type");
+	femmodel->parameters->FindParam(&control_steady,"control_steady");
+	femmodel->parameters->FindParam(&numberofnodes,"numberofnodes");
+	femmodel->parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
+	femmodel->parameters->FindParam(&isstokes,"isstokes");
 
 	/*First copy param_g so we don't modify it: */
@@ -97,6 +97,5 @@
 	/*Compute misfit for this velocity field.*/
 	inputs->Add("fit",fit[n]);
-	Misfitx( &J, femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials, 
-				inputs,analysis_type,sub_analysis_type);
+	Misfitx( &J, femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials, femmodel->parameters,inputs,analysis_type,sub_analysis_type);
 
 	/*Free ressources:*/
Index: /issm/trunk/src/c/parallel/prognostic.cpp
===================================================================
--- /issm/trunk/src/c/parallel/prognostic.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/prognostic.cpp	(revision 2333)
@@ -81,8 +81,8 @@
 	_printf_("initialize inputs:\n");
 	
-	model->FindParam(&u_g_serial,"u_g",PrognosticAnalysisEnum());
-	model->FindParam(&h_g_initial,"h_g",PrognosticAnalysisEnum());
-	model->FindParam(&melting_g,"m_g",PrognosticAnalysisEnum());
-	model->FindParam(&accumulation_g,"a_g",PrognosticAnalysisEnum());
+	model->FindParam(&u_g_serial,NULL,NULL,"u_g",PrognosticAnalysisEnum());
+	model->FindParam(&h_g_initial,NULL,NULL,"h_g",PrognosticAnalysisEnum());
+	model->FindParam(&melting_g,NULL,NULL,"m_g",PrognosticAnalysisEnum());
+	model->FindParam(&accumulation_g,NULL,NULL,"a_g",PrognosticAnalysisEnum());
 	model->FindParam(&dt,"dt");
 	model->FindParam(&yts,"yts");
Index: /issm/trunk/src/c/parallel/prognostic_core.cpp
===================================================================
--- /issm/trunk/src/c/parallel/prognostic_core.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/prognostic_core.cpp	(revision 2333)
@@ -46,5 +46,5 @@
 	_printf_("depth averaging velocity...\n");
 	u_g=inputs->Get("velocity",&dofs[0],2); //take (vx,vy) from inputs velocity
-	FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials,"velocity");
+	FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials,fem_p->parameters,"velocity");
 	inputs->Add("velocity_average",u_g,2,numberofnodes);
 	
@@ -53,5 +53,5 @@
 
 	_printf_("extrude computed thickness on all layers:\n");
-	FieldExtrudex( h_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials,"thickness",0);
+	FieldExtrudex( h_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials,fem_p->parameters,"thickness",0);
 
 	/*Plug results into output dataset: */
Index: /issm/trunk/src/c/parallel/steadystate.cpp
===================================================================
--- /issm/trunk/src/c/parallel/steadystate.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/steadystate.cpp	(revision 2333)
@@ -99,6 +99,6 @@
 
 	_printf_("initialize inputs:\n");
-	model->FindParam(&u_g_initial,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
-	model->FindParam(&p_g_initial,"p_g",ThermalAnalysisEnum());
+	model->FindParam(&u_g_initial,NULL,NULL,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
+	model->FindParam(&p_g_initial,NULL,NULL,"p_g",ThermalAnalysisEnum());
 	model->FindParam(&dt,"dt");
 	model->FindParam(&numberofnodes,"numberofnodes");
@@ -112,5 +112,5 @@
 		model->FindParam(&cm_noisedampening,"cm_noisedampening");
 		inputs->Add("cm_noisedampening",cm_noisedampening);
-		model->FindParam(&u_g_obs,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
+		model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
 		inputs->Add("velocity_obs",u_g_obs,2,numberofnodes);
 	}
@@ -139,7 +139,7 @@
 			fem_ds=model->GetFormulation(DiagnosticAnalysisEnum(),StokesAnalysisEnum());
 			param=(Param*)fem_dh->parameters->FindParamObject("control_steady");
-			param->SetInteger(1);
+			param->SetDouble(1);
 			param=(Param*)fem_ds->parameters->FindParamObject("control_steady");
-			param->SetInteger(1);
+			param->SetDouble(1);
 			/*run control analysis: */
 			_printf_("call computational core:\n");
Index: /issm/trunk/src/c/parallel/steadystate_core.cpp
===================================================================
--- /issm/trunk/src/c/parallel/steadystate_core.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/steadystate_core.cpp	(revision 2333)
@@ -95,5 +95,5 @@
 		//compute depth averaged temperature and add to inputs
 		VecDuplicatePatch(&t_g_average,t_g); 
-		FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,"temperature");
+		FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,fem_t->parameters,"temperature");
 		inputs->Add("temperature_average",t_g_average,1,numberofnodes);
 		inputs->Add("temperature",t_g,1,numberofnodes);
Index: /issm/trunk/src/c/parallel/thermal.cpp
===================================================================
--- /issm/trunk/src/c/parallel/thermal.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/thermal.cpp	(revision 2333)
@@ -78,6 +78,6 @@
 	
 	_printf_("initialize inputs:\n");
-	model->FindParam(&u_g,"u_g",ThermalAnalysisEnum());
-	model->FindParam(&p_g,"p_g",ThermalAnalysisEnum());
+	model->FindParam(&u_g,NULL,NULL,"u_g",ThermalAnalysisEnum());
+	model->FindParam(&p_g,NULL,NULL,"p_g",ThermalAnalysisEnum());
 	model->FindParam(&numberofnodes,"numberofnodes");
 	model->FindParam(&dt,"dt");
Index: /issm/trunk/src/c/parallel/thermal_core.cpp
===================================================================
--- /issm/trunk/src/c/parallel/thermal_core.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/thermal_core.cpp	(revision 2333)
@@ -52,9 +52,9 @@
 
 	//first recover parameters common to all solutions
-	fem_t->FindParam((void*)&numberofnodes,"numberofnodes");
-	fem_t->FindParam((void*)&sub_analysis_type,"sub_analysis_type");
-	fem_t->FindParam((void*)&verbose,"verbose");
-	fem_t->FindParam((void*)&ndt,"ndt");
-	fem_t->FindParam((void*)&dt,"dt");
+	fem_t->FindParam(&numberofnodes,"numberofnodes");
+	fem_t->FindParam(&sub_analysis_type,"sub_analysis_type");
+	fem_t->FindParam(&verbose,"verbose");
+	fem_t->FindParam(&ndt,"ndt");
+	fem_t->FindParam(&dt,"dt");
 
 	if(dt==0){
@@ -86,8 +86,8 @@
 
 		//initialize temperature and melting
-		fem_t->FindParam((void*)&t_g_serial,"t_g");
+		fem_t->FindParam(&t_g_serial,NULL,NULL,"t_g");
 		t_g[0]=SerialToVec(t_g_serial,numberofnodes);
 		xfree((void**)&t_g_serial);
-		fem_m->FindParam((void*)&m_g_serial,"m_g");
+		fem_m->FindParam(&m_g_serial,NULL,NULL,"m_g");
 		m_g[0]=SerialToVec(m_g_serial,numberofnodes);
 		xfree((void**)&m_g_serial);
Index: /issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp	(revision 2333)
@@ -44,11 +44,11 @@
 	kflag=1; pflag=1;
 
-	fem->parameters->FindParam((void*)&connectivity,"connectivity");
-	fem->parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
-	fem->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
-	fem->parameters->FindParam((void*)&solver_string,"solverstring");
-	fem->parameters->FindParam((void*)&verbose,"verbose");
-	fem->parameters->FindParam((void*)&lowmem,"lowmem");
-	fem->parameters->FindParam((void*)&min_thermal_constraints,"min_thermal_constraints");
+	fem->parameters->FindParam(&connectivity,"connectivity");
+	fem->parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
+	fem->parameters->FindParam(&numberofnodes,"numberofnodes");
+	fem->parameters->FindParam(&solver_string,"solverstring");
+	fem->parameters->FindParam(&verbose,"verbose");
+	fem->parameters->FindParam(&lowmem,"lowmem");
+	fem->parameters->FindParam(&min_thermal_constraints,"min_thermal_constraints");
 
 	count=1;
@@ -63,5 +63,5 @@
 
 		/*Update parameters: */
-		UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials,inputs);
+		UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials,fem->parameters,inputs);
 
 		//*Generate system matrices
@@ -70,5 +70,5 @@
 			/*Compute Kgg_nopenalty and pg_nopenalty once for all: */
 			if (count==1){
-				SystemMatricesx(&Kgg_nopenalty, &pg_nopenalty,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
+				SystemMatricesx(&Kgg_nopenalty, &pg_nopenalty,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
 			}
 
@@ -78,10 +78,10 @@
 
 			//apply penalties each time
-			PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,inputs,analysis_type,sub_analysis_type); 
+			PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type); 
 		}
 		else{
-			SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
+			SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
 			//apply penalties
-			PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,inputs,analysis_type,sub_analysis_type); 
+			PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type); 
 		}
 
@@ -117,5 +117,5 @@
 		inputs->Add("temperature",tg,numberofdofspernode,numberofnodes);
 		
-		PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->loads,fem->materials,inputs,analysis_type,sub_analysis_type); 
+		PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type); 
 
 		if (!converged){
Index: /issm/trunk/src/c/parallel/transient.cpp
===================================================================
--- /issm/trunk/src/c/parallel/transient.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/transient.cpp	(revision 2333)
@@ -102,7 +102,7 @@
 
 	_printf_("initialize inputs:\n");
-	model->FindParam(&u_g,"u_g",PrognosticAnalysisEnum());
-	model->FindParam(&m_g,"m_g",PrognosticAnalysisEnum());
-	model->FindParam(&a_g,"a_g",PrognosticAnalysisEnum());
+	model->FindParam(&u_g,NULL,NULL,"u_g",PrognosticAnalysisEnum());
+	model->FindParam(&m_g,NULL,NULL,"m_g",PrognosticAnalysisEnum());
+	model->FindParam(&a_g,NULL,NULL,"a_g",PrognosticAnalysisEnum());
 	model->FindParam(&numberofnodes,"numberofnodes");
 	model->FindParam(&dt,"dt");
Index: /issm/trunk/src/c/parallel/transient_core_2d.cpp
===================================================================
--- /issm/trunk/src/c/parallel/transient_core_2d.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/transient_core_2d.cpp	(revision 2333)
@@ -84,5 +84,5 @@
 	time=0;
 	
-	fem_p->parameters->FindParam((void*)&u_g_serial3d,"u_g");
+	fem_p->parameters->FindParam(&u_g_serial3d,NULL,NULL,"u_g");
 	u_g_serial=(double*)xmalloc(2*numberofnodes*sizeof(double));
 	for(i=0;i<numberofnodes;i++){
@@ -92,11 +92,11 @@
 	u_g=SerialToVec(u_g_serial,2*numberofnodes); xfree((void**)&u_g_serial);
 
-	fem_p->parameters->FindParam((void*)&h_g_serial,"h_g");
+	fem_p->parameters->FindParam(&h_g_serial,NULL,NULL,"h_g");
 	h_g=SerialToVec(h_g_serial,1*numberofnodes); xfree((void**)&h_g_serial);
 
-	fem_p->parameters->FindParam((void*)&s_g_serial,"s_g");
+	fem_p->parameters->FindParam(&s_g_serial,NULL,NULL,"s_g");
 	s_g=SerialToVec(s_g_serial,1*numberofnodes); xfree((void**)&s_g_serial);
 
-	fem_p->parameters->FindParam((void*)&b_g_serial,"b_g");
+	fem_p->parameters->FindParam(&b_g_serial,NULL,NULL,"b_g");
 	b_g=SerialToVec(b_g_serial,1*numberofnodes); xfree((void**)&b_g_serial);
 
@@ -143,7 +143,5 @@
 		//update surface and bed using the new thickness
 		_printf_("   updating geometry\n");
-		UpdateGeometryx(&new_h_g,&new_b_g,&new_s_g, 
-				fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, 
-				h_g_intermediary,b_g,s_g); 
+		UpdateGeometryx(&new_h_g,&new_b_g,&new_s_g, fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, fem_p->parameters,h_g_intermediary,b_g,s_g); 
 
 		VecFree(&h_g);h_g=new_h_g; 
Index: /issm/trunk/src/c/parallel/transient_core_3d.cpp
===================================================================
--- /issm/trunk/src/c/parallel/transient_core_3d.cpp	(revision 2332)
+++ /issm/trunk/src/c/parallel/transient_core_3d.cpp	(revision 2333)
@@ -90,23 +90,23 @@
 	time=0;
 	
-	fem_p->parameters->FindParam((void*)&u_g_serial,"u_g");
+	fem_p->parameters->FindParam(&u_g_serial,NULL,NULL,"u_g");
 	u_g=SerialToVec(u_g_serial,3*numberofnodes); xfree((void**)&u_g_serial);
 
-	fem_p->parameters->FindParam((void*)&p_g_serial,"p_g");
+	fem_p->parameters->FindParam(&p_g_serial,NULL,NULL,"p_g");
 	p_g=SerialToVec(p_g_serial,1*numberofnodes); xfree((void**)&p_g_serial);
 
-	fem_p->parameters->FindParam((void*)&h_g_serial,"h_g");
+	fem_p->parameters->FindParam(&h_g_serial,NULL,NULL,"h_g");
 	h_g=SerialToVec(h_g_serial,1*numberofnodes); xfree((void**)&h_g_serial);
 
-	fem_p->parameters->FindParam((void*)&s_g_serial,"s_g");
+	fem_p->parameters->FindParam(&s_g_serial,NULL,NULL,"s_g");
 	s_g=SerialToVec(s_g_serial,1*numberofnodes); xfree((void**)&s_g_serial);
 
-	fem_p->parameters->FindParam((void*)&b_g_serial,"b_g");
+	fem_p->parameters->FindParam(&b_g_serial,NULL,NULL,"b_g");
 	b_g=SerialToVec(b_g_serial,1*numberofnodes); xfree((void**)&b_g_serial);
 
-	fem_p->parameters->FindParam((void*)&t_g_serial,"t_g");
+	fem_p->parameters->FindParam(&t_g_serial,NULL,NULL,"t_g");
 	t_g=SerialToVec(t_g_serial,1*numberofnodes); xfree((void**)&t_g_serial);
 
-	fem_p->parameters->FindParam((void*)&m_g_serial,"m_g");
+	fem_p->parameters->FindParam(&m_g_serial,NULL,NULL,"m_g");
 	m_g=SerialToVec(m_g_serial,1*numberofnodes); xfree((void**)&m_g_serial);
 
@@ -146,5 +146,5 @@
 		if(verbose)_printf_("%s\n","computing depth average temperature");
 		VecDuplicatePatch(&t_g_average,t_g); 
-		FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,"temperature");
+		FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,fem_t->parameters,"temperature");
 		inputs->Add("temperature_average",t_g_average,1,numberofnodes);
 		VecFree(&t_g_average); //not needed anymore
@@ -171,18 +171,16 @@
 		//update surface and bed using the new thickness
 		if(verbose)_printf_("   updating geometry\n");
-		UpdateGeometryx(&h_g,&b_g,&s_g, 
-				fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, 
-				h_g_intermediary,b_g,s_g); 
+		UpdateGeometryx(&h_g,&b_g,&s_g, fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, fem_p->parameters,h_g_intermediary,b_g,s_g); 
 		VecFree(&h_g_intermediary);
 		
 		if(verbose)_printf_("%s\n","updating node positions");
-		UpdateNodePositionsx( fem_dh->elements,fem_dh->nodes,fem_dh->loads,fem_dh->materials,h_g,b_g);
-		UpdateNodePositionsx( fem_dv->elements,fem_dv->nodes,fem_dv->loads,fem_dv->materials,h_g,b_g);
-		UpdateNodePositionsx( fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials,h_g,b_g);
-		UpdateNodePositionsx( fem_ds->elements,fem_ds->nodes,fem_ds->loads,fem_ds->materials,h_g,b_g);
-		UpdateNodePositionsx( fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,h_g,b_g);
-		UpdateNodePositionsx( fem_p->elements,fem_p->nodes,fem_p->loads,fem_p->materials,h_g,b_g);
-		UpdateNodePositionsx( fem_t->elements,fem_t->nodes,fem_t->loads,fem_t->materials,h_g,b_g);
-		UpdateNodePositionsx( fem_m->elements,fem_m->nodes,fem_m->loads,fem_m->materials,h_g,b_g);
+		UpdateNodePositionsx( fem_dh->elements,fem_dh->nodes,fem_dh->loads,fem_dh->materials,fem_dh->parameters,h_g,b_g);
+		UpdateNodePositionsx( fem_dv->elements,fem_dv->nodes,fem_dv->loads,fem_dv->materials,fem_dv->parameters,h_g,b_g);
+		UpdateNodePositionsx( fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials,fem_dhu->parameters,h_g,b_g);
+		UpdateNodePositionsx( fem_ds->elements,fem_ds->nodes,fem_ds->loads,fem_ds->materials,fem_ds->parameters,h_g,b_g);
+		UpdateNodePositionsx( fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,h_g,b_g);
+		UpdateNodePositionsx( fem_p->elements,fem_p->nodes,fem_p->loads,fem_p->materials,fem_p->parameters,h_g,b_g);
+		UpdateNodePositionsx( fem_t->elements,fem_t->nodes,fem_t->loads,fem_t->materials,fem_t->parameters,h_g,b_g);
+		UpdateNodePositionsx( fem_m->elements,fem_m->nodes,fem_m->loads,fem_m->materials,fem_m->parameters,h_g,b_g);
 
 		//plug into results.
Index: /issm/trunk/src/m/classes/public/plot/applyoptions.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/applyoptions.m	(revision 2332)
+++ /issm/trunk/src/m/classes/public/plot/applyoptions.m	(revision 2333)
@@ -73,6 +73,5 @@
 %Basinzoom
 if ~isnan(options_structure.basinzoom),                                                                                                                         
-	basinzoom(options_structure.basinzoom);                                                                                                                           
-end
+	basinzoom(options_structure.basinzoom,options_structure.unitmultiplier);                                                                                                                          end
 
 %Caxis
Index: /issm/trunk/src/m/enum/NumparEnum.m
===================================================================
--- /issm/trunk/src/m/enum/NumparEnum.m	(revision 2333)
+++ /issm/trunk/src/m/enum/NumparEnum.m	(revision 2333)
@@ -0,0 +1,9 @@
+function macro=NumparEnum()
+%NUMPARENUM - Enum of Numpar
+%
+%   file generated by src/c/EnumDefinitions/SynchronizeMatlabEnum
+%
+%   Usage:
+%      macro=NumparEnum()
+
+macro=443;
Index: /issm/trunk/src/m/solutions/cielo/ControlInitialization.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/ControlInitialization.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/ControlInitialization.m	(revision 2333)
@@ -27,6 +27,6 @@
 slopex=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum());
 slopey=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum());
-slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopex,'slopex',0);
-slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopey,'slopey',0);
+slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopex,'slopex',0);
+slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopey,'slopey',0);
 
 %Add to inputs
@@ -40,5 +40,5 @@
 u_g=diagnostic_core_nonlinear(m_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum());
 displaystring(verbose,'\n%s',['extruding horizontal velocities...']);
-u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,u_g,'velocity',1);
+u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,m_dh.parameters,u_g,'velocity',1);
 
 %vertical velocities
Index: /issm/trunk/src/m/solutions/cielo/CreateFemModel.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/CreateFemModel.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/CreateFemModel.m	(revision 2333)
@@ -9,8 +9,8 @@
 	
 	displaystring(md.verbose,'\n   reading data from model %s...',md.name);
-	[m.elements,m.nodes,m.constraints,m.loads,m.materials,parameters]=ModelProcessor(md);
+	[m.elements,m.nodes,m.constraints,m.loads,m.materials,m.parameters]=ModelProcessor(md);
 
 	displaystring(md.verbose,'%s','   generating degrees of freedom...');
-	[m.nodes,m.part,m.tpart]=Dof(m.elements,m.nodes,parameters);
+	[m.nodes,m.part,m.tpart]=Dof(m.elements,m.nodes,m.parameters);
 
 	displaystring(md.verbose,'%s','   generating single point constraints...');
@@ -30,14 +30,8 @@
 
 	displaystring(md.verbose,'%s','   configuring element and loads...');
-	[m.elements,m.loads,m.nodes] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials);
+	[m.elements,m.loads,m.nodes,m.parameters] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials,m.parameters);
 
 	displaystring(md.verbose,'%s','   processing parameters...');
-	parameters= ProcessParams(parameters,m.part.vector);
-
-	displaystring(md.verbose,'%s','   creating parameters in matlab workspace...');
-	m.parameters= ParamsToWorkspace(parameters);
-
-	%Get rid of parameters dataset. 
-	clear parameters;
+	m.parameters= ProcessParams(m.parameters,m.part.vector);
 
 end
Index: /issm/trunk/src/m/solutions/cielo/control_core.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/control_core.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/control_core.m	(revision 2333)
@@ -45,5 +45,5 @@
 
 	%Update inputs in datasets
-	[model.elements,model.nodes,model.loads,model.materials]=UpdateFromInputs(model.elements,model.nodes,model.loads,model.materials,inputs);
+	[model.elements,model.nodes,model.loads,model.materials,model.parameters]=UpdateFromInputs(model.elements,model.nodes,model.loads,model.materials,model.parameters,inputs);
 
 	displaystring(verbose,'\n%s',['      computing gradJ...']);
Index: /issm/trunk/src/m/solutions/cielo/diagnostic.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/diagnostic.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/diagnostic.m	(revision 2333)
@@ -5,5 +5,4 @@
 %      md=diagnostic(md)
 %
-
 	%timing
 	t1=clock;
@@ -11,8 +10,8 @@
 	%Build all models requested for diagnostic simulation
 	models.analysis_type=DiagnosticAnalysisEnum; %needed for processresults
-	
+
 	displaystring(md.verbose,'%s',['reading diagnostic horiz model data']);
 	md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=HorizAnalysisEnum; models.dh=CreateFemModel(md);
-	
+
 	displaystring(md.verbose,'\n%s',['reading diagnostic vert model data']);
 	md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=VertAnalysisEnum; models.dv=CreateFemModel(md);
Index: /issm/trunk/src/m/solutions/cielo/diagnostic_core.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/diagnostic_core.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/diagnostic_core.m	(revision 2333)
@@ -21,4 +21,6 @@
 numrifts=m_dhu.parameters.numrifts;
 
+debug=1;
+
 if ishutter,
 
@@ -29,6 +31,6 @@
 	if dim==3,
 		displaystring(verbose,'\n%s',['extruding slopes in 3d...']);
-		slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopex,'slopex',0);
-		slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopey,'slopey',0);
+		slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopex,'slopex',0);
+		slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopey,'slopey',0);
 	end
 
@@ -63,5 +65,5 @@
 
 	displaystring(verbose,'\n%s',['extruding horizontal velocities...']);
-	u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,u_g,'velocity',1);
+	u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,m_dh.parameters,u_g,'velocity',1);
 
 	displaystring(verbose,'\n%s',['computing vertical velocities...']);
@@ -85,6 +87,6 @@
 		slopex=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum());
 		slopey=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum());
-		slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopex,'slopex',0);
-		slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopey,'slopey',0);
+		slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopex,'slopex',0);
+		slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopey,'slopey',0);
 
 		inputs=add(inputs,'bedslopex',slopex,'doublevec',m_sl.parameters.numberofdofspernode,m_sl.parameters.numberofnodes);
Index: /issm/trunk/src/m/solutions/cielo/diagnostic_core_linear.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/diagnostic_core_linear.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/diagnostic_core_linear.m	(revision 2333)
@@ -9,5 +9,5 @@
 
 	%Update inputs in datasets
-	[m.elements,m.nodes, m.loads,m.materials]=UpdateFromInputs(m.elements,m.nodes, m.loads,m.materials,inputs);
+	[m.elements,m.nodes, m.loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, m.loads,m.materials,m.parameters,inputs);
 	
 	%system matrices
Index: /issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m	(revision 2333)
@@ -26,11 +26,11 @@
 			inputs=add(inputs,'old_velocity',soln(count).u_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes);
 		end
-
+		
 		%Update inputs in datasets
-		[m.elements,m.nodes, loads,m.materials]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs);
+		[m.elements,m.nodes, loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,m.parameters,inputs);
 		
 		%system matrices 
 		[K_gg_nopenalty , p_g_nopenalty]=SystemMatrices(m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type);
-		
+	
 		%penalties
 		[K_gg , p_g, kmax]=PenaltySystemMatrices(K_gg_nopenalty,p_g_nopenalty,m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type);
@@ -41,22 +41,22 @@
 		%Reduce load from g size to f size
 		[p_f] = Reduceloadfromgtof( p_g, m.Gmn, K_fs, m.ys, m.nodesets);
-
+		
 		%Increment index
 		count=count+1;
-
+		
 		%Solve	
 		[soln(count).u_f]=Solver(K_ff,p_f,[],m.parameters);
-
+		
 		%Merge back to g set
 		[soln(count).u_g]= Mergesolutionfromftog( soln(count).u_f, m.Gmn, m.ys, m.nodesets ); 
-
+		
 		%Deal with penalty loads
 		inputs=add(inputs,'velocity',soln(count).u_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes);
-	
+		
 		%penalty constraints
 		[loads,constraints_converged,num_unstable_constraints] =PenaltyConstraints( m.elements,m.nodes, loads, m.materials,m.parameters,inputs,analysis_type,sub_analysis_type);
-	
+		
 		displaystring(m.parameters.verbose,'%s%i','      number of unstable constraints: ',num_unstable_constraints);
-
+		
 		%Figure out if convergence have been reached
 		converged=convergence(K_ff,p_f,soln(count).u_f,soln(count-1).u_f,m.parameters);
Index: /issm/trunk/src/m/solutions/cielo/gradjcompute_core.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/gradjcompute_core.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/gradjcompute_core.m	(revision 2333)
@@ -39,5 +39,5 @@
 if (dim==3 & extrude_param),
 	displaystring(verbose,'%s','          extruding gradient...');
-	grad_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,grad_g,'gradj',0);
+	grad_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,m.parameters,grad_g,'gradj',0);
 end
 
Index: /issm/trunk/src/m/solutions/cielo/prognostic_core.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/prognostic_core.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/prognostic_core.m	(revision 2333)
@@ -13,5 +13,5 @@
 	%Take only the first two dofs of m.parameters.u_g
 	u_g=get(inputs,'velocity',[1 1 0 0]);
-	u_g=FieldDepthAverage(m.elements,m.nodes,m.loads,m.materials,u_g,'velocity');
+	u_g=FieldDepthAverage(m.elements,m.nodes,m.loads,m.materials,m.parameters,u_g,'velocity');
 	inputs=add(inputs,'velocity_average',u_g,'doublevec',2,m.parameters.numberofnodes);
 
@@ -20,5 +20,5 @@
 
 	displaystring(m.parameters.verbose,'\n%s',['extrude computed thickness on all layers:']);
-	results.h_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,results.h_g,'thickness',0);
+	results.h_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,m.parameters,results.h_g,'thickness',0);
 
 end %end function
Index: /issm/trunk/src/m/solutions/cielo/steadystate_core.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/steadystate_core.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/steadystate_core.m	(revision 2333)
@@ -46,5 +46,5 @@
 	%add temperature to inputs.
 	%Compute depth averaged temperature
-	temperature_average=FieldDepthAverage(m_t.elements,m_t.nodes,m_t.loads,m_t.materials,results_thermal.t_g,'temperature');
+	temperature_average=FieldDepthAverage(m_t.elements,m_t.nodes,m_t.loads,m_t.materials,m_t.parameters,results_thermal.t_g,'temperature');
 	inputs=add(inputs,'temperature_average',temperature_average,'doublevec',1,m_t.parameters.numberofnodes);
 	inputs=add(inputs,'temperature',results_thermal.t_g,'doublevec',1,m_t.parameters.numberofnodes);
Index: /issm/trunk/src/m/solutions/cielo/thermal_core_nonlinear.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/thermal_core_nonlinear.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/thermal_core_nonlinear.m	(revision 2333)
@@ -23,5 +23,5 @@
 
 		%Update inputs in datasets
-		[m.elements,m.nodes, loads,m.materials]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs);
+		[m.elements,m.nodes, loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,m.parameters,inputs);
 
 		%system matrices 
@@ -57,5 +57,5 @@
 		inputs=add(inputs,'temperature',t_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes);
 		displaystring(m.parameters.verbose,'%s',['   update inputs']);
-		[m.elements,m.nodes, loads,m.materials]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs);
+		[m.elements,m.nodes, loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,m.parameters,inputs);
 	
 		%penalty constraints
Index: /issm/trunk/src/m/solutions/cielo/transient3d.m
===================================================================
--- /issm/trunk/src/m/solutions/cielo/transient3d.m	(revision 2332)
+++ /issm/trunk/src/m/solutions/cielo/transient3d.m	(revision 2333)
@@ -93,5 +93,5 @@
 
 	%Compute depth averaged temperature
-	temperature_average=FieldDepthAverage(models.t.elements,models.t.nodes,models.t.loads,models.t.materials,results(n+1).t_g,'temperature');
+	temperature_average=FieldDepthAverage(models.t.elements,models.t.nodes,models.t.loads,models.t.materials,models.t.parameters,results(n+1).t_g,'temperature');
 	inputs=add(inputs,'temperature_average',temperature_average,'doublevec',1,models.t.parameters.numberofnodes);
 
Index: /issm/trunk/src/m/utils/Nightly/nightlyrun.m
===================================================================
--- /issm/trunk/src/m/utils/Nightly/nightlyrun.m	(revision 2332)
+++ /issm/trunk/src/m/utils/Nightly/nightlyrun.m	(revision 2333)
@@ -3,5 +3,5 @@
 %
 %   This function goes to each directory of 'tests/Verifications' and
-%   launch the nightly tests. A list of option can be given in input:
+%   launches the nightly tests. A list of option can be given in input:
 %     o analysis_type: cell containing all the analysis that the user wants to run
 %     o sub_analysis_type: cell containing all the sub_analysis that the user wants to run
Index: /issm/trunk/src/m/utils/Plot/basinzoom.m
===================================================================
--- /issm/trunk/src/m/utils/Plot/basinzoom.m	(revision 2332)
+++ /issm/trunk/src/m/utils/Plot/basinzoom.m	(revision 2333)
@@ -1,3 +1,3 @@
-function varargout=basinzoom(region)
+function varargout=basinzoom(region,unitmultiplier)
 %ANTZOOM - zoom on a basin in Antarctica or Greenland.
 %
@@ -45,4 +45,11 @@
 				%do nothing;
 			end
+		end
+
+		if ~isnan(unitmultiplier)
+			x0=x0*unitmultiplier;
+			x1=x1*unitmultiplier;
+			y0=y0*unitmultiplier;
+			y1=y1*unitmultiplier;
 		end
 
@@ -112,4 +119,5 @@
 	regions=AddAvailableRegion(regions,'icestreams',-1.2274*10^6,-.137*10^6,-1.1172*10^6,-.138*10^6);
 	regions=AddAvailableRegion(regions,'icestreamE',2.2*10^6,2.7*10^6,0,5*10^5);
+	regions=AddAvailableRegion(regions,'jakobshavn',-4.6*10^5,-3*10^5,-2.4*10^6,-2.1*10^6);
 	regions=AddAvailableRegion(regions,'larseniceshelf',-2.3855*10^6,-1.9649*10^6,0.9498*10^6,1.2996*10^6);
 	regions=AddAvailableRegion(regions,'mcmurdo',1.3750*10^5,4.8255*10^5,-1.4569*10^6,-1.1119*10^6);
Index: /issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.cpp
===================================================================
--- /issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.cpp	(revision 2332)
+++ /issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.cpp	(revision 2333)
@@ -24,5 +24,5 @@
 
 	/*Input datasets: */
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
+	FetchData(&nodes,NODES);
 	
 	/*!Generate internal degree of freedom numbers: */
Index: /issm/trunk/src/mex/ComputePressure/ComputePressure.cpp
===================================================================
--- /issm/trunk/src/mex/ComputePressure/ComputePressure.cpp	(revision 2332)
+++ /issm/trunk/src/mex/ComputePressure/ComputePressure.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	ParameterInputs* inputs=NULL;
 	int      numberofnodes;
@@ -28,9 +29,9 @@
         
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
-	FetchData((void**)&numberofnodes,NULL,NULL,mxGetField(PARAMS,0,"numberofnodes"),"Integer",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
 
 	/*!Generate internal degree of freedom numbers: */
@@ -39,8 +40,8 @@
 	inputs->Init(INPUTS);
 
-	UpdateFromInputsx(elements,nodes,loads, materials,inputs);
+	UpdateFromInputsx(elements,nodes,loads, materials,parameters,inputs);
 
 	/*!Generate internal degree of freedom numbers: */
-	ComputePressurex(&p_g, elements,nodes,loads,materials,numberofnodes);
+	ComputePressurex(&p_g, elements,nodes,loads,materials,parameters);
 
 	/*write output datasets: */
@@ -52,4 +53,5 @@
 	delete materials;
 	delete loads;
+	delete parameters;
 	delete inputs;
 	VecFree(&p_g);
Index: /issm/trunk/src/mex/ComputePressure/ComputePressure.h
===================================================================
--- /issm/trunk/src/mex/ComputePressure/ComputePressure.h	(revision 2332)
+++ /issm/trunk/src/mex/ComputePressure/ComputePressure.h	(revision 2333)
@@ -21,5 +21,5 @@
 #define LOADS (mxArray*)prhs[2]
 #define MATERIALS (mxArray*)prhs[3]
-#define PARAMS (mxArray*)prhs[4]
+#define PARAMETERS (mxArray*)prhs[4]
 #define INPUTS (mxArray*)prhs[5]
 
Index: /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.cpp
===================================================================
--- /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.cpp	(revision 2332)
+++ /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* nodes=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 
 	/* output datasets: elements and loads*/
@@ -25,11 +26,12 @@
 	
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTSIN,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	FetchData(&elements,ELEMENTSIN);
+	FetchData(&loads,LOADSIN);
+	FetchData(&nodes,NODES);
+	FetchData(&materials,MATERIALS);
+	FetchData(&parameters,PARAMETERS);
 
 	/*!Configure objects:*/
-	ConfigureObjectsx(elements, loads, nodes, materials);
+	ConfigureObjectsx(elements, loads, nodes, materials,parameters);
 
 	/*write output datasets: */
@@ -37,4 +39,5 @@
 	WriteData(LOADS,loads);
 	WriteData(NODESOUT,nodes);
+	WriteData(PARAMETERSOUT,parameters);
 
 	/*Free ressources: */
@@ -43,4 +46,5 @@
 	delete nodes;
 	delete materials;
+	delete parameters;
 
 	/*end module: */
@@ -51,5 +55,5 @@
 {
 	_printf_("\n");
-	_printf_("   usage: [elements,loads, nodes] = %s(elements,loads,nodes, materials);\n",__FUNCT__);
+	_printf_("   usage: [elements,loads, nodes,parameters] = %s(elements,loads,nodes, materials,parameters);\n",__FUNCT__);
 	_printf_("\n");
 }
Index: /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.h
===================================================================
--- /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.h	(revision 2332)
+++ /issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.h	(revision 2333)
@@ -21,4 +21,5 @@
 #define NODES (mxArray*)prhs[2]
 #define MATERIALS (mxArray*)prhs[3]
+#define PARAMETERS (mxArray*)prhs[4]
 
 /* serial output macros: */
@@ -26,10 +27,11 @@
 #define LOADS (mxArray**)&plhs[1]
 #define NODESOUT (mxArray**)&plhs[2]
+#define PARAMETERSOUT (mxArray**)&plhs[3]
 
 /* serial arg counts: */
 #undef NLHS
-#define NLHS  3
+#define NLHS  4
 #undef NRHS
-#define NRHS  4
+#define NRHS  5
 
 
Index: /issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp
===================================================================
--- /issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp	(revision 2332)
+++ /issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp	(revision 2333)
@@ -59,8 +59,8 @@
 
 	/*Fetch inputs: */
-	FetchData((void**)&index,&nel,NULL,INDEXHANDLE,"Matrix","Mat");
-	FetchData((void**)&x,&nods,NULL,XHANDLE,"Matrix","Mat");
-	FetchData((void**)&y,NULL,NULL,YHANDLE,"Matrix","Mat");
-	FetchData((void**)&edgevalue,NULL,NULL,EDGEVALUEHANDLE,"Integer",NULL);
+	FetchData(&index,&nel,NULL,INDEXHANDLE);
+	FetchData(&x,&nods,NULL,XHANDLE);
+	FetchData(&y,NULL,NULL,YHANDLE);
+	FetchData(&edgevalue,EDGEVALUEHANDLE);
 
 	/*Recover list of contours from the 'contours' structure: */
@@ -94,5 +94,5 @@
 
 	/*Recover  interptype: */
-	FetchData((void**)&interptype,NULL,NULL,INTERPTYPEHANDLE,"String",NULL);
+	FetchData(&interptype,INTERPTYPEHANDLE);
 
 	/*Run interpolation routine: */
Index: /issm/trunk/src/mex/ContourToNodes/ContourToNodes.cpp
===================================================================
--- /issm/trunk/src/mex/ContourToNodes/ContourToNodes.cpp	(revision 2332)
+++ /issm/trunk/src/mex/ContourToNodes/ContourToNodes.cpp	(revision 2333)
@@ -53,7 +53,7 @@
 
 	/*Fetch inputs: */
-	FetchData((void**)&x,&nods,NULL,XHANDLE,"Matrix","Mat");
-	FetchData((void**)&y,NULL,NULL,YHANDLE,"Matrix","Mat");
-	FetchData((void**)&edgevalue,NULL,NULL,EDGEVALUEHANDLE,"Integer",NULL);
+	FetchData(&x,&nods,NULL,XHANDLE);
+	FetchData(&y,NULL,NULL,YHANDLE);
+	FetchData(&edgevalue,EDGEVALUEHANDLE);
 
 	/*Recover list of contours from the 'contours' structure: */
Index: /issm/trunk/src/mex/ControlConstrain/ControlConstrain.cpp
===================================================================
--- /issm/trunk/src/mex/ControlConstrain/ControlConstrain.cpp	(revision 2332)
+++ /issm/trunk/src/mex/ControlConstrain/ControlConstrain.cpp	(revision 2333)
@@ -16,4 +16,5 @@
 	char*    control_type=NULL;
 	int      gsize;
+	DataSet* parameters=NULL;
 
 	/*Boot module: */
@@ -24,8 +25,10 @@
 
 	/*Input datasets: */
-	FetchData((void**)&p_g,&gsize,NULL,PG,"Vector","Vec");
-	FetchData((void**)&mincontrolconstraint,NULL,NULL,mxGetField(PARAMETERS,0,"mincontrolconstraint"),"Scalar",NULL);
-	FetchData((void**)&maxcontrolconstraint,NULL,NULL,mxGetField(PARAMETERS,0,"maxcontrolconstraint"),"Scalar",NULL);
-	FetchData((void**)&control_type,NULL,NULL,mxGetField(PARAMETERS,0,"control_type"),"String",NULL);
+	FetchData(&p_g,&gsize,PG);
+	FetchParams(&parameters,PARAMETERS);
+
+	parameters->FindParam(&mincontrolconstraint,"mincontrolconstraint");
+	parameters->FindParam(&maxcontrolconstraint,"maxcontrolconstraint");
+	parameters->FindParam(&control_type,"control_type");
 
 	/*!Call core code: */
@@ -37,4 +40,5 @@
 	/*Free ressources: */
 	xfree((void**)&control_type);
+	delete parameters;
 
 	/*end module: */
Index: /issm/trunk/src/mex/ControlOptimization/ControlOptimization.cpp
===================================================================
--- /issm/trunk/src/mex/ControlOptimization/ControlOptimization.cpp	(revision 2332)
+++ /issm/trunk/src/mex/ControlOptimization/ControlOptimization.cpp	(revision 2333)
@@ -38,13 +38,13 @@
 
 	/*Input datasets: */
-	FetchData((void**)&function_name,NULL,NULL,FUNCTIONNAME,"String",NULL);
-	FetchData((void**)&xmin,NULL,NULL,XMIN,"Scalar",NULL);
-	FetchData((void**)&xmax,NULL,NULL,XMAX,"Scalar",NULL);
-	FetchData((void**)&tolerance,NULL,NULL,mxGetField(OPTIONS,0,"TolX"),"Scalar",NULL);
-	FetchData((void**)&maxiter,NULL,NULL,mxGetField(OPTIONS,0,"MaxIter"),"Integer",NULL);
+	FetchData(&function_name,FUNCTIONNAME);
+	FetchData(&xmin,XMIN);
+	FetchData(&xmax,XMAX);
+	FetchData(&tolerance,mxGetField(OPTIONS,0,"TolX"));
+	FetchData(&maxiter,mxGetField(OPTIONS,0,"MaxIter"));
 
 	/*Parameters: */
-	FetchData((void**)&cm_jump,NULL,NULL,mxGetField(PARAMETERS,0,"cm_jump"),"Matrix","Mat");
-	FetchData((void**)&n_value,NULL,NULL,STEP,"Integer",NULL);
+	FetchData(&cm_jump,NULL,NULL,mxGetField(PARAMETERS,0,"cm_jump"));
+	FetchData(&n_value,STEP);
 
 	optargs.function_name=function_name;
Index: /issm/trunk/src/mex/Dof/Dof.cpp
===================================================================
--- /issm/trunk/src/mex/Dof/Dof.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Dof/Dof.cpp	(revision 2333)
@@ -26,7 +26,7 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
-	FetchData((void**)&params,NULL,NULL,PARAMS,"DataSet",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODESIN);
+	FetchData(&params,PARAMS);
 
 	/*!Generate internal degree of freedom numbers: */
Index: /issm/trunk/src/mex/Du/Du.cpp
===================================================================
--- /issm/trunk/src/mex/Du/Du.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Du/Du.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	ParameterInputs* inputs=NULL;
 	int               analysis_type;
@@ -30,10 +31,11 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
-	FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
-	FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+	FetchData(&analysis_type,ANALYSIS);
+	FetchData(&sub_analysis_type,SUBANALYSIS);
 
 	/*Fetch inputs: */
@@ -42,5 +44,5 @@
 
 	/*!Call core code: */
-	Dux(&du_g, elements,nodes,loads,materials,inputs,analysis_type,sub_analysis_type);
+	Dux(&du_g, elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type);
 
 	/*write output : */
Index: /issm/trunk/src/mex/Echo/Echo.cpp
===================================================================
--- /issm/trunk/src/mex/Echo/Echo.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Echo/Echo.cpp	(revision 2333)
@@ -20,5 +20,5 @@
 
 	/*Input datasets: */
-	FetchData((void**)&dataset,NULL,NULL,DATASET,"DataSet",NULL);
+	FetchData(&dataset,DATASET);
 
 	/*Echo dataset: */
Index: /issm/trunk/src/mex/ElementConnectivity/ElementConnectivity.cpp
===================================================================
--- /issm/trunk/src/mex/ElementConnectivity/ElementConnectivity.cpp	(revision 2332)
+++ /issm/trunk/src/mex/ElementConnectivity/ElementConnectivity.cpp	(revision 2333)
@@ -23,6 +23,6 @@
         
 	/*Input datasets: */
-	FetchData((void**)&elements,&nel,NULL,ELEMENTS,"Matrix","Mat");
-	FetchData((void**)&nodeconnectivity,&nods,&width,NODECONNECTIVITY,"Matrix","Mat");
+	FetchData(&elements,&nel,NULL,ELEMENTS);
+	FetchData(&nodeconnectivity,&nods,&width,NODECONNECTIVITY);
 
 	/*!Generate internal degree of freedom numbers: */
Index: /issm/trunk/src/mex/FieldDepthAverage/FieldDepthAverage.cpp
===================================================================
--- /issm/trunk/src/mex/FieldDepthAverage/FieldDepthAverage.cpp	(revision 2332)
+++ /issm/trunk/src/mex/FieldDepthAverage/FieldDepthAverage.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	Vec      field=NULL;
 	char*    fieldname=NULL;
@@ -25,13 +26,14 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
-	FetchData((void**)&field,NULL,NULL,FIELD,"Vector",NULL);
-	FetchData((void**)&fieldname,NULL,NULL,FIELDNAME,"String",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+	FetchData(&field,FIELD);
+	FetchData(&fieldname,FIELDNAME);
 
 	/*!Call core code: */
-	FieldDepthAveragex(field,elements,nodes,loads,materials,fieldname);
+	FieldDepthAveragex(field,elements,nodes,loads,materials,parameters,fieldname);
 
 	/*write output : */
@@ -43,4 +45,5 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	VecFree(&field);
 	xfree((void**)&fieldname);
@@ -54,5 +57,5 @@
 {
 	_printf_("\n");
-	_printf_("   usage: [field] = %s(elements, nodes,loads, materials, field,fieldname);\n",__FUNCT__);
+	_printf_("   usage: [field] = %s(elements, nodes,loads, materials, parameters,field,fieldname);\n",__FUNCT__);
 	_printf_("\n");
 }
Index: /issm/trunk/src/mex/FieldDepthAverage/FieldDepthAverage.h
===================================================================
--- /issm/trunk/src/mex/FieldDepthAverage/FieldDepthAverage.h	(revision 2332)
+++ /issm/trunk/src/mex/FieldDepthAverage/FieldDepthAverage.h	(revision 2333)
@@ -21,6 +21,7 @@
 #define LOADS (mxArray*)prhs[2]
 #define MATERIALS (mxArray*)prhs[3]
-#define FIELD (mxArray*)prhs[4]
-#define FIELDNAME (mxArray*)prhs[5]
+#define PARAMETERS (mxArray*)prhs[4]
+#define FIELD (mxArray*)prhs[5]
+#define FIELDNAME (mxArray*)prhs[6]
 
 /* serial output macros: */
@@ -31,5 +32,5 @@
 #define NLHS  1
 #undef NRHS
-#define NRHS  6
+#define NRHS  7
 
 
Index: /issm/trunk/src/mex/FieldExtrude/FieldExtrude.cpp
===================================================================
--- /issm/trunk/src/mex/FieldExtrude/FieldExtrude.cpp	(revision 2332)
+++ /issm/trunk/src/mex/FieldExtrude/FieldExtrude.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	Vec      field=NULL;
 	char*    field_name=NULL;
@@ -26,14 +27,15 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
-	FetchData((void**)&field,NULL,NULL,FIELD,"Vector",NULL);
-	FetchData((void**)&field_name,NULL,NULL,FIELDNAME,"String",NULL);
-	FetchData((void**)&collapse,NULL,NULL,COLLAPSE,"Integer",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+	FetchData(&field,FIELD);
+	FetchData(&field_name,FIELDNAME);
+	FetchData(&collapse,COLLAPSE);
 
 	/*!Call core code: */
-	FieldExtrudex(field,elements,nodes,loads,materials,field_name,collapse);
+	FieldExtrudex(field,elements,nodes,loads,materials,parameters,field_name,collapse);
 
 	/*write output : */
@@ -45,4 +47,5 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	VecFree(&field);
 	xfree((void**)&field_name);
@@ -56,5 +59,5 @@
 {
 	_printf_("\n");
-	_printf_("   usage: [field] = %s(elements, nodes,loads, materials, field, field_name, collapse);\n",__FUNCT__);
+	_printf_("   usage: [field] = %s(elements, nodes,loads, materials, parameters, field, field_name, collapse);\n",__FUNCT__);
 	_printf_("\n");
 }
Index: /issm/trunk/src/mex/FieldExtrude/FieldExtrude.h
===================================================================
--- /issm/trunk/src/mex/FieldExtrude/FieldExtrude.h	(revision 2332)
+++ /issm/trunk/src/mex/FieldExtrude/FieldExtrude.h	(revision 2333)
@@ -21,7 +21,8 @@
 #define LOADS (mxArray*)prhs[2]
 #define MATERIALS (mxArray*)prhs[3]
-#define FIELD (mxArray*)prhs[4]
-#define FIELDNAME (mxArray*)prhs[5]
-#define COLLAPSE (mxArray*)prhs[6]
+#define PARAMETERS (mxArray*)prhs[4]
+#define FIELD (mxArray*)prhs[5]
+#define FIELDNAME (mxArray*)prhs[6]
+#define COLLAPSE (mxArray*)prhs[7]
 
 /* serial output macros: */
@@ -32,5 +33,5 @@
 #define NLHS  1
 #undef NRHS
-#define NRHS  7
+#define NRHS  8
 
 
Index: /issm/trunk/src/mex/Gradj/Gradj.cpp
===================================================================
--- /issm/trunk/src/mex/Gradj/Gradj.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Gradj/Gradj.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	char*    control_type=NULL;
 	ParameterInputs* inputs=NULL;
@@ -32,12 +33,13 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
-	FetchData((void**)&numberofnodes,NULL,NULL,mxGetField(PARAMETERS,0,"numberofnodes"),"Integer",NULL);
-	FetchData((void**)&control_type,NULL,NULL,mxGetField(PARAMETERS,0,"control_type"),"String",NULL);
-	FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
-	FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+	parameters->FindParam(&numberofnodes,"numberofnodes");
+	parameters->FindParam(&control_type,"control_type");
+	FetchData(&analysis_type,ANALYSIS);
+	FetchData(&sub_analysis_type,SUBANALYSIS);
 
 	/*Fetch inputs: */
@@ -46,5 +48,5 @@
 
 	/*!Call core code: */
-	Gradjx(&grad_g,numberofnodes,elements,nodes,loads,materials,inputs,analysis_type,sub_analysis_type,control_type);
+	Gradjx(&grad_g,numberofnodes,elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type,control_type);
 
 	/*write output : */
@@ -56,4 +58,5 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	xfree((void**)&control_type);
 	delete inputs;
Index: /issm/trunk/src/mex/HoleFiller/HoleFiller.cpp
===================================================================
--- /issm/trunk/src/mex/HoleFiller/HoleFiller.cpp	(revision 2332)
+++ /issm/trunk/src/mex/HoleFiller/HoleFiller.cpp	(revision 2333)
@@ -38,6 +38,6 @@
 
 	/*Fetch data: */
-	FetchData((void**)&imagein,&imagein_rows,&imagein_cols,IMAGEIN,"Matrix","Mat");
-	FetchData((void**)&smooth_flag,NULL,NULL,SMOOTH,"Integer",NULL);
+	FetchData(&imagein,&imagein_rows,&imagein_cols,IMAGEIN);
+	FetchData(&smooth_flag,SMOOTH);
 	
 	/*Get smooth flag setup: */
Index: /issm/trunk/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp
===================================================================
--- /issm/trunk/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 2332)
+++ /issm/trunk/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 2333)
@@ -53,10 +53,10 @@
 
 	/*Input datasets: */
-	FetchData((void**)&x,&x_rows,NULL,XHANDLE,"Matrix","Mat");
-	FetchData((void**)&y,&y_rows,NULL,YHANDLE,"Matrix","Mat");
-	FetchData((void**)&data,&data_rows,&data_cols,DATAHANDLE,"Matrix","Mat");
-	FetchData((void**)&x_mesh,&x_mesh_rows,NULL,XMESHHANDLE,"Matrix","Mat");
-	FetchData((void**)&y_mesh,&y_mesh_rows,NULL,YMESHHANDLE,"Matrix","Mat");
-	FetchData((void**)&default_value,NULL,NULL,DEFAULTHANDLE,"Scalar",NULL);
+	FetchData(&x,&x_rows,NULL,XHANDLE);
+	FetchData(&y,&y_rows,NULL,YHANDLE);
+	FetchData(&data,&data_rows,&data_cols,DATAHANDLE);
+	FetchData(&x_mesh,&x_mesh_rows,NULL,XMESHHANDLE);
+	FetchData(&y_mesh,&y_mesh_rows,NULL,YMESHHANDLE);
+	FetchData(&default_value,DEFAULTHANDLE);
 
 	/* Run core computations: */
Index: /issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
===================================================================
--- /issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp	(revision 2332)
+++ /issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp	(revision 2333)
@@ -35,15 +35,15 @@
 
 	/*Input datasets: */
-	FetchData((void**)&index,&nel,NULL,INDEX,"Matrix","Mat");
-	FetchData((void**)&x,&nods,NULL,X,"Matrix","Mat");
-	FetchData((void**)&y,NULL,NULL,Y,"Matrix","Mat");
-	FetchData((void**)&meshdata,&meshdata_length,NULL,MESHDATA,"Matrix","Mat");
-	FetchData((void**)&cornereast,NULL,NULL,CORNEREAST,"Scalar",NULL);
-	FetchData((void**)&cornernorth,NULL,NULL,CORNERNORTH,"Scalar",NULL);
-	FetchData((void**)&xposting,NULL,NULL,XPOSTING,"Scalar",NULL);
-	FetchData((void**)&yposting,NULL,NULL,YPOSTING,"Scalar",NULL);
-	FetchData((void**)&nlines,NULL,NULL,NLINES,"Integer",NULL);
-	FetchData((void**)&ncols,NULL,NULL,NCOLS,"Integer",NULL);
-	FetchData((void**)&default_value,NULL,NULL,DEFAULTVALUE,"Scalar",NULL);
+	FetchData(&index,&nel,NULL,INDEX);
+	FetchData(&x,&nods,NULL,X);
+	FetchData(&y,NULL,NULL,Y);
+	FetchData(&meshdata,&meshdata_length,NULL,MESHDATA);
+	FetchData(&cornereast,CORNEREAST);
+	FetchData(&cornernorth,CORNERNORTH);
+	FetchData(&xposting,XPOSTING);
+	FetchData(&yposting,YPOSTING);
+	FetchData(&nlines,NLINES);
+	FetchData(&ncols,NCOLS);
+	FetchData(&default_value,DEFAULTVALUE);
 
 	/*Call core of computation: */
Index: /issm/trunk/src/mex/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
===================================================================
--- /issm/trunk/src/mex/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp	(revision 2332)
+++ /issm/trunk/src/mex/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp	(revision 2333)
@@ -60,11 +60,11 @@
 
 	/*Input datasets: */
-	FetchData((void**)&index_data,&index_data_rows,NULL,INDEXHANDLE,"Matrix","Mat");
-	FetchData((void**)&x_data,&x_data_rows,NULL,XHANDLE,"Matrix","Mat");
-	FetchData((void**)&y_data,&y_data_rows,NULL,YHANDLE,"Matrix","Mat");
-	FetchData((void**)&data,&data_rows,&data_cols,DATAHANDLE,"Matrix","Mat");
-	FetchData((void**)&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE,"Matrix","Mat");
-	FetchData((void**)&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE,"Matrix","Mat");
-	FetchData((void**)&default_value,NULL,NULL,DEFAULTHANDLE,"Scalar",NULL);
+	FetchData(&index_data,&index_data_rows,NULL,INDEXHANDLE);
+	FetchData(&x_data,&x_data_rows,NULL,XHANDLE);
+	FetchData(&y_data,&y_data_rows,NULL,YHANDLE);
+	FetchData(&data,&data_rows,&data_cols,DATAHANDLE);
+	FetchData(&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE);
+	FetchData(&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE);
+	FetchData(&default_value,DEFAULTHANDLE);
 
 	/*some checks*/
Index: /issm/trunk/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
===================================================================
--- /issm/trunk/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 2332)
+++ /issm/trunk/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp	(revision 2333)
@@ -64,13 +64,13 @@
 
 	/*Input datasets: */
-	FetchData((void**)&index_data,&index_data_rows,NULL,INDEXHANDLE,"Matrix","Mat");
-	FetchData((void**)&x_data,&x_data_rows,NULL,XHANDLE,"Matrix","Mat");
-	FetchData((void**)&y_data,&y_data_rows,NULL,YHANDLE,"Matrix","Mat");
-	FetchData((void**)&z_data,&z_data_rows,NULL,ZHANDLE,"Matrix","Mat");
-	FetchData((void**)&data,&data_rows,&data_cols,DATAHANDLE,"Matrix","Mat");
-	FetchData((void**)&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE,"Matrix","Mat");
-	FetchData((void**)&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE,"Matrix","Mat");
-	FetchData((void**)&z_prime,&z_prime_rows,NULL,ZPRIMEHANDLE,"Matrix","Mat");
-	FetchData((void**)&default_value,NULL,NULL,DEFAULTHANDLE,"Scalar",NULL);
+	FetchData(&index_data,&index_data_rows,NULL,INDEXHANDLE);
+	FetchData(&x_data,&x_data_rows,NULL,XHANDLE);
+	FetchData(&y_data,&y_data_rows,NULL,YHANDLE);
+	FetchData(&z_data,&z_data_rows,NULL,ZHANDLE);
+	FetchData(&data,&data_rows,&data_cols,DATAHANDLE);
+	FetchData(&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE);
+	FetchData(&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE);
+	FetchData(&z_prime,&z_prime_rows,NULL,ZPRIMEHANDLE);
+	FetchData(&default_value,DEFAULTHANDLE);
 
 	/*some checks*/
Index: /issm/trunk/src/mex/Makefile.am
===================================================================
--- /issm/trunk/src/mex/Makefile.am	(revision 2332)
+++ /issm/trunk/src/mex/Makefile.am	(revision 2333)
@@ -32,5 +32,4 @@
 				Orth\
 				OutputRifts\
-				ParamsToWorkspace\
 				PenaltyConstraints\
 				PenaltySystemMatrices\
@@ -165,7 +164,4 @@
 			  OutputRifts/OutputRifts.h
 
-ParamsToWorkspace_SOURCES = ParamsToWorkspace/ParamsToWorkspace.cpp\
-			  ParamsToWorkspace/ParamsToWorkspace.h
-
 PenaltyConstraints_SOURCES = PenaltyConstraints/PenaltyConstraints.cpp\
 			  PenaltyConstraints/PenaltyConstraints.h
Index: /issm/trunk/src/mex/MassFlux/MassFlux.cpp
===================================================================
--- /issm/trunk/src/mex/MassFlux/MassFlux.cpp	(revision 2332)
+++ /issm/trunk/src/mex/MassFlux/MassFlux.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	double*  segments=NULL;
 	int      num_segments;
@@ -30,17 +31,16 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
-
-	/*parameters: */
-	FetchData((void**)&segments,&num_segments,NULL,mxGetField(PARAMETERS,0,"qmu_mass_flux_segments"),"Matrix","Mat");
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+	parameters->FindParam(&segments,&num_segments,NULL,"qmu_mass_flux_segments");
 
 	/*results: */
-	FetchData((void**)&ug,NULL,NULL,UG,"Matrix","Mat");
+	FetchData(&ug,NULL,NULL,UG);
 
 	/*!Compute mass flux along the profile: */
-	MassFluxx(&mass_flux, elements,nodes,loads,materials,segments,num_segments,ug);
+	MassFluxx(&mass_flux, elements,nodes,loads,materials,parameters,segments,num_segments,ug);
 
 	/*write output datasets: */
@@ -52,4 +52,5 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	xfree((void**)&ug);
 
Index: /issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.cpp
===================================================================
--- /issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.cpp	(revision 2333)
@@ -26,7 +26,7 @@
 
 	/*Input datasets: */
-	FetchData((void**)&uf,NULL,NULL,UF,"Vector",NULL);
-	FetchData((void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);
-	FetchData((void**)&ys,NULL,NULL,YS,"Vector",NULL);
+	FetchData(&uf,UF);
+	FetchData(&Gmn,GMN);
+	FetchData(&ys,YS);
 	FetchNodeSets(&nodesets,NODESETS);
 
Index: /issm/trunk/src/mex/MeshPartition/MeshPartition.cpp
===================================================================
--- /issm/trunk/src/mex/MeshPartition/MeshPartition.cpp	(revision 2332)
+++ /issm/trunk/src/mex/MeshPartition/MeshPartition.cpp	(revision 2333)
@@ -57,8 +57,8 @@
 
 	/*Fetch data: */
-	FetchData((void**)&meshtype,NULL,NULL,mxGetField(MODEL,0,"type"),"String",NULL);
-	FetchData((void**)&numberofelements,NULL,NULL,mxGetField(MODEL,0,"numberofelements"),"Integer",NULL);
-	FetchData((void**)&numberofgrids,NULL,NULL,mxGetField(MODEL,0,"numberofgrids"),"Integer",NULL);
-	FetchData((void**)&elements,NULL,&elements_width,mxGetField(MODEL,0,"elements"),"Matrix","Mat");
+	FetchData(&meshtype,mxGetField(MODEL,0,"type"));
+	FetchData(&numberofelements,mxGetField(MODEL,0,"numberofelements"));
+	FetchData(&numberofgrids,mxGetField(MODEL,0,"numberofgrids"));
+	FetchData(&elements,NULL,&elements_width,mxGetField(MODEL,0,"elements"));
 
 	
@@ -66,11 +66,11 @@
 	if (strcmp(meshtype,"3d")==0){
 	
-		FetchData((void**)&numberofelements2d,NULL,NULL,mxGetField(MODEL,0,"numberofelements2d"),"Integer",NULL);
-		FetchData((void**)&numberofgrids2d,NULL,NULL,mxGetField(MODEL,0,"numberofgrids2d"),"Integer",NULL);
-		FetchData((void**)&elements2d,NULL,NULL,mxGetField(MODEL,0,"elements2d"),"Matrix","Mat");
+		FetchData(&numberofelements2d,mxGetField(MODEL,0,"numberofelements2d"));
+		FetchData(&numberofgrids2d,mxGetField(MODEL,0,"numberofgrids2d"));
+		FetchData(&elements2d,NULL,NULL,mxGetField(MODEL,0,"elements2d"));
 
 	}
-	FetchData((void**)&numlayers,NULL,NULL,mxGetField(MODEL,0,"numlayers"),"Integer",NULL);
-	FetchData((void**)&numareas,NULL,NULL,NUMAREAS,"Integer",NULL);
+	FetchData(&numlayers,mxGetField(MODEL,0,"numlayers"));
+	FetchData(&numareas,NUMAREAS);
 
 	/*Run partitioning algorithm based on a "clever" use of the Metis partitioner: */
Index: /issm/trunk/src/mex/Misfit/Misfit.cpp
===================================================================
--- /issm/trunk/src/mex/Misfit/Misfit.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Misfit/Misfit.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	ParameterInputs* inputs=NULL;
 	int               analysis_type;
@@ -29,10 +30,11 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
-	FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
-	FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+	FetchData(&analysis_type,ANALYSIS);
+	FetchData(&sub_analysis_type,SUBANALYSIS);
 
 	/*Fetch inputs: */
@@ -41,5 +43,5 @@
 
 	/*!Call core code: */
-	Misfitx(&J, elements,nodes,loads,materials,inputs,analysis_type,sub_analysis_type);
+	Misfitx(&J, elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type);
 
 	/*write output : */
@@ -51,4 +53,5 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	delete inputs;
 
Index: /issm/trunk/src/mex/MpcNodes/MpcNodes.cpp
===================================================================
--- /issm/trunk/src/mex/MpcNodes/MpcNodes.cpp	(revision 2332)
+++ /issm/trunk/src/mex/MpcNodes/MpcNodes.cpp	(revision 2333)
@@ -25,6 +25,6 @@
 
 	/*Input datasets: */
-	FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
-	FetchData((void**)&constraints,NULL,NULL,CONSTRAINTS,"DataSet",NULL);
+	FetchData(&nodes,NODESIN);
+	FetchData(&constraints,CONSTRAINTS);
 
 	/*!Generate internal degree of freedom numbers: */
Index: /issm/trunk/src/mex/NodeConnectivity/NodeConnectivity.cpp
===================================================================
--- /issm/trunk/src/mex/NodeConnectivity/NodeConnectivity.cpp	(revision 2332)
+++ /issm/trunk/src/mex/NodeConnectivity/NodeConnectivity.cpp	(revision 2333)
@@ -22,6 +22,6 @@
         
 	/*Input datasets: */
-	FetchData((void**)&elements,&nel,NULL,ELEMENTS,"Matrix","Mat");
-	FetchData((void**)&nods,NULL,NULL,NUMNODES,"Integer",NULL);
+	FetchData(&elements,&nel,NULL,ELEMENTS);
+	FetchData(&nods,NUMNODES);
 
 	/*!Generate internal degree of freedom numbers: */
Index: /issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.cpp
===================================================================
--- /issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.cpp	(revision 2332)
+++ /issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.cpp	(revision 2333)
@@ -25,5 +25,5 @@
 	/*Input datasets: */
 	FetchNodeSets(&nodesets,NODESETS);
-	FetchData((void**)&Rmg,NULL,NULL,RMG,"Matrix",NULL);
+	FetchData(&Rmg,RMG);
 
 	/*!Generate internal degree of freedom numbers: */
Index: /issm/trunk/src/mex/Orth/Orth.cpp
===================================================================
--- /issm/trunk/src/mex/Orth/Orth.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Orth/Orth.cpp	(revision 2333)
@@ -24,6 +24,6 @@
 
 	/*Input datasets: */
-	FetchData((void**)&gradj,NULL,NULL,GRADJ,"Vector",NULL);
-	FetchData((void**)&oldgradj,NULL,NULL,OLDGRADJ,"Vector",NULL);
+	FetchData(&gradj,GRADJ);
+	FetchData(&oldgradj,OLDGRADJ);
 
 	/*!Reduce load from g to f size: */
Index: /issm/trunk/src/mex/OutputRifts/OutputRifts.cpp
===================================================================
--- /issm/trunk/src/mex/OutputRifts/OutputRifts.cpp	(revision 2332)
+++ /issm/trunk/src/mex/OutputRifts/OutputRifts.cpp	(revision 2333)
@@ -25,6 +25,6 @@
 
 	/*Input datasets: */
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&numrifts,NULL,NULL,mxGetField(PARAMETERS,0,"numrifts"),"Integer",NULL);
+	FetchData(&loads,LOADS);
+	FetchData(&numrifts,mxGetField(PARAMETERS,0,"numrifts"));
 
 	/*!Call core code: */
Index: /issm/trunk/src/mex/ParameterOutput/ParameterOutput.cpp
===================================================================
--- /issm/trunk/src/mex/ParameterOutput/ParameterOutput.cpp	(revision 2332)
+++ /issm/trunk/src/mex/ParameterOutput/ParameterOutput.cpp	(revision 2333)
@@ -31,13 +31,13 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
-	FetchData((void**)&results,NULL,NULL,RESULTS,"DataSet",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchData(&results,RESULTS);
 	
 	/*parameters: */
-	FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
-	FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
+	FetchData(&analysis_type,ANALYSIS);
+	FetchData(&sub_analysis_type,SUBANALYSIS);
 
 	/*Fetch inputs: */
Index: /issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.cpp
===================================================================
--- /issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.cpp	(revision 2332)
+++ /issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	ParameterInputs* inputs=NULL;
 	int               analysis_type;
@@ -30,12 +31,13 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADSIN);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
 
 	/*parameters: */
-	FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
-	FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
+	FetchData(&analysis_type,ANALYSIS);
+	FetchData(&sub_analysis_type,SUBANALYSIS);
 
 	/*Fetch inputs: */
@@ -44,5 +46,5 @@
 
 	/*!Generate internal degree of freedom numbers: */
-	PenaltyConstraintsx(&converged, &num_unstable_constraints, elements,nodes,loads,materials,inputs,analysis_type,sub_analysis_type); 
+	PenaltyConstraintsx(&converged, &num_unstable_constraints, elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type); 
 
 	/*write output datasets: */
@@ -57,4 +59,5 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	delete inputs;
 
Index: /issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.cpp
===================================================================
--- /issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.cpp	(revision 2332)
+++ /issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.cpp	(revision 2333)
@@ -20,4 +20,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	int         kflag,pflag;
 	ParameterInputs* inputs=NULL;
@@ -32,15 +33,17 @@
 
 	/*Input datasets: */
-	FetchData((void**)&Kgg,NULL,NULL,KGGIN,"Matrix",NULL);
-	FetchData((void**)&pg,NULL,NULL,PGIN,"Vector",NULL);
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	FetchData(&Kgg,KGGIN);
+	FetchData(&pg,PGIN);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+	
 	/*parameters: */
-	FetchData((void**)&kflag,NULL,NULL,mxGetField(PARAMETERS,0,"kflag"),"Integer",NULL);
-	FetchData((void**)&pflag,NULL,NULL,mxGetField(PARAMETERS,0,"pflag"),"Integer",NULL);
-	FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
-	FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
+	parameters->FindParam(&kflag,"kflag");
+	parameters->FindParam(&pflag,"pflag");
+	FetchData(&analysis_type,ANALYSIS);
+	FetchData(&sub_analysis_type,SUBANALYSIS);
 
 	/*Fetch inputs: */
@@ -49,5 +52,5 @@
 
 	/*!Generate stiffnesses from penalties: */
-	PenaltySystemMatricesx(Kgg, pg,&kmax,elements,nodes,loads,materials,kflag,pflag,inputs,analysis_type,sub_analysis_type); 
+	PenaltySystemMatricesx(Kgg, pg,&kmax,elements,nodes,loads,materials,parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type); 
 
 	/*write output datasets: */
@@ -61,4 +64,5 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	delete inputs;
 	MatFree(&Kgg);
Index: /issm/trunk/src/mex/ProcessParams/ProcessParams.cpp
===================================================================
--- /issm/trunk/src/mex/ProcessParams/ProcessParams.cpp	(revision 2332)
+++ /issm/trunk/src/mex/ProcessParams/ProcessParams.cpp	(revision 2333)
@@ -21,9 +21,10 @@
 
 	/*Input datasets: */
-	FetchData((void**)&parameters,NULL,NULL,PARAMETERSIN,"DataSet",NULL);
-	FetchData((void**)&partition,NULL,NULL,PARTITION,"Vector",NULL);
+	FetchData(&parameters,PARAMETERSIN);
+	FetchData(&partition,PARTITION);
 
 	/*Shit partition: */
 	if(partition)VecShift(partition,-1.0);
+
 
 	/*!Generate internal degree of freedom numbers: */
@@ -31,5 +32,5 @@
 
 	/*write output datasets: */
-	WriteData(PARAMETERSOUT,parameters);
+	WriteParams(PARAMETERSOUT,parameters);
 
 	/*Free ressources: */
Index: /issm/trunk/src/mex/Qmu/Qmu.cpp
===================================================================
--- /issm/trunk/src/mex/Qmu/Qmu.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Qmu/Qmu.cpp	(revision 2333)
@@ -41,9 +41,9 @@
 	inputs=INPUTS;
 	
-	FetchData((void**)&analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"analysis_type"),"Integer",NULL);
-	FetchData((void**)&sub_analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"sub_analysis_type"),"Integer",NULL);
-	FetchData((void**)&dakota_input_file,NULL,NULL,mxGetField(PARAMETERS,0,"qmuinname"),"String",NULL);
-	FetchData((void**)&dakota_output_file,NULL,NULL,mxGetField(PARAMETERS,0,"qmuoutname"),"String",NULL);
-	FetchData((void**)&dakota_error_file,NULL,NULL,mxGetField(PARAMETERS,0,"qmuerrname"),"String",NULL);
+	FetchData(&analysis_type,mxGetField(PARAMETERS,0,"analysis_type"));
+	FetchData(&sub_analysis_type,mxGetField(PARAMETERS,0,"sub_analysis_type"));
+	FetchData(&dakota_input_file,mxGetField(PARAMETERS,0,"qmuinname"));
+	FetchData(&dakota_output_file,mxGetField(PARAMETERS,0,"qmuoutname"));
+	FetchData(&dakota_error_file,mxGetField(PARAMETERS,0,"qmuerrname"));
 
 	/*!Generate internal degree of freedom numbers: */
Index: /issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.cpp
===================================================================
--- /issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.cpp	(revision 2333)
@@ -27,8 +27,8 @@
 
 	/*Input datasets: */
-	FetchData((void**)&pg,NULL,NULL,PG,"Vector",NULL);
-	FetchData((void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);
-	FetchData((void**)&Kfs,NULL,NULL,KFS,"Matrix",NULL);
-	FetchData((void**)&ys,NULL,NULL,YS,"Vector",NULL);
+	FetchData(&pg,PG);
+	FetchData(&Gmn,GMN);
+	FetchData(&Kfs,KFS);
+	FetchData(&ys,YS);
 	FetchNodeSets(&nodesets,NODESETS);
 
Index: /issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.cpp
===================================================================
--- /issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.cpp	(revision 2333)
@@ -26,6 +26,6 @@
 
 	/*Input datasets: */
-	FetchData((void**)&Kgg,NULL,NULL,KGG,"Matrix",NULL);
-	FetchData((void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);
+	FetchData(&Kgg,KGG);
+	FetchData(&Gmn,GMN);
 	FetchNodeSets(&nodesets,NODESETS);
 
Index: /issm/trunk/src/mex/Reducevectorgtof/Reducevectorgtof.cpp
===================================================================
--- /issm/trunk/src/mex/Reducevectorgtof/Reducevectorgtof.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Reducevectorgtof/Reducevectorgtof.cpp	(revision 2333)
@@ -24,5 +24,5 @@
 
 	/*Input datasets: */
-	FetchData((void**)&ug,NULL,NULL,UG,"Vector",NULL);
+	FetchData(&ug,UG);
 	FetchNodeSets(&nodesets,NODESETS);
 
Index: /issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.cpp
===================================================================
--- /issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.cpp	(revision 2333)
@@ -25,5 +25,5 @@
 
 	/*Input datasets: */
-	FetchData((void**)&yg,NULL,NULL,YG,"Vector",NULL);
+	FetchData(&yg,YG);
 	FetchNodeSets(&nodesets,NODESETS);
 
Index: /issm/trunk/src/mex/SetStructureField/SetStructureField.cpp
===================================================================
--- /issm/trunk/src/mex/SetStructureField/SetStructureField.cpp	(revision 2332)
+++ /issm/trunk/src/mex/SetStructureField/SetStructureField.cpp	(revision 2333)
@@ -59,8 +59,8 @@
 
 	/*Get name in array.name: */
-	FetchData((void**)&name,NULL,NULL,NAMEHANDLE,"String",NULL);
+	FetchData(&name,NAMEHANDLE);
 
 	/*Get field in array.field: */
-	FetchData((void**)&field,NULL,NULL,FIELDHANDLE,"String",NULL);
+	FetchData(&field,FIELDHANDLE);
 
 	/*Branch out on type of value: */
@@ -68,5 +68,5 @@
 
 		/*Get string store in the value mxArray: */
-		FetchData((void**)&string,NULL,NULL,VALUEHANDLE,"String",NULL);
+		FetchData(&string,VALUEHANDLE);
 
 		/*Start looping on output array: */
Index: /issm/trunk/src/mex/Solver/Solver.cpp
===================================================================
--- /issm/trunk/src/mex/Solver/Solver.cpp	(revision 2332)
+++ /issm/trunk/src/mex/Solver/Solver.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	Vec uf0=NULL;
 	char* solver_string=NULL;
+	DataSet* parameters=NULL;
 
 	/* output datasets: */
@@ -26,8 +27,9 @@
 
 	/*Input datasets: */
-	FetchData((void**)&Kff,NULL,NULL,KFF,"Matrix",NULL); 
-	FetchData((void**)&pf,NULL,NULL,PF,"Vector",NULL);
-	FetchData((void**)&uf0,NULL,NULL,UF0,"Vector",NULL);
-	FetchData((void**)&solver_string,NULL,NULL,mxGetField(PARAMS,0,"solverstring"),"String",NULL);
+	FetchData(&Kff,KFF);
+	FetchData(&pf,PF);
+	FetchData(&uf0,UF0);
+	FetchParams(&parameters,PARAMETERS);
+	parameters->FindParam(&solver_string,"solver_string");
 
 	/*!Reduce vector: */
@@ -43,4 +45,5 @@
 	VecFree(&uf);
 	xfree((void**)&solver_string);
+	delete parameters;
 
 	/*end module: */
Index: /issm/trunk/src/mex/Solver/Solver.h
===================================================================
--- /issm/trunk/src/mex/Solver/Solver.h	(revision 2332)
+++ /issm/trunk/src/mex/Solver/Solver.h	(revision 2333)
@@ -20,5 +20,5 @@
 #define PF (mxArray*)prhs[1]
 #define UF0 (mxArray*)prhs[2]
-#define PARAMS (mxArray*)prhs[3]
+#define PARAMETERS (mxArray*)prhs[3]
 
 /* serial output macros: */
Index: /issm/trunk/src/mex/SpcNodes/SpcNodes.cpp
===================================================================
--- /issm/trunk/src/mex/SpcNodes/SpcNodes.cpp	(revision 2332)
+++ /issm/trunk/src/mex/SpcNodes/SpcNodes.cpp	(revision 2333)
@@ -25,6 +25,6 @@
 
 	/*Input datasets: */
-	FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
-	FetchData((void**)&constraints,NULL,NULL,CONSTRAINTS,"DataSet",NULL);
+	FetchData(&nodes,NODESIN);
+	FetchData(&constraints,CONSTRAINTS);
 	
 	/*!Generate internal degree of freedom numbers: */
Index: /issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp
===================================================================
--- /issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp	(revision 2332)
+++ /issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	int         kflag,pflag;
 	int         connectivity;
@@ -33,15 +34,18 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+
 	/*parameters: */
-	FetchData((void**)&kflag,NULL,NULL,mxGetField(PARAMETERS,0,"kflag"),"Integer",NULL);
-	FetchData((void**)&pflag,NULL,NULL,mxGetField(PARAMETERS,0,"pflag"),"Integer",NULL);
-	FetchData((void**)&connectivity,NULL,NULL,mxGetField(PARAMETERS,0,"connectivity"),"Integer",NULL);
-	FetchData((void**)&numberofdofspernode,NULL,NULL,mxGetField(PARAMETERS,0,"numberofdofspernode"),"Integer",NULL);
-	FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
-	FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
+	parameters->FindParam(&kflag,"kflag");
+	parameters->FindParam(&pflag,"pflag");
+	parameters->FindParam(&connectivity,"connectivity");
+	parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
+
+	FetchData(&analysis_type,ANALYSIS);
+	FetchData(&sub_analysis_type,SUBANALYSIS);
 
 	/*Fetch inputs: */
@@ -50,5 +54,5 @@
 
 	/*!Generate internal degree of freedom numbers: */
-	SystemMatricesx(&Kgg, &pg,elements,nodes,loads,materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
+	SystemMatricesx(&Kgg, &pg,elements,nodes,loads,materials,parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 
 
 	/*write output datasets: */
@@ -62,4 +66,5 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	delete inputs;
 	MatFree(&Kgg);
Index: /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.cpp
===================================================================
--- /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.cpp	(revision 2332)
+++ /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	ParameterInputs* inputs=NULL;
 
@@ -22,18 +23,19 @@
 	/*checks on arguments on the matlab side: */
 	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&UpdateFromInputsUsage);
-
+	
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTSIN,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALSIN,"DataSet",NULL);
-
+	FetchData(&elements,ELEMENTSIN);
+	FetchData(&nodes,NODESIN);
+	FetchData(&loads,LOADSIN);
+	FetchData(&materials,MATERIALSIN);
+	FetchParams(&parameters,PARAMETERSIN);
+	
 	/*Fetch inputs: */
 	inputs=new ParameterInputs;
 	inputs->Init(INPUTS);
-
+	
 	/*!Generate internal degree of freedom numbers: */
-	UpdateFromInputsx(elements,nodes,loads, materials,inputs);
-
+	UpdateFromInputsx(elements,nodes,loads, materials,parameters,inputs);
+	
 	/*write output datasets: */
 	WriteData(ELEMENTS,elements);
@@ -41,5 +43,6 @@
 	WriteData(LOADS,loads);
 	WriteData(MATERIALS,materials);
-
+	WriteParams(PARAMETERS,parameters);
+	
 	/*Free ressources: */
 	delete elements;
@@ -47,6 +50,7 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	delete inputs;
-
+	
 	/*end module: */
 	MODULEEND();
@@ -56,5 +60,5 @@
 {
 	_printf_("\n");
-	_printf_("   usage: [elements,nodes,loads, materials] = %s(elements,nodes,loads, materials,inputs);\n",__FUNCT__);
+	_printf_("   usage: [elements,nodes,loads, materials, parameters] = %s(elements,nodes,loads, materials,parameters,inputs);\n",__FUNCT__);
 	_printf_("\n");
 }
Index: /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.h
===================================================================
--- /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.h	(revision 2332)
+++ /issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.h	(revision 2333)
@@ -21,5 +21,6 @@
 #define LOADSIN (mxArray*)prhs[2]
 #define MATERIALSIN (mxArray*)prhs[3]
-#define INPUTS (mxArray*)prhs[4]
+#define PARAMETERSIN (mxArray*)prhs[4]
+#define INPUTS (mxArray*)prhs[5]
 
 /* serial output macros: */
@@ -28,10 +29,11 @@
 #define LOADS (mxArray**)&plhs[2]
 #define MATERIALS (mxArray**)&plhs[3]
+#define PARAMETERS (mxArray**)&plhs[4]
 
 /* serial arg counts: */
 #undef NLHS
-#define NLHS  4
+#define NLHS  5
 #undef NRHS
-#define NRHS  5
+#define NRHS  6
 
 
Index: /issm/trunk/src/mex/UpdateGeometry/UpdateGeometry.cpp
===================================================================
--- /issm/trunk/src/mex/UpdateGeometry/UpdateGeometry.cpp	(revision 2332)
+++ /issm/trunk/src/mex/UpdateGeometry/UpdateGeometry.cpp	(revision 2333)
@@ -15,4 +15,5 @@
 	DataSet* loads=NULL;
 	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
 	Vec      newthickness=NULL;
 	Vec      bed=NULL;
@@ -31,15 +32,16 @@
         
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
 	
-	FetchData((void**)&newthickness,NULL,NULL,NEWTHICKNESS,"Vector",NULL);
-	FetchData((void**)&bed,NULL,NULL,BED,"Vector",NULL);
-	FetchData((void**)&surface,NULL,NULL,SURFACE,"Vector",NULL);
+	FetchData(&newthickness,NEWTHICKNESS);
+	FetchData(&bed,BED);
+	FetchData(&surface,SURFACE);
 
 	/*!Generate internal degree of freedom numbers: */
-	UpdateGeometryx(&outthickness,&outbed,&outsurface, elements, nodes,loads, materials, newthickness,bed,surface);
+	UpdateGeometryx(&outthickness,&outbed,&outsurface, elements, nodes,loads, materials, parameters,newthickness,bed,surface);
 
 	/*write output data: */
@@ -53,4 +55,5 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	VecFree(&newthickness);
 	VecFree(&bed);
@@ -66,5 +69,5 @@
 void UpdateGeometryUsage(void) {
 	_printf_("\n");
-	_printf_("   usage: [outthickness,outbed,outsrface] = %s(elements, nodes, materials, params,newthickness,bed,surface);\n",__FUNCT__);
+	_printf_("   usage: [outthickness,outbed,outsrface] = %s(elements, nodes, materials, parameters,newthickness,bed,surface);\n",__FUNCT__);
 	_printf_("\n");
 }
Index: /issm/trunk/src/mex/UpdateNodePositions/UpdateNodePositions.cpp
===================================================================
--- /issm/trunk/src/mex/UpdateNodePositions/UpdateNodePositions.cpp	(revision 2332)
+++ /issm/trunk/src/mex/UpdateNodePositions/UpdateNodePositions.cpp	(revision 2333)
@@ -14,5 +14,6 @@
 	DataSet* nodes=NULL;
 	DataSet* loads=NULL;
-	DataSet* materials=NULL;
+	DataSet* materials=NULL; 
+	DataSet* parameters=NULL;
 	Vec      thickness=NULL;
 	Vec      bed=NULL;
@@ -25,13 +26,14 @@
 
 	/*Input datasets: */
-	FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
-	FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
-	FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
-	FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
-	FetchData((void**)&thickness,NULL,NULL,THICKNESS,"Vector",NULL);
-	FetchData((void**)&bed,NULL,NULL,BED,"Vector",NULL);
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+	FetchData(&thickness,THICKNESS);
+	FetchData(&bed,BED);
 	
 	/*!Generate internal degree of freedom numbers: */
-	UpdateNodePositionsx(elements,nodes,loads, materials,thickness,bed);
+	UpdateNodePositionsx(elements,nodes,loads, materials,parameters,thickness,bed);
 
 	/*write output datasets: */
@@ -43,4 +45,5 @@
 	delete loads;
 	delete materials;
+	delete parameters;
 	VecFree(&thickness);
 	VecFree(&bed);
@@ -53,5 +56,5 @@
 {
 	_printf_("\n");
-	_printf_("   usage: [elements,nodes,loads, materials] = %s(elements,nodes,loads, materials,inputs);\n",__FUNCT__);
+	_printf_("   usage: [elements,nodes,loads, materials] = %s(elements,nodes,loads, materials,parameters, inputs);\n",__FUNCT__);
 	_printf_("\n");
 }
Index: /issm/trunk/src/mex/UpdateNodePositions/UpdateNodePositions.h
===================================================================
--- /issm/trunk/src/mex/UpdateNodePositions/UpdateNodePositions.h	(revision 2332)
+++ /issm/trunk/src/mex/UpdateNodePositions/UpdateNodePositions.h	(revision 2333)
@@ -21,6 +21,7 @@
 #define LOADS (mxArray*)prhs[2]
 #define MATERIALS (mxArray*)prhs[3]
-#define BED (mxArray*)prhs[4]
-#define THICKNESS (mxArray*)prhs[5]
+#define PARAMETERS (mxArray*)prhs[4]
+#define BED (mxArray*)prhs[5]
+#define THICKNESS (mxArray*)prhs[6]
 	
 /* serial output macros: */
@@ -31,5 +32,5 @@
 #define NLHS  1
 #undef NRHS
-#define NRHS  6
+#define NRHS  7
 
 
