Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 5357)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 5358)
@@ -221,5 +221,5 @@
 	ResetPenaltiesEnum,
 	RheologyBEnum,
-	RheologyB2dEnum,
+	RheologyBbarEnum,
 	RheologyNEnum,
 	SegmentOnIceShelfEnum,
Index: /issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp	(revision 5357)
+++ /issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp	(revision 5358)
@@ -16,5 +16,5 @@
 		case DragCoefficientEnum : return "drag_coefficient";
 		case RheologyBEnum : return "rheology_B";
-		case RheologyB2dEnum : return "rheology_B";
+		case RheologyBbarEnum : return "rheology_B";
 		default : ISSMERROR("No model field is associated to enum %s",EnumToString(en));
 	}
Index: /issm/trunk/src/c/EnumDefinitions/EnumToString.cpp
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumToString.cpp	(revision 5357)
+++ /issm/trunk/src/c/EnumDefinitions/EnumToString.cpp	(revision 5358)
@@ -195,5 +195,5 @@
 		case ResetPenaltiesEnum : return "ResetPenalties";
 		case RheologyBEnum : return "RheologyB";
-		case RheologyB2dEnum : return "RheologyB2d";
+		case RheologyBbarEnum : return "RheologyBbar";
 		case RheologyNEnum : return "RheologyN";
 		case SegmentOnIceShelfEnum : return "SegmentOnIceShelf";
Index: /issm/trunk/src/c/EnumDefinitions/StringToEnum.cpp
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/StringToEnum.cpp	(revision 5357)
+++ /issm/trunk/src/c/EnumDefinitions/StringToEnum.cpp	(revision 5358)
@@ -193,5 +193,5 @@
 	else if (strcmp(name,"ResetPenalties")==0) return ResetPenaltiesEnum;
 	else if (strcmp(name,"RheologyB")==0) return RheologyBEnum;
-	else if (strcmp(name,"RheologyB2d")==0) return RheologyB2dEnum;
+	else if (strcmp(name,"RheologyBbar")==0) return RheologyBbarEnum;
 	else if (strcmp(name,"RheologyN")==0) return RheologyNEnum;
 	else if (strcmp(name,"SegmentOnIceShelf")==0) return SegmentOnIceShelfEnum;
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/UpdateElementsBalancedthickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/UpdateElementsBalancedthickness.cpp	(revision 5357)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/UpdateElementsBalancedthickness.cpp	(revision 5358)
@@ -39,6 +39,6 @@
 		IoModelFetchData(&iomodel->thickness_obs,NULL,NULL,iomodel_handle,"thickness_obs");
 		IoModelFetchData(&iomodel->weights,NULL,NULL,iomodel_handle,"weights");
-		if(strcmp(iomodel->control_type,"dhdt")==0){
-			IoModelFetchData(&iomodel->control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type); //copy the control parameter in iomodel
+		if(iomodel->control_type==DhDtEnum){
+			IoModelFetchData(&iomodel->control_parameter,NULL,NULL,iomodel_handle,EnumToModelField(iomodel->control_type)); //copy the control parameter in iomodel
 		}
 	}
Index: /issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 5357)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 5358)
@@ -26,15 +26,9 @@
 
 		/*What control type?*/
-		if (strcmp(iomodel->control_type,"drag_coefficient")==0){
-			parameters->AddObject(new IntParam(ControlTypeEnum,DragCoefficientEnum));
-		}
-		else  if (strcmp(iomodel->control_type,"rheology_B")==0){
-			parameters->AddObject(new IntParam(ControlTypeEnum,RheologyB2dEnum));
-		}
-		else  if (strcmp(iomodel->control_type,"dhdt")==0){
-			parameters->AddObject(new IntParam(ControlTypeEnum,DhDtEnum));
+		if (iomodel->control_type!=DragCoefficientEnum && iomodel->control_type!=RheologyBbarEnum &&  iomodel->control_type!=DhDtEnum){
+			ISSMERROR("control_type %s not supported yet!",EnumToString(iomodel->control_type));
 		}
 		else{
-			ISSMERROR("control_type %s not supported yet!",iomodel->control_type);
+			parameters->AddObject(new IntParam(ControlTypeEnum,iomodel->control_type));
 		}
 
@@ -75,5 +69,5 @@
 		xfree((void**)&iomodel->maxiter);
 
-		IoModelFetchData(&control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type);
+		IoModelFetchData(&control_parameter,NULL,NULL,iomodel_handle,EnumToModelField(iomodel->control_type));
 		parameters->AddObject(new DoubleVecParam(ControlParameterEnum,control_parameter,iomodel->nsteps));
 		xfree((void**)&control_parameter);
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 5357)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 5358)
@@ -40,6 +40,6 @@
 	IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B");
 	IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n");
