Index: issm/trunk-jpl/src/m/classes/m1qn3inversion.m
===================================================================
--- issm/trunk-jpl/src/m/classes/m1qn3inversion.m	(revision 18994)
+++ issm/trunk-jpl/src/m/classes/m1qn3inversion.m	(revision 19040)
@@ -27,10 +27,10 @@
 	end
 	methods
-		function obj = m1qn3inversion(varargin) % {{{
+		function self = m1qn3inversion(varargin) % {{{
 			switch nargin
 				case 0
-					obj=setdefaultparameters(obj);
+					self=setdefaultparameters(self);
 				case 1
-					obj=structtoobj(m1qn3inversion(),varargin{1});
+					self=structtoobj(m1qn3inversion(),varargin{1});
 				otherwise
 					error('constructor not supported');
@@ -61,8 +61,8 @@
 
 		end % }}}
-		function md = checkconsistency(obj,md,solution,analyses) % {{{
+		function md = checkconsistency(self,md,solution,analyses) % {{{
 
 			%Early return
-			if ~obj.iscontrol, return; end
+			if ~self.iscontrol, return; end
 
 			if ~IssmConfig('_HAVE_M1QN3_'),
@@ -97,23 +97,23 @@
 			end
 		end % }}}
-		function disp(obj) % {{{
+		function disp(self) % {{{
 			disp(sprintf('   m1qn3inversion parameters:'));
-			fielddisplay(obj,'iscontrol','is inversion activated?');
-			fielddisplay(obj,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity');
-			fielddisplay(obj,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
-			fielddisplay(obj,'control_scaling_factors','order of magnitude of each control (useful for multi-parameter optimization)');
-			fielddisplay(obj,'maxsteps','maximum number of iterations (gradient computation)');
-			fielddisplay(obj,'maxiter','maximum number of Function evaluation (forward run)');
-			fielddisplay(obj,'dxmin','convergence criterion: two points less than dxmin from eachother (sup-norm) are considered identical');
-			fielddisplay(obj,'gttol','convergence criterion: ||g(X)||/||g(X0)|| (g(X0): gradient at initial guess X0)');
-			fielddisplay(obj,'cost_functions','indicate the type of response for each optimization step');
-			fielddisplay(obj,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter');
-			fielddisplay(obj,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(obj,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
-			fielddisplay(obj,'vx_obs','observed velocity x component [m/yr]');
-			fielddisplay(obj,'vy_obs','observed velocity y component [m/yr]');
-			fielddisplay(obj,'vel_obs','observed velocity magnitude [m/yr]');
-			fielddisplay(obj,'thickness_obs','observed thickness [m]');
-			fielddisplay(obj,'surface_obs','observed surface elevation [m]');
+			fielddisplay(self,'iscontrol','is inversion activated?');
+			fielddisplay(self,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity');
+			fielddisplay(self,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
+			fielddisplay(self,'control_scaling_factors','order of magnitude of each control (useful for multi-parameter optimization)');
+			fielddisplay(self,'maxsteps','maximum number of iterations (gradient computation)');
+			fielddisplay(self,'maxiter','maximum number of Function evaluation (forward run)');
+			fielddisplay(self,'dxmin','convergence criterion: two points less than dxmin from eachother (sup-norm) are considered identical');
+			fielddisplay(self,'gttol','convergence criterion: ||g(X)||/||g(X0)|| (g(X0): gradient at initial guess X0)');
+			fielddisplay(self,'cost_functions','indicate the type of response for each optimization step');
+			fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter');
+			fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex');
+			fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
+			fielddisplay(self,'vx_obs','observed velocity x component [m/yr]');
+			fielddisplay(self,'vy_obs','observed velocity y component [m/yr]');
+			fielddisplay(self,'vel_obs','observed velocity magnitude [m/yr]');
+			fielddisplay(self,'thickness_obs','observed thickness [m]');
+			fielddisplay(self,'surface_obs','observed surface elevation [m]');
 			disp('Available cost functions:');
 			disp('   101: SurfaceAbsVelMisfit');
@@ -127,36 +127,36 @@
 			disp('   503: ThicknessAbsGradient');
 		end % }}}
-		function marshall(obj,md,fid) % {{{
+		function marshall(self,md,fid) % {{{
 
 			yts=365.0*24.0*3600.0;
 
-			WriteData(fid,'object',obj,'class','inversion','fieldname','iscontrol','format','Boolean');
+			WriteData(fid,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean');
 			WriteData(fid,'enum',InversionTypeEnum(),'data',2,'format','Integer');
-			if ~obj.iscontrol, return; end
-			WriteData(fid,'object',obj,'class','inversion','fieldname','incomplete_adjoint','format','Boolean');
-			WriteData(fid,'object',obj,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3);
-			WriteData(fid,'object',obj,'class','inversion','fieldname','maxsteps','format','Integer');
-			WriteData(fid,'object',obj,'class','inversion','fieldname','maxiter','format','Integer');
-			WriteData(fid,'object',obj,'class','inversion','fieldname','dxmin','format','Double');
-			WriteData(fid,'object',obj,'class','inversion','fieldname','gttol','format','Double');
-			WriteData(fid,'object',obj,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
-			WriteData(fid,'object',obj,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,'object',obj,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,'object',obj,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,'object',obj,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,'object',obj,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			if(numel(obj.thickness_obs)==md.mesh.numberofelements),
+			if ~self.iscontrol, return; end
+			WriteData(fid,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean');
+			WriteData(fid,'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3);
+			WriteData(fid,'object',self,'class','inversion','fieldname','maxsteps','format','Integer');
+			WriteData(fid,'object',self,'class','inversion','fieldname','maxiter','format','Integer');
+			WriteData(fid,'object',self,'class','inversion','fieldname','dxmin','format','Double');
+			WriteData(fid,'object',self,'class','inversion','fieldname','gttol','format','Double');
+			WriteData(fid,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
+			WriteData(fid,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);
+			WriteData(fid,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);
+			WriteData(fid,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+			WriteData(fid,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+			WriteData(fid,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+			if(numel(self.thickness_obs)==md.mesh.numberofelements),
 				mattype=2;
 			else
 				mattype=1;
 			end
-			WriteData(fid,'object',obj,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
-			WriteData(fid,'object',obj,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
+			WriteData(fid,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
+			WriteData(fid,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
 
 			%process control parameters
-			num_control_parameters=numel(obj.control_parameters);
+			num_control_parameters=numel(self.control_parameters);
 			data=zeros(1,num_control_parameters);
 			for i=1:num_control_parameters,
-				data(i)=StringToEnum(obj.control_parameters{i});
+				data(i)=StringToEnum(self.control_parameters{i});
 			end
 			WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3);
@@ -164,6 +164,6 @@
 
 			%process cost functions
-			num_cost_functions=size(obj.cost_functions,2);
-			data=marshallcostfunctions(obj.cost_functions);
+			num_cost_functions=size(self.cost_functions,2);
+			data=marshallcostfunctions(self.cost_functions);
 			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);
 			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');
