Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 9562)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 9563)
@@ -456,6 +456,4 @@
 	TolxEnum,
 	OptscalEnum,
-	EpsvelEnum,
-	MeanvelEnum,
 	OutputfilenameEnum,
 	WaterfractionEnum,
Index: /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 9562)
+++ /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 9563)
@@ -399,6 +399,4 @@
 		case TolxEnum : return "Tolx";
 		case OptscalEnum : return "Optscal";
-		case EpsvelEnum : return "Epsvel";
-		case MeanvelEnum : return "Meanvel";
 		case OutputfilenameEnum : return "Outputfilename";
 		case WaterfractionEnum : return "Waterfraction";
Index: /issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 9562)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 9563)
@@ -39,8 +39,6 @@
 		parameters->AddObject(iomodel->CopyConstantObject(NumCmResponsesEnum));
 		parameters->AddObject(iomodel->CopyConstantObject(NstepsEnum));
-		parameters->AddObject(iomodel->CopyConstantObject(TolxEnum));
 		parameters->AddObject(iomodel->CopyConstantObject(EpsCmEnum));
 		parameters->AddObject(iomodel->CopyConstantObject(CmGradientEnum));
-		parameters->AddObject(iomodel->CopyConstantObject(MeanvelEnum));
 
 		/*What solution type?*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 9562)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 9563)
@@ -35,5 +35,4 @@
 	parameters->AddObject(iomodel->CopyConstantObject(MaxNonlinearIterationsEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(MaxSteadystateIterationsEnum));
-	parameters->AddObject(iomodel->CopyConstantObject(EpsvelEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(YtsEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(DtEnum));
Index: /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 9562)
+++ /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 9563)
@@ -397,6 +397,4 @@
 	else if (strcmp(name,"Tolx")==0) return TolxEnum;
 	else if (strcmp(name,"Optscal")==0) return OptscalEnum;
-	else if (strcmp(name,"Epsvel")==0) return EpsvelEnum;
-	else if (strcmp(name,"Meanvel")==0) return MeanvelEnum;
 	else if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum;
 	else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum;
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 9562)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 9563)
@@ -1840,6 +1840,7 @@
 	int        artdiff;
 	int        i,j,ig,found=0;
-	double     Jdet,u,v,w,um,vm,wm,epsvel;
+	double     Jdet,u,v,w,um,vm,wm;
 	double     gravity,rho_ice,rho_water;
+	double     epsvel=1.e-13;
 	double     heatcapacity,thermalconductivity,dt;
 	double     pressure,enthalpy;
@@ -1875,5 +1876,4 @@
 	this->parameters->FindParam(&dt,DtEnum);
 	this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
-	this->parameters->FindParam(&epsvel,EpsvelEnum);
 	Input* pressure_input=inputs->GetInput(PressureEnum);      _assert_(pressure_input);
 	Input* enthalpy_input=inputs->GetInput(EnthalpyEnum);      _assert_(enthalpy_input);
@@ -2117,5 +2117,6 @@
 	int        artdiff;
 	int        i,j,ig,found=0;
-	double     Jdet,u,v,w,um,vm,wm,epsvel;
+	double     Jdet,u,v,w,um,vm,wm;
+	double     epsvel=1.e-13;
 	double     gravity,rho_ice,rho_water;
 	double     heatcapacity,thermalconductivity,dt;
@@ -2149,5 +2150,4 @@
 	this->parameters->FindParam(&dt,DtEnum);
 	this->parameters->FindParam(&artdiff,ArtificialDiffusivityEnum);
-	this->parameters->FindParam(&epsvel,EpsvelEnum);
 	Input* vx_input=inputs->GetInput(VxEnum);      _assert_(vx_input);
 	Input* vy_input=inputs->GetInput(VyEnum);      _assert_(vy_input);
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 9562)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 9563)
@@ -1510,5 +1510,7 @@
 	double     Jdet;
 	double     obs_velocity_mag,velocity_mag;
-	double     dux,duy,meanvel,epsvel;
+	double     dux,duy;
+	double     epsvel=1.e-13;
+	double     meanvel=1000/(365*24*3600); /*1000 m/yr*/
 	double     scalex=0,scaley=0,scale=0,S=0;
 	double     vx,vy,vxobs,vyobs,weight;