-	if(iomodel->control_analysis && strcmp(iomodel->control_type,"rheology_B")==0){
-		IoModelFetchData(&iomodel->control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type); //copy the control parameter in iomodel
+	if(iomodel->control_analysis && iomodel->control_type==RheologyBbarEnum){
+		IoModelFetchData(&iomodel->control_parameter,NULL,NULL,iomodel_handle,EnumToModelField(iomodel->control_type)); //copy the control parameter in iomodel
 	}
 	
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 5357)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 5358)
@@ -47,6 +47,6 @@
 		IoModelFetchData(&iomodel->vy_obs,NULL,NULL,iomodel_handle,"vy_obs");
 		IoModelFetchData(&iomodel->weights,NULL,NULL,iomodel_handle,"weights");
-		if(strcmp(iomodel->control_type,"drag_coefficient")==0){
-			IoModelFetchData(&iomodel->control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type); //copy the control parameter in iomodel
+		if(iomodel->control_type==DragCoefficientEnum){
+			IoModelFetchData(&iomodel->control_parameter,NULL,NULL,iomodel_handle,EnumToModelField(iomodel->control_type)); //copy the control parameter in iomodel
 		}
 	}
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/UpdateElementsDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/UpdateElementsDiagnosticStokes.cpp	(revision 5357)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/UpdateElementsDiagnosticStokes.cpp	(revision 5358)
@@ -48,6 +48,6 @@
 		IoModelFetchData(&iomodel->vy_obs,NULL,NULL,iomodel_handle,"vy_obs");
 		IoModelFetchData(&iomodel->weights,NULL,NULL,iomodel_handle,"weights");
-		if(strcmp(iomodel->control_type,"drag_coefficient")==0){
-			IoModelFetchData(&iomodel->control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type); //copy the control parameter in iomodel
+		if(iomodel->control_type==DragCoefficientEnum){
+			IoModelFetchData(&iomodel->control_parameter,NULL,NULL,iomodel_handle,EnumToModelField(iomodel->control_type)); //copy the control parameter in iomodel
 		}
 	}
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5357)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5358)
@@ -716,5 +716,5 @@
 
 		/*Depth Average B*/
-		this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum);
+		this->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
 
 		tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
@@ -723,5 +723,5 @@
 
 		/*delete B average*/
-		this->matice->inputs->DeleteInput(RheologyB2dEnum);
+		this->matice->inputs->DeleteInput(RheologyBbarEnum);
 
 		return J;
@@ -731,6 +731,6 @@
 		/*Depth Average B and put it in inputs*/
 		Penta* penta=GetBasalElement();
-		penta->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum);
-		Input* B_input=penta->matice->inputs->GetInput(RheologyB2dEnum);
+		penta->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
+		Input* B_input=penta->matice->inputs->GetInput(RheologyBbarEnum);
 		Input* B_copy=(Input*)B_input->copy();
 		this->matice->inputs->AddInput((Input*)B_copy);
@@ -741,6 +741,6 @@
 
 		/*delete B average*/
-		this->matice->inputs->DeleteInput(RheologyB2dEnum);
-		penta->matice->inputs->DeleteInput(RheologyB2dEnum);
+		this->matice->inputs->DeleteInput(RheologyBbarEnum);
+		penta->matice->inputs->DeleteInput(RheologyBbarEnum);
 
 		return J;
@@ -1033,5 +1033,5 @@
 		GradjDrag(gradient);
 	}
