Index: LMDZ6/branches/Ocean_skin/libf/phy_common/geometry_mod.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phy_common/geometry_mod.F90	(revision 3428)
+++ LMDZ6/branches/Ocean_skin/libf/phy_common/geometry_mod.F90	(revision 3605)
@@ -30,4 +30,6 @@
 !$OMP THREADPRIVATE(cell_area)
 
+  INTEGER,SAVE,ALLOCATABLE :: ind_cell_glo(:)      ! global indice of a local cell
+!$OMP THREADPRIVATE(ind_cell_glo)
 
 CONTAINS
@@ -35,5 +37,5 @@
   SUBROUTINE init_geometry(klon,longitude_,latitude_, &
                            boundslon_,boundslat_, &
-                           cell_area_,dx_,dy_)
+                           cell_area_,ind_cell_glo_,dx_,dy_)
   USE mod_grid_phy_lmdz, ONLY: nvertex
   USE nrtype, ONLY : PI
@@ -45,4 +47,5 @@
     REAL,INTENT(IN) :: boundslat_(klon,nvertex)
     REAL,INTENT(IN) :: cell_area_(klon)
+    INTEGER,OPTIONAL,INTENT(IN) :: ind_cell_glo_(klon)
     REAL,OPTIONAL,INTENT(IN) :: dx_(klon)
     REAL,OPTIONAL,INTENT(IN) :: dy_(klon)
@@ -55,4 +58,5 @@
     ALLOCATE(boundslat(klon,nvertex))
     ALLOCATE(cell_area(klon))
+    IF (PRESENT(ind_cell_glo_)) ALLOCATE(ind_cell_glo(klon))
     IF (PRESENT(dx_)) ALLOCATE(dx(klon))
     IF (PRESENT(dy_))ALLOCATE(dy(klon))
@@ -65,4 +69,5 @@
     boundslat(:,:) = boundslat_(:,:)
     cell_area(:) = cell_area_(:)
+    IF (PRESENT(ind_cell_glo_)) ind_cell_glo(:) = ind_cell_glo_(:)
     IF (PRESENT(dx_)) dx(:) = dx_(:)
     IF (PRESENT(dy_)) dy(:) = dy_(:)
Index: LMDZ6/branches/Ocean_skin/libf/phy_common/init_print_control_mod.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phy_common/init_print_control_mod.F90	(revision 3605)
+++ LMDZ6/branches/Ocean_skin/libf/phy_common/init_print_control_mod.F90	(revision 3605)
@@ -0,0 +1,67 @@
+MODULE init_print_control_mod
+
+! init_print_control to initialize print_control_mod variables
+! not included there because of circular dependecy issues
+
+CONTAINS
+
+  SUBROUTINE init_print_control
+  USE print_control_mod, ONLY : set_print_control
+  USE ioipsl_getin_p_mod, ONLY : getin_p
+  USE mod_phys_lmdz_para, ONLY: is_omp_root, is_master
+  IMPLICIT NONE
+
+    INTEGER :: lunout ! default output file identifier (6==screen)
+    INTEGER :: prt_level ! Output level
+    LOGICAL :: debug ! flag to specify if in "debug mode"
+    LOGICAL :: opened
+    INTEGER :: number
+    
+    !Config  Key  = prt_level
+    !Config  Desc = niveau d'impressions de débogage
+    !Config  Def  = 0
+    !Config  Help = Niveau d'impression pour le débogage
+    !Config         (0 = minimum d'impression)
+    prt_level = 0
+    CALL getin_p('prt_level',prt_level)
+
+    !Config  Key  = lunout
+    !Config  Desc = unite de fichier pour les impressions
+    !Config  Def  = 6
+    !Config  Help = unite de fichier pour les impressions 
+    !Config         (defaut sortie standard = 6)
+    lunout=6
+    CALL getin_p('lunout', lunout)
+
+    IF (is_omp_root) THEN
+      IF (lunout /= 5 .and. lunout /= 6) THEN
+         INQUIRE(FILE='lmdz.out_0000',OPENED=opened,NUMBER=number)
+         IF (opened) THEN
+           lunout=number
+         ELSE
+           OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write',  &
+                STATUS='unknown',FORM='formatted')
+         ENDIF
+      ENDIF
+    ENDIF
+
+    !Config  Key  = debug
+    !Config  Desc = mode debogage
+    !Config  Def  = false
+    !Config  Help = positionne le mode debogage
+
+    debug = .FALSE.
+    CALL getin_p('debug',debug)
+    
+    IF (is_master) THEN
+      WRITE(lunout,*)"init_print_control: prt_level=",prt_level
+      WRITE(lunout,*)"init_print_control: lunout=",lunout
+      WRITE(lunout,*)"init_print_control: debug=",debug      
+    ENDIF
+    
+    CALL set_print_control(lunout,prt_level,debug)
+
+  END SUBROUTINE init_print_control  
+
+END MODULE init_print_control_mod
+
Index: LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_mpi_data.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_mpi_data.F90	(revision 3428)
+++ LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_mpi_data.F90	(revision 3605)
@@ -3,5 +3,4 @@
 !
 MODULE mod_phys_lmdz_mpi_data
