Index: ../trunk-jpl/src/m/classes/m1qn3inversion.py
===================================================================
--- ../trunk-jpl/src/m/classes/m1qn3inversion.py	(revision 19040)
+++ ../trunk-jpl/src/m/classes/m1qn3inversion.py	(revision 19041)
@@ -23,6 +23,7 @@
 			self.iscontrol                   = 0
 			self.incomplete_adjoint          = 0
 			self.control_parameters          = float('NaN')
+			self.control_scaling_factors     = float('NaN')
 			self.maxsteps                    = 0
 			self.maxiter                     = 0
 			self.dxmin                       = 0.
@@ -42,6 +43,10 @@
 		elif len(args)==1 and args[0].__module__=='inversion':
 			print 'converting inversion to m1qn3inversion'
 			inv=args[0]
+			#first call setdefaultparameters: 
+			self.setdefaultparameters()
+
+			#then go fish whatever is available in the inversion object provided to the constructor
 			self.iscontrol                   = inv.iscontrol
 			self.incomplete_adjoint          = inv.incomplete_adjoint
 			self.control_parameters          = inv.control_parameters
@@ -63,6 +68,7 @@
 		string="%s\n%s"%(string,fielddisplay(self,'iscontrol','is inversion activated?'))
 		string="%s\n%s"%(string,fielddisplay(self,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity'))
 		string="%s\n%s"%(string,fielddisplay(self,'control_parameters','ex: [''FrictionCoefficient''], or [''MaterialsRheologyBbar'']'))
+		string="%s\n%s"%(string,fielddisplay(self,'control_scaling_factors','order of magnitude of each control (useful for multi-parameter optimization)'))
 		string="%s\n%s"%(string,fielddisplay(self,'maxsteps','maximum number of iterations (gradient computation)'))
 		string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of Function evaluation (forward run)'))
 		string="%s\n%s"%(string,fielddisplay(self,'dxmin','convergence criterion: two points less than dxmin from eachother (sup-norm) are considered identical'))
@@ -95,6 +101,9 @@
 		#parameter to be inferred by control methods (only
 		#drag and B are supported yet)
 		self.control_parameters='FrictionCoefficient'
+		
+		#Scaling factor for each control
+		self.control_scaling_factors=1
 
 		#number of iterations
 		self.maxsteps=20
@@ -121,6 +130,7 @@
 		md = checkfield(md,'fieldname','inversion.iscontrol','values',[0,1])
 		md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0,1])
 		md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',supportedcontrols())
+		md = checkfield(md,'fieldname','inversion.control_scaling_factors','size',[num_controls],'>',0,'NaN',1)
 		md = checkfield(md,'fieldname','inversion.maxsteps','numel',[1],'>=',0)
 		md = checkfield(md,'fieldname','inversion.maxiter','numel',[1],'>=',0)
 		md = checkfield(md,'fieldname','inversion.dxmin','numel',[1],'>',0.)
@@ -147,6 +157,7 @@
 		if not self.iscontrol:
 			return
 		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')
