Index: issm/trunk/src/c/io/FetchData.cpp
===================================================================
--- issm/trunk/src/c/io/FetchData.cpp	(revision 8224)
+++ issm/trunk/src/c/io/FetchData.cpp	(revision 8330)
@@ -571,5 +571,5 @@
 #endif
 
-#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
+#if defined(_HAVE_PETSC_)
 /*FUNCTION FetchData(double** pmatrix, int* pM,int* pN,FILE* fid){{{1*/
 void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid){
Index: issm/trunk/src/c/io/IoModelFetchData.cpp
===================================================================
--- issm/trunk/src/c/io/IoModelFetchData.cpp	(revision 8224)
+++ issm/trunk/src/c/io/IoModelFetchData.cpp	(revision 8330)
@@ -11,71 +11,55 @@
 #include "./io.h"
 
-#ifdef _SERIAL_
-/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
-													  Serial IoModelFetch Data Routines, all overloaded.
-**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
-/*FUNCTION IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){{{1*/
-void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){
-
-	FetchData(pdataset,mxGetAssignedField(model_handle,0,data_name));
+/*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int* pN,FILE* model_handle,char* data_name){{{1*/
+void  IoModelFetchData(double** pmatrix,int* pM,int* pN,FILE* model_handle,char* data_name){
+	
+	FILE* fid=NULL;
+	
+	/*Set file pointer to beginning of the data: */
+	fid=SetFilePointerToData(model_handle,data_name);
+	
+	/*Now fetch: */
+	FetchData(pmatrix,pM,pN,fid);
 
 }
 /*}}}*/
-/*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){{{1*/
-void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){
+/*FUNCTION IoModelFetchData(char** pstring,FILE* model_handle,char* data_name){{{1*/
+void  IoModelFetchData(char** pstring,FILE* model_handle,char* data_name){
+
+	FILE* fid=NULL;
 	
-	FetchData(pmatrix,pM,pN,mxGetAssignedField(model_handle,0,data_name));
-
+	/*Set file pointer to beginning of the data: */
+	fid=SetFilePointerToData(model_handle,data_name);
+	
+	/*Now fetch: */
+	FetchData(pstring,fid);
 }
 /*}}}*/
-/*FUNCTION IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){{{1*/
-void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){
+/*FUNCTION IoModelFetchData(double* pscalar,FILE* model_handle,char* data_name){{{1*/
+void  IoModelFetchData(double* pscalar,FILE* model_handle,char* data_name){
+
+	FILE* fid=NULL;
 	
-	FetchData(pmatrix,mxGetAssignedField(model_handle,0,data_name));
-
+	/*Set file pointer to beginning of the data: */
+	fid=SetFilePointerToData(model_handle,data_name);
+	
+	/*Now fetch: */
+	FetchData(pscalar,fid);
 }
 /*}}}*/
-/*FUNCTION IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){{{1*/
-void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){
+/*FUNCTION IoModelFetchData(int* pinteger,FILE* model_handle,char* data_name){{{1*/
+void  IoModelFetchData(int* pinteger,FILE* model_handle,char* data_name){
+
+	FILE* fid=NULL;
 	
-	FetchData(pvector,pM,mxGetAssignedField(model_handle,0,data_name));
-
+	/*Set file pointer to beginning of the data: */
+	fid=SetFilePointerToData(model_handle,data_name);
+	
+	/*Now fetch: */
+	FetchData(pinteger,fid);
 }
 /*}}}*/
-/*FUNCTION IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){{{1*/
-void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){
-	
-	FetchData(pvector,mxGetAssignedField(model_handle,0,data_name));
-
-}
-/*}}}*/
-/*FUNCTION IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){{{1*/
-void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){
-	
-	FetchData(pstring,mxGetAssignedField(model_handle,0,data_name));
-
-}
-/*}}}*/
-/*FUNCTION IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){{{1*/
-void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){
-	
-	FetchData(pscalar,mxGetAssignedField(model_handle,0,data_name));
-
-}
-/*}}}*/
-/*FUNCTION IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){{{1*/
-void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){
-
-	FetchData(pinteger,mxGetAssignedField(model_handle,0,data_name));
-}
-/*}}}*/
-#endif
-
-#ifdef _PARALLEL_
-/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
-													  Parallel IoModelFetch Data Routines, all overloaded.
-**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
-/*FUNCTION SetFilePointerToData(ConstDataHandle model_handle,char* data_name){{{1*/
-FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name){
+/*FUNCTION SetFilePointerToData(FILE* model_handle,char* data_name){{{1*/
+FILE* SetFilePointerToData(FILE* model_handle,char* data_name){
 
 	extern int my_rank;
@@ -140,51 +124,62 @@
 }
 /*}}}*/
-/*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name){{{1*/
-void  IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name){
+
+#ifdef _SERIAL_
+/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
+													  Serial IoModelFetch Data Routines, all overloaded.
+**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
+/*FUNCTION IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){{{1*/
+void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){
+
+	FetchData(pdataset,mxGetAssignedField(model_handle,0,data_name));
+
+}
+/*}}}*/
+/*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){{{1*/
+void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){
 	
-	FILE* fid=NULL;
+	FetchData(pmatrix,pM,pN,mxGetAssignedField(model_handle,0,data_name));
+
+}
+/*}}}*/
+/*FUNCTION IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){{{1*/
+void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){
 	
-	/*Set file pointer to beginning of the data: */
-	fid=SetFilePointerToData(model_handle,data_name);
+	FetchData(pmatrix,mxGetAssignedField(model_handle,0,data_name));
+
+}
+/*}}}*/
+/*FUNCTION IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){{{1*/
+void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){
 	
-	/*Now fetch: */
-	FetchData(pmatrix,pM,pN,fid);
+	FetchData(pvector,pM,mxGetAssignedField(model_handle,0,data_name));
+
+}
+/*}}}*/
+/*FUNCTION IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){{{1*/
+void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){
+	
+	FetchData(pvector,mxGetAssignedField(model_handle,0,data_name));
 
 }
 /*}}}*/
 /*FUNCTION IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){{{1*/