-!  USE mod_const_mpi
   
   INTEGER,SAVE :: ii_begin
@@ -36,11 +35,8 @@
   INTEGER,SAVE :: mpi_size
   INTEGER,SAVE :: mpi_master
-!  INTEGER,SAVE :: mpi_root
   LOGICAL,SAVE :: is_mpi_root
   LOGICAL,SAVE :: is_using_mpi
   
   
-!  LOGICAL,SAVE :: is_north_pole
-!  LOGICAL,SAVE :: is_south_pole
   LOGICAL,SAVE :: is_north_pole_dyn
   LOGICAL,SAVE :: is_south_pole_dyn
@@ -50,15 +46,13 @@
 CONTAINS
   
-!  SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)
   SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, communicator)
-!  USE mod_const_mpi, ONLY : COMM_LMDZ
   IMPLICIT NONE
 #ifdef CPP_MPI
     INCLUDE 'mpif.h'
 #endif
-    INTEGER,INTENT(in) :: nbp
-    INTEGER,INTENT(in) :: nbp_lon
-    INTEGER,INTENT(in) :: nbp_lat
-    INTEGER,INTENT(in) :: communicator
+    INTEGER,INTENT(IN) :: nbp
+    INTEGER,INTENT(IN) :: nbp_lon
+    INTEGER,INTENT(IN) :: nbp_lat
+    INTEGER,INTENT(IN) :: communicator
     
     INTEGER,ALLOCATABLE :: distrib(:)
@@ -189,7 +183,7 @@
 
   SUBROUTINE print_module_data
-!  USE print_control_mod, ONLY: lunout
+  USE print_control_mod, ONLY: lunout
   IMPLICIT NONE
-  INCLUDE "iniprint.h" 
+!  INCLUDE "iniprint.h" 
   
     WRITE(lunout,*) 'ii_begin =', ii_begin
Index: LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90	(revision 3428)
+++ LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90	(revision 3605)
@@ -42,4 +42,9 @@
   END INTERFACE 
 
+  INTERFACE reduce_min_mpi
+    MODULE PROCEDURE reduce_min_mpi_i,reduce_min_mpi_i1,reduce_min_mpi_i2,reduce_min_mpi_i3,reduce_min_mpi_i4, &
+                     reduce_min_mpi_r,reduce_min_mpi_r1,reduce_min_mpi_r2,reduce_min_mpi_r3,reduce_min_mpi_r4
+  END INTERFACE 
+
  INTERFACE grid1dTo2d_mpi
     MODULE PROCEDURE grid1dTo2d_mpi_i,grid1dTo2d_mpi_i1,grid1dTo2d_mpi_i2,grid1dTo2d_mpi_i3, &
