Index: /issm/trunk-jpl/m4/issm_options.m4
===================================================================
--- /issm/trunk-jpl/m4/issm_options.m4	(revision 21524)
+++ /issm/trunk-jpl/m4/issm_options.m4	(revision 21525)
@@ -1895,4 +1895,18 @@
 	AC_MSG_RESULT($HAVE_BAMG)
 	dnl }}}
+	dnl with-ocean{{{
+	AC_ARG_WITH([ocean],
+		AS_HELP_STRING([--with-ocean = YES],[compile with ice/ocean coupling (default is no)]),
+		[OCEAN=$withval],[OCEAN=no]) 
+	AC_MSG_CHECKING(for ice/ocean capability compilation)
+
+	HAVE_OCEAN=no
+	if test "x$OCEAN" = "xyes"; then
+		HAVE_OCEAN=yes
+		AC_DEFINE([_HAVE_OCEAN_],[1],[with ice/ocean coupling capability])
+	fi
+	AM_CONDITIONAL([OCEAN], [test x$HAVE_OCEAN = xyes])
+	AC_MSG_RESULT($HAVE_OCEAN)
+	dnl }}}
 	dnl with-kml{{{
 	AC_ARG_WITH([kml],
Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 21524)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 21525)
@@ -264,5 +264,5 @@
 					./modules/ConstraintsStatex/RiftConstraintsState.cpp\
 					./modules/ModelProcessorx/CreateOutputDefinitions.cpp\
-					./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp\	
+					./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp\
 					./modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp\
 					./classes/Inputs/PentaInput.cpp\
@@ -694,4 +694,9 @@
 issm_slr_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
 
+if OCEAN
+bin_PROGRAMS += issm_ocean
+issm_ocean_SOURCES = main/issm_ocean.cpp
+issm_ocean_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
+endif
 
 if KRIGING
Index: /issm/trunk-jpl/src/c/main/issm_ocean.cpp
===================================================================
--- /issm/trunk-jpl/src/c/main/issm_ocean.cpp	(revision 21525)
+++ /issm/trunk-jpl/src/c/main/issm_ocean.cpp	(revision 21525)
@@ -0,0 +1,132 @@
+/*!\file:  issm_ocean.cpp
+ * \brief: ISSM OCEAN main program. 
+ */ 
+
+#include "./issm.h"
+
+int main(int argc,char **argv){
+
+//	/*diverse:*/
+//	int    nummodels = 2;
+//	int*   commsizes=xNew<int>(nummodels);
+//	int*   rankzeros=xNew<int>(nummodels);
+//	char** modelnames=xNew<char*>(nummodels);
+//	char** dirnames=xNew<char*>(nummodels);
+//	int    iceid=0; 
+//	int    oceanid=1; 
+//	int    modelid;
+//	int    my_rank;
+//	int    count=0;
+//	ISSM_MPI_Comm worldcomm;
+//	ISSM_MPI_Comm modelcomm;
+//	ISSM_MPI_Comm toonceancomm;
+//	ISSM_MPI_Comm fromicecomms;
+
+	/*Initialize exception trapping: */
+	ExceptionTrapBegin();
+
+//	/*Initialize environment (MPI, PETSC, MUMPS, etc ...)*/
+//	worldcomm=EnvironmentInit(argc,argv);
+//	
+//	/*What is my rank?:*/
+//	ISSM_MPI_Comm_rank(worldcomm,&my_rank);
+//
+//	/*First model is ice, second is ocean*/
+//	for(int i=0;i<nummodels;i++){
+//		char* string=NULL;
+//		
+//		string=xNew<char>(strlen(argv[5+3*i])+1);
+//		xMemCpy<char>(string,argv[5+3*i],strlen(argv[5+3*i])+1);
+//		dirnames[i]=string;
+//		
+//		string=xNew<char>(strlen(argv[5+3*i+1])+1);
+//		xMemCpy<char>(string,argv[5+3*i+1],strlen(argv[5+3*i+1])+1);
+//		modelnames[i]=string;
+//
+//		commsizes[i]=(int) strtol(argv[5+3*i+2], (char **)NULL, 10);
+//	}
+//
+//	/*Figure out which model each cpu will belong to: */
+//	count=0;
+//	for(int i=0;i<nummodels;i++){
+//		if(my_rank>=count && my_rank<(count+commsizes[i])){
+//			modelid=i;
+//			break;
+//		}
+//		count+=commsizes[i];
+//	} 
+//	/*Buil array of who is rank 0 of their own group:*/
+//	count=0;
+//	for(int i=0;i<nummodels;i++){
+//		rankzeros[i]=count;
+//		count+=commsizes[i];
+//	}
+//	/*}}}*/
+//
+//	/*Split world into sub-communicators for each and every model:*/
+//	ISSM_MPI_Comm_split(worldcomm,modelid, my_rank, &modelcomm);
+//
+//	/*Build inter communicators:*/ // change to Dimitris solution
+//	if(modelid==iceid){
+//		ISSM_MPI_Intercomm_create( modelcomm, 0, worldcomm, rankzeros[oceanid], iceid, fromicecomms+i); //communicate from local erth comm 9rank 0) to ice comm (rank 0) using modelid tag.
+//	}
+//	else{
+//		ISSM_MPI_Intercomm_create( modelcomm, 0, worldcomm, rankzeros[iceid], oceanid, &toearthcomm); //communicate from local ice comm (rank 0) to earth comm (rank 0) using modelid tag.
+//	}
+
+//	/*Supply specific argc and argv for each sub-communicator (corresponding to each  model specificatiions):{{{*/
+//	char** arguments=xNew<char*>(4);
+//	arguments[0]=xNew<char>(strlen(argv[0])+1); xMemCpy<char>(arguments[0],argv[0],strlen(argv[0])+1); //executable name
+//	arguments[1]=xNew<char>(strlen(argv[1])+1); xMemCpy<char>(arguments[1],argv[1],strlen(argv[1])+1); //solution name
+//	arguments[2]=xNew<char>(strlen(argv[5+3*modelid])+1); xMemCpy<char>(arguments[2],argv[5+3*modelid],strlen(argv[5+3*modelid])+1); //directory name
+//	arguments[3]=xNew<char>(strlen(argv[5+3*modelid+1])+1); xMemCpy<char>(arguments[3],argv[5+3*modelid+1],strlen(argv[5+3*modelid+1])+1); //model name
+//	/*}}}*/
+//
+
+	//REMOVE
+	/*Initialize environment (MPI, PETSC, MUMPS, etc ...)*/
+	ISSM_MPI_Comm comm_init=EnvironmentInit(argc,argv);
+	/*Initialize femmodel from arguments provided command line: */
+	FemModel *femmodel = new FemModel(argc,argv,comm_init);
+	///*Initialize femmodel from arguments provided command line: */
+	//FemModel *femmodel = new FemModel(1,arguments,modelcomm);
+	
+//	/*Now that the models are initialized, keep communicator information in the parameters datasets of each model: */
+//	femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(worldcomm,WorldCommEnum));
+//	femmodel->parameters->AddObject(new IntParam(NumModelsEnum,nummodels));
+//	femmodel->parameters->AddObject(new IntParam(ModelIdEnum,oceanid));
+//	femmodel->parameters->AddObject(new IntParam(EarthIdEnum,iceid));
+//	if(modelid==earthid) femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm*>(fromicecomms,IcecapToEarthCommEnum));
+//	else femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(toearthcomm,IcecapToEarthCommEnum));
+
+	/*Solve: */
+	femmodel->Solve();
+
+	/*Output results: */
+	OutputResultsx(femmodel);
+
+	/*Wrap up: */
+	femmodel->CleanUp();
+
+	/*Delete Model: */
+	delete femmodel;
+
+	/*Finalize environment:*/
+	EnvironmentFinalize();
+
+	/*Finalize exception trapping: */
+	ExceptionTrapEnd();
+
+//	/*Free ressources:*/
+//	xDelete<int>(commsizes);
+//	for(int i=0;i<nummodels;i++){
+//		char* string=NULL;
+//		string=dirnames[i]; xDelete<char>(string);
+//		string=modelnames[i]; xDelete<char>(string);
+//	}
+//	xDelete<char*>(dirnames);
+//	xDelete<char*>(modelnames);
+
+	/*Return unix success: */
+	return 0; 
+}