-void  IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){
+void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){
+	
+	FetchData(pstring,mxGetAssignedField(model_handle,0,data_name));
 
-	FILE* fid=NULL;
-	
-	/*Set file pointer to beginning of the data: */
-	fid=SetFilePointerToData(model_handle,data_name);
-	
-	/*Now fetch: */
-	FetchData(pstring,fid);
 }
 /*}}}*/
 /*FUNCTION IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){{{1*/
-void  IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){
+void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){
+	
+	FetchData(pscalar,mxGetAssignedField(model_handle,0,data_name));
 
-	FILE* fid=NULL;
-	
-	/*Set file pointer to beginning of the data: */
-	fid=SetFilePointerToData(model_handle,data_name);
-	
-	/*Now fetch: */
-	FetchData(pscalar,fid);
 }
 /*}}}*/
 /*FUNCTION IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){{{1*/
-void  IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){
+void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){
 
-	FILE* fid=NULL;
-	
-	/*Set file pointer to beginning of the data: */
-	fid=SetFilePointerToData(model_handle,data_name);
-	
-	/*Now fetch: */
-	FetchData(pinteger,fid);
+	FetchData(pinteger,mxGetAssignedField(model_handle,0,data_name));
 }
 /*}}}*/
Index: issm/trunk/src/c/io/ParsePetscOptions.cpp
===================================================================
--- issm/trunk/src/c/io/ParsePetscOptions.cpp	(revision 8224)
+++ 	(revision )
@@ -1,119 +1,0 @@
-/*!\file:  ParsePetscOptions.cpp
- * \brief: parse options present in a petsc file, and create petsc options 
- * objects accordingly. This will be used to drive the behaviour of Petsc for 
- * each analysis type.
- */ 
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "./io.h"
-
-
-#ifdef _PARALLEL_
-void ParsePetscOptions(Parameters* parameters,char* optionsname){
-
-	FILE* fid=NULL;
-	char line [1000];
-	extern int my_rank;
-	int i;
-
-	/*intermediary: */
-	double* analyses=NULL;
-	char** strings=NULL;
-	int numanalyses;
-	char* string=NULL;
-	char* newstring=NULL;
-	char* catstring=NULL;
-	int   stringlength;
-
-	if(my_rank==0){
-
-		/*try to open file: */
-		fid =pfopen(optionsname ,"r");
-
-		/*Now, go through lines and figure out how many analyses we have: */
-		numanalyses=0;
-		while ( fgets(line, sizeof line, fid) ){
-			/*skip comments and empty lines: */
-			if ((line[0]=='%') || (line[0]=='\n') || (line[0]==' ') || (line[0]=='\t') || (line[0]=='\r'))continue;
-			/*ok, first time, we should get an analysis enum, starting with a +: */
-			if (line[0]=='+')numanalyses++;
-			else continue;
-		}
-
-		/*Now, allocate analyses and strings: */
-		analyses=(double*)xmalloc(numanalyses*sizeof(double));
-		strings=(char**)xmalloc(numanalyses*sizeof(char*));
-		for(i=0;i<numanalyses;i++)strings[i]=NULL; 
-
-		/*Go back to beginning of file:*/
-		fseek(fid,0,SEEK_SET);
-		numanalyses=0;
-		while ( fgets(line, sizeof line, fid) ){
-		
-			/*skip comments and empty lines: */
-			if ((line[0]=='%') || (line[0]=='\n') || (line[0]==' ') || (line[0]=='\t') || (line[0]=='\r'))continue;
-		
-			/*Get rid of end of line: */
-			line[strlen(line)-1]='\0';
-		
-			if (line[0]=='+'){ /*this is the analysis line: */
-				analyses[numanalyses]=StringToEnumx(&line[1]);  //skip the '+'
-				numanalyses++;
-			}
-			else{ /*this is an option corresponding to analysis numanalyses-1. Add it 
-			to the already existing options*/
-				if(strings[numanalyses-1]==NULL){
-					string=(char*)xmalloc((strlen(line)+1)*sizeof(char)); strcpy(string,line);
-					strings[numanalyses-1]=string;
-				}
-				else{
-					string=strings[numanalyses-1];
-					newstring=(char*)xmalloc((strlen(line)+1)*sizeof(char)); strcpy(newstring,line);
-					/*concatenate:*/
-					catstring=(char*)xmalloc((strlen(string)+1+strlen(newstring)+1+1)*sizeof(char)); //fit in a space " "
-					strcpy(catstring,string);
-					strcat(catstring," ");
-					strcat(catstring,newstring);
-					strings[numanalyses-1]=catstring;
-					xfree((void**)&newstring);
-					xfree((void**)&string);
-				}
-			}
-		}
-
-		/*close file: */
-		pfclose(fid,optionsname);
-	}
-
-	/*Ok, broadcast to other cpus: */
-	MPI_Bcast(&numanalyses,1,MPI_INT,0,MPI_COMM_WORLD);
-	if(my_rank!=0){
-		analyses=(double*)xmalloc(numanalyses*sizeof(double));
-		strings=(char**)xmalloc(numanalyses*sizeof(char*));
-	}
-	MPI_Bcast(analyses,numanalyses,MPI_DOUBLE,0,MPI_COMM_WORLD);
-	for(i=0;i<numanalyses;i++){
-		char* string=strings[i];
-		if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
-		MPI_Bcast(&stringlength,1,MPI_INT,0,MPI_COMM_WORLD);
-		if(my_rank!=0)string=(char*)xmalloc(stringlength);
-		MPI_Bcast(string,stringlength,MPI_CHAR,0,MPI_COMM_WORLD);
-		if(my_rank!=0)strings[i]=string;
-	}
-
-	/*Ok, out of strings and analyses and numanalyses, create parameters, and plug them into parameters container: */
-	parameters->AddObject(new StringArrayParam(PetscOptionsStringsEnum,strings,numanalyses));
-	parameters->AddObject(new DoubleVecParam(PetscOptionsAnalysesEnum,analyses,numanalyses));
-
-	/*Clean up and return*/
-	for(i=0;i<numanalyses;i++) xfree((void**)&strings[i]);
-	xfree((void**)&strings);
-	xfree((void**)&analyses);
-	return;
-}
-#endif
Index: issm/trunk/src/c/io/io.h
===================================================================
--- issm/trunk/src/c/io/io.h	(revision 8224)
+++ issm/trunk/src/c/io/io.h	(revision 8330)
@@ -15,4 +15,16 @@
 FILE* pfopen(char* filename,char* format);
 void  pfclose(FILE* fid,char* filename);