@@ -986,4 +991,129 @@
   END SUBROUTINE reduce_sum_mpi_r4 
   
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!! Definition des reduce_min   --> 4D   !!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  SUBROUTINE reduce_min_mpi_i(VarIn, VarOut)
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN)  :: VarIn
+    INTEGER,INTENT(OUT) :: VarOut
+    INTEGER             :: VarIn_tmp(1)
+    INTEGER             :: VarOut_tmp(1)
+    
+    VarIn_tmp(1)=VarIn    
+    CALL reduce_min_mpi_igen(VarIn_tmp,Varout_tmp,1)
+    VarOut=VarOut_tmp(1)
+    
+  END SUBROUTINE reduce_min_mpi_i
+
+  SUBROUTINE reduce_min_mpi_i1(VarIn, VarOut)
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
+    
+    CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn))
+  
+  END SUBROUTINE reduce_min_mpi_i1
+
+  SUBROUTINE reduce_min_mpi_i2(VarIn, VarOut)
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:,:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
+    
+    CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn))
+  
+  END SUBROUTINE reduce_min_mpi_i2
+
+  SUBROUTINE reduce_min_mpi_i3(VarIn, VarOut)
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:,:,:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
+    
+    CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn))
+  
+  END SUBROUTINE reduce_min_mpi_i3
+
+  SUBROUTINE reduce_min_mpi_i4(VarIn, VarOut)
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:,:,:,:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
+    
+    CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn))
+  
+  END SUBROUTINE reduce_min_mpi_i4                  
+  
+  
+  SUBROUTINE reduce_min_mpi_r(VarIn, VarOut)
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN)  :: VarIn
+    REAL,INTENT(OUT) :: VarOut
+    REAL             :: VarIn_tmp(1)
+    REAL             :: VarOut_tmp(1)
+    
+    VarIn_tmp(1)=VarIn    
+    CALL reduce_min_mpi_rgen(VarIn_tmp,Varout_tmp,1)
+    VarOut=VarOut_tmp(1)
+  
+  END SUBROUTINE reduce_min_mpi_r
+
+  SUBROUTINE reduce_min_mpi_r1(VarIn, VarOut)
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:) :: VarOut
+    
+    CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn))
+     
+  END SUBROUTINE reduce_min_mpi_r1
+
+  SUBROUTINE reduce_min_mpi_r2(VarIn, VarOut)
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:,:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
+    
+    CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn))
+  
+  END SUBROUTINE reduce_min_mpi_r2
+
+  SUBROUTINE reduce_min_mpi_r3(VarIn, VarOut)
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:,:,:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
+    
+    CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn))
+  
+  END SUBROUTINE reduce_min_mpi_r3
+
+  SUBROUTINE reduce_min_mpi_r4(VarIn, VarOut)
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:,:,:,:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
+    
+    CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn))
+  
+  END SUBROUTINE reduce_min_mpi_r4 
+
+
 
 
@@ -1678,4 +1808,62 @@
 
 
+  SUBROUTINE reduce_min_mpi_igen(VarIn,VarOut,nb)
+    USE mod_phys_lmdz_mpi_data 
+    USE mod_grid_phy_lmdz
+    IMPLICIT NONE
+    
+#ifdef CPP_MPI
+    INCLUDE 'mpif.h'
+#endif
+   
+    INTEGER,INTENT(IN) :: nb
+    INTEGER,DIMENSION(nb),INTENT(IN) :: VarIn
+    INTEGER,DIMENSION(nb),INTENT(OUT) :: VarOut    
+    INTEGER :: ierr
+   
+    IF (.not.is_using_mpi) THEN
+      VarOut(:)=VarIn(:)
+      RETURN
+    ENDIF
+
+
+#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
+  
+  SUBROUTINE reduce_min_mpi_rgen(VarIn,VarOut,nb)
+    USE mod_phys_lmdz_mpi_data 
+    USE mod_grid_phy_lmdz
+
+    IMPLICIT NONE
+
+#ifdef CPP_MPI
+    INCLUDE 'mpif.h'
+#endif
+    
+    INTEGER,INTENT(IN) :: nb
+    REAL,DIMENSION(nb),INTENT(IN) :: VarIn
+    REAL,DIMENSION(nb),INTENT(OUT) :: VarOut    
+    INTEGER :: ierr
+ 
+    IF (.not.is_using_mpi) THEN
+      VarOut(:)=VarIn(:)
+      RETURN
+    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
+
+
+
+
+
+
+
   SUBROUTINE grid1dTo2d_mpi_igen(VarIn,VarOut,dimsize)
     USE mod_phys_lmdz_mpi_data