@@ -1524,6 +1526,4 @@
 	this->parameters->FindParam(&num_responses,NumCmResponsesEnum);
 	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
-	this->parameters->FindParam(&meanvel,MeanvelEnum);
-	this->parameters->FindParam(&epsvel,EpsvelEnum);
 	Input* weights_input=inputs->GetInput(WeightsEnum);   _assert_(weights_input);
 	Input* vx_input     =inputs->GetInput(VxEnum);        _assert_(vx_input);
@@ -1686,5 +1686,7 @@
 	double     Jdet;
 	double     obs_velocity_mag,velocity_mag;
-	double     dux,duy,meanvel,epsvel;
+	double     dux,duy;
+	double     epsvel=1.e-13;
+	double     meanvel=1000/(365*24*3600); /*1000 m/yr*/
 	double     scalex=0,scaley=0,scale=0,S=0;
 	double     vx,vy,vxobs,vyobs,weight;
@@ -1700,6 +1702,4 @@
 	this->parameters->FindParam(&num_responses,NumCmResponsesEnum);
 	this->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
-	this->parameters->FindParam(&meanvel,MeanvelEnum);
-	this->parameters->FindParam(&epsvel,EpsvelEnum);
 	Input* weights_input = inputs->GetInput(WeightsEnum);   _assert_(weights_input);
 	Input* vx_input      = inputs->GetInput(VxEnum);        _assert_(vx_input);
@@ -4856,5 +4856,7 @@
 	int        i,ig;
 	double     Jelem=0;
-	double     meanvel, epsvel,misfit,Jdet;
+	double     misfit,Jdet;
+	double     epsvel=1.e-13;
+	double     meanvel=1000/(365*24*3600); /*1000 m/yr*/
 	double     velocity_mag,obs_velocity_mag;
 	double     xyz_list[NUMVERTICES][3];
@@ -4869,6 +4871,4 @@
 
 	/*Retrieve all inputs we will be needing: */
-	this->parameters->FindParam(&meanvel,MeanvelEnum);
-	this->parameters->FindParam(&epsvel,EpsvelEnum);
 	Input* weights_input=inputs->GetInput(WeightsEnum);   _assert_(weights_input);
 	Input* vx_input     =inputs->GetInput(VxEnum);        _assert_(vx_input);
@@ -4922,5 +4922,7 @@
 	int        fit=-1;
 	double     Jelem=0, S=0;
-	double     meanvel, epsvel, misfit, Jdet;
+	double     epsvel=1.e-13;
+	double     meanvel=1000/(365*24*3600); /*1000 m/yr*/
+	double     misfit, Jdet;
 	double     vx,vy,vxobs,vyobs,weight;
 	double     xyz_list[NUMVERTICES][3];
@@ -4934,6 +4936,4 @@
 
 	/*Retrieve all inputs we will be needing: */
-	this->parameters->FindParam(&meanvel,MeanvelEnum);
-	this->parameters->FindParam(&epsvel,EpsvelEnum);
 	Input* weights_input=inputs->GetInput(WeightsEnum);   _assert_(weights_input);
 	Input* vx_input     =inputs->GetInput(VxEnum);        _assert_(vx_input);
@@ -5011,5 +5011,7 @@
 	double     Jelem=0;
 	double     scalex=1,scaley=1;
-	double     meanvel, epsvel,misfit,Jdet;
+	double     misfit,Jdet;
+	double     epsvel=1.e-13;
+	double     meanvel=1000/(365*24*3600); /*1000 m/yr*/
 	double     vx,vy,vxobs,vyobs,weight;
 	double     xyz_list[NUMVERTICES][3];
@@ -5023,6 +5025,4 @@
 
 	/*Retrieve all inputs we will be needing: */
