Index: /XIOS/trunk/arch/arch-GCC_LINUX.path
===================================================================
--- /XIOS/trunk/arch/arch-GCC_LINUX.path	(revision 474)
+++ /XIOS/trunk/arch/arch-GCC_LINUX.path	(revision 475)
@@ -11,5 +11,5 @@
 HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz"
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-GCC_MACOSX.path
===================================================================
--- /XIOS/trunk/arch/arch-GCC_MACOSX.path	(revision 474)
+++ /XIOS/trunk/arch/arch-GCC_MACOSX.path	(revision 475)
@@ -7,5 +7,5 @@
 HDF5_LIB=""
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-PW6_VARGAS.path
===================================================================
--- /XIOS/trunk/arch/arch-PW6_VARGAS.path	(revision 474)
+++ /XIOS/trunk/arch/arch-PW6_VARGAS.path	(revision 475)
@@ -11,5 +11,5 @@
 MPI_LIB=""
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-X64_ADA.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_ADA.path	(revision 474)
+++ /XIOS/trunk/arch/arch-X64_ADA.path	(revision 475)
@@ -11,5 +11,5 @@
 HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz"
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-X64_CURIE.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_CURIE.path	(revision 474)
+++ /XIOS/trunk/arch/arch-X64_CURIE.path	(revision 475)
@@ -11,7 +11,7 @@
 HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
 
 #only for MEMTRACK debuging : developper only
Index: /XIOS/trunk/arch/arch-X64_CURIE_GCC.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_CURIE_GCC.path	(revision 474)
+++ /XIOS/trunk/arch/arch-X64_CURIE_GCC.path	(revision 475)
@@ -11,5 +11,5 @@
 HDF5_LIB=""
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-X64_CURIE_PGI.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_CURIE_PGI.path	(revision 474)
+++ /XIOS/trunk/arch/arch-X64_CURIE_PGI.path	(revision 475)
@@ -11,5 +11,5 @@
 HDF5_LIB=""
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-X64_CURIE_VAMPIR.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_CURIE_VAMPIR.path	(revision 474)
+++ /XIOS/trunk/arch/arch-X64_CURIE_VAMPIR.path	(revision 475)
@@ -11,5 +11,5 @@
 HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-X64_HORUS.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_HORUS.path	(revision 474)
+++ /XIOS/trunk/arch/arch-X64_HORUS.path	(revision 475)
@@ -11,5 +11,5 @@
 HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz"
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-X64_JADE.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_JADE.path	(revision 474)
+++ /XIOS/trunk/arch/arch-X64_JADE.path	(revision 475)
@@ -11,5 +11,5 @@
 HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz"
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-X64_TITANE.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_TITANE.path	(revision 474)
+++ /XIOS/trunk/arch/arch-X64_TITANE.path	(revision 475)
@@ -11,5 +11,5 @@
 HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-X64_TITANE_VAMPIR.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_TITANE_VAMPIR.path	(revision 474)
+++ /XIOS/trunk/arch/arch-X64_TITANE_VAMPIR.path	(revision 475)
@@ -11,5 +11,5 @@
 HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/arch/arch-XE6_LYNX.path
===================================================================
--- /XIOS/trunk/arch/arch-XE6_LYNX.path	(revision 474)
+++ /XIOS/trunk/arch/arch-XE6_LYNX.path	(revision 475)
@@ -11,5 +11,5 @@
 HDF5_LIB="-lhdf5_hl -lhdf5 -lz -lcurl"
 
-OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
-OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
Index: /XIOS/trunk/bld.cfg
===================================================================
--- /XIOS/trunk/bld.cfg	(revision 474)
+++ /XIOS/trunk/bld.cfg	(revision 475)
@@ -55,3 +55,4 @@
 bld::excl_dep        use::mod_prism_get_localcomm_proto
 bld::excl_dep        use::mod_prism_proto
+bld::excl_dep        use::mod_prism
 bld::excl_dep        inc::mpif.h