Index: LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_omp_data.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_omp_data.F90	(revision 3428)
+++ LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_omp_data.F90	(revision 3605)
@@ -7,4 +7,5 @@
   INTEGER,SAVE :: omp_rank
   LOGICAL,SAVE :: is_omp_root
+  LOGICAL,SAVE :: is_omp_master  ! alias of is_omp_root
   LOGICAL,SAVE :: is_using_omp
   LOGICAL,SAVE :: is_north_pole_phy, is_south_pole_phy
@@ -17,5 +18,5 @@
   INTEGER,SAVE :: klon_omp_begin
   INTEGER,SAVE :: klon_omp_end
-!$OMP  THREADPRIVATE(omp_rank,klon_omp,is_omp_root,klon_omp_begin,klon_omp_end)
+!$OMP  THREADPRIVATE(omp_rank,klon_omp,is_omp_root,is_omp_master,klon_omp_begin,klon_omp_end)
 !$OMP  THREADPRIVATE(is_north_pole_phy, is_south_pole_phy)
 
@@ -60,8 +61,8 @@
    ELSE
      abort_message = 'ANORMAL : OMP_MASTER /= 0'
-     CALL abort_gcm (modname,abort_message,1)
+     CALL abort_physic (modname,abort_message,1)
    ENDIF
 !$OMP END MASTER
-
+   is_omp_master=is_omp_root
 
 !$OMP MASTER 
@@ -106,6 +107,7 @@
 
   SUBROUTINE Print_module_data
+  USE print_control_mod, ONLY: lunout
   IMPLICIT NONE
-  INCLUDE "iniprint.h"
+!  INCLUDE "iniprint.h"
 
 !$OMP CRITICAL  
Index: LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_omp_transfert.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_omp_transfert.F90	(revision 3428)
+++ LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_omp_transfert.F90	(revision 3605)
@@ -47,6 +47,11 @@
   END INTERFACE 
 
-
-  PUBLIC bcast_omp,scatter_omp,gather_omp,reduce_sum_omp, omp_barrier
+  INTERFACE reduce_min_omp
+    MODULE PROCEDURE reduce_min_omp_i,reduce_min_omp_i1,reduce_min_omp_i2,reduce_min_omp_i3,reduce_min_omp_i4, &
+                     reduce_min_omp_r,reduce_min_omp_r1,reduce_min_omp_r2,reduce_min_omp_r3,reduce_min_omp_r4
+  END INTERFACE 
+
+
+  PUBLIC bcast_omp,scatter_omp,gather_omp,reduce_sum_omp, reduce_min_omp, omp_barrier
 
 CONTAINS
@@ -710,4 +715,134 @@
   END SUBROUTINE reduce_sum_omp_r4
 
