Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 13588)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 13589)
@@ -68,4 +68,6 @@
 					./classes/objects/Vertex.cpp\
 					./classes/objects/AdolcEdf.h\
+					./classes/IssmComm.h\
+					./classes/IssmComm.cpp\
 					./classes/Hook.h\
 					./classes/Hook.cpp\
@@ -343,5 +345,4 @@
 					./modules/InputConvergencex/InputConvergencex.cpp\
 					./modules/InputConvergencex/InputConvergencex.h\
-					./solutions/PrintBanner.cpp\
 					./solutions/convergence.cpp\
 					./solutions/ProcessArguments.cpp\
Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 13588)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 13589)
@@ -21,5 +21,5 @@
 /*Object constructors and destructor*/
 /*FUNCTION FemModel::FemModel(int argc,char** argv){{{*/
-FemModel::FemModel(int argc,char** argv){
+FemModel::FemModel(int argc,char** argv,COMM incomm){
 
 	/*configuration: */
@@ -34,4 +34,11 @@
 	char *petscfilename  = NULL;
 	char *rootpath       = NULL;
+
+	/*First things first, store the communicator, and set it as a global variable: */
+	this->comm=incomm;
+	this->SetStaticComm();
+
+	/*Print starting banner:*/
+	this->PrintBanner();
 
 	/*Start profiler: */
@@ -264,4 +271,23 @@
 }
 /*}}}*/
+/*FUNCTION FemModel::SetStaticComm {{{*/
+void FemModel::SetStaticComm(void){
+
+	/*This routine sets the global communicator variable hidden inside the IssmComm 
+	 *class: */
+	IssmComm::SetComm(this->comm);
+
+}
+/*}}}*/
+/*FUNCTION FemModel::PrintBanner {{{*/
+void FemModel::PrintBanner(void){
+
+	_pprintLine_("");
+	_pprintLine_("Ice Sheet System Model (" << PACKAGE_NAME << ") version " << PACKAGE_VERSION);
+	_pprintLine_("(website: " << PACKAGE_URL << " contact: " << PACKAGE_BUGREPORT << ")");
+	_pprintLine_("");
+
+}
+/*}}}*/
 
 /*Numerics: */
Index: /issm/trunk-jpl/src/c/classes/FemModel.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.h	(revision 13588)
+++ /issm/trunk-jpl/src/c/classes/FemModel.h	(revision 13589)
@@ -44,7 +44,8 @@
 		Parameters  *parameters;           //one set of parameters, independent of the analysis_type
 		Results     *results;              //results that cannot be fit into the elements 
+		COMM        comm;                  //communicator for this particular model
 
 		/*constructors, destructors: */
-		FemModel(int argc,char** argv);
+		FemModel(int argc,char** argv,COMM comm_init);
 		FemModel(char* rootpath, char* inputfilename, char* outputfilename, char* petscfilename, char* lockfilename, const int solution_type,const int* analyses,const int nummodels);
 		~FemModel();
@@ -55,4 +56,6 @@
 		void Solve(void);
 		void OutputResults(void);
+		void SetStaticComm();
+		void PrintBanner(void);
 
 		/*Fem: */
Index: /issm/trunk-jpl/src/c/classes/IoModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/IoModel.cpp	(revision 13588)
+++ /issm/trunk-jpl/src/c/classes/IoModel.cpp	(revision 13589)
@@ -1340,15 +1340,15 @@
 		}
 	}
-#ifdef _HAVE_MPI_
+	#ifdef _HAVE_MPI_
 	MPI_Bcast(&found,1,MPI_INT,0,MPI_COMM_WORLD); 
 	if(!found)_error_("could not find data with name " << EnumToStringx(data_enum) << " in binary file");
-#endif
+	#endif
 
 	/*Broadcast code and vector type: */
-#ifdef _HAVE_MPI_
+	#ifdef _HAVE_MPI_
 	MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD); 
 	MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD); 
 	if(record_code==5) MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD); 
-#endif
+	#endif
 
 	/*Assign output pointers:*/
Index: /issm/trunk-jpl/src/c/classes/IssmComm.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/IssmComm.cpp	(revision 13589)
+++ /issm/trunk-jpl/src/c/classes/IssmComm.cpp	(revision 13589)
@@ -0,0 +1,38 @@
+/*! \file IssmComm.cpp
+ * \brief  file containing the methods for IssmComm.h
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./IssmComm.h"
+
+void IssmComm::SetComm(COMM incomm){ /*{{{*/
+	comm=incomm;
+}/*}}}*/
+COMM IssmComm::GetComm(){  /*{{{*/
+	return comm;
+}/*}}}*/
+int IssmComm::GetRank(){  /*{{{*/
+	int my_rank;
+	#ifdef _HAVE_MPI_
+	MPI_Comm_rank(comm,&my_rank);
+	#else
+	my_rank=0;
+	#endif
+	return my_rank;
+
+}/*}}}*/
+int IssmComm::GetSize(){  /*{{{*/
+	int size;
+	#ifdef _HAVE_MPI_
+	MPI_Comm_size(comm,&size);
+	#else
+	size=1;
+	#endif
+	return size;
+
+}/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/IssmComm.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/IssmComm.h	(revision 13589)
+++ /issm/trunk-jpl/src/c/classes/IssmComm.h	(revision 13589)
@@ -0,0 +1,31 @@
+/* \file IssmComm.h
+ * \brief  create a class with a static comm, and static methods to access it
+ * This is a way of protecting access to the communicator.
+ */
+
+#ifndef _ISSM_COMM_H
+#define _ISSM_COMM_H
+
+/*{{{*/
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../include/types.h"
+/*}}}*/
+
+class IssmComm {
+
+	private:
+		static COMM comm;
+
+	public:
+		static void SetComm(COMM incomm);
+		static COMM GetComm();
+		static int GetRank();
+		static int GetSize();
+};
+
+#endif  /* _ISSM_COMM_H */
Index: /issm/trunk-jpl/src/c/classes/classes.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/classes.h	(revision 13588)
+++ /issm/trunk-jpl/src/c/classes/classes.h	(revision 13589)
@@ -31,4 +31,5 @@
 #include "./OptPars.h"
 #include "./AdolcEdf.h"
