Index: LMDZ6/branches/LMDZ_ECRad/libf/phy_common/abort_physic.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phy_common/abort_physic.F90	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phy_common/abort_physic.F90	(revision 4727)
@@ -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/branches/LMDZ_ECRad/libf/phy_common/mod_phys_lmdz_mpi_data.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phy_common/mod_phys_lmdz_mpi_data.F90	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phy_common/mod_phys_lmdz_mpi_data.F90	(revision 4727)
@@ -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,9 +63,5 @@
     INTEGER :: i
     
-#ifdef CPP_MPI
-    is_using_mpi=.TRUE.
-#else
-    is_using_mpi=.FALSE.
-#endif
+    is_using_mpi = using_mpi
     
     if ((nbp_lon.eq.1).and.(nbp_lat.eq.1)) then ! running 1D column model
@@ -82,9 +76,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 +87,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/branches/LMDZ_ECRad/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90	(revision 4727)
@@ -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