+
+
+  SUBROUTINE reduce_min_omp_i(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN)  :: VarIn
+    INTEGER,INTENT(OUT) :: VarOut
+    INTEGER             :: VarIn_tmp(1)
+    INTEGER             :: VarOut_tmp(1)
+    
+    VarIn_tmp(1)=VarIn
+    CALL Check_buffer_i(1)   
+    CALL reduce_min_omp_igen(VarIn_tmp,Varout_tmp,1,buffer_i)
+    VarOut=VarOut_tmp(1)
+    
+  END SUBROUTINE reduce_min_omp_i
+
+  SUBROUTINE reduce_min_omp_i1(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
+    
+    CALL Check_buffer_i(size(VarIn))   
+    CALL reduce_min_omp_igen(VarIn,Varout,Size(VarIn),buffer_i)
+   
+  END SUBROUTINE reduce_min_omp_i1
+  
+  
+  SUBROUTINE reduce_min_omp_i2(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:,:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
+
+    CALL Check_buffer_i(size(VarIn))   
+    CALL reduce_min_omp_igen(VarIn,Varout,Size(VarIn),buffer_i)
+  
+  END SUBROUTINE reduce_min_omp_i2
+
+
+  SUBROUTINE reduce_min_omp_i3(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:,:,:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
+    
+    CALL Check_buffer_i(size(VarIn))   
+    CALL reduce_min_omp_igen(VarIn,Varout,Size(VarIn),buffer_i)
+  
+  END SUBROUTINE reduce_min_omp_i3
+
+
+  SUBROUTINE reduce_min_omp_i4(VarIn, VarOut)
+    IMPLICIT NONE
+
+    INTEGER,INTENT(IN),DIMENSION(:,:,:,:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
+  
+    CALL Check_buffer_i(size(VarIn))   
+    CALL reduce_min_omp_igen(VarIn,Varout,Size(VarIn),buffer_i)
+  
+  END SUBROUTINE reduce_min_omp_i4
+
+
+  SUBROUTINE reduce_min_omp_r(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN)  :: VarIn
+    REAL,INTENT(OUT) :: VarOut
+    REAL             :: VarIn_tmp(1)
+    REAL             :: VarOut_tmp(1)
+    
+    VarIn_tmp(1)=VarIn
+    CALL Check_buffer_r(1)   
+    CALL reduce_min_omp_rgen(VarIn_tmp,Varout_tmp,1,buffer_r)
+    VarOut=VarOut_tmp(1)
+  
+  END SUBROUTINE reduce_min_omp_r
+
+  SUBROUTINE reduce_min_omp_r1(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:) :: VarOut
+    
+    CALL Check_buffer_r(size(VarIn))   
+    CALL reduce_min_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r)
+   
+  END SUBROUTINE reduce_min_omp_r1
+  
+  
+  SUBROUTINE reduce_min_omp_r2(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:,:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
+    
+    CALL Check_buffer_r(size(VarIn))   
+    CALL reduce_min_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r)
+  
+  END SUBROUTINE reduce_min_omp_r2
+
+
+  SUBROUTINE reduce_min_omp_r3(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:,:,:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
+    
+    CALL Check_buffer_r(size(VarIn))   
+    CALL reduce_min_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r)
+  
+  END SUBROUTINE reduce_min_omp_r3
+
+
+  SUBROUTINE reduce_min_omp_r4(VarIn, VarOut)
+    IMPLICIT NONE
+
+    REAL,INTENT(IN),DIMENSION(:,:,:,:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
+  
+    CALL Check_buffer_r(size(VarIn))   
+    CALL reduce_min_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r)
+  
+  END SUBROUTINE reduce_min_omp_r4
+
+
+
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !    LES ROUTINES GENERIQUES    !
@@ -1062,3 +1197,69 @@
   END SUBROUTINE reduce_sum_omp_rgen
 
+
+  SUBROUTINE reduce_min_omp_igen(VarIn,VarOut,dimsize,Buff)
+  IMPLICIT NONE
+
+    INTEGER,INTENT(IN) :: dimsize
+    INTEGER,INTENT(IN),DIMENSION(dimsize) :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(dimsize) :: VarOut
+    INTEGER,INTENT(INOUT),DIMENSION(dimsize) :: Buff
+
+    INTEGER :: i
+    INTEGER :: var
+
+  !$OMP MASTER
+    Buff(:)=HUGE(var)
+  !$OMP END MASTER
+  !$OMP BARRIER
+  
+  !$OMP CRITICAL     
+    DO i=1,dimsize
+      Buff(i)=MIN(Buff(i),VarIn(i))
+    ENDDO
+  !$OMP END CRITICAL
+  !$OMP BARRIER  
+  
+  !$OMP MASTER
+    DO i=1,dimsize
+      VarOut(i)=Buff(i)
+    ENDDO
+  !$OMP END MASTER
+  !$OMP BARRIER
+  
+  END SUBROUTINE reduce_min_omp_igen
+
+  SUBROUTINE reduce_min_omp_rgen(VarIn,VarOut,dimsize,Buff)
+  IMPLICIT NONE
+
+    INTEGER,INTENT(IN) :: dimsize
+    REAL,INTENT(IN),DIMENSION(dimsize) :: VarIn
+    REAL,INTENT(OUT),DIMENSION(dimsize) :: VarOut
+    REAL,INTENT(INOUT),DIMENSION(dimsize) :: Buff
+
+    INTEGER :: i
+    REAL :: var
+
+  !$OMP MASTER
+    Buff(:)=HUGE(var)
+  !$OMP END MASTER
+  !$OMP BARRIER
+  
+  !$OMP CRITICAL     
+    DO i=1,dimsize
+      Buff(i)=MIN(Buff(i),VarIn(i))
+    ENDDO
+  !$OMP END CRITICAL
+  !$OMP BARRIER  
+  
+  !$OMP MASTER
+    DO i=1,dimsize
+      VarOut(i)=Buff(i)
+    ENDDO
+  !$OMP END MASTER
+  !$OMP BARRIER
+  
+  END SUBROUTINE reduce_min_omp_rgen
+
+
 END MODULE mod_phys_lmdz_omp_transfert
Index: LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_para.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_para.F90	(revision 3428)
+++ LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_para.F90	(revision 3605)
@@ -33,5 +33,5 @@
        is_master=.FALSE.
      ENDIF
-     CALL Test_transfert
+!ym     CALL Test_transfert
 !$OMP END PARALLEL    
      IF (is_using_mpi .OR. is_using_omp) THEN
@@ -49,6 +49,7 @@
   SUBROUTINE Test_transfert
   USE mod_grid_phy_lmdz
+  USE print_control_mod, ONLY: lunout
   IMPLICIT NONE
-    INCLUDE "iniprint.h"
+!    INCLUDE "iniprint.h"
  
     REAL :: Test_Field1d_glo(klon_glo,nbp_lev)
Index: LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_transfert_para.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_transfert_para.F90	(revision 3428)
+++ LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_transfert_para.F90	(revision 3605)
@@ -1,4 +1,4 @@
 !
-!$Header$
+!$Id$
 !
 MODULE mod_phys_lmdz_transfert_para
@@ -46,4 +46,8 @@
   END INTERFACE 
 
+  INTERFACE reduce_min
+    MODULE PROCEDURE reduce_min_i,reduce_min_i1,reduce_min_i2,reduce_min_i3,reduce_min_i4, &
+                     reduce_min_r,reduce_min_r1,reduce_min_r2,reduce_min_r3,reduce_min_r4
+  END INTERFACE 
    
 CONTAINS
@@ -1271,4 +1275,173 @@
   END SUBROUTINE reduce_sum_r4  
 
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!! Definition des reduce_min   --> 4D   !!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+! Les entiers
+
+  SUBROUTINE reduce_min_i(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN)  :: VarIn
+    INTEGER,INTENT(OUT) :: VarOut
+    
+    INTEGER             :: Var_tmp
+           
+    CALL reduce_min_omp(VarIn,Var_tmp)
+!$OMP MASTER      
+    CALL reduce_min_mpi(Var_tmp,VarOut)
+!$OMP END MASTER
+  
+  END SUBROUTINE reduce_min_i  
+
+
+  SUBROUTINE reduce_min_i1(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
+    
+    INTEGER,DIMENSION(SIZE(VarIn))   :: Var_tmp
+           
+    CALL reduce_min_omp(VarIn,Var_tmp)
+!$OMP MASTER      
+    CALL reduce_min_mpi(Var_tmp,VarOut)
+!$OMP END MASTER
+  
+  END SUBROUTINE reduce_min_i1  
+
+
+  SUBROUTINE reduce_min_i2(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:,:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
+    
+    INTEGER,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2)) :: Var_tmp
+           
+    CALL reduce_min_omp(VarIn,Var_tmp)
+!$OMP MASTER      
+    CALL reduce_min_mpi(Var_tmp,VarOut)
+!$OMP END MASTER
+  
+  END SUBROUTINE reduce_min_i2  
+  
+
+  SUBROUTINE reduce_min_i3(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:,:,:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
+    
+    INTEGER,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3))  :: Var_tmp
+           
+    CALL reduce_min_omp(VarIn,Var_tmp)
+!$OMP MASTER      
+    CALL reduce_min_mpi(Var_tmp,VarOut)
+!$OMP END MASTER
+  
+  END SUBROUTINE reduce_min_i3  
+
+
+  SUBROUTINE reduce_min_i4(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    INTEGER,INTENT(IN),DIMENSION(:,:,:,:)  :: VarIn
+    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
+    
+    INTEGER,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4))  :: Var_tmp
+           
+    CALL reduce_min_omp(VarIn,Var_tmp)
+!$OMP MASTER      
+    CALL reduce_min_mpi(Var_tmp,VarOut)
+!$OMP END MASTER
+  
+  END SUBROUTINE reduce_min_i4  
+
+
+! Les reels
+
+  SUBROUTINE reduce_min_r(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN)  :: VarIn
+    REAL,INTENT(OUT) :: VarOut
+    
+    REAL             :: Var_tmp
+           
+    CALL reduce_min_omp(VarIn,Var_tmp)
+!$OMP MASTER      
+    CALL reduce_min_mpi(Var_tmp,VarOut)
+!$OMP END MASTER
+  
+  END SUBROUTINE reduce_min_r  
+
+
+  SUBROUTINE reduce_min_r1(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:) :: VarOut
+    
+    REAL,DIMENSION(SIZE(VarIn))   :: Var_tmp
+           
+    CALL reduce_min_omp(VarIn,Var_tmp)
+!$OMP MASTER      
+    CALL reduce_min_mpi(Var_tmp,VarOut)
+!$OMP END MASTER
+  
+  END SUBROUTINE reduce_min_r1  
+
+
+  SUBROUTINE reduce_min_r2(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:,:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
+    
+    REAL,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2)) :: Var_tmp
+           
+    CALL reduce_min_omp(VarIn,Var_tmp)
+!$OMP MASTER      
+    CALL reduce_min_mpi(Var_tmp,VarOut)
+!$OMP END MASTER
+  
+  END SUBROUTINE reduce_min_r2  
+  
+
+  SUBROUTINE reduce_min_r3(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:,:,:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
+    
+    REAL,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3))  :: Var_tmp
+           
+    CALL reduce_min_omp(VarIn,Var_tmp)
+!$OMP MASTER      
+    CALL reduce_min_mpi(Var_tmp,VarOut)
+!$OMP END MASTER
+  
+  END SUBROUTINE reduce_min_r3  
+
+
+  SUBROUTINE reduce_min_r4(VarIn, VarOut)
+    IMPLICIT NONE
+  
+    REAL,INTENT(IN),DIMENSION(:,:,:,:)  :: VarIn
+    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
+    
+    REAL,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4))  :: Var_tmp
+           
+    CALL reduce_min_omp(VarIn,Var_tmp)
+!$OMP MASTER      
+    CALL reduce_min_mpi(Var_tmp,VarOut)
+!$OMP END MASTER
+  
+  END SUBROUTINE reduce_min_r4  
+
+
    
 END MODULE mod_phys_lmdz_transfert_para
