Index: /issm/trunk-jpl/src/c/cores/controlm1qn3_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23306)
+++ /issm/trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 23307)
@@ -39,11 +39,11 @@
 
 	/*Intermediaries*/
-	long         omode;
-	double       f,dxmin,gttol; 
-	int          maxsteps,maxiter;
-	int          intn,numberofvertices,num_controls,num_cost_functions,solution_type;
-	IssmDouble  *scaling_factors = NULL;
-	double      *X  = NULL;
-	double      *G  = NULL;
+	long    omode;
+	double  f,dxmin,gttol; 
+	int     maxsteps,maxiter;
+	int     intn,numberofvertices,num_controls,num_cost_functions,solution_type;
+	double *scaling_factors = NULL;
+	double *X  = NULL;
+	double *G  = NULL;
 
 	/*Recover some parameters*/
@@ -93,5 +93,5 @@
 		for(int i=0;i<numberofvertices;i++){
 			int index = numberofvertices*c+i;
-			X[index] = X[index]/reCast<double>(scaling_factors[c]);
+			X[index] = X[index]/scaling_factors[c];
 		}
 	}
@@ -148,5 +148,5 @@
 		for(int i=0;i<numberofvertices;i++){
 			int index = numberofvertices*c+i;
-			X[index] = X[index]*reCast<double>(scaling_factors[c]);
+			X[index] = X[index]*scaling_factors[c];
 			if(X[index]>XU[index]) X[index]=XU[index];
 			if(X[index]<XL[index]) X[index]=XL[index];
@@ -187,5 +187,5 @@
 	xDelete<double>(XU);
 	xDelete<double>(XL);
-	xDelete<IssmDouble>(scaling_factors);
+	xDelete<double>(scaling_factors);
 	xDelete<double>(mystruct.Jlist);
 	xDelete<int>(mystruct.i);
@@ -203,8 +203,8 @@
 	/*Recover some parameters*/
 	int num_responses,num_controls,numberofvertices,solution_type;
-	IssmDouble* scaling_factors = NULL;
+	double* scaling_factors = NULL;
 	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
 	femmodel->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
-	femmodel->parameters->FindParam(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
+	femmodel->parameters->FindParamAndMakePassive(&scaling_factors,NULL,InversionControlScalingFactorsEnum);
 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
 	numberofvertices=femmodel->vertices->NumberOfVertices();
@@ -223,5 +223,5 @@
 		for(int i=0;i<numberofvertices;i++){
 			int index = numberofvertices*c+i;
-			X[index] = X[index]*reCast<double>(scaling_factors[c]);
+			X[index] = X[index]*scaling_factors[c];
 			if(X[index]>XU[index]) X[index]=XU[index];
 			if(X[index]<XL[index]) X[index]=XL[index];
@@ -290,6 +290,6 @@
 			if(X[index]>=XU[index]) G[index]=0.;
 			if(X[index]<=XL[index]) G[index]=0.;
-			G[index] = G[index]*reCast<double>(scaling_factors[c]);
-			X[index] = X[index]/reCast<double>(scaling_factors[c]);
+			G[index] = G[index]*scaling_factors[c];
+			X[index] = X[index]/scaling_factors[c];
 			Gnorm += G[index]*G[index];
 		}
@@ -306,5 +306,5 @@
 	xDelete<double>(XU);
 	xDelete<double>(XL);
-	xDelete<IssmDouble>(scaling_factors);
+	xDelete<double>(scaling_factors);
 }/*}}}*/
 