+
+
+void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid);
+void FetchData(char** pstring,FILE* fid);
+void FetchData(double* pscalar,FILE* fid);
+void FetchData(int* pinteger,FILE* fid);
+void  IoModelFetchData(double** pmatrix,int* pM,int* pN,FILE* model_handle,char* data_name);
+void  IoModelFetchData(char** pstring,FILE* model_handle,char* data_name);
+void  IoModelFetchData(double* pscalar,FILE* model_handle,char* data_name);
+void  IoModelFetchData(int* pinteger,FILE* model_handle,char* data_name);
+FILE* SetFilePointerToData(FILE* model_handle,char* data_name);
+
 
 #ifdef _SERIAL_
@@ -75,21 +87,9 @@
 
 #ifdef _PARALLEL_
-void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid);
-void FetchData(char** pstring,FILE* fid);
-void FetchData(double* pscalar,FILE* fid);
-void FetchData(int* pinteger,FILE* fid);
 
-
-FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name);
-void  IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name);
-void  IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name);
-void  IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name);
-void  IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name);
 
 void WriteData(int* pdummy,void* data,char* data_type);
 void WriteDataToDisk(void* data,int* pM,int* pN,char* datatype,FILE* fid);
 
-/*petsc options: */
-void ParsePetscOptions(Parameters* parameters, char* filename);
 
 #endif