+#include "./IssmComm.h"
 
 #endif
Index: /issm/trunk-jpl/src/c/include/globals.h
===================================================================
--- /issm/trunk-jpl/src/c/include/globals.h	(revision 13588)
+++ /issm/trunk-jpl/src/c/include/globals.h	(revision 13589)
@@ -6,4 +6,9 @@
 #define GLOBALS_H_
 
+
+#include "./types.h"
+#include "../classes/IssmComm.h"
+COMM IssmComm::comm;
+
 int my_rank=0;
 int num_procs=1;
Index: /issm/trunk-jpl/src/c/include/types.h
===================================================================
--- /issm/trunk-jpl/src/c/include/types.h	(revision 13588)
+++ /issm/trunk-jpl/src/c/include/types.h	(revision 13589)
@@ -40,3 +40,11 @@
 #endif
 
+/*Define communicator: */
+#ifdef _HAVE_MPI_
+#include "mpi.h"
+typedef MPI_Comm COMM;
+#else
+typedef int COMM;
+#endif
+
 #endif //ifndef _TYPES_H_
Index: /issm/trunk-jpl/src/c/solutions/EnvironmentInit.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/EnvironmentInit.cpp	(revision 13588)
+++ /issm/trunk-jpl/src/c/solutions/EnvironmentInit.cpp	(revision 13589)
@@ -10,8 +10,5 @@
 #include "../toolkits/toolkits.h"
 
-void EnvironmentInit(int argc,char** argv){
-	
-	extern int my_rank;
-	extern int num_procs;
+COMM EnvironmentInit(int argc,char** argv){
 
 	/*Initialize environments: Petsc, MPI, etc...: */
@@ -19,14 +16,14 @@
 	int ierr=PetscInitialize(&argc,&argv,(char*)0,"");  
 	if(ierr) _error_("Could not initialize Petsc");
+	return MPI_COMM_WORLD;
 	#else
 	#ifdef _HAVE_MPI_
 	MPI_Init(&argc,&argv);
+	return MPI_COMM_WORLD;
+	#else
+	return 1; //return bogus number for comm, which does not exist anyway.
 	#endif
 	#endif
 	
-	/*Size and rank: */
-	#ifdef _HAVE_MPI_
-	MPI_Comm_rank(MPI_COMM_WORLD,&my_rank);  
-	MPI_Comm_size(MPI_COMM_WORLD,&num_procs); 
-	#endif
+
 }
Index: sm/trunk-jpl/src/c/solutions/PrintBanner.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/PrintBanner.cpp	(revision 13588)
+++ 	(revision )
@@ -1,15 +1,0 @@
-/*!\file: PrintBanner.cpp
- * \brief: print banner information on ISSM
- */ 
-
-#include "../include/include.h"
-#include "../shared/shared.h"
-
-void PrintBanner(void){
-
-	_pprintLine_("");
-	_pprintLine_("Ice Sheet System Model (" << PACKAGE_NAME << ") version " << PACKAGE_VERSION);
-	_pprintLine_("(website: " << PACKAGE_URL << " contact: " << PACKAGE_BUGREPORT << ")");
-	_pprintLine_("");
-}
-
Index: /issm/trunk-jpl/src/c/solutions/issm.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/issm.cpp	(revision 13588)
+++ /issm/trunk-jpl/src/c/solutions/issm.cpp	(revision 13589)
@@ -7,6 +7,5 @@
 int main(int argc,char **argv){
 
-	/*Print starting banner:*/
-	PrintBanner();
+	COMM comm_init;
 
 	/*Initialize exception trapping: */
@@ -14,8 +13,12 @@
 
 	/*Initialize environment (MPI, PETSC, MUMPS, etc ...)*/
-	EnvironmentInit(argc,argv);
-		
+	comm_init=EnvironmentInit(argc,argv);
+
+	/*Hack for now: */
+	MPI_Comm_rank(comm_init,&my_rank);
+	MPI_Comm_size(comm_init,&num_procs);
+
 	/*Initialize femmodel from arguments provided command line: */
-	FemModel *femmodel = new FemModel(argc,argv);
+	FemModel *femmodel = new FemModel(argc,argv,comm_init);
 
 	/*Solve: */
Index: /issm/trunk-jpl/src/c/solutions/solutions.h
===================================================================
--- /issm/trunk-jpl/src/c/solutions/solutions.h	(revision 13588)
+++ /issm/trunk-jpl/src/c/solutions/solutions.h	(revision 13589)
@@ -8,4 +8,5 @@
 #include "../classes/objects/objects.h"
 #include "../io/io.h"
+#include "../toolkits/toolkits.h"
 
 struct OptArgs;
@@ -47,5 +48,5 @@
 void controlrestart(FemModel* femmodel,IssmDouble* J);
 void ResetBoundaryConditions(FemModel* femmodel, int analysis_type);
-void EnvironmentInit(int argc,char** argv);
+COMM EnvironmentInit(int argc,char** argv);
 void EnvironmentFinalize(void);
 int  DakotaSpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* femmodel,int counter);