-	this->parameters->FindParam(&meanvel,MeanvelEnum);
-	this->parameters->FindParam(&epsvel,EpsvelEnum);
 	Input* weights_input=inputs->GetInput(WeightsEnum);   _assert_(weights_input);
 	Input* vx_input     =inputs->GetInput(VxEnum);        _assert_(vx_input);
Index: /issm/trunk/src/c/objects/OptPars.h
===================================================================
--- /issm/trunk/src/c/objects/OptPars.h	(revision 9562)
+++ /issm/trunk/src/c/objects/OptPars.h	(revision 9563)
@@ -10,5 +10,4 @@
 	double xmin;
 	double xmax;
-	double tolerance;
 	double cm_jump;
 	int maxiter;
Index: /issm/trunk/src/c/shared/Numerics/BrentSearch.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/BrentSearch.cpp	(revision 9562)
+++ /issm/trunk/src/c/shared/Numerics/BrentSearch.cpp	(revision 9563)
@@ -28,5 +28,6 @@
 	double xmax,xmin,xbest;
 	double x,x1,x2,xm;
-	double tol1,tol2,seps,tolerance;
+	double tol1,tol2,seps;
+	double tolerance=1.e-4;
 	int    maxiter,iter;
 	bool   loop=true,goldenflag;
@@ -35,5 +36,4 @@
 	xmin=optpars->xmin;
 	xmax=optpars->xmax;
-	tolerance=optpars->tolerance;
 	maxiter=optpars->maxiter;
 	cm_jump=optpars->cm_jump;
Index: /issm/trunk/src/c/shared/Numerics/OptimalSearch.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/OptimalSearch.cpp	(revision 9562)
+++ /issm/trunk/src/c/shared/Numerics/OptimalSearch.cpp	(revision 9563)
@@ -24,5 +24,6 @@
 
 	/*tolerances: */
-	double seps,tolerance;
+	double seps;
+	double tolerance=1.e-4;
 	int    maxiter;
 
@@ -35,5 +36,4 @@
 	x1       =optpars->xmin;
 	x2       =optpars->xmax;
-	tolerance=optpars->tolerance;
 	maxiter  =optpars->maxiter;
 	
Index: /issm/trunk/src/c/solutions/control_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/control_core.cpp	(revision 9562)
+++ /issm/trunk/src/c/solutions/control_core.cpp	(revision 9563)
@@ -20,5 +20,4 @@
 	int     nsteps;
 	double  eps_cm;
-	double  tolx;
 	bool    cm_gradient;
 	int     dim;
@@ -54,5 +53,4 @@
 	femmodel->parameters->FindParam(&cm_jump,NULL,CmJumpEnum);
 	femmodel->parameters->FindParam(&eps_cm,EpsCmEnum);
-	femmodel->parameters->FindParam(&tolx,TolxEnum);
 	femmodel->parameters->FindParam(&cm_gradient,CmGradientEnum);
 	femmodel->parameters->FindParam(&dim,DimEnum);
@@ -75,5 +73,5 @@
 	/*Initialize some of the BrentSearch arguments: */
 	optargs.femmodel=femmodel;
-	optpars.xmin=0; optpars.xmax=1; optpars.tolerance=tolx ;
+	optpars.xmin=0; optpars.xmax=1;
 	
 	/*Start looping: */
Index: /issm/trunk/src/c/solutions/solutions.h
===================================================================
--- /issm/trunk/src/c/solutions/solutions.h	(revision 9562)
+++ /issm/trunk/src/c/solutions/solutions.h	(revision 9563)
@@ -40,6 +40,4 @@
 
 //optimization
-int GoldenSearch(double* psearch_scalar,double* pJ,double xa, double xb, double tolerance, int maxiter, double fit,double optscal,double (*f)(double*,double,double,FemModel*),FemModel* femmodel);
-int BrentSearch(double* psearch_scalar,double* pJ,double xa, double xb, double tolerance, int maxiter, double fit,double optscal,double (*f)(double*,double,double,FemModel*),FemModel* femmodel);
 int GradJSearch(double* search_vector,FemModel* femmodel,int step);
 
