Index: issm/trunk-jpl/src/m/classes/inversion.m
===================================================================
--- issm/trunk-jpl/src/m/classes/inversion.m	(revision 11445)
+++ issm/trunk-jpl/src/m/classes/inversion.m	(revision 11446)
@@ -8,4 +8,5 @@
 		iscontrol                   = 0
 		tao                         = 0
+		incomplete_adjoint          = 0
 		control_parameters          = NaN
 		nsteps                      = 0
@@ -43,37 +44,40 @@
 		function obj = setdefaultparameters(obj) % {{{
 
-			 %parameter to be inferred by control methods (only
-			 %drag and B are supported yet)
-			 obj.control_parameters={'FrictionCoefficient'};
+			%default is incomplete adjoint for now
+			obj.incomplete_adjoint=1;
 
-			 %number of steps in the control methods
-			 obj.nsteps=20;
+			%parameter to be inferred by control methods (only
+			%drag and B are supported yet)
+			obj.control_parameters={'FrictionCoefficient'};
 
-			 %maximum number of iteration in the optimization algorithm for
-			 %each step
-			 obj.maxiter_per_step=20*ones(obj.nsteps,1);
+			%number of steps in the control methods
+			obj.nsteps=20;
 
-			 %the inversed parameter is updated as follows:
-			 %new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1];
-			 %usually the gradient_scaling must be of the order of magnitude of the 
-			 %inversed parameter (10^8 for B, 50 for drag) and can be decreased
-			 %after the first iterations
-			 obj.gradient_scaling=50*ones(obj.nsteps,1);
+			%maximum number of iteration in the optimization algorithm for
+			%each step
+			obj.maxiter_per_step=20*ones(obj.nsteps,1);
 
-			 %several responses can be used:
-			 obj.cost_functions=101*ones(obj.nsteps,1);
+			%the inversed parameter is updated as follows:
+			%new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1];
+			%usually the gradient_scaling must be of the order of magnitude of the 
+			%inversed parameter (10^8 for B, 50 for drag) and can be decreased
+			%after the first iterations
+			obj.gradient_scaling=50*ones(obj.nsteps,1);
 
-			 %step_threshold is used to speed up control method. When
-			 %misfit(1)/misfit(0) < obj.step_threshold, we go directly to
-			 %the next step
-			 obj.step_threshold=.7*ones(obj.nsteps,1); %30 per cent decrement.
+			%several responses can be used:
+			obj.cost_functions=101*ones(obj.nsteps,1);
 
-			 %stop control solution at the gradient computation and return it? 
-			 obj.gradient_only=0;
+			%step_threshold is used to speed up control method. When
+			%misfit(1)/misfit(0) < obj.step_threshold, we go directly to
+			%the next step
+			obj.step_threshold=.7*ones(obj.nsteps,1); %30 per cent decrement.
 
-			 %cost_function_threshold is a criteria to stop the control methods.
-			 %if J[n]-J[n-1]/J[n] < criteria, the control run stops
-			 %NaN if not applied
-			 obj.cost_function_threshold=NaN; %not activated
+			%stop control solution at the gradient computation and return it? 
+			obj.gradient_only=0;
+
+			%cost_function_threshold is a criteria to stop the control methods.
+			%if J[n]-J[n-1]/J[n] < criteria, the control run stops
+			%NaN if not applied
+			obj.cost_function_threshold=NaN; %not activated
 
 		end % }}}
@@ -87,4 +91,6 @@
 
 			checkfield(md,'inversion.iscontrol','values',[0 1]);
+			checkfield(md,'inversion.tao','values',[0 1]);
+			checkfield(md,'inversion.incomplete_adjoint','values',[0 1]);
 			checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'Vx' 'Vy'});
 			checkfield(md,'inversion.nsteps','numel',1,'>=',1);
@@ -107,4 +113,5 @@
 		function disp(obj) % {{{
 			fielddisplay(obj,'iscontrol','is inversion activated?');
+			fielddisplay(obj,'incomplete_adjoint','do we assume linear viscosity?');
 			fielddisplay(obj,'control_parameters','parameter where inverse control is carried out; ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
 			fielddisplay(obj,'nsteps','number of optimization searches');
@@ -137,4 +144,5 @@
 			WriteData(fid,'object',obj,'fieldname','iscontrol','format','Boolean');
 			WriteData(fid,'object',obj,'fieldname','tao','format','Boolean');
+			WriteData(fid,'object',obj,'fieldname','incomplete_adjoint','format','Boolean');
 			if ~obj.iscontrol, return; end
 			WriteData(fid,'object',obj,'fieldname','nsteps','format','Integer');