Index: LMDZ6/branches/Ocean_skin/libf/phy_common/physics_distribution_mod.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phy_common/physics_distribution_mod.F90	(revision 3428)
+++ LMDZ6/branches/Ocean_skin/libf/phy_common/physics_distribution_mod.F90	(revision 3605)
@@ -10,6 +10,12 @@
                                        nbp, nbp_lon, nbp_lat, nbp_lev, &
                                        communicator)
-  USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para
+  USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para, klon_omp
   USE mod_grid_phy_lmdz, ONLY: init_grid_phy_lmdz
+  USE dimphy, ONLY : Init_dimphy
+  USE infotrac_phy, ONLY : type_trac
+#ifdef REPROBUS
+  USE CHEM_REP, ONLY : Init_chem_rep_phys
+#endif
+
   IMPLICIT NONE
     INTEGER,INTENT(IN) :: grid_type 
@@ -24,4 +30,15 @@
     CALL init_grid_phy_lmdz(grid_type,nvertex, nbp_lon,nbp_lat,nbp_lev)
     CALL init_phys_lmdz_para(nbp,nbp_lon, nbp_lat, communicator)
+!$OMP PARALLEL
+    CALL init_dimphy(klon_omp,nbp_lev)
+
+! Initialization of Reprobus
+    IF (type_trac == 'repr') THEN
+#ifdef REPROBUS
+       CALL Init_chem_rep_phys(klon_omp,nbp_lev)
+#endif
+    END IF
+
+!$OMP END PARALLEL
 
   END SUBROUTINE init_physics_distribution  
