Index: /issm/trunk-jpl/src/c/cores/controladm1qn3_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23051)
+++ /issm/trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 23052)
@@ -30,7 +30,4 @@
 	int          N;
 	int*         i;
-	IssmPDouble* X_best;
-	IssmPDouble* G_best;
-	IssmPDouble* J_best;
 } m1qn3_struct;
 
@@ -84,7 +81,4 @@
 	int           JlistN       = input_struct->N;
 	int*          Jlisti       = input_struct->i;
-	IssmPDouble* X_best			= input_struct->X_best;
-	IssmPDouble* G_best			= input_struct->G_best;
-	IssmPDouble*  J_best       = input_struct->J_best;
 	int           intn         = (int)*n;
 
@@ -166,13 +160,4 @@
 		}
 	}
-	if(my_rank==0){
-		if(*J_best<0 || J<*J_best){
-			*J_best = reCast<IssmPDouble>(J);
-			for(int i=0;i<intn;i++){
-				X_best[i] = reCast<IssmPDouble>(X[i]);
-				G_best[i] = reCast<IssmPDouble>(G[i]);
-			}
-		}
-}
 
 	/*Turning off trace tape*/
@@ -352,8 +337,4 @@
 	_printf0_("\n");
 
-	input_struct->X_best = X_best;
-	input_struct->G_best = G_best;
-	input_struct->J_best = J_best;
-	
 	/*Clean-up and return*/
 	*Jlisti = (*Jlisti) +1;
@@ -439,5 +420,4 @@
 	long      ndz = 4*n+m*(2*n+1);
 	double*   dz  = xNew<double>(ndz);
-	IssmDouble J_best = -10.;
 	if(VerboseControl())_printf0_("   Computing initial solution\n");
 	_printf0_("\n");
@@ -452,8 +432,4 @@
 	mystruct.Jlist    = xNewZeroInit<IssmPDouble>(mystruct.M*mystruct.N);
 	mystruct.i        = xNewZeroInit<int>(1);
-	mystruct.J_best   = xNewZeroInit<IssmPDouble>(1);
-	mystruct.X_best	= xNewZeroInit<IssmPDouble>(intn);
-	mystruct.G_best   = xNewZeroInit<IssmPDouble>(intn);
-	*mystruct.J_best = -10.;
 	/*Initialize Gradient and cost function of M1QN3*/
 	indic = 4; /*gradient required*/
@@ -499,12 +475,8 @@
 	IssmDouble* aX=xNew<IssmDouble>(intn);
 	IssmDouble* aG=xNew<IssmDouble>(intn);
-	double* X_best = xNew<double>(intn);
-	double* G_best = xNew<double>(intn);
 
 	for(int i=0;i<intn;i++) {
 		aX[i] = reCast<IssmDouble>(X[i]); 
 		aG[i] = reCast<IssmDouble>(G[i]);
-		X_best[i] = reCast<double>(mystruct.X_best[i]);	
-		G_best[i] = reCast<double>(mystruct.G_best[i]);	
 		}
 
@@ -527,18 +499,11 @@
 			GenericExternalResult<IssmPDouble*>* X_output = new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,control_enum[i],&X[offset],N[i],numberofvertices,1,0.);
 
-			GenericExternalResult<IssmPDouble*>* Gbest_output = new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,Outputdefinition90Enum+i,&G_best[offset],N[i],numberofvertices,1,0.);
-			GenericExternalResult<IssmPDouble*>* Xbest_output = new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,Outputdefinition80Enum+i,&X_best[offset],N[i],numberofvertices,1,0.);
-
 			/*transpose for consistency with MATLAB's formating*/
 			G_output->Transpose();
 			X_output->Transpose();
-			Gbest_output->Transpose();
-			Xbest_output->Transpose();
 
 			/*Add to results*/
 			femmodel->results->AddObject(G_output);
 			femmodel->results->AddObject(X_output);
-			femmodel->results->AddObject(Gbest_output);
-			femmodel->results->AddObject(Xbest_output);
 			
 			offset += N[i]*numberofvertices;
@@ -565,6 +530,4 @@
 	xDelete<double>(G);
 	xDelete<double>(X);
-	xDelete<double>(X_best);
-	xDelete<double>(G_best);
 	xDelete<double>(dz);
 	xDelete<double>(XU);
