Index: /LMDZ6/trunk/libf/dyn3dmem/abort_gcm.F
===================================================================
--- /LMDZ6/trunk/libf/dyn3dmem/abort_gcm.F	(revision 4599)
+++ /LMDZ6/trunk/libf/dyn3dmem/abort_gcm.F	(revision 4600)
@@ -47,11 +47,13 @@
       else
         write(lunout,*) 'Houston, we have a problem, ierr = ', ierr
-#ifdef CPP_MPI
+
+        if (using_mpi) THEN
 C$OMP CRITICAL (MPI_ABORT_GCM)
-        call MPI_ABORT(COMM_LMDZ, 1, ierror_mpi)
+          call MPI_ABORT(COMM_LMDZ, 1, ierror_mpi)
 C$OMP END CRITICAL (MPI_ABORT_GCM)
-#else
-        stop 1
-#endif          
+        else
+         stop 1
+        endif          
+      
       endif
       END
Index: /LMDZ6/trunk/libf/dyn3dmem/mod_const_mpi.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3dmem/mod_const_mpi.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/dyn3dmem/mod_const_mpi.F90	(revision 4600)
@@ -11,4 +11,6 @@
 
   SUBROUTINE Init_const_mpi
+    USE lmdz_mpi
+
 #ifdef CPP_IOIPSL
     USE IOIPSL, ONLY: getin
@@ -25,7 +27,4 @@
 #endif
     IMPLICIT NONE
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
 
     INTEGER             :: ierr
@@ -52,7 +51,5 @@
 !$OMP END MASTER
 #endif
-#ifdef CPP_MPI
       MPI_REAL_LMDZ=MPI_REAL8
-#endif
     ELSE
       CALL init_mpi
@@ -62,16 +59,14 @@
   
   SUBROUTINE Init_mpi
+    USE lmdz_mpi
+
 #ifdef CPP_XIOS
     USE wxios, only: wxios_init
 #endif
   IMPLICIT NONE
-#ifdef CPP_MPI
-     INCLUDE 'mpif.h'
-#endif
     INTEGER             :: ierr
     INTEGER             :: thread_required
     INTEGER             :: thread_provided
 
-#ifdef CPP_MPI
 !$OMP MASTER
       thread_required=MPI_THREAD_SERIALIZED
@@ -92,13 +87,6 @@
 #endif
 !$OMP END MASTER
-#else
-#ifdef CPP_XIOS
-!$OMP MASTER
-      CALL wxios_init("LMDZ")
-!$OMP END MASTER
-#endif
-#endif
 
-   END SUBROUTINE Init_mpi
+END SUBROUTINE Init_mpi
     
 END MODULE mod_const_mpi
Index: /LMDZ6/trunk/libf/dyn3dmem/mod_hallo.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3dmem/mod_hallo.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/dyn3dmem/mod_hallo.F90	(revision 4600)
@@ -106,15 +106,9 @@
   
   SUBROUTINE create_global_mpi_buffer
+  USE lmdz_mpi
   IMPLICIT NONE
-#ifdef CPP_MPI
-  INCLUDE 'mpif.h'
-#endif  
     POINTER (Pbuffer,MPI_Buffer(MaxBufferSize))
     REAL :: MPI_Buffer
-#ifdef CPP_MPI
     INTEGER(KIND=MPI_ADDRESS_KIND) :: BS 
-#else
-    INTEGER(KIND=8) :: BS
-#endif
     INTEGER :: i,ierr
 
@@ -122,7 +116,5 @@
       Bs=8*MaxBufferSize
 !$OMP CRITICAL (MPI)
-#ifdef CPP_MPI
       CALL MPI_ALLOC_MEM(BS,MPI_INFO_NULL,Pbuffer,ierr)
-#endif
 !$OMP END CRITICAL (MPI)
       DO i=1,MaxBufferSize
@@ -1157,9 +1149,7 @@
   subroutine Register_Hallo(Field,ij,ll,RUp,Rdown,SUp,SDown,a_request)
   USE dimensions_mod
+  USE lmdz_mpi
       implicit none
 
-#ifdef CPP_MPI
-    include 'mpif.h'
-#endif    
       INTEGER :: ij,ll
       REAL, dimension(ij,ll) :: Field
@@ -1224,8 +1214,6 @@
   subroutine Register_Hallo_u(Field,ll,RUp,Rdown,SUp,SDown,a_request)
   USE dimensions_mod
+  USE lmdz_mpi
       implicit none
-#ifdef CPP_MPI
-    include 'mpif.h'
-#endif    
       INTEGER :: ll
       REAL, dimension(ijb_u:ije_u,ll) :: Field
@@ -1289,8 +1277,6 @@
   subroutine Register_Hallo_v(Field,ll,RUp,Rdown,SUp,SDown,a_request)
   USE dimensions_mod
+  USE lmdz_mpi
       implicit none
-#ifdef CPP_MPI
-    include 'mpif.h'
-#endif    
       INTEGER :: ll
       REAL, dimension(ijb_v:ije_v,ll) :: Field
@@ -1354,9 +1340,6 @@
     subroutine SendRequest(a_Request)
     USE dimensions_mod
+    USE lmdz_mpi
       implicit none
-
-#ifdef CPP_MPI
-      include 'mpif.h'
-#endif
 
       type(request),target :: a_request
@@ -1410,8 +1393,6 @@
 !$OMP CRITICAL (MPI)
          
-#ifdef CPP_MPI
          call MPI_ISEND(Buffer(req%Pos),SizeBuffer,MPI_REAL_LMDZ,rank,a_request%tag+1000*omp_rank,     &
                          COMM_LMDZ,Req%MSG_Request,ierr)
-#endif
          IF (.NOT.using_mpi) THEN
            PRINT *,'Erreur, echange MPI en mode sequentiel !!!'
@@ -1453,8 +1434,7 @@
 !$OMP CRITICAL (MPI)
 
-#ifdef CPP_MPI
              call MPI_IRECV(Buffer(Req%Pos),SizeBuffer,MPI_REAL_LMDZ,rank,a_request%tag+1000*omp_rank,     &
                            COMM_LMDZ,Req%MSG_Request,ierr)
-#endif             
+
              IF (.NOT.using_mpi) THEN
                PRINT *,'Erreur, echange MPI en mode sequentiel !!!'
@@ -1478,9 +1458,6 @@
    subroutine WaitRequest(a_Request)
    USE dimensions_mod
+   USE lmdz_mpi
    implicit none
-   
-#ifdef CPP_MPI
-      include 'mpif.h'   
-#endif
       
       type(request),target :: a_request
@@ -1488,9 +1465,5 @@
       type(Hallo),pointer :: PtrHallo
       integer, dimension(2*mpi_size) :: TabRequest
-#ifdef CPP_MPI
       integer, dimension(MPI_STATUS_SIZE,2*mpi_size) :: TabStatus
-#else
-      integer, dimension(1,2*mpi_size) :: TabStatus
-#endif
       integer :: NbRequest
       integer :: i,rank,pos,ij,l,ierr
@@ -1521,7 +1494,5 @@
 !        PRINT *,"Process de rang",mpi_rank,"Task : ",omp_rank,"--->",NbRequest,"en attente"
 !        PRINT *,"No des requetes :",TabRequest(1:NbRequest)
-#ifdef CPP_MPI
         call MPI_WAITALL(NbRequest,TabRequest,TabStatus,ierr)
-#endif
 !        PRINT *,"Process de rang",mpi_rank,"Task : ",omp_rank,"--->",NbRequest,"complete"
 !        PRINT *,"-------------------------------------------------------------------"
@@ -1571,19 +1542,13 @@
      
    subroutine WaitSendRequest(a_Request)
+   USE lmdz_mpi
    USE dimensions_mod
    implicit none
    
-#ifdef CPP_MPI
-      include 'mpif.h'   
-#endif      
       type(request),target :: a_request
       type(request_SR),pointer :: Req
       type(Hallo),pointer :: PtrHallo
       integer, dimension(mpi_size) :: TabRequest
-#ifdef CPP_MPI
       integer, dimension(MPI_STATUS_SIZE,mpi_size) :: TabStatus
-#else
-      integer, dimension(1,mpi_size) :: TabStatus
-#endif
       integer :: NbRequest
       integer :: i,rank,pos,ij,l,ierr
@@ -1606,7 +1571,5 @@
 !        PRINT *,"Process de rang",mpi_rank,"Task : ",omp_rank,"--->",NbRequest,"en attente"
 !        PRINT *,"No des requetes :",TabRequest(1:NbRequest)
-#ifdef CPP_MPI
-        call MPI_WAITALL(NbRequest,TabRequest,TabStatus,ierr)
-#endif
+         call MPI_WAITALL(NbRequest,TabRequest,TabStatus,ierr)
 !        PRINT *,"Process de rang",mpi_rank,"Task : ",omp_rank,"--->",NbRequest,"complete"
 !        PRINT *,"-------------------------------------------------------------------"
