Index: /issm/trunk/src/c/modules/Solverx/Solverx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Solverx/Solverx.cpp	(revision 5974)
+++ /issm/trunk/src/c/modules/Solverx/Solverx.cpp	(revision 5975)
@@ -51,6 +51,5 @@
 
 	/*Process petscrc to see if we are not using special types of external solvers: */
-	parameters->FindParam(&petscrc,PetscRcEnum);
-	PetscOptionsDetermineSolverType(&solver_type,petscrc);
+	PetscOptionsDetermineSolverType(&solver_type,parameters);
 	
 	/*In serial mode, we don't have a petsc.rc file to boot the Petsc options. Do it now 
Index: /issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp	(revision 5974)
+++ /issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp	(revision 5975)
@@ -39,6 +39,8 @@
 #include "../../../include/include.h"
 
-void PetscOptionsDetermineSolverType(int* psolver_type,char* options_string){
+void PetscOptionsDetermineSolverType(int* psolver_type,Parameters* parameters){
 
+	
+	
 
 	/*The list of options is going to be pairs of the type "-option option_value"*/
@@ -53,70 +55,101 @@
 	int ignore_second;
 	int first_token=1;
+	char parallel_option[100];
+	PetscTruth flag;
 
 	/*output: */
 	int solver_type=PETSCPACKAGE;
 
+	/*In serial, pick up the options string from parameters, and analyze it. 
+	 * In parallel, options are command line driven, so retrieve the mat_type 
+	 * option and conclude: */
 