Index: /issm/trunk/src/m/classes/model/model.m
===================================================================
--- /issm/trunk/src/m/classes/model/model.m	(revision 9562)
+++ /issm/trunk/src/m/classes/model/model.m	(revision 9563)
@@ -184,5 +184,4 @@
 		 maxiter          = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3);
 		 cm_responses     = modelfield('default',NaN,'marshall',true,'preprocess','marshallcmresponses','format','DoubleMat','mattype',3);
-		 tolx             = modelfield('default',0,'marshall',true,'format','Double');
 		 optscal          = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3);
 		 eps_cm           = modelfield('default',0,'marshall',true,'format','Double');
@@ -191,6 +190,4 @@
 		 cm_jump          = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3);
 		 cm_gradient      = modelfield('default',0,'marshall',true,'format','Boolean');
-		 epsvel                         = modelfield('default',0,'marshall',true,'format','Double');
-		 meanvel                        = modelfield('default',0,'marshall',true,'format','Double');
 		 num_control_type               = modelfield('default',0,'marshall',true,'format','Integer');
 		 num_cm_responses               = modelfield('default',0,'marshall',true,'format','Integer');
@@ -263,5 +260,4 @@
 		 qmu_mass_flux_profiles          = modelfield('default',NaN,'marshall',false);
 		 qmu_mass_flux_segments          = modelfield('default',{},'marshall',true,'format','MatArray');
-		 qmu_relax                       = modelfield('default',0,'marshall',false);
 
 		 %flaim
@@ -684,7 +680,4 @@
 			 md.maxiter=20*ones(md.nsteps,1);
 
-			 %tolerance used by the optimization algorithm
-			 md.tolx=10^-4;
-
 			 %the inversed parameter is updated as follows:
 			 %new_par=old_par + optscal(n)*C*gradient with C in [0 1];
@@ -709,10 +702,4 @@
 			 %NaN if not applied
 			 md.eps_cm=NaN; %not activated
-
-			 %minimum velocity to avoid the misfit to be singular
-			 md.epsvel=eps;
-
-			 %averaged velocity used to scale the logarithmic Misfit (000 m/an)
-			 md.meanvel=1000/(365*24*3600);
 
 			 %grounding line migration: 
Index: /issm/trunk/src/m/model/display/displaycontrol.m
===================================================================
--- /issm/trunk/src/m/model/display/displaycontrol.m	(revision 9562)
+++ /issm/trunk/src/m/model/display/displaycontrol.m	(revision 9563)
@@ -18,11 +18,8 @@
 	fielddisplay(md,'cm_responses','indicate the type of response for each optimization steps');
 	fielddisplay(md,'maxiter','maximum iterations during each optimization step');
-	fielddisplay(md,'tolx','minimum tolerance which will stop one optimization search');
 	fielddisplay(md,'cm_jump','decrease threshold for misfit, default is 30%');
 	fielddisplay(md,'cm_min','absolute minimum acceptable value of the inversed parameter');
 	fielddisplay(md,'cm_max','absolute maximum acceptable value of the inversed parameter');
 	fielddisplay(md,'cm_gradient','stop control method solution at gradient');
-	fielddisplay(md,'meanvel','velocity scaling factor when evaluating relative or logarithmic misfit');
-	fielddisplay(md,'epsvel','for relative fit, avoids misfit becoming infinity, for logarithmic fit, threshold for velocity');
 	fielddisplay(md,'plot','visualization of the results of each iteration yes -> 1 no -> 0. Default is 1');
 	disp('Available responses:');