Index: /XIOS/trunk/make_xios
===================================================================
--- /XIOS/trunk/make_xios	(revision 474)
+++ /XIOS/trunk/make_xios	(revision 475)
@@ -4,4 +4,5 @@
 compil_full="false"
 use_oasis="false"
+oasis="oasis3_mct"
 use_memtrack="false"
 job="1"
@@ -23,5 +24,5 @@
 	    echo "       [--avail] : to know available target architectures "
 	    echo "       [--full] : to generate dependencies and recompile from scratch"
-	    echo "       [--use_oasis] : to use Oasis coupler"
+	    echo "       [--use_oasis 'oasis3' 'oasis3_mct' : default oasis3_mct] : to use Oasis coupler"
 	    echo "       [--doc] : to generate Doxygen documentation (not available yet)"
 	    echo "       [--job ntasks] : to use parallel compilation with ntasks"
@@ -37,5 +38,5 @@
          "--avail") ls arch/*.fcm | cut -d"-" -f2 | cut -d"." -f1 ; exit ;; 
          "--full")  compil_full="true"  ; shift ;;
-         "--use_oasis")  use_oasis="true"  ; shift  ;;
+         "--use_oasis")  use_oasis="true" oasis=$2 ; shift ; shift  ;;
          "--doc")   doc="true"          ; shift ;;
          "--job")   job=$2              ; shift ; shift ;;
@@ -130,8 +131,20 @@
 if [[ "$use_oasis" == "true" ]]
    then
-   NETCDF_LIB="-lnetcdff -lnetcdf"
-   XMLIO_FINCDIR="$OASIS_INCDIR $XMLIO_FINCDIR"
-   XMLIO_LIB="$OASIS_LIBDIR $OASIS_LIB $XMLIO_LIB"
-   XMLIO_CPPKEY="$XMLIO_CPPKEY USE_OASIS"
+    if [[ "$oasis" == "oasis3_mct" ]]
+    then
+	XMLIO_CPPKEY="$XMLIO_CPPKEY USE_OMCT"
+    elif [[ "$oasis" == "oasis3"  ]]
+    then
+	XMLIO_CPPKEY="$XMLIO_CPPKEY USE_OASIS"
+	OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
+	OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
+	OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
+    else
+	echo "Bad choice for --use_oasis argument : choose between 'oasis3','oasis3_mct'"
+	exit
+    fi
+    NETCDF_LIB="-lnetcdff -lnetcdf"
+    XMLIO_FINCDIR="$OASIS_INCDIR $XMLIO_FINCDIR"
+    XMLIO_LIB="$OASIS_LIBDIR $OASIS_LIB $XMLIO_LIB"
 fi 
 
Index: /XIOS/trunk/src/interface/c/oasis_cinterface.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/oasis_cinterface.cpp	(revision 474)
+++ /XIOS/trunk/src/interface/c/oasis_cinterface.cpp	(revision 475)
@@ -16,4 +16,9 @@
   }
   
+  void oasis_enddef(void)
+  {
+    fxios_oasis_enddef() ;
+  }
+
   void oasis_get_localcomm(MPI_Comm& comm)
   {
Index: /XIOS/trunk/src/interface/c/oasis_cinterface.hpp
===================================================================
--- /XIOS/trunk/src/interface/c/oasis_cinterface.hpp	(revision 474)
+++ /XIOS/trunk/src/interface/c/oasis_cinterface.hpp	(revision 475)
@@ -8,4 +8,5 @@
 
   void fxios_oasis_init(const char* server_id,int str_len) ;
+  void fxios_oasis_enddef(void) ;
   void fxios_oasis_finalize(void) ;
   void fxios_oasis_get_localcomm(MPI_Fint* f_comm) ;
@@ -17,4 +18,5 @@
 {
   void oasis_init(const std::string& server_id) ;
+  void oasis_enddef(void) ;
   void oasis_finalize(void) ;
   void oasis_get_localcomm(MPI_Comm& comm) ;
Index: /XIOS/trunk/src/interface/fortran/oasis_interface.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/oasis_interface.F90	(revision 474)
+++ /XIOS/trunk/src/interface/fortran/oasis_interface.F90	(revision 475)
@@ -3,4 +3,7 @@
 #ifdef USE_OASIS
   USE mod_prism_proto
+#endif
+#ifdef USE_OMCT
+  USE mod_prism
 #endif
     CHARACTER(kind = C_CHAR),DIMENSION(*) :: server_id
@@ -16,6 +19,6 @@
     ENDDO
 
-#ifdef USE_OASIS
-    CALL prism_init_comp_proto (comp_id, oasis_server_id, ierr)
+#if defined USE_OASIS || defined USE_OMCT
+     CALL prism_init_comp_proto (comp_id, oasis_server_id, ierr)
 #endif
     PRINT *,"---> prism_init",oasis_server_id,ierr
@@ -23,4 +26,16 @@
 END SUBROUTINE fxios_oasis_init
 
+SUBROUTINE fxios_oasis_enddef() BIND(C,NAME="fxios_oasis_enddef")
+  USE, INTRINSIC :: ISO_C_BINDING
+#ifdef USE_OMCT
+  USE mod_prism
+#endif
+  IMPLICIT NONE
+  INTEGER :: ierr
+#ifdef USE_OMCT
+     CALL prism_enddef_proto(ierr)
+#endif
+
+END SUBROUTINE fxios_oasis_enddef
 
 SUBROUTINE fxios_oasis_finalize() BIND(C,NAME="fxios_oasis_finalize")
@@ -29,8 +44,11 @@
   USE mod_prism_proto
 #endif
+#ifdef USE_OMCT
+  USE mod_prism
+#endif
   IMPLICIT NONE
   INTEGER :: ierr
   
-#ifdef USE_OASIS
+#if defined USE_OASIS || defined USE_OMCT
     CALL prism_terminate_proto(ierr)
 #endif
@@ -42,6 +60,9 @@
   USE, INTRINSIC :: ISO_C_BINDING
 #ifdef USE_OASIS
-!  USE mod_prism_get_localcomm_proto 
+  USE mod_prism_get_localcomm_proto 
 #endif
+#ifdef USE_OMCT
+  USE mod_prism
+#endif 
   IMPLICIT NONE
   INTEGER(kind=C_INT) :: f_comm
@@ -50,5 +71,5 @@
   INTEGER :: ierr
     
-#ifdef USE_OASIS
+#if defined USE_OASIS || defined USE_OMCT
     CALL prism_get_localcomm_proto(comm,ierr)
 #endif
@@ -64,4 +85,7 @@
 #ifdef USE_OASIS
   USE mod_prism_get_comm 
+#endif
+#ifdef USE_OMCT
+  USE mod_prism
 #endif
   IMPLICIT NONE
@@ -79,5 +103,5 @@
     ENDDO
     
-#ifdef USE_OASIS
+#if defined USE_OASIS || defined USE_OMCT
     CALL prism_get_intracomm(comm_client_server,oasis_client_id,ierr)
 #endif
@@ -91,4 +115,7 @@
 #ifdef USE_OASIS
   USE mod_prism_get_comm 
+#endif
+#ifdef USE_OMCT
+  USE mod_prism
 #endif
   IMPLICIT NONE
@@ -106,5 +133,5 @@
     ENDDO
     
-#ifdef USE_OASIS
+#if defined USE_OASIS || defined USE_OMCT
     CALL prism_get_intercomm(comm_client_server,oasis_client_id,ierr)
 #endif
Index: /XIOS/trunk/src/server.cpp
===================================================================
--- /XIOS/trunk/src/server.cpp	(revision 474)
+++ /XIOS/trunk/src/server.cpp	(revision 475)
@@ -118,4 +118,5 @@
           interComm.push_back(newComm) ;
         }
+	oasis_enddef() ;
       }
       