@@ -1628,19 +1591,11 @@
    subroutine WaitRecvRequest(a_Request)
    USE dimensions_mod
+   USE lmdz_mpi
    implicit none
-   
-#ifdef CPP_MPI
-      include 'mpif.h'   
-#endif
-      
       type(request),target :: a_request
       type(request_SR),pointer :: Req
       type(Hallo),pointer :: PtrHallo
       integer, dimension(mpi_size) :: TabRequest
-#ifdef CPP_MPI
       integer, dimension(MPI_STATUS_SIZE,mpi_size) :: TabStatus
-#else
-      integer, dimension(1,mpi_size) :: TabStatus
-#endif
       integer :: NbRequest
       integer :: i,rank,pos,ij,l,ierr
@@ -1664,7 +1619,5 @@
 !        PRINT *,"Process de rang",mpi_rank,"Task : ",omp_rank,"--->",NbRequest,"en attente"
 !        PRINT *,"No des requetes :",TabRequest(1:NbRequest)
-#ifdef CPP_MPI
-        call MPI_WAITALL(NbRequest,TabRequest,TabStatus,ierr)
-#endif
+         call MPI_WAITALL(NbRequest,TabRequest,TabStatus,ierr)
 !        PRINT *,"Process de rang",mpi_rank,"Task : ",omp_rank,"--->",NbRequest,"complete"
 !        PRINT *,"-------------------------------------------------------------------"
Index: /LMDZ6/trunk/libf/dyn3dmem/parallel_lmdz.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3dmem/parallel_lmdz.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/dyn3dmem/parallel_lmdz.F90	(revision 4600)
@@ -4,4 +4,5 @@
   MODULE parallel_lmdz
   USE mod_const_mpi
+  USE lmdz_mpi, ONLY : using_mpi
 #ifdef CPP_IOIPSL
       use IOIPSL
@@ -12,5 +13,4 @@
     INTEGER,PARAMETER :: halo_max=3
     
-    LOGICAL,SAVE :: using_mpi ! .true. if using MPI
     LOGICAL,SAVE :: using_omp ! .true. if using OpenMP
     LOGICAL,SAVE :: is_master ! .true. if the core is both MPI & OpenMP master
@@ -88,8 +88,6 @@
     subroutine init_parallel
     USE vampir
+    USE lmdz_mpi
     implicit none
-#ifdef CPP_MPI
-      include 'mpif.h'
-#endif
       INCLUDE "dimensions.h"
       INCLUDE "paramet.h"
@@ -111,11 +109,4 @@
 #endif  
 
-#ifdef CPP_MPI
-       using_mpi=.TRUE.
-#else
-       using_mpi=.FALSE.
-#endif
-      
-
 #ifdef CPP_OMP
        using_OMP=.TRUE.
@@ -127,8 +118,6 @@
       
       IF (using_mpi) THEN
-#ifdef CPP_MPI
         call MPI_COMM_SIZE(COMM_LMDZ,mpi_size,ierr)
         call MPI_COMM_RANK(COMM_LMDZ,mpi_rank,ierr)
-#endif
       ELSE
         mpi_size=1
@@ -161,7 +150,6 @@
          write(lunout,*)" ---> diminuez le nombre de CPU ou augmentez la taille en lattitude"
           
-#ifdef CPP_MPI
           IF (using_mpi) call MPI_ABORT(COMM_LMDZ,-1, ierr)
-#endif          
+
         endif
         
@@ -395,4 +383,5 @@
     
     subroutine Finalize_parallel
+    USE lmdz_mpi
 #ifdef CPP_XIOS
     ! ug Pour les sorties XIOS
@@ -418,7 +407,4 @@
       include "dimensions.h"
       include "paramet.h"
-#ifdef CPP_MPI
-      include 'mpif.h'
-#endif      
 
       integer :: ierr
@@ -446,7 +432,5 @@
       CALL wxios_close()
 #endif
-#ifdef CPP_MPI
-         IF (using_mpi) call MPI_FINALIZE(ierr)
-#endif
+      IF (using_mpi) call MPI_FINALIZE(ierr)
       end if
       
@@ -502,14 +486,10 @@
     
     SUBROUTINE barrier
+    USE lmdz_mpi
     IMPLICIT NONE
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
     INTEGER :: ierr
     
 !$OMP CRITICAL (MPI)      
-#ifdef CPP_MPI
       IF (using_mpi) CALL MPI_Barrier(COMM_LMDZ,ierr)
-#endif
 !$OMP END CRITICAL (MPI)
     
@@ -518,11 +498,9 @@
       
     subroutine exchange_hallo(Field,ij,ll,up,down)
+    USE lmdz_mpi
     USE Vampir
     implicit none
       INCLUDE "dimensions.h"
       INCLUDE "paramet.h"    
-#ifdef CPP_MPI
-    include 'mpif.h'
-#endif    
       INTEGER :: ij,ll
       REAL, dimension(ij,ll) :: Field
@@ -533,9 +511,6 @@
       LOGICAL :: RecvUp,RecvDown
       INTEGER, DIMENSION(4) :: Request
-#ifdef CPP_MPI
       INTEGER, DIMENSION(MPI_STATUS_SIZE,4) :: Status
-#else
-      INTEGER, DIMENSION(1,4) :: Status
-#endif
+
       INTEGER :: NbRequest
       REAL, dimension(:),allocatable :: Buffer_Send_up,Buffer_Send_down
@@ -582,8 +557,6 @@
           call PACK_Data(Field(ij_begin,1),ij,ll,down,Buffer_Send_up)
 !$OMP CRITICAL (MPI)
-#ifdef CPP_MPI
           call MPI_ISEND(Buffer_send_up,Buffer_Size,MPI_REAL8,MPI_Rank-1,1,     &
                           COMM_LMDZ,Request(NbRequest),ierr)
-#endif
 !$OMP END CRITICAL (MPI)
         ENDIF
@@ -597,8 +570,6 @@
         
 !$OMP CRITICAL (MPI)
-#ifdef CPP_MPI
           call MPI_ISEND(Buffer_send_down,Buffer_Size,MPI_REAL8,MPI_Rank+1,1,     &
                           COMM_LMDZ,Request(NbRequest),ierr)
-#endif
 !$OMP END CRITICAL (MPI)
         ENDIF
@@ -611,8 +582,6 @@
               
 !$OMP CRITICAL (MPI)
-#ifdef CPP_MPI
           call MPI_IRECV(Buffer_recv_up,Buffer_size,MPI_REAL8,MPI_Rank-1,1,  &
                           COMM_LMDZ,Request(NbRequest),ierr)
-#endif
 !$OMP END CRITICAL (MPI)
      
@@ -626,15 +595,11 @@
         
 !$OMP CRITICAL (MPI)
-#ifdef CPP_MPI
           call MPI_IRECV(Buffer_recv_down,Buffer_size,MPI_REAL8,MPI_Rank+1,1,     &
                           COMM_LMDZ,Request(NbRequest),ierr)
-#endif
 !$OMP END CRITICAL (MPI)
         
         ENDIF
   
-#ifdef CPP_MPI
         if (NbRequest > 0) call MPI_WAITALL(NbRequest,Request,Status,ierr)
-#endif
         IF (RecvUp)  call Unpack_Data(Field(ij_begin-up*iip1,1),ij,ll,up,Buffer_Recv_up)
         IF (RecvDown) call Unpack_Data(Field(ij_end+1,1),ij,ll,down,Buffer_Recv_down)  
@@ -651,11 +616,9 @@
 
     subroutine Gather_Field(Field,ij,ll,rank)
+    USE lmdz_mpi
     implicit none
     INCLUDE "dimensions.h"
     INCLUDE "paramet.h" 
     INCLUDE "iniprint.h"
-#ifdef CPP_MPI
-    include 'mpif.h'
-#endif    
       INTEGER :: ij,ll,rank
       REAL, dimension(ij,ll) :: Field
@@ -709,8 +672,6 @@
   
 !$OMP CRITICAL (MPI)
-#ifdef CPP_MPI
         call MPI_GATHERV(Buffer_send,(min(ij_end,ij)-ij_begin+1)*ll,MPI_REAL8,   &
                           Buffer_Recv,Recv_count,displ,MPI_REAL8,rank,COMM_LMDZ,ierr)
-#endif
 !$OMP END CRITICAL (MPI)
       
@@ -735,10 +696,8 @@
 
     subroutine AllGather_Field(Field,ij,ll)
+    USE lmdz_mpi
     implicit none
     INCLUDE "dimensions.h"
     INCLUDE "paramet.h"    
-#ifdef CPP_MPI
-    include 'mpif.h'
-#endif    
       INTEGER :: ij,ll
       REAL, dimension(ij,ll) :: Field