Index: /issm/trunk/src/m/model/ismodelselfconsistent.m
===================================================================
--- /issm/trunk/src/m/model/ismodelselfconsistent.m	(revision 9562)
+++ /issm/trunk/src/m/model/ismodelselfconsistent.m	(revision 9563)
@@ -84,10 +84,10 @@
 fields={'numberofelements','numberofnodes','x','y','z','drag_coefficient','drag_p','drag_q',...
 	'rho_ice','rho_water','rheology_B','elementoniceshelf','surface','thickness','bed','g','lowmem','nsteps','maxiter',...
-	'tolx','eps_res','max_nonlinear_iterations','rheology_n','nodeonbed','nodeonsurface','elementonbed','elementonsurface','elementconnectivity'};
+	'eps_res','max_nonlinear_iterations','rheology_n','nodeonbed','nodeonsurface','elementonbed','elementonsurface','elementconnectivity'};
 checknan(md,fields);
 %}}}}
 %FIELDS >= 0 {{{1
 fields={'numberofelements','numberofnodes','elements','drag_coefficient','drag_p','drag_q',...
-	'rho_ice','rho_water','rheology_B','elementoniceshelf','thickness','g','eps_res','max_nonlinear_iterations','eps_rel','eps_abs','nsteps','maxiter','tolx',...
+	'rho_ice','rho_water','rheology_B','elementoniceshelf','thickness','g','eps_res','max_nonlinear_iterations','eps_rel','eps_abs','nsteps','maxiter',...
 	'lowmem','rheology_n','nodeonbed','nodeonsurface','elementonbed','elementonsurface'};
 checkgreater(md,fields,0);
@@ -95,5 +95,5 @@
 %FIELDS > 0 {{{1
 fields={'numberofelements','numberofnodes','elements','drag_p',...
-	'rho_ice','rho_water','rheology_B','thickness','g','max_nonlinear_iterations','eps_res','eps_rel','eps_abs','maxiter','tolx'};
+	'rho_ice','rho_water','rheology_B','thickness','g','max_nonlinear_iterations','eps_res','eps_rel','eps_abs','maxiter'};
 checkgreaterstrict(md,fields,0);
 %}}}
@@ -275,9 +275,4 @@
 			message(['model not consistent: for qmu analysis, partitioning vector cannot go over npart, number of partition areas']);
 		end
-	end
-	if ~md.qmu_relax,
-		%if md.eps_rel>1.1*10^-5,
-		%	message(['model not consistent: for qmu analysis, eps_rel should be least than 10^-5, 10^-15 being a better value']);
-		%end
 	end
 end
Index: /issm/trunk/src/m/solutions/control_core.m
===================================================================
--- /issm/trunk/src/m/solutions/control_core.m	(revision 9562)
+++ /issm/trunk/src/m/solutions/control_core.m	(revision 9563)
@@ -16,5 +16,4 @@
 	cm_jump=femmodel.parameters.CmJump;
 	eps_cm=femmodel.parameters.EpsCm;
-	tolx=femmodel.parameters.Tolx;
 	cm_gradient=femmodel.parameters.CmGradient;
 	dim=femmodel.parameters.Dim;
Index: /issm/trunk/src/mex/ControlOptimization/ControlOptimization.cpp
===================================================================
--- /issm/trunk/src/mex/ControlOptimization/ControlOptimization.cpp	(revision 9562)
+++ /issm/trunk/src/mex/ControlOptimization/ControlOptimization.cpp	(revision 9563)
@@ -10,5 +10,4 @@
 	char* function_name=NULL;
 	double xmin,xmax;
-	double tolerance;
 	double* maxiter;
 	OptArgs optargs;
@@ -33,5 +32,4 @@
 	FetchMatlabData(&xmin,XMIN);
 	FetchMatlabData(&xmax,XMAX);
-	FetchMatlabData(&tolerance,mxGetField(OPTIONS,0,"TolX"));
 	FetchMatlabData(&maxiter,NULL,NULL,mxGetField(OPTIONS,0,"MaxIter"));
 
@@ -45,5 +43,4 @@
 	optpars.xmin=xmin;
 	optpars.xmax=xmax;
-	optpars.tolerance=tolerance;
 	optpars.maxiter=(int)maxiter[n_value-1];
 	optpars.cm_jump=cm_jump[n_value-1];
