Index: /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.cpp
===================================================================
--- /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.cpp	(revision 1368)
+++ /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.cpp	(revision 1369)
@@ -1,4 +1,2 @@
-
-
 #include "ep_lib.hpp"
 
@@ -45,5 +43,5 @@
 
 
-#undef MPI_INT
+/*#undef MPI_INT
 #undef MPI_FLOAT
 #undef MPI_DOUBLE
@@ -63,5 +61,5 @@
 #undef MPI_REQUEST_NULL
 #undef MPI_INFO_NULL
-
+*/
 
 
Index: /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.hpp
===================================================================
--- /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.hpp	(revision 1368)
+++ /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.hpp	(revision 1369)
@@ -1,24 +1,5 @@
 #ifndef EP_DECLARATION_HPP_INCLUDED
 #define EP_DECLARATION_HPP_INCLUDED
-/*
-extern ::MPI_Datatype MPI_INT_STD;
-extern ::MPI_Datatype MPI_FLOAT_STD;
-extern ::MPI_Datatype MPI_DOUBLE_STD;
-extern ::MPI_Datatype MPI_LONG_STD;
-extern ::MPI_Datatype MPI_CHAR_STD;
-extern ::MPI_Datatype MPI_UNSIGNED_LONG_STD;
-extern ::MPI_Datatype MPI_UNSIGNED_CHAR_STD;
 
-extern ::MPI_Op MPI_SUM_STD;
-extern ::MPI_Op MPI_MAX_STD;
-extern ::MPI_Op MPI_MIN_STD;
-
-extern ::MPI_Comm MPI_COMM_WORLD_STD;
-extern ::MPI_Comm MPI_COMM_NULL_STD;
-
-extern ::MPI_Status MPI_STATUS_IGNORE_STD;
-extern ::MPI_Request MPI_REQUEST_NULL_STD;
-extern ::MPI_Info MPI_INFO_NULL_STD;
-*/
 #undef MPI_INT
 #undef MPI_FLOAT
Index: /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_fortran.cpp
===================================================================
--- /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_fortran.cpp	(revision 1368)
+++ /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_fortran.cpp	(revision 1369)
@@ -7,30 +7,27 @@
 #include "ep_mpi.hpp"
 
-// #ifdef _openmpi
-// //#undef MPI_Fint
-// #endif
 
 namespace ep_lib
 {
 
-  int EP_Comm_c2f(MPI_Comm comm)
+  void* EP_Comm_c2f(MPI_Comm comm)
   {
     Debug("MPI_Comm_c2f");
-    int fint;
-    //#ifdef _intelmpi
-    fint = (::MPI_Fint)(to_mpi_comm(comm.mpi_comm));
-    //#elif _openmpi
-    //fint = ::MPI_Comm_c2f(to_mpi_comm(comm.mpi_comm));
-    //#endif
+    void* fint = new ::MPI_Fint;
+    #ifdef _intelmpi
+    *static_cast< ::MPI_Fint*>(fint) = (::MPI_Fint)(to_mpi_comm(comm.mpi_comm));
+    #elif _openmpi
+    *static_cast< ::MPI_Fint*>(fint) = MPI_Comm_c2f(to_mpi_comm(comm.mpi_comm));
+    #endif
     
-    std::map<std::pair<int, int>, MPI_Comm > ::iterator it;
+    std::map<std::pair< ::MPI_Fint, int>, MPI_Comm > ::iterator it;
     
     #pragma omp critical (fc_comm_map)
     {
-      it = fc_comm_map.find(std::make_pair(fint, omp_get_thread_num()));
+      it = fc_comm_map.find(std::make_pair(*static_cast< ::MPI_Fint*>(fint), omp_get_thread_num()));
       if(it == fc_comm_map.end())
       {
-        fc_comm_map.insert(std::make_pair( std::make_pair( fint, omp_get_thread_num()) , comm));
-        printf("EP_Comm_c2f : MAP %p insert: %d, %d, %p\n", &fc_comm_map, fint, omp_get_thread_num(), comm.ep_comm_ptr);
+        fc_comm_map.insert(std::make_pair( std::make_pair( *static_cast< ::MPI_Fint*>(fint), omp_get_thread_num()) , comm));
+        printf("EP_Comm_c2f : MAP %p insert: %d, %d, %p\n", &fc_comm_map, *static_cast< ::MPI_Fint*>(fint), omp_get_thread_num(), comm.ep_comm_ptr);
       }
     }
@@ -41,13 +38,13 @@
   }
 
-  MPI_Comm EP_Comm_f2c(int comm)
+  MPI_Comm EP_Comm_f2c(void* comm)
   {
     Debug("MPI_Comm_f2c");
     
     
-    std::map<std::pair<int, int>, MPI_Comm > ::iterator it;
+    std::map<std::pair< ::MPI_Fint, int>, MPI_Comm > ::iterator it;
     
     #pragma omp critical (fc_comm_map)
-    it = fc_comm_map.find(std::make_pair(comm, omp_get_thread_num()));
+    it = fc_comm_map.find(std::make_pair(*static_cast< ::MPI_Fint*>(comm), omp_get_thread_num()));
     
     if(it != fc_comm_map.end())
@@ -60,10 +57,11 @@
        
       
-    //#ifdef _openmpi
-    //::MPI_Comm base_comm = ::MPI_Comm_f2c(comm);
-    //#elif _intelmpi
+    
+    #ifdef _intelmpi
     ::MPI_Comm *base_comm = new ::MPI_Comm;
-    *base_comm = (::MPI_Comm)(comm);
-    //#endif
+    *base_comm = (::MPI_Comm)(*static_cast< ::MPI_Fint*>(comm));
+    #elif _openmpi
+    ::MPI_Comm *base_comm = ::MPI_Comm_f2c(*static_cast< ::MPI_Fint*>(comm));
+    #endif
 
     if(*base_comm != to_mpi_comm(MPI_COMM_NULL.mpi_comm))
Index: /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib_fortran.hpp
===================================================================
--- /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib_fortran.hpp	(revision 1368)
+++ /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib_fortran.hpp	(revision 1369)
@@ -7,6 +7,6 @@
 {
 
-  int EP_Comm_c2f(MPI_Comm comm);
-  MPI_Comm EP_Comm_f2c(int comm);
+  void* EP_Comm_c2f(MPI_Comm comm);
+  MPI_Comm EP_Comm_f2c(void* comm);
 }
 
Index: /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.cpp
===================================================================
--- /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.cpp	(revision 1368)
+++ /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.cpp	(revision 1369)
@@ -76,4 +76,10 @@
     mpi_aint = new ::MPI_Aint;
     *(static_cast< ::MPI_Aint*>(mpi_aint)) = *(static_cast< ::MPI_Aint*>(aint));
+  }
+  
+  MPI_Fint::MPI_Fint(void* fint)
+  {
+    mpi_fint = new ::MPI_Fint;
+    *(static_cast< ::MPI_Fint*>(mpi_fint)) = *(static_cast< ::MPI_Fint*>(fint));
   }
 
Index: /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp
===================================================================
--- /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp	(revision 1368)
+++ /XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp	(revision 1369)
@@ -263,8 +263,9 @@
     public:
 
-    int mpi_fint;
+    void* mpi_fint;
 
     MPI_Fint() {}
-    MPI_Fint(int f): mpi_fint(f) {}
+    MPI_Fint(void* fint);
+    //MPI_Fint(int f): mpi_fint(f) {}
     
   };