@@ -748,7 +707,5 @@
         call Gather_Field(Field,ij,ll,0)
 !$OMP CRITICAL (MPI)
-#ifdef CPP_MPI
       call MPI_BCAST(Field,ij*ll,MPI_REAL8,0,COMM_LMDZ,ierr)
-#endif
 !$OMP END CRITICAL (MPI)
       ENDIF
@@ -757,10 +714,8 @@
     
    subroutine Broadcast_Field(Field,ij,ll,rank)
+    USE lmdz_mpi
     implicit none
     INCLUDE "dimensions.h"
     INCLUDE "paramet.h"    
-#ifdef CPP_MPI
-    include 'mpif.h'
-#endif    
       INTEGER :: ij,ll
       REAL, dimension(ij,ll) :: Field
@@ -771,7 +726,5 @@
       
 !$OMP CRITICAL (MPI)
-#ifdef CPP_MPI
       call MPI_BCAST(Field,ij*ll,MPI_REAL8,rank,COMM_LMDZ,ierr)
-#endif
 !$OMP END CRITICAL (MPI)
       
@@ -781,8 +734,8 @@
    
 !  Subroutine verif_hallo(Field,ij,ll,up,down)
+!    USE lmdz_mpi
 !    implicit none
 !      INCLUDE "dimensions.h"
 !      INCLUDE "paramet.h"    
-!    include 'mpif.h'
 !    
 !      INTEGER :: ij,ll
Index: /LMDZ6/trunk/libf/dyn3dmem/times.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3dmem/times.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/dyn3dmem/times.F90	(revision 4600)
@@ -137,8 +137,7 @@
   subroutine allgather_timer
     USE parallel_lmdz
-    implicit none
-#ifdef CPP_MPI    
-    include 'mpif.h'
-#endif
+    USE lmdz_mpi
+    implicit none
+
     integer :: ierr
     integer :: data_size
@@ -155,11 +154,7 @@
     
       tmp_table(:,:)=timer_table(:,:,mpi_rank)
-#ifdef CPP_MPI 
       call mpi_allgather(tmp_table(1,1),data_size,MPI_REAL_LMDZ,timer_table(1,1,0),data_size,MPI_REAL_LMDZ,COMM_LMDZ,ierr)
-#endif
       tmp_table(:,:)=timer_table_sqr(:,:,mpi_rank)
-#ifdef CPP_MPI
       call mpi_allgather(tmp_table(1,1),data_size,MPI_REAL_LMDZ,timer_table_sqr(1,1,0),data_size,MPI_REAL_LMDZ,COMM_LMDZ,ierr)
-#endif    
       deallocate(tmp_table)
     
@@ -172,8 +167,6 @@
   subroutine allgather_timer_average
     USE parallel_lmdz
-    implicit none
-#ifdef CPP_MPI
-    include 'mpif.h'
-#endif
+    USE lmdz_mpi
+    implicit none
     integer :: ierr
     integer :: data_size
@@ -192,15 +185,9 @@
 
       tmp_table(:,:)=timer_average(:,:,mpi_rank)
-#ifdef CPP_MPI
       call mpi_allgather(tmp_table(1,1),data_size,MPI_REAL_LMDZ,timer_average(1,1,0),data_size,MPI_REAL_LMDZ,COMM_LMDZ,ierr)
-#endif
       tmp_table(:,:)=timer_delta(:,:,mpi_rank)
-#ifdef CPP_MPI
       call mpi_allgather(tmp_table(1,1),data_size,MPI_REAL_LMDZ,timer_delta(1,1,0),data_size,MPI_REAL_LMDZ,COMM_LMDZ,ierr)
-#endif
       tmp_iter(:,:)=timer_iteration(:,:,mpi_rank)
-#ifdef CPP_MPI
       call mpi_allgather(tmp_iter(1,1),data_size,MPI_INTEGER,timer_iteration(1,1,0),data_size,MPI_INTEGER,COMM_LMDZ,ierr)
-#endif    
       deallocate(tmp_table)
     
Index: /LMDZ6/trunk/libf/dynphy_lonlat/calfis_loc.F
===================================================================
--- /LMDZ6/trunk/libf/dynphy_lonlat/calfis_loc.F	(revision 4599)
+++ /LMDZ6/trunk/libf/dynphy_lonlat/calfis_loc.F	(revision 4600)
@@ -38,4 +38,6 @@
       USE IOPHY
 #endif
+      USE lmdz_mpi
+
 #ifdef CPP_PARA
       USE parallel_lmdz,ONLY:omp_chunk,using_mpi,jjb_u,jje_u,jjb_v,jje_v
@@ -117,7 +119,4 @@
       include "comgeom2.h"
       include "iniprint.h"
-#ifdef CPP_MPI
-      include 'mpif.h'
-#endif
 c    Arguments :
 c    -----------
@@ -233,9 +232,5 @@
       REAL,SAVE,dimension(1:iim,1:llm):: du_send,du_recv,dv_send,dv_recv
       INTEGER :: ierr
-#ifdef CPP_MPI
       INTEGER,dimension(MPI_STATUS_SIZE,4) :: Status
-#else
-      INTEGER,dimension(1,4) :: Status
-#endif
       INTEGER, dimension(4) :: Req
       REAL,ALLOCATABLE,SAVE:: zdufi2(:,:),zdvfi2(:,:)
@@ -873,5 +868,5 @@
 
 c$OMP BARRIER
-#ifdef CPP_MPI 
+
 c$OMP MASTER
 !$OMP CRITICAL (MPI)
@@ -882,5 +877,5 @@
 !$OMP END CRITICAL (MPI)
 c$OMP END MASTER
-#endif
+
 c$OMP BARRIER
      
@@ -889,5 +884,5 @@
       if (MPI_rank<MPI_Size-1) then
 c$OMP BARRIER
-#ifdef CPP_MPI 
+
 c$OMP MASTER      
 !$OMP CRITICAL (MPI)
@@ -898,5 +893,5 @@
 !$OMP END CRITICAL (MPI)
 c$OMP END MASTER
-#endif
+
       endif
 
@@ -904,5 +899,4 @@
 
 
-#ifdef CPP_MPI 
 c$OMP MASTER    
 !$OMP CRITICAL (MPI)
@@ -916,5 +910,4 @@
 !$OMP END CRITICAL (MPI)
 c$OMP END MASTER
-#endif
 
 c$OMP BARRIER     
Index: /LMDZ6/trunk/libf/dynphy_lonlat/phylmd/ce0l.F90
===================================================================
--- /LMDZ6/trunk/libf/dynphy_lonlat/phylmd/ce0l.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/dynphy_lonlat/phylmd/ce0l.F90	(revision 4600)
@@ -46,4 +46,5 @@
   USE comvert_mod, ONLY: pa, preff, pressure_exner
   USE temps_mod, ONLY: calend, day_ini, dt
+  USE lmdz_mpi
 
   IMPLICIT NONE
@@ -55,7 +56,4 @@
   include "comgeom2.h"
   include "iniprint.h"
-#ifdef CPP_MPI
-  include 'mpif.h'
-#endif
   
   REAL               :: masque(iip1,jjp1)             !--- CONTINENTAL MASK
@@ -255,7 +253,5 @@
   CALL xios_finalize
 #endif
-#ifdef CPP_MPI
   IF (using_mpi) call MPI_FINALIZE(ierr)
-#endif
 #endif
 