-	else if (control_type==RheologyB2dEnum){
+	else if (control_type==RheologyBbarEnum){
 		GradjB(gradient);
 	}
@@ -1087,5 +1087,5 @@
 
 	/*Rheology*/
-	if(control_type==RheologyB2dEnum){
+	if(control_type==RheologyBbarEnum){
 
 		/*The update is done by the element on bed only*/
@@ -1097,5 +1097,5 @@
 
 		/*Now, update using the gradient new = old + scalar * gradient*/
-		//matice->inputs->AXPY(RheologyB2dEnum,scalar,GradientEnum);
+		//matice->inputs->AXPY(RheologyBbarEnum,scalar,GradientEnum);
 		// For now: Gradient is in element (TO BE CHANGED) and parameter in matice
 		Input* input_B   =(Input*)matice->inputs->GetInput(RheologyBEnum); ISSMASSERT(input_B);
@@ -1268,5 +1268,5 @@
 
 	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
-	if (enum_type==RheologyB2dEnum){
+	if (enum_type==RheologyBbarEnum){
 		input=this->matice->inputs->GetInput(RheologyBEnum);
 	}
@@ -2636,5 +2636,5 @@
 
 		/*Depth Averaging B*/
-		this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum);
+		this->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
 
 		/*Call Tria function*/
@@ -2644,5 +2644,5 @@
 
 		/*Delete B averaged*/
-		this->matice->inputs->DeleteInput(RheologyB2dEnum);
+		this->matice->inputs->DeleteInput(RheologyBbarEnum);
 
 		return;
@@ -5264,5 +5264,5 @@
 
 		/*Depth Average B*/
-		this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum);
+		this->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
 
 		tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
@@ -5271,12 +5271,12 @@
 
 		/*delete B average*/
-		this->matice->inputs->DeleteInput(RheologyB2dEnum);
+		this->matice->inputs->DeleteInput(RheologyBbarEnum);
 	}
 	else{
-		/*Gradient is computed on bed only (B2d)*/
+		/*Gradient is computed on bed only (Bbar)*/
 		if (!onbed) return;
 
 		/*Depth Average B*/
-		this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum);
+		this->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
 
 		/*B is a 2d field, use MacAyeal(2d) gradient even if it is Stokes or Pattyn*/
@@ -5286,5 +5286,5 @@
 
 		/*delete B average*/
-		this->matice->inputs->DeleteInput(RheologyB2dEnum);
+		this->matice->inputs->DeleteInput(RheologyBbarEnum);
 	}
 
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5357)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5358)
@@ -419,5 +419,5 @@
 
 			/*update input*/
-			if (name==RheologyB2dEnum || name==RheologyBEnum){
+			if (name==RheologyBbarEnum || name==RheologyBEnum){
 				matice->inputs->AddInput(new TriaVertexInput(name,values));
 			}
@@ -709,6 +709,6 @@
 			}
 		}
-		else if (control_type==RheologyB2dEnum){
-			matice->inputs->GetParameterDerivativeValue(&dB[0], &xyz_list[0][0], &gauss_l1l2l3[0],RheologyB2dEnum);
+		else if (control_type==RheologyBbarEnum){
+			matice->inputs->GetParameterDerivativeValue(&dB[0], &xyz_list[0][0], &gauss_l1l2l3[0],RheologyBbarEnum);
 			Jelem+=cm_noisedmp*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight;
 		}
@@ -954,5 +954,5 @@
 		GradjDrag(gradient);
 	}