@@ -279,7 +280,7 @@
   static std::map<std::pair<int, int>, MPI_Comm >  fc_comm_map;
 
-  static std::map<std::pair<int, int>, MPI_Comm >  *fc_comm_map_ptr;
-  #pragma omp threadprivate(fc_comm_map_ptr)
-            //    <MPI_Fint,thread_num>   EP_Comm
+//  static std::map<std::pair<int, int>, MPI_Comm >  *fc_comm_map_ptr;
+//  #pragma omp threadprivate(fc_comm_map_ptr)
+//            //    <MPI_Fint,thread_num>   EP_Comm
 
 }
Index: /XIOS/dev/branch_openmp/src/interface/c/icdata.cpp
===================================================================
--- /XIOS/dev/branch_openmp/src/interface/c/icdata.cpp	(revision 1368)
+++ /XIOS/dev/branch_openmp/src/interface/c/icdata.cpp	(revision 1369)
@@ -56,5 +56,4 @@
       ep_lib::MPI_Comm return_comm;
       
-      //ep_lib::fc_comm_map.clear();
 
       if (!cstr2string(client_id, len_client_id, str)) return;
@@ -67,5 +66,5 @@
       #elif _usingEP
       ep_lib::fc_comm_map.clear();
-      if (initialized) local_comm=ep_lib::EP_Comm_f2c(static_cast<int>(*f_local_comm));
+      if (initialized) local_comm=ep_lib::EP_Comm_f2c((f_local_comm));
       else local_comm=MPI_COMM_NULL;
       #endif
@@ -77,5 +76,5 @@
       *f_return_comm=MPI_Comm_c2f(return_comm);
       #elif _usingEP
-      *f_return_comm=ep_lib::EP_Comm_c2f(return_comm);
+      *f_return_comm=*static_cast<MPI_Fint*>(ep_lib::EP_Comm_c2f(return_comm));
       #endif
       CTimer::get("XIOS init").suspend();
@@ -94,5 +93,5 @@
      comm=MPI_Comm_f2c(*f_comm);
      #elif _usingEP
-     comm = ep_lib::EP_Comm_f2c(static_cast< int >(*f_comm));
+     comm = ep_lib::EP_Comm_f2c(f_comm);
      #endif
      CClient::registerContext(str, comm);