Index: /LMDZ6/trunk/libf/misc/lmdz_mpi.F90
===================================================================
--- /LMDZ6/trunk/libf/misc/lmdz_mpi.F90	(revision 4600)
+++ /LMDZ6/trunk/libf/misc/lmdz_mpi.F90	(revision 4600)
@@ -0,0 +1,27 @@
+#ifdef CPP_MPI
+MODULE lmdz_mpi
+
+  INCLUDE 'mpif.h'
+  LOGICAL,PARAMETER :: using_mpi = .TRUE.
+END MODULE lmdz_mpi
+
+#else
+
+MODULE lmdz_mpi
+  LOGICAL,PARAMETER :: using_mpi = .FALSE.
+
+  INTEGER, PARAMETER         :: MPI_REAL8 = 1
+  INTEGER, PARAMETER         :: MPI_INTEGER = 1
+  INTEGER, PARAMETER         :: MPI_CHARACTER = 1
+  INTEGER, PARAMETER         :: MPI_LOGICAL = 1
+  INTEGER, PARAMETER         :: MPI_SUM = 1
+  INTEGER, PARAMETER         :: MPI_MIN = 1
+  INTEGER, PARAMETER         :: MPI_COMM_WORLD = 1
+  INTEGER, PARAMETER         :: MPI_STATUS_SIZE = 1
+  INTEGER, PARAMETER         :: MPI_THREAD_SERIALIZED =1
+  INTEGER(kind=8), PARAMETER :: MPI_ADDRESS_KIND = 1
+  INTEGER, PARAMETER         :: MPI_INFO_NULL = 1
+
+END MODULE lmdz_mpi
+
+#endif
Index: /LMDZ6/trunk/libf/misc/lmdz_mpi_wrappers.F90
===================================================================
--- /LMDZ6/trunk/libf/misc/lmdz_mpi_wrappers.F90	(revision 4600)
+++ /LMDZ6/trunk/libf/misc/lmdz_mpi_wrappers.F90	(revision 4600)
@@ -0,0 +1,172 @@
+! mpi subroutine wrappers
+
+#ifndef CPP_MPI
+
+SUBROUTINE lmdz_mpi_wrapper_abort
+  STOP 'CPP_MPI key undefined, must not enter in MPI wrappers ==> aborting'
+END SUBROUTINE lmdz_mpi_wrapper_abort
+
+SUBROUTINE MPI_ABORT(COMM, ERRORCODE, IERROR)
+IMPLICIT NONE
+    INTEGER ::       COMM, ERRORCODE, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_ABORT
+
+SUBROUTINE MPI_ALLGATHER(SENDBUF, SENDCOUNT, SENDTYPE, RECVBUF, RECVCOUNT, RECVTYPE, COMM, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE  ::   SENDBUF , RECVBUF
+    INTEGER    SENDCOUNT, SENDTYPE, RECVCOUNT, RECVTYPE, COMM
+    INTEGER    IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE   MPI_ALLGATHER
+  
+SUBROUTINE MPI_COMM_SIZE(COMM, SIZE, IERROR)
+IMPLICIT NONE
+    INTEGER    COMM, SIZE, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_COMM_SIZE
+
+SUBROUTINE MPI_COMM_RANK(COMM, RANK, IERROR)
+IMPLICIT NONE
+    INTEGER    COMM, RANK, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_COMM_RANK
+
+SUBROUTINE MPI_BARRIER(COMM, IERROR)
+IMPLICIT NONE
+    INTEGER    COMM, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_BARRIER   
+
+SUBROUTINE MPI_ISEND(BUF, COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE  ::    BUF
+    INTEGER    COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR
+    
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_ISEND
+
+SUBROUTINE MPI_ISSEND(BUF, COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE  ::    BUF
+    INTEGER    COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_ISSEND
+
+SUBROUTINE MPI_IRECV(BUF, COUNT, DATATYPE, SOURCE, TAG, COMM, REQUEST, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE  ::    BUF
+    INTEGER    COUNT, DATATYPE, SOURCE, TAG, COMM, REQUEST, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_IRECV   
+
+SUBROUTINE MPI_WAITALL(COUNT, ARRAY_OF_REQUESTS, ARRAY_OF_STATUSES, IERROR)
+USE lmdz_mpi, ONLY : MPI_STATUS_SIZE
+IMPLICIT NONE
+    INTEGER    COUNT, ARRAY_OF_REQUESTS(*)
+    INTEGER    ARRAY_OF_STATUSES(MPI_STATUS_SIZE,*), IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE  MPI_WAITALL  
+
+SUBROUTINE MPI_GATHERV(SENDBUF, SENDCOUNT, SENDTYPE, RECVBUF, RECVCOUNTS, DISPLS, RECVTYPE, ROOT, COMM, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE  ::    SENDBUF, RECVBUF
+    INTEGER    SENDCOUNT, SENDTYPE, RECVCOUNTS(*), DISPLS(*)
+    INTEGER    RECVTYPE, ROOT, COMM, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_GATHERV
+    
+SUBROUTINE MPI_BCAST(BUFFER, COUNT, DATATYPE, ROOT, COMM, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE  ::    BUFFER
+    INTEGER    COUNT, DATATYPE, ROOT, COMM, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_BCAST
+
+SUBROUTINE MPI_ALLREDUCE(SENDBUF, RECVBUF, COUNT, DATATYPE, OP, COMM, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE  ::    SENDBUF, RECVBUF
+    INTEGER    COUNT, DATATYPE, OP, COMM, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_ALLREDUCE
+
+SUBROUTINE MPI_INIT_THREAD(REQUIRED, PROVIDED, IERROR)
+IMPLICIT NONE
+    INTEGER    REQUIRED, PROVIDED, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_INIT_THREAD
+
+SUBROUTINE MPI_ALLOC_MEM(SIZE, INFO, BASEPTR, IERROR)
+USE lmdz_mpi, ONLY : MPI_ADDRESS_KIND
+IMPLICIT NONE
+    INTEGER INFO, IERROR
+    INTEGER(KIND=MPI_ADDRESS_KIND) SIZE, BASEPTR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_ALLOC_MEM
+
+SUBROUTINE MPI_SCATTERV(SENDBUF, SENDCOUNTS, DISPLS, SENDTYPE, RECVBUF, RECVCOUNT, RECVTYPE, ROOT, COMM, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE  ::    SENDBUF, RECVBUF
+    INTEGER    SENDCOUNTS(*), DISPLS(*), SENDTYPE
+    INTEGER    RECVCOUNT, RECVTYPE, ROOT, COMM, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_SCATTERV
+
+SUBROUTINE MPI_REDUCE(SENDBUF, RECVBUF, COUNT, DATATYPE, OP, ROOT, COMM, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE ::    SENDBUF, RECVBUF
+    INTEGER    COUNT, DATATYPE, OP, ROOT, COMM, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_REDUCE
+
+SUBROUTINE MPI_RECV(BUF, COUNT, DATATYPE, SOURCE, TAG, COMM, STATUS, IERROR)
+USE ISO_C_BINDING
+USE lmdz_mpi, ONLY : MPI_STATUS_SIZE
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE ::    BUF
+    INTEGER    COUNT, DATATYPE, SOURCE, TAG, COMM
+    INTEGER    STATUS(MPI_STATUS_SIZE), IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_RECV
+
+SUBROUTINE MPI_SEND(BUF, COUNT, DATATYPE, DEST, TAG, COMM, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE  ::  BUF
+    INTEGER    COUNT, DATATYPE, DEST, TAG, COMM, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_SEND
+
+SUBROUTINE MPI_COMM_SPLIT(COMM, COLOR, KEY, NEWCOMM, IERROR)
+IMPLICIT NONE
+    INTEGER    COMM, COLOR, KEY, NEWCOMM, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_COMM_SPLIT
+
+
+SUBROUTINE MPI_GATHER(SENDBUF, SENDCOUNT, SENDTYPE, RECVBUF, RECVCOUNT, RECVTYPE, ROOT, COMM, IERROR)
+USE ISO_C_BINDING
+IMPLICIT NONE
+    TYPE(C_PTR),VALUE  ::  SENDBUF, RECVBUF
+    INTEGER    SENDCOUNT, SENDTYPE, RECVCOUNT, RECVTYPE, ROOT
+    INTEGER    COMM, IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_GATHER
+
+
+SUBROUTINE MPI_FINALIZE(IERROR)
+IMPLICIT NONE
+    INTEGER    IERROR
+    CALL lmdz_mpi_wrapper_abort
+END SUBROUTINE MPI_Finalize
+
+#endif
Index: /LMDZ6/trunk/libf/phy_common/abort_physic.F90
===================================================================
--- /LMDZ6/trunk/libf/phy_common/abort_physic.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phy_common/abort_physic.F90	(revision 4600)
@@ -38,20 +38,20 @@
       if (ierr .eq. 0) then
         write(lunout,*) 'Everything is cool'
-#ifdef CPP_MPI
-        !$OMP CRITICAL (MPI_ABORT_PHYSIC)
-        call MPI_ABORT(COMM_LMDZ_PHY, 0, ierror_mpi)
-        !$OMP END CRITICAL (MPI_ABORT_PHYSIC)
-#else
-        stop 0
-#endif          
+        if (using_mpi) then
+          !$OMP CRITICAL (MPI_ABORT_PHYSIC)
+          call MPI_ABORT(COMM_LMDZ_PHY, 0, ierror_mpi)
+          !$OMP END CRITICAL (MPI_ABORT_PHYSIC)
+        else
+          stop 0
+        endif          
       else
         write(lunout,*) 'Houston, we have a problem, ierr = ', ierr
-#ifdef CPP_MPI
-!$OMP CRITICAL (MPI_ABORT_PHYSIC)
-        call MPI_ABORT(COMM_LMDZ_PHY, 1, ierror_mpi)
-!$OMP END CRITICAL (MPI_ABORT_PHYSIC)
-#else
-        stop 1
-#endif          
+        if (using_mpi) then
+          !$OMP CRITICAL (MPI_ABORT_PHYSIC)
+          call MPI_ABORT(COMM_LMDZ_PHY, 1, ierror_mpi)
+          !$OMP END CRITICAL (MPI_ABORT_PHYSIC)
+        else
+          stop 1
+        endif          
       endif
       END
Index: /LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_mpi_data.F90
===================================================================
--- /LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_mpi_data.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_mpi_data.F90	(revision 4600)
@@ -3,5 +3,6 @@
 !
 MODULE mod_phys_lmdz_mpi_data
-  
+  USE lmdz_mpi 
+
   INTEGER,SAVE :: ii_begin
   INTEGER,SAVE :: ii_end
@@ -47,9 +48,6 @@
   
   SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, nbp_lev, grid_type, nvertex, communicator)
-
+  USE lmdz_mpi
   IMPLICIT NONE
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
     INTEGER,INTENT(IN) :: nbp
     INTEGER,INTENT(IN) :: nbp_lon
@@ -65,10 +63,4 @@
     INTEGER :: i
     
-#ifdef CPP_MPI
-    is_using_mpi=.TRUE.
-#else
-    is_using_mpi=.FALSE.
-#endif
-    
     if ((nbp_lon.eq.1).and.(nbp_lat.eq.1)) then ! running 1D column model
        klon_glo=1
@@ -82,9 +74,7 @@
 
     IF (is_using_mpi) THEN    
-#ifdef CPP_MPI
       MPI_REAL_LMDZ=MPI_REAL8
       CALL MPI_COMM_SIZE(COMM_LMDZ_PHY,mpi_size,ierr)    
       CALL MPI_COMM_RANK(COMM_LMDZ_PHY,mpi_rank,ierr)
-#endif
     ELSE
       mpi_size=1
@@ -95,7 +85,5 @@
 
     IF (is_using_mpi) THEN    
-#ifdef CPP_MPI
-    CALL MPI_ALLGATHER(nbp,1,MPI_INTEGER,distrib,1,MPI_INTEGER,COMM_LMDZ_PHY,ierr)
-#endif
+      CALL MPI_ALLGATHER(nbp,1,MPI_INTEGER,distrib,1,MPI_INTEGER,COMM_LMDZ_PHY,ierr)
     ELSE
      distrib(:)=nbp
Index: /LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90
===================================================================
--- /LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90	(revision 4600)
@@ -1367,4 +1367,5 @@
   SUBROUTINE bcast_mpi_cgen(var,nb)
     USE mod_phys_lmdz_mpi_data 
+    USE lmdz_mpi
     IMPLICIT NONE
     
@@ -1372,14 +1373,9 @@
     INTEGER,INTENT(IN) :: nb
     
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
     INTEGER :: ierr
 
     IF (.not.is_using_mpi) RETURN
     
-#ifdef CPP_MPI
     CALL MPI_BCAST(Var,nb,MPI_CHARACTER,mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
         
   END SUBROUTINE bcast_mpi_cgen
@@ -1389,4 +1385,5 @@
   SUBROUTINE bcast_mpi_igen(var,nb)
     USE mod_phys_lmdz_mpi_data
+    USE lmdz_mpi
     IMPLICIT NONE
     
@@ -1394,14 +1391,9 @@
     INTEGER,DIMENSION(nb),INTENT(INOUT) :: Var
     
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
     INTEGER :: ierr
 
     IF (.not.is_using_mpi) RETURN
 
-#ifdef CPP_MPI
     CALL MPI_BCAST(Var,nb,MPI_INTEGER,mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
         
   END SUBROUTINE bcast_mpi_igen
@@ -1412,4 +1404,5 @@
   SUBROUTINE bcast_mpi_rgen(var,nb)
     USE mod_phys_lmdz_mpi_data
+    USE lmdz_mpi
     IMPLICIT NONE
     
@@ -1417,14 +1410,9 @@
     REAL,DIMENSION(nb),INTENT(INOUT) :: Var
     
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
     INTEGER :: ierr
 
     IF (.not.is_using_mpi) RETURN
 
-#ifdef CPP_MPI
     CALL MPI_BCAST(Var,nb,MPI_REAL_LMDZ,mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
     
   END SUBROUTINE bcast_mpi_rgen
@@ -1435,4 +1423,5 @@
   SUBROUTINE bcast_mpi_lgen(var,nb)
     USE mod_phys_lmdz_mpi_data
+    USE lmdz_mpi
     IMPLICIT NONE
     
@@ -1440,14 +1429,9 @@
     LOGICAL,DIMENSION(nb),INTENT(INOUT) :: Var
     
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
     INTEGER :: ierr
 
     IF (.not.is_using_mpi) RETURN
 
-#ifdef CPP_MPI
     CALL MPI_BCAST(Var,nb,MPI_LOGICAL,mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
 
   END SUBROUTINE bcast_mpi_lgen
@@ -1458,4 +1442,5 @@
     USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
+    USE lmdz_mpi
     IMPLICIT NONE
   
@@ -1464,7 +1449,4 @@
     INTEGER,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
   
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
     INTEGER,DIMENSION(0:mpi_size-1) :: displs
     INTEGER,DIMENSION(0:mpi_size-1) :: counts
@@ -1493,8 +1475,6 @@
     ENDIF
       
-#ifdef CPP_MPI 
     CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_INTEGER,VarOut,klon_mpi*dimsize,   &
                       MPI_INTEGER,mpi_master, COMM_LMDZ_PHY,ierr)
-#endif
 
   END SUBROUTINE scatter_mpi_igen
@@ -1503,4 +1483,5 @@
     USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
+    USE lmdz_mpi
     IMPLICIT NONE
   
@@ -1508,8 +1489,4 @@
     REAL,INTENT(IN),DIMENSION(klon_glo,dimsize) :: VarIn
     REAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
-  
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
 
     INTEGER,DIMENSION(0:mpi_size-1) :: displs
@@ -1537,10 +1514,7 @@
     ENDIF
       
-#ifdef CPP_MPI 
     CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_REAL_LMDZ,VarOut,klon_mpi*dimsize,   &
                       MPI_REAL_LMDZ,mpi_master, COMM_LMDZ_PHY,ierr)
 
-#endif
-
   END SUBROUTINE scatter_mpi_rgen
 
@@ -1549,4 +1523,5 @@
     USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
+    USE lmdz_mpi
     IMPLICIT NONE
   
@@ -1555,7 +1530,4 @@
     LOGICAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
   
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
 
     INTEGER,DIMENSION(0:mpi_size-1) :: displs
@@ -1583,8 +1555,6 @@
     ENDIF
       
-#ifdef CPP_MPI
     CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_LOGICAL,VarOut,klon_mpi*dimsize,   &
                       MPI_LOGICAL,mpi_master, COMM_LMDZ_PHY,ierr)
-#endif
 
   END SUBROUTINE scatter_mpi_lgen  
@@ -1596,10 +1566,7 @@
     USE mod_phys_lmdz_mpi_data
     USE mod_grid_phy_lmdz
-    IMPLICIT NONE
-  
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
-    
+    USE lmdz_mpi
+    IMPLICIT NONE
+  
     INTEGER,INTENT(IN) :: dimsize
     INTEGER,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn
@@ -1628,8 +1595,6 @@
     ENDIF
     
-#ifdef CPP_MPI
     CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_INTEGER,VarTmp,counts,displs,   &
                      MPI_INTEGER,mpi_master, COMM_LMDZ_PHY,ierr)
-#endif
 
                           
@@ -1650,10 +1615,7 @@
     USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
-    IMPLICIT NONE
-  
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
-    
+    USE lmdz_mpi
+    IMPLICIT NONE
+  
     INTEGER,INTENT(IN) :: dimsize
     REAL,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn
@@ -1681,8 +1643,6 @@
     ENDIF
 
-#ifdef CPP_MPI
     CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_REAL_LMDZ,VarTmp,counts,displs,   &
                       MPI_REAL_LMDZ,mpi_master, COMM_LMDZ_PHY,ierr)
-#endif
                           
     IF (is_mpi_root) THEN
@@ -1702,4 +1662,5 @@
     USE mod_phys_lmdz_mpi_data
     USE mod_grid_phy_lmdz
+    USE lmdz_mpi
     IMPLICIT NONE
   
@@ -1707,8 +1668,4 @@
     LOGICAL,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn
     LOGICAL,INTENT(OUT),DIMENSION(klon_glo,dimsize) :: VarOut
-  
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
 
     INTEGER,DIMENSION(0:mpi_size-1) :: displs
@@ -1734,8 +1691,6 @@
     
 
-#ifdef CPP_MPI
     CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_LOGICAL,VarTmp,counts,displs,   &
                       MPI_LOGICAL,mpi_master, COMM_LMDZ_PHY,ierr)
-#endif
                           
     IF (is_mpi_root) THEN
@@ -1757,9 +1712,6 @@
     USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
-    IMPLICIT NONE
-    
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
+    USE lmdz_mpi
+    IMPLICIT NONE
    
     INTEGER,INTENT(IN) :: nb
@@ -1774,7 +1726,5 @@
 
 
-#ifdef CPP_MPI
     CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_INTEGER,MPI_SUM,mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
             
   END SUBROUTINE reduce_sum_mpi_igen
@@ -1783,11 +1733,7 @@
     USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
-
-    IMPLICIT NONE
-
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
-    
+    USE lmdz_mpi
+    IMPLICIT NONE
+
     INTEGER,INTENT(IN) :: nb
     REAL,DIMENSION(nb),INTENT(IN) :: VarIn
@@ -1800,7 +1746,5 @@
     ENDIF
    
-#ifdef CPP_MPI
     CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_REAL_LMDZ,MPI_SUM,mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
         
   END SUBROUTINE reduce_sum_mpi_rgen
@@ -1811,10 +1755,7 @@
     USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
-    IMPLICIT NONE
-    
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
-   
+    USE lmdz_mpi
+    IMPLICIT NONE
+    
     INTEGER,INTENT(IN) :: nb
     INTEGER,DIMENSION(nb),INTENT(IN) :: VarIn
@@ -1828,7 +1769,5 @@
 
 
-#ifdef CPP_MPI
     CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_INTEGER,MPI_MIN,mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
             
   END SUBROUTINE reduce_min_mpi_igen
@@ -1837,11 +1776,8 @@
     USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
-
-    IMPLICIT NONE
-
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif
-    
+    USE lmdz_mpi
+
+    IMPLICIT NONE
+
     INTEGER,INTENT(IN) :: nb
     REAL,DIMENSION(nb),INTENT(IN) :: VarIn
@@ -1854,7 +1790,5 @@
     ENDIF
    
-#ifdef CPP_MPI
     CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_REAL_LMDZ,MPI_MIN,mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
         
   END SUBROUTINE reduce_min_mpi_rgen
Index: /LMDZ6/trunk/libf/phylmd/cpl_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/cpl_mod.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phylmd/cpl_mod.F90	(revision 4600)
@@ -1249,5 +1249,7 @@
     USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
     USE time_phylmdz_mod, ONLY: start_time, itau_phy
-    use config_ocean_skin_m, only: activate_ocean_skin
+    USE config_ocean_skin_m, only: activate_ocean_skin
+    USE lmdz_mpi
+
 ! Some includes
 !    
@@ -1283,8 +1285,5 @@
     REAL  :: calving_glo(nb_zone_calving)
     
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
     INTEGER, DIMENSION(MPI_STATUS_SIZE)                  :: status
-#endif
 
 ! End definitions
@@ -1357,15 +1356,11 @@
         IF (is_parallel) THEN
            IF (.NOT. is_north_pole_dyn) THEN
-#ifdef CPP_MPI
               CALL MPI_RECV(Up,1,MPI_REAL_LMDZ,mpi_rank-1,1234,COMM_LMDZ_PHY,status,error)
               CALL MPI_SEND(tmp_calv(1,1),1,MPI_REAL_LMDZ,mpi_rank-1,1234,COMM_LMDZ_PHY,error)
-#endif
            ENDIF
        
            IF (.NOT. is_south_pole_dyn) THEN
-#ifdef CPP_MPI
               CALL MPI_SEND(tmp_calv(1,jj_nb),1,MPI_REAL_LMDZ,mpi_rank+1,1234,COMM_LMDZ_PHY,error)
               CALL MPI_RECV(down,1,MPI_REAL_LMDZ,mpi_rank+1,1234,COMM_LMDZ_PHY,status,error)
-#endif
            ENDIF
          
@@ -1392,7 +1387,5 @@
          ENDDO
          
-#ifdef CPP_MPI
          CALL MPI_ALLREDUCE(calving, calving_glo, nb_zone_calving, MPI_REAL_LMDZ, MPI_SUM, COMM_LMDZ_PHY, error)
-#endif
          
          tab_flds(:,:,ids_calvin) = 0
Index: /LMDZ6/trunk/libf/phylmd/create_etat0_limit_unstruct.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/create_etat0_limit_unstruct.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phylmd/create_etat0_limit_unstruct.F90	(revision 4600)
@@ -84,7 +84,5 @@
                 CALL xios_context_finalize()
                 CALL xios_finalize()
-#ifdef CPP_MPI    
                 CALL MPI_Finalize(ierr)
-#endif
                 abort_message='create_etat0_limit_unstruct, Initial state file are created, all is fine' 
                 CALL abort_physic(modname,abort_message,0)
@@ -102,7 +100,5 @@
                 CALL xios_context_finalize()
                 CALL xios_finalize()
-#ifdef CPP_MPI
                 CALL MPI_Finalize(ierr)
-#endif
               ENDIF
 !$OMP BARRIER
Index: /LMDZ6/trunk/libf/phylmd/mod_surf_para.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/mod_surf_para.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phylmd/mod_surf_para.F90	(revision 4600)
@@ -50,7 +50,6 @@
   SUBROUTINE Init_surf_para(knon)
   USE mod_phys_lmdz_para
-#ifdef CPP_MPI
-  INCLUDE 'mpif.h'
-#endif
+  USE lmdz_mpi
+
     INTEGER :: knon
     INTEGER :: i,ierr
@@ -88,8 +87,6 @@
       
       IF (is_using_mpi) THEN
-#ifdef CPP_MPI
         CALL MPI_ALLGather(knon_mpi,1,MPI_INTEGER,knon_mpi_para,1,MPI_INTEGER,COMM_LMDZ_PHY,ierr)
         CALL MPI_ALLGather(knon_omp_para,omp_size,MPI_INTEGER,knon_glo_para,omp_size,MPI_INTEGER,COMM_LMDZ_PHY,ierr)
-#endif
       ELSE
         knon_mpi_para(:)=knon_mpi
@@ -169,7 +166,6 @@
   SUBROUTINE gather_surf_mpi_i(FieldIn,FieldOut)
   USE mod_phys_lmdz_para
-#ifdef CPP_MPI
-  INCLUDE 'mpif.h'
-#endif
+  USE lmdz_mpi
+
     INTEGER :: FieldIn(:)
     INTEGER :: FieldOut(:)
@@ -177,9 +173,7 @@
     
     IF (is_using_mpi) THEN
-#ifdef CPP_MPI
       CALL MPI_Gatherv(FieldIn,knon_mpi,MPI_INTEGER,                                &
                        FieldOut,knon_mpi_para,knon_mpi_begin_para(:)-1,MPI_INTEGER, &
                        mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
     ELSE
       FieldOut(:)=FieldIn(:)
@@ -224,7 +218,6 @@
   SUBROUTINE gather_surf_mpi_r(FieldIn,FieldOut)
   USE mod_phys_lmdz_para
-#ifdef CPP_MPI
-  INCLUDE 'mpif.h'
-#endif
+  USE lmdz_mpi
+
     REAL :: FieldIn(:)
     REAL :: FieldOut(:)
@@ -232,9 +225,7 @@
     
     IF (is_using_mpi) THEN
-#ifdef CPP_MPI
       CALL MPI_Gatherv(FieldIn,knon_mpi,MPI_REAL_LMDZ,                                 &
                        FieldOut,knon_mpi_para,knon_mpi_begin_para(:)-1,MPI_REAL_LMDZ,  &
                        mpi_master,COMM_LMDZ_PHY,ierr)            
-#endif
     ELSE
       FieldOut(:)=FieldIn(:)
@@ -277,7 +268,6 @@
   SUBROUTINE scatter_surf_mpi_i(FieldIn,FieldOut)
   USE mod_phys_lmdz_para
-#ifdef CPP_MPI
-  INCLUDE 'mpif.h'
-#endif
+  USE lmdz_mpi
+
     INTEGER :: FieldIn(:)
     INTEGER :: FieldOut(:)
@@ -285,9 +275,7 @@
     
     IF (is_using_mpi) THEN
-#ifdef CPP_MPI
       CALL MPI_Scatterv(FieldIn,knon_mpi_para,knon_mpi_begin_para(:)-1,MPI_INTEGER,   &
                         FieldOut,knon_mpi,MPI_INTEGER,                                &
                         mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
     ELSE
       FieldOut(:)=FieldIn(:)
@@ -329,7 +317,6 @@
   SUBROUTINE scatter_surf_mpi_r(FieldIn,FieldOut)
   USE mod_phys_lmdz_para
-#ifdef CPP_MPI
-  INCLUDE 'mpif.h'
-#endif
+  USE lmdz_mpi
+
     REAL :: FieldIn(:)
     REAL :: FieldOut(:)
@@ -337,9 +324,7 @@
     
     IF (is_using_mpi) THEN
-#ifdef CPP_MPI
       CALL MPI_Scatterv(FieldIn,knon_mpi_para,knon_mpi_begin_para(:)-1,MPI_INTEGER,   &
                         FieldOut,knon_mpi,MPI_INTEGER,                                &
                         mpi_master,COMM_LMDZ_PHY,ierr)
-#endif
     ELSE
       FieldOut(:)=FieldIn(:)
Index: /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_mod.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_mod.F90	(revision 4600)
@@ -701,9 +701,6 @@
   SUBROUTINE Get_orchidee_communicator(orch_comm, orch_mpi_size, orch_mpi_rank, orch_omp_size,orch_omp_rank)
   USE  mod_surf_para
+  USE lmdz_mpi
       
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
-
     INTEGER,INTENT(OUT) :: orch_comm
     INTEGER,INTENT(OUT) :: orch_mpi_size
@@ -725,9 +722,7 @@
       ENDIF
     
-#ifdef CPP_MPI    
       CALL MPI_COMM_SPLIT(COMM_LMDZ_PHY,color,mpi_rank,orch_comm,ierr)
       CALL MPI_COMM_SIZE(orch_comm,orch_mpi_size,ierr)
       CALL MPI_COMM_RANK(orch_comm,orch_mpi_rank,ierr)
-#endif
     
     ENDIF
@@ -753,8 +748,5 @@
     USE mod_surf_para    
     USE indice_sol_mod
-
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
+    USE lmdz_mpi
 
 ! Input arguments
Index: /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_nofrein_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_nofrein_mod.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_nofrein_mod.F90	(revision 4600)
@@ -527,9 +527,6 @@
   SUBROUTINE Get_orchidee_communicator(orch_comm,orch_omp_size,orch_omp_rank)
   USE  mod_surf_para
+  USE lmdz_mpi
       
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
-
     INTEGER,INTENT(OUT) :: orch_comm
     INTEGER,INTENT(OUT) :: orch_omp_size
@@ -550,7 +547,5 @@
       ENDIF
     
-#ifdef CPP_MPI    
       CALL MPI_COMM_SPLIT(COMM_LMDZ_PHY,color,mpi_rank,orch_comm,ierr)
-#endif
     
     ENDIF
@@ -577,8 +572,5 @@
     USE mod_surf_para    
     USE indice_sol_mod
-
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
+    USE lmdz_mpi
 
 ! Input arguments
Index: /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_nolic_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_nolic_mod.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_nolic_mod.F90	(revision 4600)
@@ -689,10 +689,7 @@
 
   SUBROUTINE Get_orchidee_communicator(orch_comm, orch_mpi_size, orch_mpi_rank, orch_omp_size,orch_omp_rank)
+  USE lmdz_mpi
   USE  mod_surf_para
       
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
-
     INTEGER,INTENT(OUT) :: orch_comm
     INTEGER,INTENT(OUT) :: orch_mpi_size
@@ -714,9 +711,7 @@
       ENDIF
     
-#ifdef CPP_MPI    
       CALL MPI_COMM_SPLIT(COMM_LMDZ_PHY,color,mpi_rank,orch_comm,ierr)
       CALL MPI_COMM_SIZE(orch_comm,orch_mpi_size,ierr)
       CALL MPI_COMM_RANK(orch_comm,orch_mpi_rank,ierr)
-#endif
     
     ENDIF
@@ -742,8 +737,5 @@
     USE mod_surf_para    
     USE indice_sol_mod
-
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
+    USE lmdz_mpi
 
 ! Input arguments
Index: /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90	(revision 4600)
@@ -421,40 +421,39 @@
        IF (knon /=0) THEN
           CALL Init_orchidee_index(knon,orch_comm,knindex,offset,ktindex)
-
-#ifndef CPP_MPI
-          ! Interface for ORCHIDEE compiled in sequential mode(without preprocessing flag CPP_MPI)
-          CALL intersurf_main (itime+itau_phy-1, nbp_lon, nbp_lat, knon, ktindex, dtime, &
-               lrestart_read, lrestart_write, lalo, &
-               contfrac, neighbours, resolution, date0, &
-               zlev,  u1_lay, v1_lay, spechum, temp_air, epot_air, ccanopy, &
-               cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &
-               precip_rain, precip_snow, lwdown, swnet, swdown, ps, &
-               evap, fluxsens, fluxlat, coastalflow, riverflow, &
-               tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0_new, &
-               lon_scat, lat_scat, q2m, t2m &
+          
+          IF (.NOT. using_mpi) THEN
+            ! Interface for ORCHIDEE compiled in sequential mode(without preprocessing flag CPP_MPI)
+            CALL intersurf_main (itime+itau_phy-1, nbp_lon, nbp_lat, knon, ktindex, dtime, &
+                 lrestart_read, lrestart_write, lalo, &
+                 contfrac, neighbours, resolution, date0, &
+                 zlev,  u1_lay, v1_lay, spechum, temp_air, epot_air, ccanopy, &
+                 cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &
+                 precip_rain, precip_snow, lwdown, swnet, swdown, ps, &
+                 evap, fluxsens, fluxlat, coastalflow, riverflow, &
+                 tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0_new, &
+                 lon_scat, lat_scat, q2m, t2m &
 #ifdef ORCH_NEW
-               , nb_fields_cpl, fields_cpl)
+                 , nb_fields_cpl, fields_cpl)
 #else
-               )
+                 )
 #endif
 
-#else          
-          ! Interface for ORCHIDEE version 1.9 or later(1.9.2, 1.9.3, 1.9.4, 1.9.5) compiled in parallel mode(with preprocessing flag CPP_MPI)
-          CALL intersurf_main (itime+itau_phy-1, nbp_lon, nbp_lat, offset, knon, ktindex, & 
-               orch_comm, dtime, lrestart_read, lrestart_write, lalo, &
-               contfrac, neighbours, resolution, date0, &
-               zlev,  u1_lay(1:knon), v1_lay(1:knon), spechum(1:knon), temp_air(1:knon), epot_air(1:knon), ccanopy(1:knon), &
-               cdrag(1:knon), petA_orc(1:knon), peqA_orc(1:knon), petB_orc(1:knon), peqB_orc(1:knon), &
-               precip_rain(1:knon), precip_snow(1:knon), lwdown(1:knon), swnet(1:knon), swdown(1:knon), ps(1:knon), &
-               evap(1:knon), fluxsens(1:knon), fluxlat(1:knon), coastalflow(1:knon), riverflow(1:knon), &
-               tsol_rad(1:knon), tsurf_new(1:knon), qsurf(1:knon), albedo_out(1:knon,:), emis_new(1:knon), z0_new(1:knon), &
-               lon_scat, lat_scat, q2m, t2m &
+          ELSE          
+            ! Interface for ORCHIDEE version 1.9 or later(1.9.2, 1.9.3, 1.9.4, 1.9.5) compiled in parallel mode(with preprocessing flag CPP_MPI)
+            CALL intersurf_main (itime+itau_phy-1, nbp_lon, nbp_lat, offset, knon, ktindex, & 
+                 orch_comm, dtime, lrestart_read, lrestart_write, lalo, &
+                 contfrac, neighbours, resolution, date0, &
+                 zlev,  u1_lay(1:knon), v1_lay(1:knon), spechum(1:knon), temp_air(1:knon), epot_air(1:knon), ccanopy(1:knon), &
+                 cdrag(1:knon), petA_orc(1:knon), peqA_orc(1:knon), petB_orc(1:knon), peqB_orc(1:knon), &
+                 precip_rain(1:knon), precip_snow(1:knon), lwdown(1:knon), swnet(1:knon), swdown(1:knon), ps(1:knon), &
+                 evap(1:knon), fluxsens(1:knon), fluxlat(1:knon), coastalflow(1:knon), riverflow(1:knon), &
+                 tsol_rad(1:knon), tsurf_new(1:knon), qsurf(1:knon), albedo_out(1:knon,:), emis_new(1:knon), z0_new(1:knon), &
+                 lon_scat, lat_scat, q2m, t2m &
 #ifdef ORCH_NEW
-               , nb_fields_cpl, fields_cpl(1:knon,:))
+                 , nb_fields_cpl, fields_cpl(1:knon,:))
 #else
-               )
+                 )
 #endif
-#endif
-          
+          ENDIF
        ENDIF
 
@@ -467,37 +466,37 @@
 
     IF (knon /=0) THEN
-#ifndef CPP_MPI
-       ! Interface for ORCHIDEE compiled in sequential mode(without preprocessing flag CPP_MPI)
-       CALL intersurf_main (itime+itau_phy, nbp_lon, nbp_lat, knon, ktindex, dtime, &
-            lrestart_read, lrestart_write, lalo, &
-            contfrac, neighbours, resolution, date0, &
-            zlev,  u1_lay, v1_lay, spechum, temp_air, epot_air, ccanopy, &
-            cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &
-            precip_rain, precip_snow, lwdown, swnet, swdown_vrai, ps, &
-            evap, fluxsens, fluxlat, coastalflow, riverflow, &
-            tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0_new, &
-            lon_scat, lat_scat, q2m, t2m &
+       IF (.NOT. using_mpi) THEN
+         ! Interface for ORCHIDEE compiled in sequential mode(without preprocessing flag CPP_MPI)
+         CALL intersurf_main (itime+itau_phy, nbp_lon, nbp_lat, knon, ktindex, dtime, &
+              lrestart_read, lrestart_write, lalo, &
+              contfrac, neighbours, resolution, date0, &
+              zlev,  u1_lay, v1_lay, spechum, temp_air, epot_air, ccanopy, &
+              cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &
+              precip_rain, precip_snow, lwdown, swnet, swdown_vrai, ps, &
+              evap, fluxsens, fluxlat, coastalflow, riverflow, &
+              tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0_new, &
+              lon_scat, lat_scat, q2m, t2m &
 #ifdef ORCH_NEW
-            , nb_fields_cpl, fields_cpl)
+              , nb_fields_cpl, fields_cpl)
 #else
-            )
+              )
 #endif
+       ELSE
+         ! Interface for ORCHIDEE version 1.9 or later compiled in parallel mode(with preprocessing flag CPP_MPI)
+         CALL intersurf_main (itime+itau_phy, nbp_lon, nbp_lat,offset, knon, ktindex, & 
+              orch_comm,dtime, lrestart_read, lrestart_write, lalo, &
+              contfrac, neighbours, resolution, date0, &
+              zlev,  u1_lay(1:knon), v1_lay(1:knon), spechum(1:knon), temp_air(1:knon), epot_air(1:knon), ccanopy(1:knon), &
+              cdrag(1:knon), petA_orc(1:knon), peqA_orc(1:knon), petB_orc(1:knon), peqB_orc(1:knon), &
+              precip_rain(1:knon), precip_snow(1:knon), lwdown(1:knon), swnet(1:knon), swdown_vrai(1:knon), ps(1:knon), &
+              evap(1:knon), fluxsens(1:knon), fluxlat(1:knon), coastalflow(1:knon), riverflow(1:knon), &
+              tsol_rad(1:knon), tsurf_new(1:knon), qsurf(1:knon), albedo_out(1:knon,:), emis_new(1:knon), z0_new(1:knon), &
+              lon_scat, lat_scat, q2m, t2m &
+#ifdef ORCH_NEW
+              , nb_fields_cpl, fields_cpl(1:knon,:))
 #else
-       ! Interface for ORCHIDEE version 1.9 or later compiled in parallel mode(with preprocessing flag CPP_MPI)
-       CALL intersurf_main (itime+itau_phy, nbp_lon, nbp_lat,offset, knon, ktindex, & 
-            orch_comm,dtime, lrestart_read, lrestart_write, lalo, &
-            contfrac, neighbours, resolution, date0, &
-            zlev,  u1_lay(1:knon), v1_lay(1:knon), spechum(1:knon), temp_air(1:knon), epot_air(1:knon), ccanopy(1:knon), &
-            cdrag(1:knon), petA_orc(1:knon), peqA_orc(1:knon), petB_orc(1:knon), peqB_orc(1:knon), &
-            precip_rain(1:knon), precip_snow(1:knon), lwdown(1:knon), swnet(1:knon), swdown_vrai(1:knon), ps(1:knon), &
-            evap(1:knon), fluxsens(1:knon), fluxlat(1:knon), coastalflow(1:knon), riverflow(1:knon), &
-            tsol_rad(1:knon), tsurf_new(1:knon), qsurf(1:knon), albedo_out(1:knon,:), emis_new(1:knon), z0_new(1:knon), &
-            lon_scat, lat_scat, q2m, t2m &
-#ifdef ORCH_NEW
-            , nb_fields_cpl, fields_cpl(1:knon,:))
-#else
-            )
+              )
 #endif
-#endif
+       ENDIF
     ENDIF
 
@@ -545,9 +544,5 @@
     
     USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
-
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
-
+    USE lmdz_mpi
 
 ! Input arguments
@@ -564,7 +559,5 @@
 ! Local varables
 !****************************************************************************************
-#ifdef CPP_MPI
     INTEGER, DIMENSION(MPI_STATUS_SIZE)   :: status
-#endif
 
     INTEGER                               :: MyLastPoint
@@ -580,8 +573,6 @@
     
     IF (is_parallel) THEN
-#ifdef CPP_MPI    
        CALL MPI_COMM_SIZE(orch_comm,mpi_size_orch,ierr)
        CALL MPI_COMM_RANK(orch_comm,mpi_rank_orch,ierr)
-#endif
     ELSE
        mpi_rank_orch=0
@@ -591,13 +582,9 @@
     IF (is_parallel) THEN
        IF (mpi_rank_orch /= 0) THEN
-#ifdef CPP_MPI
           CALL MPI_RECV(LastPoint,1,MPI_INTEGER,mpi_rank_orch-1,1234,orch_comm,status,ierr)
-#endif
        ENDIF
        
        IF (mpi_rank_orch /= mpi_size_orch-1) THEN
-#ifdef CPP_MPI
           CALL MPI_SEND(MyLastPoint,1,MPI_INTEGER,mpi_rank_orch+1,1234,orch_comm,ierr)  
-#endif
        ENDIF
     ENDIF
@@ -617,9 +604,5 @@
 ! 
   SUBROUTINE Get_orchidee_communicator(knon,orch_comm)
-    
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
-
+  USE lmdz_mpi
 
     INTEGER,INTENT(IN)  :: knon
@@ -638,7 +621,5 @@
     ENDIF
     
-#ifdef CPP_MPI    
     CALL MPI_COMM_SPLIT(COMM_LMDZ_PHY,color,mpi_rank,orch_comm,ierr)
-#endif
     
   END SUBROUTINE Get_orchidee_communicator
@@ -650,8 +631,5 @@
     USE indice_sol_mod
     USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
-
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
+    USE lmdz_mpi
 
 ! Input arguments
@@ -688,9 +666,5 @@
        knon_nb(:)=knon
     ELSE  
-       
-#ifdef CPP_MPI  
        CALL MPI_GATHER(knon,1,MPI_INTEGER,knon_nb,1,MPI_INTEGER,0,COMM_LMDZ_PHY,ierr)
-#endif
-       
     ENDIF
     
@@ -714,10 +688,6 @@
        ktindex_g(:)=ktindex_p(:)
     ELSE
-       
-#ifdef CPP_MPI  
        CALL MPI_GATHERV(ktindex_p,knon,MPI_INTEGER,ktindex_g,knon_nb,&
             displs,MPI_INTEGER,0,COMM_LMDZ_PHY,ierr)
-#endif
-       
     ENDIF
     
@@ -776,5 +746,4 @@
           neighbours(:,i)=neighbours_g(:,i)
        ELSE
-#ifdef CPP_MPI
           IF (knon > 0) THEN
              ! knon>0, scattter global field neighbours_g from master process to local process
@@ -784,5 +753,4 @@
              CALL MPI_SCATTERV(neighbours_g(:,i),knon_nb,displs,MPI_INTEGER,var_tmp,knon,MPI_INTEGER,0,COMM_LMDZ_PHY,ierr) 
           END IF
-#endif
        ENDIF
     ENDDO
Index: /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_nounstruct_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_nounstruct_mod.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_nounstruct_mod.F90	(revision 4600)
@@ -525,9 +525,6 @@
   SUBROUTINE Get_orchidee_communicator(orch_comm,orch_omp_size,orch_omp_rank)
   USE  mod_surf_para
+  USE lmdz_mpi
       
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
-
     INTEGER,INTENT(OUT) :: orch_comm
     INTEGER,INTENT(OUT) :: orch_omp_size
@@ -548,7 +545,5 @@
       ENDIF
     
-#ifdef CPP_MPI    
       CALL MPI_COMM_SPLIT(COMM_LMDZ_PHY,color,mpi_rank,orch_comm,ierr)
-#endif
     
     ENDIF
@@ -575,8 +570,5 @@
     USE mod_surf_para    
     USE indice_sol_mod
-
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
+    USE lmdz_mpi
 
 ! Input arguments
Index: /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_noz0h_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_noz0h_mod.F90	(revision 4599)
+++ /LMDZ6/trunk/libf/phylmd/surf_land_orchidee_noz0h_mod.F90	(revision 4600)
@@ -525,9 +525,6 @@
   SUBROUTINE Get_orchidee_communicator(orch_comm,orch_omp_size,orch_omp_rank)
   USE  mod_surf_para
+  USE lmdz_mpi
       
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
-
     INTEGER,INTENT(OUT) :: orch_comm
     INTEGER,INTENT(OUT) :: orch_omp_size
@@ -548,7 +545,5 @@
       ENDIF
     
-#ifdef CPP_MPI    
       CALL MPI_COMM_SPLIT(COMM_LMDZ_PHY,color,mpi_rank,orch_comm,ierr)
-#endif
     
     ENDIF
@@ -575,8 +570,5 @@
     USE mod_surf_para    
     USE indice_sol_mod
-
-#ifdef CPP_MPI
-    INCLUDE 'mpif.h'
-#endif    
+    USE lmdz_mpi
 
 ! Input arguments