-	else if (control_type==RheologyB2dEnum){
+	else if (control_type==RheologyBbarEnum){
 		GradjB(gradient);
 	}
@@ -1050,5 +1050,5 @@
 	adjointx_input=inputs->GetInput(AdjointxEnum);
 	adjointy_input=inputs->GetInput(AdjointyEnum);
-	rheologyb_input=matice->inputs->GetInput(RheologyB2dEnum);
+	rheologyb_input=matice->inputs->GetInput(RheologyBbarEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -1392,22 +1392,22 @@
 
 	/*Rheology*/
-	if(control_type==RheologyB2dEnum){
+	if(control_type==RheologyBbarEnum){
 
 		/*First, get revert to previous parameter value (kept in ControlParameter input)*/
-		matice->inputs->DuplicateInput(ControlParameterEnum,RheologyB2dEnum);
+		matice->inputs->DuplicateInput(ControlParameterEnum,RheologyBbarEnum);
 
 		/*Now, update using the gradient new = old + scalar * gradient*/
-		//matice->inputs->AXPY(RheologyB2dEnum,scalar,GradientEnum);
+		//matice->inputs->AXPY(RheologyBbarEnum,scalar,GradientEnum);
 		// For now: Gradient is in element (TO BE CHANGED) and parameter in matice
-		Input* input_B   =(Input*)matice->inputs->GetInput(RheologyB2dEnum); ISSMASSERT(input_B);
+		Input* input_B   =(Input*)matice->inputs->GetInput(RheologyBbarEnum); ISSMASSERT(input_B);
 		Input* input_Grad=(Input*)this->inputs->GetInput(GradientEnum); ISSMASSERT(input_Grad);
 		input_B->AXPY(input_Grad,scalar);
 
 		/*Constrain constrain input*/
-		input=(Input*)matice->inputs->GetInput(RheologyB2dEnum); ISSMASSERT(input);
+		input=(Input*)matice->inputs->GetInput(RheologyBbarEnum); ISSMASSERT(input);
 		input->Constrain(cm_min,cm_max);
 
 		/*Finally: save input if requested*/
-		if (save_parameter) matice->inputs->DuplicateInput(RheologyB2dEnum,ControlParameterEnum);
+		if (save_parameter) matice->inputs->DuplicateInput(RheologyBbarEnum,ControlParameterEnum);
 
 	}
@@ -1542,5 +1542,5 @@
 
 	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
-	if (enum_type==RheologyB2dEnum){
+	if (enum_type==RheologyBbarEnum){
 		input=this->matice->inputs->GetInput(enum_type);
 	}
@@ -5533,5 +5533,5 @@
 	gravity=matpar->GetG();
 	n=matice->GetN();
-	B=matice->GetB2d();
+	B=matice->GetBbar();
 
 	/* Get slopes and thickness */
Index: /issm/trunk/src/c/objects/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/objects/IoModel.cpp	(revision 5357)
+++ /issm/trunk/src/c/objects/IoModel.cpp	(revision 5358)
@@ -100,5 +100,4 @@
 	xfree((void**)&this->riftinfo);
 	xfree((void**)&this->penalties);
-	xfree((void**)&this->control_type);
 	xfree((void**)&this->control_parameter);
 	
@@ -297,7 +296,4 @@
 	this->rheology_n=NULL;
 	this->rheology_B=NULL;
-
-	/*!control methods: */
-	this->control_type=NULL;
 
 	/*!solution parameters: */
Index: /issm/trunk/src/c/objects/IoModel.h
===================================================================
--- /issm/trunk/src/c/objects/IoModel.h	(revision 5357)
+++ /issm/trunk/src/c/objects/IoModel.h	(revision 5358)
@@ -125,5 +125,5 @@
 
 		/*control methods: */
-		char*	control_type;
+		int      control_type;
 		double*	control_parameter;
 
Index: /issm/trunk/src/c/objects/Materials/Matice.cpp
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 5357)
+++ /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 5358)
@@ -47,5 +47,5 @@
 		if (iomodel->rheology_B) {
 			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];
-			this->inputs->AddInput(new TriaVertexInput(RheologyB2dEnum,nodeinputs));
+			this->inputs->AddInput(new TriaVertexInput(RheologyBbarEnum,nodeinputs));
 		}
 
@@ -257,12 +257,12 @@
 }
 /*}}}*/
-/*FUNCTION Matice::GetB2d {{{1*/
-double Matice::GetB2d(){
+/*FUNCTION Matice::GetBbar {{{1*/
+double Matice::GetBbar(){
 
 	/*Output*/
-	double B2d;
-
-	inputs->GetParameterAverage(&B2d,RheologyB2dEnum);
-	return B2d;
+	double Bbar;
+
+	inputs->GetParameterAverage(&Bbar,RheologyBbarEnum);
+	return Bbar;
 }
 /*}}}*/
@@ -302,5 +302,5 @@
 
 	/*Get B and n*/
-	B=GetB2d();
+	B=GetBbar();
 	n=GetN();
 
@@ -507,5 +507,5 @@
 
 	/*Get B and n*/
-	B=GetB2d();
+	B=GetBbar();
 	n=GetN();
 
@@ -652,5 +652,5 @@
 	if (
 				name==RheologyBEnum ||
-				name==RheologyB2dEnum ||
+				name==RheologyBbarEnum ||
 				name==RheologyNEnum ||
 				name==ControlParameterEnum
Index: /issm/trunk/src/c/objects/Materials/Matice.h
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matice.h	(revision 5357)
+++ /issm/trunk/src/c/objects/Materials/Matice.h	(revision 5358)
@@ -64,5 +64,5 @@
 		void   GetViscosityComplement(double* pviscosity_complement, double* pepsilon);
 		double GetB();
-		double GetB2d();
+		double GetBbar();
 		double GetN();
 		bool   IsInput(int name);
