Index: /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13406)
+++ /issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp	(revision 13407)
@@ -35,6 +35,8 @@
 	if(N!=N2)_error_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !");
 	if(M!=N)_error_("Stiffness matrix should be square!");
+#ifdef _HAVE_ADOLC_
+	ensureContiguousLocations(N);
+#endif
 	IssmDouble *x  = xNew<IssmDouble>(N);
-
 #ifdef _HAVE_ADOLC_
 	SolverxSeq(x,Kff->matrix,pf->vector,N,parameters);
@@ -74,4 +76,6 @@
 int EDF_fos_forward_for_solverx(int n, IssmPDouble *inVal, IssmPDouble *inDeriv, int m, IssmPDouble *outVal, IssmPDouble *outDeriv) { /*{{{*/
 #ifdef _HAVE_GSL_
+//  for (int i=0; i<m*m; ++i) std::cout << "EDF_fos_forward_for_solverx A["<< i << "]=" << inVal[i] << std::endl;
+//  for (int i=0; i<m; ++i) std::cout << "EDF_fos_forward_for_solverx b["<< i << "]=" << inVal[i+m*m] << std::endl;
   // the matrix will be modified by LU decomposition. Use gsl_A copy
   double* Acopy = xNew<double>(m*m);
@@ -90,4 +94,5 @@
   xMemCpy(outVal,gsl_vector_ptr(gsl_x_p,0),m);
   gsl_vector_free(gsl_x_p);
+//  for (int i=0; i<m; ++i) std::cout << "EDF_fos_forward_for_solverx x["<< i << "]=" << outVal[i] << std::endl;
   // solve for the derivatives acc. to A * dx = r  with r=db - dA * x
   // compute the RHS
@@ -161,4 +166,6 @@
 void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
 	// pack inputs to conform to the EDF-prescribed interface
+        // ensure a contiguous block of locations:
+        ensureContiguousLocations(n*(n+1));
         IssmDouble*  adoubleEDFin=xNew<IssmDouble>(n*(n+1));  // packed inputs, i.e. matrix and right hand side
         for(int i=0; i<n*n;i++)adoubleEDFin[i]    =A[i];      // pack matrix
@@ -170,4 +177,5 @@
 	             n*(n+1), pdoubleEDFin, adoubleEDFin,
 	             n, pdoubleEDFout,X);
+	// for(int i=0; i<n;  i++) {ADOLC_DUMP_MACRO(X[i]);}
 	xDelete(adoubleEDFin);
 	xDelete(pdoubleEDFin);
@@ -184,4 +192,6 @@
 	gsl_vector      *x = NULL;
 	gsl_permutation *p = NULL;
+//	for (int i=0; i<n*n; ++i) std::cout << "SolverxSeq A["<< i << "]=" << A[i] << std::endl;
+//	for (int i=0; i<n; ++i) std::cout << "SolverxSeq b["<< i << "]=" << B[i] << std::endl;
 	/*A will be modified by LU decomposition. Use copy*/
 	double* Acopy = xNew<double>(n*n);
@@ -203,4 +213,5 @@
 	/*Copy result*/
 	xMemCpy(X,gsl_vector_ptr(x,0),n);
+//      for (int i=0; i<n; ++i) std::cout << "SolverxSeq x["<< i << "]=" << X[i] << std::endl;
 
 	/*Clean up and assign output pointer*/