Index: LMDZ6/branches/Ocean_skin/libf/phy_common/print_control_mod.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phy_common/print_control_mod.F90	(revision 3428)
+++ LMDZ6/branches/Ocean_skin/libf/phy_common/print_control_mod.F90	(revision 3605)
@@ -7,57 +7,21 @@
 !$OMP THREADPRIVATE(lunout,prt_level,debug)
 
+  ! NB: Module variable Initializations done by set_print_control
+  !     routine from init_print_control_mod to avoid circular
+  !     module dependencies
+
 CONTAINS
 
-  SUBROUTINE init_print_control
-  USE ioipsl_getin_p_mod, ONLY : getin_p
-  USE mod_phys_lmdz_para, ONLY: is_omp_root, is_master
+  SUBROUTINE set_print_control(lunout_,prt_level_,debug_)
   IMPLICIT NONE
-
-    LOGICAL :: opened
-    INTEGER :: number
+    INTEGER :: lunout_
+    INTEGER :: prt_level_
+    LOGICAL :: debug_
+      
+    lunout = lunout_
+    prt_level = prt_level_
+    debug = debug_
     
-    !Config  Key  = prt_level
-    !Config  Desc = niveau d'impressions de débogage
-    !Config  Def  = 0
-    !Config  Help = Niveau d'impression pour le débogage
-    !Config         (0 = minimum d'impression)
-    prt_level = 0
-    CALL getin_p('prt_level',prt_level)
-
-    !Config  Key  = lunout
-    !Config  Desc = unite de fichier pour les impressions
-    !Config  Def  = 6
-    !Config  Help = unite de fichier pour les impressions 
-    !Config         (defaut sortie standard = 6)
-    lunout=6
-    CALL getin_p('lunout', lunout)
-
-    IF (is_omp_root) THEN
-      IF (lunout /= 5 .and. lunout /= 6) THEN
-         INQUIRE(FILE='lmdz.out_0000',OPENED=opened,NUMBER=number)
-         IF (opened) THEN
-           lunout=number
-         ELSE
-           OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write',  &
-                STATUS='unknown',FORM='formatted')
-         ENDIF
-      ENDIF
-    ENDIF
-
-    !Config  Key  = debug
-    !Config  Desc = mode debogage
-    !Config  Def  = false
-    !Config  Help = positionne le mode debogage
-
-    debug = .FALSE.
-    CALL getin_p('debug',debug)
-    
-    IF (is_master) THEN
-      WRITE(lunout,*)"init_print_control: prt_level=",prt_level
-      WRITE(lunout,*)"init_print_control: lunout=",lunout
-      WRITE(lunout,*)"init_print_control: debug=",debug      
-    ENDIF
-    
-  END SUBROUTINE init_print_control  
+  END SUBROUTINE set_print_control
 
 END MODULE print_control_mod