-	PetscTokenCreate(options_string,' ',&token);
-	for (;;){
-		
+	#ifdef _SERIAL_
+		parameters->FindParam(&options_string,PetscRcEnum);
 
-		/*Read next tokens*/
-		if(first_token){
-			PetscTokenFind(token,&first);
-		}
-		PetscTokenFind(token,&second);
-		
-		if (!first){
-			/*We are at the end of options*/
-			break;
-		}
-		if(!second){
-			/*We have no second value, end the token analysis.*/
-			if(first[0]!='-'){
-				/*This is not good, the option does not have '-'! Get out*/
-				ISSMERROR("%s%s%s","Option ",first," should be preceded by '-'!");
+
+		PetscTokenCreate(options_string,' ',&token);
+		for (;;){
+			
+
+			/*Read next tokens*/
+			if(first_token){
+				PetscTokenFind(token,&first);
 			}
-			break;
-		}
-		else{
-			/*Ok, we have a second token coming in. Is it another option, or 'first' option's value?*/
-			if (second[0]=='-'){
-				/*Second is another option, ignore it and prepare next loop step*/
-				first=second;
-				first_token=0;
+			PetscTokenFind(token,&second);
+			
+			if (!first){
+				/*We are at the end of options*/
+				break;
+			}
+			if(!second){
+				/*We have no second value, end the token analysis.*/
+				if(first[0]!='-'){
+					/*This is not good, the option does not have '-'! Get out*/
+					ISSMERROR("%s%s%s","Option ",first," should be preceded by '-'!");
+				}
+				break;
 			}
 			else{
-				/*Second is 'first' option's value*/
-				PetscStrlen(second,&len);
-				while (len > 0 && (second[len-1] == ' ' || second[len-1] == 'n')) {
-					len--; second[len] = 0;
+				/*Ok, we have a second token coming in. Is it another option, or 'first' option's value?*/
+				if (second[0]=='-'){
+					/*Second is another option, ignore it and prepare next loop step*/
+					first=second;
+					first_token=0;
 				}
-				/*We now have a pair first and second. Check whether first is equal to -mat_type. If so, check 
-				 * the second argument for the name of the external package desired.*/
-				if (strcmp(first,"-mat_type")==0){
-					if (strcmp(second,"aijmumps")==0){
-						solver_type=MUMPSPACKAGE_LU;
+				else{
+					/*Second is 'first' option's value*/
+					PetscStrlen(second,&len);
+					while (len > 0 && (second[len-1] == ' ' || second[len-1] == 'n')) {
+						len--; second[len] = 0;
 					}
-					if (strcmp(second,"sbaijmumps")==0){
-						solver_type=MUMPSPACKAGE_CHOL;
+					/*We now have a pair first and second. Check whether first is equal to -mat_type. If so, check 
+					 * the second argument for the name of the external package desired.*/
+					if (strcmp(first,"-mat_type")==0){
+						if (strcmp(second,"aijmumps")==0){
+							solver_type=MUMPSPACKAGE_LU;
+						}
+						if (strcmp(second,"sbaijmumps")==0){
+							solver_type=MUMPSPACKAGE_CHOL;
+						}
+						if (strcmp(second,"aijspooles")==0){
+							solver_type=SPOOLESPACKAGE_LU;
+						}
+						if (strcmp(second,"sbaijspooles")==0){
+							solver_type=SPOOLESPACKAGE_CHOL;
+						}
+						if (strcmp(second,"superlu_dist")==0){
+							solver_type=SUPERLUDISTPACKAGE;
+						}
 					}
-					if (strcmp(second,"aijspooles")==0){
-						solver_type=SPOOLESPACKAGE_LU;
-					}
-					if (strcmp(second,"sbaijspooles")==0){
-						solver_type=SPOOLESPACKAGE_CHOL;
-					}
-					if (strcmp(second,"superlu_dist")==0){
-						solver_type=SUPERLUDISTPACKAGE;
-					}
+					
+					first_token=1;
 				}
-				
-				first_token=1;
 			}
 		}
-	}
+		PetscTokenDestroy(token);
+	#else
 
-	PetscTokenDestroy(token);
+		/*retrieve mat_type option: */
+		PetscOptionsGetString(PETSC_NULL,"-mat_type",&parallel_option[0],100,&flag);
+
+		if (strcmp(parallel_option,"aijmumps")==0){
+			solver_type=MUMPSPACKAGE_LU;
+		}
+		if (strcmp(parallel_option,"sbaijmumps")==0){
+			solver_type=MUMPSPACKAGE_CHOL;
+		}
+		if (strcmp(parallel_option,"aijspooles")==0){
+			solver_type=SPOOLESPACKAGE_LU;
+		}
+		if (strcmp(parallel_option,"sbaijspooles")==0){
+			solver_type=SPOOLESPACKAGE_CHOL;
+		}
+		if (strcmp(parallel_option,"superlu_dist")==0){
+			solver_type=SUPERLUDISTPACKAGE;
+		}
+	#endif
+
+
 
 	/*Assign output: */
Index: /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h	(revision 5974)
+++ /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h	(revision 5975)
@@ -9,4 +9,5 @@
 #include "petscvec.h"
 #include "petscksp.h"
+class Parameters;
 
 
@@ -39,5 +40,5 @@
 void MatInvert(Mat* pInv, Mat Matrix);
 void PetscOptionsInsertMultipleString(char* options_string);
-void PetscOptionsDetermineSolverType(int* psolver_type,char* options_string);
+void PetscOptionsDetermineSolverType(int* psolver_type,Parameters* parameters);
 void VecMerge(Vec A, Vec B, double* row_partition_vector,int row_partition_size);
 void MatMultPatch(Mat A,Vec X, Vec AX);
Index: /issm/trunk/src/m/utils/Ecco3/issm2ecco3.m
===================================================================
--- /issm/trunk/src/m/utils/Ecco3/issm2ecco3.m	(revision 5975)
+++ /issm/trunk/src/m/utils/Ecco3/issm2ecco3.m	(revision 5975)
@@ -0,0 +1,8 @@
+function gridfield=issm2ecco3(field,transition,xecco3,yecco3)
+
+	xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
+	gridfieldlinear=zeros(length(xecco3linear),1);
+	gridfieldlinear(transition(:,1))=field(transition(:,2));
+	gridfield=xecco3;
+	gridfield(:)=gridfieldlinear;
+	gridfield=gridfield';
Index: /issm/trunk/test/NightlyRun/test102.m
===================================================================
--- /issm/trunk/test/NightlyRun/test102.m	(revision 5974)
+++ /issm/trunk/test/NightlyRun/test102.m	(revision 5975)
@@ -4,4 +4,5 @@
 md=setelementstype(md,'macayeal','all');
 md=SetParallel(md,3);
+md=solversettomumps(md);
 md=solve(md,'analysis_type',DiagnosticSolutionEnum);
 
