Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxy.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxy.f90	(revision 5120)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxy.f90	(revision 5122)
@@ -5,7 +5,5 @@
         rlonu, xprimu, rlonv, xprimv, rlonm025, xprimm025, rlonp025, xprimp025)
 
-  USE comconst_mod, ONLY: pi
-  USE serre_mod, ONLY: pxo, pyo, alphax, alphay, transx, transy
-  USE lmdz_fxy, ONLY: fxy_new
+  USE lmdz_fxy_new, ONLY: fx, fxprim, fy, fyprim
 
   IMPLICIT NONE
@@ -26,7 +24,4 @@
   REAL :: rlonu(iip1), xprimu(iip1), rlonv(iip1), xprimv(iip1), &
           rlonm025(iip1), xprimm025(iip1), rlonp025(iip1), xprimp025(iip1)
-  REAL :: ripx, fx, fxprim, fy, fyprim, ri, rj, bigy
-
-  CALL fxy_new(ripx, fx, fxprim, fy, fyprim, ri, rj, bigy)
 
   !    ......  calcul  des  latitudes  et de y'   .....
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxysinus.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxysinus.f90	(revision 5120)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxysinus.f90	(revision 5122)
@@ -6,5 +6,5 @@
 
   USE comconst_mod, ONLY: pi
-  USE lmdz_fxy, ONLY: fxy_sin
+  USE lmdz_fxy_sin, ONLY: fx, fxprim, fy, fyprim
   IMPLICIT NONE
   !
@@ -24,8 +24,4 @@
   REAL :: rlonu(iip1), xprimu(iip1), rlonv(iip1), xprimv(iip1), &
           rlonm025(iip1), xprimm025(iip1), rlonp025(iip1), xprimp025(iip1)
-  REAL :: fy, fx, fxprim, fyprim, ri, rj
-
-  CALL fxy_sin(fy, fx, fxprim, fyprim, ri, rj)
-
 
   !    ......  calcul  des  latitudes  et de y'   .....
Index: LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy.f90	(revision 5120)
+++ 	(revision )
@@ -1,136 +1,0 @@
-! This module replaces grid/fxy*.h
-
-MODULE lmdz_fxy
-  IMPLICIT NONE; PRIVATE
-  PUBLIC fxy_new, fxy_reg, fxy_sin, fxy_prim
-CONTAINS
-  SUBROUTINE fxy_new(ripx, fx, fxprim, fy, fyprim, ri, rj, bigy)
-    INCLUDE "dimensions.h"
-    REAL :: ripx, fx, fxprim, fy, fyprim, ri, rj, bigy
-
-    !....stretching in x...
-    ripx(ri) = (ri - 1.0) * 2. * pi / REAL(iim)
-    fx  (ri) = ripx(ri) + transx + &
-            alphax * SIN(ripx(ri) + transx - pxo) - pi
-    fxprim(ri) = 2. * pi / REAL(iim) * &
-            (1. + alphax * COS(ripx(ri) + transx - pxo))
-
-    !....stretching in y...
-    bigy(rj) = 2. * (REAL(jjp1) - rj) * pi / jjm
-    fy(rj) = (bigy(rj) + transy + &
-            alphay * SIN(bigy(rj) + transy - pyo)) / 2. - pi / 2.
-    fyprim(rj) = (pi / jjm) * (1. + &
-            alphay * COS(bigy(rj) + transy - pyo))
-
-    ! fy(rj)= pyo-pisjjm*(rj-transy)+coefalpha*SIN(depisjm*(rj-
-    ! *  transy ))
-    !   fyprim(rj)= pisjjm-pisjjm*coefy2* COS(depisjm*(rj-transy))
-    !--------------------------------------------------------------
-  END SUBROUTINE fxy_new
-
-  SUBROUTINE fxy_reg(fy, fx, fxprim, fyprim, ri, rj)
-    INCLUDE "dimensions.h"
-    REAL :: fy, fx, fxprim, fyprim, ri, rj
-
-    fy    (rj) = pi / REAL(jjm) * (0.5 * REAL(jjm) + 1. - rj)
-    fyprim(rj) = pi / REAL(jjm)
-
-    ! fy(rj)=ASIN(1.+2.*((1.-rj)/REAL(jjm)))
-    ! fyprim(rj)=1./SQRT((rj-1.)*(jjm+1.-rj))
-
-    fx    (ri) = 2. * pi / REAL(iim) * (ri - 0.5 * REAL(iim) - 1.)
-    ! fx    ( ri ) = 2.*pi/REAL(iim) * ( ri - 0.5* ( REAL(iim) + 1.) )
-    fxprim(ri) = 2. * pi / REAL(iim)
-    !
-    !    La valeur de pi est passee par le common/const/ou /const2/ .
-    !    Sinon, il faut la calculer avant d'appeler ces fonctions .
-    !
-    !   ----------------------------------------------------------------
-    ! Fonctions a changer eventuellement, selon x(x) et y(y) choisis .
-    !   -----------------------------------------------------------------
-    !
-    !    .....  ici, on a l'application particuliere suivante   ........
-    !
-    !            **************************************
-    !            **     x = 2. * pi/iim *  X         **
-    !            **     y =      pi/jjm *  Y         **
-    !            **************************************
-    !
-    !   ..................................................................
-    !   ..................................................................
-    !
-    !
-    !
-    !-----------------------------------------------------------------------
-
-  END SUBROUTINE fxy_reg
-
-  SUBROUTINE fxy_sin(fy, fx, fxprim, fyprim, ri, rj)
-    REAL :: fy, fx, fxprim, fyprim, ri, rj
-
-    fy(rj) = ASIN(1. + 2. * ((1. - rj) / REAL(jjm)))
-    fyprim(rj) = 1. / SQRT((rj - 1.) * (jjm + 1. - rj))
-
-    fx    (ri) = 2. * pi / REAL(iim) * (ri - 0.5 * REAL(iim) - 1.)
-    ! fx    ( ri ) = 2.*pi/REAL(iim) * ( ri - 0.5* ( REAL(iim) + 1.) )
-    fxprim(ri) = 2. * pi / REAL(iim)
-    !
-    !
-    !    La valeur de pi est passee par le common/const/ou /const2/ .
-    !    Sinon, il faut la calculer avant d'appeler ces fonctions .
-    !
-    !   ----------------------------------------------------------------
-    ! Fonctions a changer eventuellement, selon x(x) et y(y) choisis .
-    !   -----------------------------------------------------------------
-    !
-    !    .....  ici, on a l'application particuliere suivante   ........
-    !
-    !            **************************************
-    !            **     x = 2. * pi/iim *  X         **
-    !            **     y =      pi/jjm *  Y         **
-    !            **************************************
-    !
-    !   ..................................................................
-    !   ..................................................................
-    !
-    !
-    !
-    !-----------------------------------------------------------------------
-  END SUBROUTINE fxy_sin
-
-  SUBROUTINE fxy_prim(fy, fx, fxprim, fyprim, ri, rj)
-    REAL :: fy, fx, fxprim, fyprim, ri, rj
-
-    fy    (rj) = pi / REAL(jjm) * (0.5 * REAL(jjm) + 1. - rj)
-    fyprim(rj) = pi / REAL(jjm)
-
-    ! fy(rj)=ASIN(1.+2.*((1.-rj)/REAL(jjm)))
-    ! fyprim(rj)=1./SQRT((rj-1.)*(jjm+1.-rj))
-
-    fx    (ri) = 2. * pi / REAL(iim) * (ri - 0.5 * REAL(iim) - 1.)
-    ! fx    ( ri ) = 2.*pi/REAL(iim) * ( ri - 0.5* ( REAL(iim) + 1.) )
-    fxprim(ri) = 2. * pi / REAL(iim)
-    !
-    !
-    !    La valeur de pi est passee par le common/const/ou /const2/ .
-    !    Sinon, il faut la calculer avant d'appeler ces fonctions .
-    !
-    !   ----------------------------------------------------------------
-    ! Fonctions a changer eventuellement, selon x(x) et y(y) choisis .
-    !   -----------------------------------------------------------------
-    !
-    !    .....  ici, on a l'application particuliere suivante   ........
-    !
-    !            **************************************
-    !            **     x = 2. * pi/iim *  X         **
-    !            **     y =      pi/jjm *  Y         **
-    !            **************************************
-    !
-    !   ..................................................................
-    !   ..................................................................
-    !
-    !
-    !
-    !-----------------------------------------------------------------------
-  END SUBROUTINE fxy_prim
-END MODULE lmdz_fxy
Index: LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_new.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_new.f90	(revision 5122)
+++ LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_new.f90	(revision 5122)
@@ -0,0 +1,40 @@
+! This module replaces grid/fxy_new.h
+
+MODULE lmdz_fxy_new
+  USE comconst_mod, ONLY: pi
+  USE serre_mod, ONLY: pxo, pyo, alphax, alphay, transx, transy
+  IMPLICIT NONE; PRIVATE
+  PUBLIC fx, fxprim, fy, fyprim
+  INCLUDE "dimensions.h"
+  INCLUDE "paramet.h"
+CONTAINS
+  REAL FUNCTION ripx(ri)
+    REAL, INTENT(IN) :: ri
+    ripx = (ri - 1.0) * 2. * pi / REAL(iim)
+  END FUNCTION ripx
+
+  REAL FUNCTION fx(ri)
+    REAL, INTENT(IN) :: ri
+    fx = ripx(ri) + transx + alphax * SIN(ripx(ri) + transx - pxo) - pi
+  END FUNCTION fx
+
+  REAL FUNCTION fxprim(ri)
+    REAL, INTENT(IN) :: ri
+    fxprim = 2. * pi / REAL(iim) * (1. + alphax * COS(ripx(ri) + transx - pxo))
+  END FUNCTION fxprim
+
+  REAL FUNCTION bigy(rj)
+    REAL, INTENT(IN) :: rj
+    bigy = 2. * (REAL(jjp1) - rj) * pi / jjm
+  END FUNCTION bigy
+
+  REAL FUNCTION fy(rj)
+    REAL, INTENT(IN) :: rj
+    fy = (bigy(rj) + transy + alphay * SIN(bigy(rj) + transy - pyo)) / 2. - pi / 2.
+  END FUNCTION fy
+
+  REAL FUNCTION fyprim(rj)
+    REAL, INTENT(IN) :: rj
+    fyprim = (pi / jjm) * (1. + alphay * COS(bigy(rj) + transy - pyo))
+  END FUNCTION fyprim
+END MODULE lmdz_fxy_new
Index: LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_prim.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_prim.f90	(revision 5122)
+++ LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_prim.f90	(revision 5122)
@@ -0,0 +1,29 @@
+! This module replaces grid/fxy_reg.h
+
+MODULE lmdz_fxy_prim
+  USE comconst_mod, ONLY: pi
+  IMPLICIT NONE; PRIVATE
+  PUBLIC fx, fxprim, fy, fyprim
+  INCLUDE "dimensions.h"
+CONTAINS
+
+  REAL FUNCTION fx(ri)
+    REAL, INTENT(IN) :: ri
+    fx = 2. * pi / REAL(iim) * (ri - 0.5 * REAL(iim) - 1.)
+  END FUNCTION fx
+
+  REAL FUNCTION fxprim(ri)
+    REAL, INTENT(IN) :: ri
+    fxprim = 2. * pi / REAL(iim)
+  END FUNCTION fxprim
+
+  REAL FUNCTION fy(rj)
+    REAL, INTENT(IN) :: rj
+    fy = pi / REAL(jjm) * (0.5 * REAL(jjm) + 1. - rj)
+  END FUNCTION fy
+
+  REAL FUNCTION fyprim(rj)
+    REAL, INTENT(IN) :: rj
+    fyprim = pi / REAL(jjm)
+  END FUNCTION fyprim
+END MODULE lmdz_fxy_prim
Index: LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_reg.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_reg.f90	(revision 5122)
+++ LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_reg.f90	(revision 5122)
@@ -0,0 +1,29 @@
+! This module replaces grid/fxy_reg.h
+
+MODULE lmdz_fxy_reg
+  USE comconst_mod, ONLY: pi
+  IMPLICIT NONE; PRIVATE
+  PUBLIC fx, fxprim, fy, fyprim
+  INCLUDE "dimensions.h"
+CONTAINS
+
+  REAL FUNCTION fx(ri)
+    REAL, INTENT(IN) :: ri
+    fx = 2. * pi / REAL(iim) * (ri - 0.5 * REAL(iim) - 1.)
+  END FUNCTION fx
+
+  REAL FUNCTION fxprim(ri)
+    REAL, INTENT(IN) :: ri
+    fxprim = 2. * pi / REAL(iim)
+  END FUNCTION fxprim
+
+  REAL FUNCTION fy(rj)
+    REAL, INTENT(IN) :: rj
+    fy = pi / REAL(jjm) * (0.5 * REAL(jjm) + 1. - rj)
+  END FUNCTION fy
+
+  REAL FUNCTION fyprim(rj)
+    REAL, INTENT(IN) :: rj
+    fyprim = pi / REAL(jjm)
+  END FUNCTION fyprim
+END MODULE lmdz_fxy_reg
Index: LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_sin.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_sin.f90	(revision 5122)
+++ LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_sin.f90	(revision 5122)
@@ -0,0 +1,29 @@
+! This module replaces grid/fxy_reg.h
+
+MODULE lmdz_fxy_sin
+  USE comconst_mod, ONLY: pi
+  IMPLICIT NONE; PRIVATE
+  PUBLIC fx, fxprim, fy, fyprim
+  INCLUDE "dimensions.h"
+CONTAINS
+
+  REAL FUNCTION fx(ri)
+    REAL, INTENT(IN) :: ri
+    fx = 2. * pi / REAL(iim) * (ri - 0.5 * REAL(iim) - 1.)
+  END FUNCTION fx
+
+  REAL FUNCTION fxprim(ri)
+    REAL, INTENT(IN) :: ri
+    fxprim = 2. * pi / REAL(iim)
+  END FUNCTION fxprim
+
+  REAL FUNCTION fy(rj)
+    REAL, INTENT(IN) :: rj
+    fy = ASIN(1. + 2. * ((1. - rj) / REAL(jjm)))
+  END FUNCTION fy
+
+  REAL FUNCTION fyprim(rj)
+    REAL, INTENT(IN) :: rj
+    fyprim = 1. / SQRT((rj - 1.) * (jjm + 1. - rj))
+  END FUNCTION fyprim
+END MODULE lmdz_fxy_sin
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_libmath.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_libmath.f90	(revision 5120)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_libmath.f90	(revision 5122)
@@ -3,5 +3,5 @@
 MODULE lmdz_libmath
   IMPLICIT NONE; PRIVATE
-  PUBLIC ismin, ismax
+  PUBLIC ismin, ismax, minmax
 
 CONTAINS
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_readTracFiles.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_readTracFiles.f90	(revision 5120)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_readTracFiles.f90	(revision 5122)
@@ -429,6 +429,5 @@
       IF(LEN_TRIM(str) == 0) CYCLE                                     !--- Empty line (probably end of file)
       IF(str     == '') CYCLE                                          !--- Skip empty line (probably at the end of the file)
-      IF(str(1:1)==
-        '&') THEN                                           !=== SECTION HEADER LINE
+      IF(str(1:1)=='&') THEN                                           !=== SECTION HEADER LINE
         ndb = SIZE(dBase)                                             !--- Number of sections so far
         secn = str(2:LEN_TRIM(str)) // ' '                               !--- Current section name
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_omp_transfert.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_omp_transfert.f90	(revision 5120)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_omp_transfert.f90	(revision 5122)
@@ -1,133 +1,124 @@
-
 !$Header$
 
 MODULE lmdz_phys_omp_transfert
-
   PRIVATE
-  
-  REAL,PARAMETER :: grow_factor=1.5
-  INTEGER,PARAMETER :: size_min=1024
-  
-  CHARACTER(LEN=size_min),SAVE            :: buffer_c
-!  INTEGER,SAVE                            :: size_c=0
-  INTEGER,SAVE,ALLOCATABLE,DIMENSION(:)   :: buffer_i
-  INTEGER,SAVE                            :: size_i=0
-  REAL,SAVE,ALLOCATABLE,DIMENSION(:)      :: buffer_r
-  INTEGER,SAVE                            :: size_r=0
-  LOGICAL,SAVE,ALLOCATABLE,DIMENSION(:)   :: buffer_l
-  INTEGER,SAVE                            :: size_l=0
-
-
-  
-  
+
+  REAL, PARAMETER :: grow_factor = 1.5
+  INTEGER, PARAMETER :: size_min = 1024
+
+  CHARACTER(LEN = size_min), SAVE :: buffer_c
+  INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: buffer_i
+  INTEGER, SAVE :: size_i = 0
+  REAL, SAVE, ALLOCATABLE, DIMENSION(:) :: buffer_r
+  INTEGER, SAVE :: size_r = 0
+  LOGICAL, SAVE, ALLOCATABLE, DIMENSION(:) :: buffer_l
+  INTEGER, SAVE :: size_l = 0
+
   INTERFACE bcast_omp
-    MODULE PROCEDURE bcast_omp_c,                                                     &
-                     bcast_omp_i,bcast_omp_i1,bcast_omp_i2,bcast_omp_i3,bcast_omp_i4, &
-                     bcast_omp_r,bcast_omp_r1,bcast_omp_r2,bcast_omp_r3,bcast_omp_r4, &
-                     bcast_omp_l,bcast_omp_l1,bcast_omp_l2,bcast_omp_l3,bcast_omp_l4
+    MODULE PROCEDURE bcast_omp_c, &
+            bcast_omp_i, bcast_omp_i1, bcast_omp_i2, bcast_omp_i3, bcast_omp_i4, &
+            bcast_omp_r, bcast_omp_r1, bcast_omp_r2, bcast_omp_r3, bcast_omp_r4, &
+            bcast_omp_l, bcast_omp_l1, bcast_omp_l2, bcast_omp_l3, bcast_omp_l4
   END INTERFACE
 
   INTERFACE scatter_omp
-    MODULE PROCEDURE scatter_omp_i,scatter_omp_i1,scatter_omp_i2,scatter_omp_i3, &
-                     scatter_omp_r,scatter_omp_r1,scatter_omp_r2,scatter_omp_r3, &
-                     scatter_omp_l,scatter_omp_l1,scatter_omp_l2,scatter_omp_l3
+    MODULE PROCEDURE scatter_omp_i, scatter_omp_i1, scatter_omp_i2, scatter_omp_i3, &
+            scatter_omp_r, scatter_omp_r1, scatter_omp_r2, scatter_omp_r3, &
+            scatter_omp_l, scatter_omp_l1, scatter_omp_l2, scatter_omp_l3
   END INTERFACE
 
-  
   INTERFACE gather_omp
-    MODULE PROCEDURE gather_omp_i,gather_omp_i1,gather_omp_i2,gather_omp_i3, &
-                     gather_omp_r,gather_omp_r1,gather_omp_r2,gather_omp_r3, &
-                     gather_omp_l,gather_omp_l1,gather_omp_l2,gather_omp_l3  
+    MODULE PROCEDURE gather_omp_i, gather_omp_i1, gather_omp_i2, gather_omp_i3, &
+            gather_omp_r, gather_omp_r1, gather_omp_r2, gather_omp_r3, &
+            gather_omp_l, gather_omp_l1, gather_omp_l2, gather_omp_l3
   END INTERFACE
-  
-  
+
   INTERFACE reduce_sum_omp
-    MODULE PROCEDURE reduce_sum_omp_i,reduce_sum_omp_i1,reduce_sum_omp_i2,reduce_sum_omp_i3,reduce_sum_omp_i4, &
-                     reduce_sum_omp_r,reduce_sum_omp_r1,reduce_sum_omp_r2,reduce_sum_omp_r3,reduce_sum_omp_r4
-  END INTERFACE 
+    MODULE PROCEDURE reduce_sum_omp_i, reduce_sum_omp_i1, reduce_sum_omp_i2, reduce_sum_omp_i3, reduce_sum_omp_i4, &
+            reduce_sum_omp_r, reduce_sum_omp_r1, reduce_sum_omp_r2, reduce_sum_omp_r3, reduce_sum_omp_r4
+  END INTERFACE
 
   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
+    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
 
 CONTAINS
-  
+
   SUBROUTINE check_buffer_i(buff_size)
-  IMPLICIT NONE
-  INTEGER :: buff_size
-
-!$OMP BARRIER
-!$OMP MASTER
+    IMPLICIT NONE
+    INTEGER :: buff_size
+
+    !$OMP BARRIER
+    !$OMP MASTER
     IF (buff_size>size_i) THEN
       IF (ALLOCATED(buffer_i)) DEALLOCATE(buffer_i)
-      size_i=MAX(size_min,INT(grow_factor*buff_size))
+      size_i = MAX(size_min, INT(grow_factor * buff_size))
       ALLOCATE(buffer_i(size_i))
     ENDIF
-!$OMP END MASTER
-!$OMP BARRIER
-  
+    !$OMP END MASTER
+    !$OMP BARRIER
+
   END SUBROUTINE check_buffer_i
-  
+
   SUBROUTINE check_buffer_r(buff_size)
-  IMPLICIT NONE
-  INTEGER :: buff_size
-
-!$OMP BARRIER
-!$OMP MASTER
+    IMPLICIT NONE
+    INTEGER :: buff_size
+
+    !$OMP BARRIER
+    !$OMP MASTER
     IF (buff_size>size_r) THEN
       IF (ALLOCATED(buffer_r)) DEALLOCATE(buffer_r)
-      size_r=MAX(size_min,INT(grow_factor*buff_size))
+      size_r = MAX(size_min, INT(grow_factor * buff_size))
       ALLOCATE(buffer_r(size_r))
     ENDIF
-!$OMP END MASTER
-!$OMP BARRIER
-  
+    !$OMP END MASTER
+    !$OMP BARRIER
+
   END SUBROUTINE check_buffer_r
-  
+
   SUBROUTINE check_buffer_l(buff_size)
-  IMPLICIT NONE
-  INTEGER :: buff_size
-
-!$OMP BARRIER
-!$OMP MASTER
+    IMPLICIT NONE
+    INTEGER :: buff_size
+
+    !$OMP BARRIER
+    !$OMP MASTER
     IF (buff_size>size_l) THEN
       IF (ALLOCATED(buffer_l)) DEALLOCATE(buffer_l)
-      size_l=MAX(size_min,INT(grow_factor*buff_size))
+      size_l = MAX(size_min, INT(grow_factor * buff_size))
       ALLOCATE(buffer_l(size_l))
     ENDIF
-!$OMP END MASTER
-!$OMP BARRIER
-  
+    !$OMP END MASTER
+    !$OMP BARRIER
+
   END SUBROUTINE check_buffer_l
-    
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! Definition des Broadcast --> 4D   !!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-!! -- Les chaine de charactère -- !!
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !! Definition des Broadcast --> 4D   !!
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  !! -- Les chaine de charactère -- !!
 
   SUBROUTINE bcast_omp_c(var)
-  IMPLICIT NONE
-    CHARACTER(LEN=*),INTENT(INOUT) :: Var
-    
-    CALL bcast_omp_cgen(Var,len(Var),buffer_c)
-    
+    IMPLICIT NONE
+    CHARACTER(LEN = *), INTENT(INOUT) :: Var
+
+    CALL bcast_omp_cgen(Var, len(Var), buffer_c)
+
   END SUBROUTINE bcast_omp_c
 
-!! -- Les entiers -- !!
-  
+  !! -- Les entiers -- !!
+
   SUBROUTINE bcast_omp_i(var)
-  IMPLICIT NONE
-    INTEGER,INTENT(INOUT) :: Var
+    IMPLICIT NONE
+    INTEGER, INTENT(INOUT) :: Var
     INTEGER :: Var_tmp(1)
-    
-    Var_tmp(1)=Var
+
+    Var_tmp(1) = Var
     CALL check_buffer_i(1)
-    CALL bcast_omp_igen(Var_tmp,1,buffer_i)
-    Var=Var_tmp(1)
+    CALL bcast_omp_igen(Var_tmp, 1, buffer_i)
+    Var = Var_tmp(1)
 
   END SUBROUTINE bcast_omp_i
@@ -135,9 +126,9 @@
 
   SUBROUTINE bcast_omp_i1(var)
-  IMPLICIT NONE
-    INTEGER,INTENT(INOUT) :: Var(:)
-   
+    IMPLICIT NONE
+    INTEGER, INTENT(INOUT) :: Var(:)
+
     CALL check_buffer_i(size(Var))
-    CALL bcast_omp_igen(Var,size(Var),buffer_i)
+    CALL bcast_omp_igen(Var, size(Var), buffer_i)
 
   END SUBROUTINE bcast_omp_i1
@@ -145,9 +136,9 @@
 
   SUBROUTINE bcast_omp_i2(var)
-  IMPLICIT NONE
-    INTEGER,INTENT(INOUT) :: Var(:,:)
-   
+    IMPLICIT NONE
+    INTEGER, INTENT(INOUT) :: Var(:, :)
+
     CALL check_buffer_i(size(Var))
-    CALL bcast_omp_igen(Var,size(Var),buffer_i)
+    CALL bcast_omp_igen(Var, size(Var), buffer_i)
 
   END SUBROUTINE bcast_omp_i2
@@ -155,9 +146,9 @@
 
   SUBROUTINE bcast_omp_i3(var)
-  IMPLICIT NONE
-    INTEGER,INTENT(INOUT) :: Var(:,:,:)
+    IMPLICIT NONE
+    INTEGER, INTENT(INOUT) :: Var(:, :, :)
 
     CALL check_buffer_i(size(Var))
-    CALL bcast_omp_igen(Var,size(Var),buffer_i)
+    CALL bcast_omp_igen(Var, size(Var), buffer_i)
 
   END SUBROUTINE bcast_omp_i3
@@ -165,24 +156,24 @@
 
   SUBROUTINE bcast_omp_i4(var)
-  IMPLICIT NONE
-    INTEGER,INTENT(INOUT) :: Var(:,:,:,:)
-   
+    IMPLICIT NONE
+    INTEGER, INTENT(INOUT) :: Var(:, :, :, :)
+
     CALL check_buffer_i(size(Var))
-    CALL bcast_omp_igen(Var,size(Var),buffer_i)
+    CALL bcast_omp_igen(Var, size(Var), buffer_i)
 
   END SUBROUTINE bcast_omp_i4
 
 
-!! -- Les reels -- !!
+  !! -- Les reels -- !!
 
   SUBROUTINE bcast_omp_r(var)
-  IMPLICIT NONE
-    REAL,INTENT(INOUT) :: Var
+    IMPLICIT NONE
+    REAL, INTENT(INOUT) :: Var
     REAL :: Var_tmp(1)
-    
-    Var_tmp(1)=Var
+
+    Var_tmp(1) = Var
     CALL check_buffer_r(1)
-    CALL bcast_omp_rgen(Var_tmp,1,buffer_r)
-    Var=Var_tmp(1)
+    CALL bcast_omp_rgen(Var_tmp, 1, buffer_r)
+    Var = Var_tmp(1)
 
   END SUBROUTINE bcast_omp_r
@@ -190,9 +181,9 @@
 
   SUBROUTINE bcast_omp_r1(var)
-  IMPLICIT NONE
-    REAL,INTENT(INOUT) :: Var(:)
-   
+    IMPLICIT NONE
+    REAL, INTENT(INOUT) :: Var(:)
+
     CALL check_buffer_r(size(Var))
-    CALL bcast_omp_rgen(Var,size(Var),buffer_r)
+    CALL bcast_omp_rgen(Var, size(Var), buffer_r)
 
   END SUBROUTINE bcast_omp_r1
@@ -200,9 +191,9 @@
 
   SUBROUTINE bcast_omp_r2(var)
-  IMPLICIT NONE
-    REAL,INTENT(INOUT) :: Var(:,:)
-   
+    IMPLICIT NONE
+    REAL, INTENT(INOUT) :: Var(:, :)
+
     CALL check_buffer_r(size(Var))
-    CALL bcast_omp_rgen(Var,size(Var),buffer_r)
+    CALL bcast_omp_rgen(Var, size(Var), buffer_r)
 
   END SUBROUTINE bcast_omp_r2
@@ -210,9 +201,9 @@
 
   SUBROUTINE bcast_omp_r3(var)
-  IMPLICIT NONE
-    REAL,INTENT(INOUT) :: Var(:,:,:)
+    IMPLICIT NONE
+    REAL, INTENT(INOUT) :: Var(:, :, :)
 
     CALL check_buffer_r(size(Var))
-    CALL bcast_omp_rgen(Var,size(Var),buffer_r)
+    CALL bcast_omp_rgen(Var, size(Var), buffer_r)
 
   END SUBROUTINE bcast_omp_r3
@@ -220,24 +211,24 @@
 
   SUBROUTINE bcast_omp_r4(var)
-  IMPLICIT NONE
-    REAL,INTENT(INOUT) :: Var(:,:,:,:)
-   
+    IMPLICIT NONE
+    REAL, INTENT(INOUT) :: Var(:, :, :, :)
+
     CALL check_buffer_r(size(Var))
-    CALL bcast_omp_rgen(Var,size(Var),buffer_r)
+    CALL bcast_omp_rgen(Var, size(Var), buffer_r)
 
   END SUBROUTINE bcast_omp_r4
 
-  
-!! -- Les booleans -- !!
+
+  !! -- Les booleans -- !!
 
   SUBROUTINE bcast_omp_l(var)
-  IMPLICIT NONE
-    LOGICAL,INTENT(INOUT) :: Var
+    IMPLICIT NONE
+    LOGICAL, INTENT(INOUT) :: Var
     LOGICAL :: Var_tmp(1)
-    
-    Var_tmp(1)=Var
+
+    Var_tmp(1) = Var
     CALL check_buffer_l(1)
-    CALL bcast_omp_lgen(Var_tmp,1,buffer_l)
-    Var=Var_tmp(1)
+    CALL bcast_omp_lgen(Var_tmp, 1, buffer_l)
+    Var = Var_tmp(1)
 
   END SUBROUTINE bcast_omp_l
@@ -245,9 +236,9 @@
 
   SUBROUTINE bcast_omp_l1(var)
-  IMPLICIT NONE
-    LOGICAL,INTENT(INOUT) :: Var(:)
-   
+    IMPLICIT NONE
+    LOGICAL, INTENT(INOUT) :: Var(:)
+
     CALL check_buffer_l(size(Var))
-    CALL bcast_omp_lgen(Var,size(Var),buffer_l)
+    CALL bcast_omp_lgen(Var, size(Var), buffer_l)
 
   END SUBROUTINE bcast_omp_l1
@@ -255,9 +246,9 @@
 
   SUBROUTINE bcast_omp_l2(var)
-  IMPLICIT NONE
-    LOGICAL,INTENT(INOUT) :: Var(:,:)
-   
+    IMPLICIT NONE
+    LOGICAL, INTENT(INOUT) :: Var(:, :)
+
     CALL check_buffer_l(size(Var))
-    CALL bcast_omp_lgen(Var,size(Var),buffer_l)
+    CALL bcast_omp_lgen(Var, size(Var), buffer_l)
 
   END SUBROUTINE bcast_omp_l2
@@ -265,9 +256,9 @@
 
   SUBROUTINE bcast_omp_l3(var)
-  IMPLICIT NONE
-    LOGICAL,INTENT(INOUT) :: Var(:,:,:)
+    IMPLICIT NONE
+    LOGICAL, INTENT(INOUT) :: Var(:, :, :)
 
     CALL check_buffer_l(size(Var))
-    CALL bcast_omp_lgen(Var,size(Var),buffer_l)
+    CALL bcast_omp_lgen(Var, size(Var), buffer_l)
 
   END SUBROUTINE bcast_omp_l3
@@ -275,27 +266,26 @@
 
   SUBROUTINE bcast_omp_l4(var)
-  IMPLICIT NONE
-    LOGICAL,INTENT(INOUT) :: Var(:,:,:,:)
-   
+    IMPLICIT NONE
+    LOGICAL, INTENT(INOUT) :: Var(:, :, :, :)
+
     CALL check_buffer_l(size(Var))
-    CALL bcast_omp_lgen(Var,size(Var),buffer_l)
+    CALL bcast_omp_lgen(Var, size(Var), buffer_l)
 
   END SUBROUTINE bcast_omp_l4
 
 
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! Definition des Scatter   --> 4D   !!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !! Definition des Scatter   --> 4D   !!
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
   SUBROUTINE scatter_omp_i(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
-
-    CALL Check_buffer_i(size(VarIn))   
-    CALL scatter_omp_igen(VarIn,Varout,1,buffer_i)
-    
+
+    INTEGER, INTENT(IN), DIMENSION(:) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:) :: VarOut
+
+    CALL Check_buffer_i(size(VarIn))
+    CALL scatter_omp_igen(VarIn, Varout, 1, buffer_i)
+
   END SUBROUTINE scatter_omp_i
 
@@ -303,22 +293,22 @@
   SUBROUTINE scatter_omp_i1(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
-
-    CALL Check_buffer_i(size(VarIn))   
-    CALL scatter_omp_igen(VarIn,Varout,Size(VarOut,2),buffer_i)
-    
+
+    INTEGER, INTENT(IN), DIMENSION(:, :) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:, :) :: VarOut
+
+    CALL Check_buffer_i(size(VarIn))
+    CALL scatter_omp_igen(VarIn, Varout, Size(VarOut, 2), buffer_i)
+
   END SUBROUTINE scatter_omp_i1
-  
-  
+
+
   SUBROUTINE scatter_omp_i2(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
-    
-    CALL Check_buffer_i(size(VarIn))   
-    CALL scatter_omp_igen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3),buffer_i)
+
+    INTEGER, INTENT(IN), DIMENSION(:, :, :) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:, :, :) :: VarOut
+
+    CALL Check_buffer_i(size(VarIn))
+    CALL scatter_omp_igen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3), buffer_i)
 
   END SUBROUTINE scatter_omp_i2
@@ -327,25 +317,23 @@
   SUBROUTINE scatter_omp_i3(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
-    
-    CALL Check_buffer_i(size(VarIn))   
-    CALL scatter_omp_igen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3)*Size(VarOut,4),buffer_i)
-  
+
+    INTEGER, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut
+
+    CALL Check_buffer_i(size(VarIn))
+    CALL scatter_omp_igen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3) * Size(VarOut, 4), buffer_i)
+
   END SUBROUTINE scatter_omp_i3
 
 
-
-
   SUBROUTINE scatter_omp_r(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:) :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:) :: VarOut
-
-    CALL Check_buffer_r(size(VarIn))   
-    CALL scatter_omp_rgen(VarIn,Varout,1,buffer_r)
-    
+
+    REAL, INTENT(IN), DIMENSION(:) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:) :: VarOut
+
+    CALL Check_buffer_r(size(VarIn))
+    CALL scatter_omp_rgen(VarIn, Varout, 1, buffer_r)
+
   END SUBROUTINE scatter_omp_r
 
@@ -353,22 +341,22 @@
   SUBROUTINE scatter_omp_r1(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
-    
-    CALL Check_buffer_r(size(VarIn))   
-    CALL scatter_omp_rgen(VarIn,Varout,Size(VarOut,2),buffer_r)
-        
+
+    REAL, INTENT(IN), DIMENSION(:, :) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:, :) :: VarOut
+
+    CALL Check_buffer_r(size(VarIn))
+    CALL scatter_omp_rgen(VarIn, Varout, Size(VarOut, 2), buffer_r)
+
   END SUBROUTINE scatter_omp_r1
-  
-  
+
+
   SUBROUTINE scatter_omp_r2(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
-    
-    CALL Check_buffer_r(size(VarIn))   
-    CALL scatter_omp_rgen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3),buffer_r)
+
+    REAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut
+
+    CALL Check_buffer_r(size(VarIn))
+    CALL scatter_omp_rgen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3), buffer_r)
 
   END SUBROUTINE scatter_omp_r2
@@ -377,24 +365,23 @@
   SUBROUTINE scatter_omp_r3(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
-    
-    CALL Check_buffer_r(size(VarIn))   
-    CALL scatter_omp_rgen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3)*Size(VarOut,4),buffer_r)
-  
+
+    REAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut
+
+    CALL Check_buffer_r(size(VarIn))
+    CALL scatter_omp_rgen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3) * Size(VarOut, 4), buffer_r)
+
   END SUBROUTINE scatter_omp_r3
-  
 
 
   SUBROUTINE scatter_omp_l(VarIn, VarOut)
     IMPLICIT NONE
-  
-    LOGICAL,INTENT(IN),DIMENSION(:) :: VarIn
-    LOGICAL,INTENT(OUT),DIMENSION(:) :: VarOut
-
-    CALL Check_buffer_l(size(VarIn))   
-    CALL scatter_omp_lgen(VarIn,Varout,1,buffer_l)
-    
+
+    LOGICAL, INTENT(IN), DIMENSION(:) :: VarIn
+    LOGICAL, INTENT(OUT), DIMENSION(:) :: VarOut
+
+    CALL Check_buffer_l(size(VarIn))
+    CALL scatter_omp_lgen(VarIn, Varout, 1, buffer_l)
+
   END SUBROUTINE scatter_omp_l
 
@@ -402,22 +389,22 @@
   SUBROUTINE scatter_omp_l1(VarIn, VarOut)
     IMPLICIT NONE
-  
-    LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
-    LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
-    
-    CALL Check_buffer_l(size(VarIn))   
-    CALL scatter_omp_lgen(VarIn,Varout,Size(VarOut,2),buffer_l)
-    
+
+    LOGICAL, INTENT(IN), DIMENSION(:, :) :: VarIn
+    LOGICAL, INTENT(OUT), DIMENSION(:, :) :: VarOut
+
+    CALL Check_buffer_l(size(VarIn))
+    CALL scatter_omp_lgen(VarIn, Varout, Size(VarOut, 2), buffer_l)
+
   END SUBROUTINE scatter_omp_l1
-  
-  
+
+
   SUBROUTINE scatter_omp_l2(VarIn, VarOut)
     IMPLICIT NONE
-  
-    LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
-    LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
-    
-    CALL Check_buffer_l(size(VarIn))   
-    CALL scatter_omp_lgen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3),buffer_l)
+
+    LOGICAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn
+    LOGICAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut
+
+    CALL Check_buffer_l(size(VarIn))
+    CALL scatter_omp_lgen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3), buffer_l)
 
   END SUBROUTINE scatter_omp_l2
@@ -426,23 +413,23 @@
   SUBROUTINE scatter_omp_l3(VarIn, VarOut)
     IMPLICIT NONE
-  
-    LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
-    LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
-    
-    CALL Check_buffer_l(size(VarIn))   
-    CALL scatter_omp_lgen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3)*Size(VarOut,4),buffer_l)
-  
-  END SUBROUTINE scatter_omp_l3  
-  
+
+    LOGICAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn
+    LOGICAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut
+
+    CALL Check_buffer_l(size(VarIn))
+    CALL scatter_omp_lgen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3) * Size(VarOut, 4), buffer_l)
+
+  END SUBROUTINE scatter_omp_l3
+
 
   SUBROUTINE gather_omp_i(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
-
-    CALL Check_buffer_i(size(VarOut))   
-    CALL gather_omp_igen(VarIn,Varout,1,buffer_i)
-    
+
+    INTEGER, INTENT(IN), DIMENSION(:) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:) :: VarOut
+
+    CALL Check_buffer_i(size(VarOut))
+    CALL gather_omp_igen(VarIn, Varout, 1, buffer_i)
+
   END SUBROUTINE gather_omp_i
 
@@ -450,11 +437,11 @@
   SUBROUTINE gather_omp_i1(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
-    
-    CALL Check_buffer_i(size(VarOut))   
-    CALL gather_omp_igen(VarIn,Varout,Size(VarIn,2),buffer_i)
-    
+
+    INTEGER, INTENT(IN), DIMENSION(:, :) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:, :) :: VarOut
+
+    CALL Check_buffer_i(size(VarOut))
+    CALL gather_omp_igen(VarIn, Varout, Size(VarIn, 2), buffer_i)
+
   END SUBROUTINE gather_omp_i1
 
@@ -462,35 +449,34 @@
   SUBROUTINE gather_omp_i2(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
-    
-    CALL Check_buffer_i(size(VarOut))   
-    CALL gather_omp_igen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3),buffer_i)
-          
+
+    INTEGER, INTENT(IN), DIMENSION(:, :, :) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:, :, :) :: VarOut
+
+    CALL Check_buffer_i(size(VarOut))
+    CALL gather_omp_igen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3), buffer_i)
+
   END SUBROUTINE gather_omp_i2
-  
+
 
   SUBROUTINE gather_omp_i3(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
-    
-    CALL Check_buffer_i(size(VarOut))   
-    CALL gather_omp_igen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4),buffer_i)
-    
+
+    INTEGER, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut
+
+    CALL Check_buffer_i(size(VarOut))
+    CALL gather_omp_igen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3) * Size(VarIn, 4), buffer_i)
+
   END SUBROUTINE gather_omp_i3
 
 
-
   SUBROUTINE gather_omp_r(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:) :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:) :: VarOut
-
-    CALL gather_omp_rgen(VarIn,Varout,1)
-    
+
+    REAL, INTENT(IN), DIMENSION(:) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:) :: VarOut
+
+    CALL gather_omp_rgen(VarIn, Varout, 1)
+
   END SUBROUTINE gather_omp_r
 
@@ -498,10 +484,10 @@
   SUBROUTINE gather_omp_r1(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
- 
-    CALL gather_omp_rgen(VarIn,Varout,Size(VarIn,2))
-        
+
+    REAL, INTENT(IN), DIMENSION(:, :) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:, :) :: VarOut
+
+    CALL gather_omp_rgen(VarIn, Varout, Size(VarIn, 2))
+
   END SUBROUTINE gather_omp_r1
 
@@ -509,21 +495,21 @@
   SUBROUTINE gather_omp_r2(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
- 
-    CALL gather_omp_rgen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3))
-    
+
+    REAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut
+
+    CALL gather_omp_rgen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3))
+
   END SUBROUTINE gather_omp_r2
-  
+
 
   SUBROUTINE gather_omp_r3(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
-     
-    CALL gather_omp_rgen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4))
-    
+
+    REAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut
+
+    CALL gather_omp_rgen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3) * Size(VarIn, 4))
+
   END SUBROUTINE gather_omp_r3
 
@@ -531,11 +517,11 @@
   SUBROUTINE gather_omp_l(VarIn, VarOut)
     IMPLICIT NONE
-  
-    LOGICAL,INTENT(IN),DIMENSION(:) :: VarIn
-    LOGICAL,INTENT(OUT),DIMENSION(:) :: VarOut
-
-    CALL Check_buffer_l(size(VarOut))   
-    CALL gather_omp_lgen(VarIn,Varout,1,buffer_l)
-    
+
+    LOGICAL, INTENT(IN), DIMENSION(:) :: VarIn
+    LOGICAL, INTENT(OUT), DIMENSION(:) :: VarOut
+
+    CALL Check_buffer_l(size(VarOut))
+    CALL gather_omp_lgen(VarIn, Varout, 1, buffer_l)
+
   END SUBROUTINE gather_omp_l
 
@@ -543,11 +529,11 @@
   SUBROUTINE gather_omp_l1(VarIn, VarOut)
     IMPLICIT NONE
-  
-    LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
-    LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
-    
-    CALL Check_buffer_l(size(VarOut))   
-    CALL gather_omp_lgen(VarIn,Varout,Size(VarIn,2),buffer_l)
-    
+
+    LOGICAL, INTENT(IN), DIMENSION(:, :) :: VarIn
+    LOGICAL, INTENT(OUT), DIMENSION(:, :) :: VarOut
+
+    CALL Check_buffer_l(size(VarOut))
+    CALL gather_omp_lgen(VarIn, Varout, Size(VarIn, 2), buffer_l)
+
   END SUBROUTINE gather_omp_l1
 
@@ -555,64 +541,62 @@
   SUBROUTINE gather_omp_l2(VarIn, VarOut)
     IMPLICIT NONE
-  
-    LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
-    LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
-    
-    CALL Check_buffer_l(size(VarOut))   
-    CALL gather_omp_lgen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3),buffer_l)
-    
+
+    LOGICAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn
+    LOGICAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut
+
+    CALL Check_buffer_l(size(VarOut))
+    CALL gather_omp_lgen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3), buffer_l)
+
   END SUBROUTINE gather_omp_l2
-  
+
 
   SUBROUTINE gather_omp_l3(VarIn, VarOut)
     IMPLICIT NONE
-  
-    LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
-    LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
-    
-    CALL Check_buffer_l(size(VarOut))   
-    CALL gather_omp_lgen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4),buffer_l)
-    
+
+    LOGICAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn
+    LOGICAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut
+
+    CALL Check_buffer_l(size(VarOut))
+    CALL gather_omp_lgen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3) * Size(VarIn, 4), buffer_l)
+
   END SUBROUTINE gather_omp_l3
 
 
-
-
   SUBROUTINE reduce_sum_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_sum_omp_igen(VarIn_tmp,Varout_tmp,1,buffer_i)
-    VarOut=VarOut_tmp(1)
-    
+
+    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_sum_omp_igen(VarIn_tmp, Varout_tmp, 1, buffer_i)
+    VarOut = VarOut_tmp(1)
+
   END SUBROUTINE reduce_sum_omp_i
 
   SUBROUTINE reduce_sum_omp_i1(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:)  :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
-    
-    CALL Check_buffer_i(size(VarIn))   
-    CALL reduce_sum_omp_igen(VarIn,Varout,Size(VarIn),buffer_i)
-   
+
+    INTEGER, INTENT(IN), DIMENSION(:) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:) :: VarOut
+
+    CALL Check_buffer_i(size(VarIn))
+    CALL reduce_sum_omp_igen(VarIn, Varout, Size(VarIn), buffer_i)
+
   END SUBROUTINE reduce_sum_omp_i1
-  
-  
+
+
   SUBROUTINE reduce_sum_omp_i2(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:,:)  :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
-
-    CALL Check_buffer_i(size(VarIn))   
-    CALL reduce_sum_omp_igen(VarIn,Varout,Size(VarIn),buffer_i)
-  
+
+    INTEGER, INTENT(IN), DIMENSION(:, :) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:, :) :: VarOut
+
+    CALL Check_buffer_i(size(VarIn))
+    CALL reduce_sum_omp_igen(VarIn, Varout, Size(VarIn), buffer_i)
+
   END SUBROUTINE reduce_sum_omp_i2
 
@@ -620,11 +604,11 @@
   SUBROUTINE reduce_sum_omp_i3(VarIn, VarOut)
     IMPLICIT NONE
-  
-    INTEGER,INTENT(IN),DIMENSION(:,:,:)  :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
-    
-    CALL Check_buffer_i(size(VarIn))   
-    CALL reduce_sum_omp_igen(VarIn,Varout,Size(VarIn),buffer_i)
-  
+
+    INTEGER, INTENT(IN), DIMENSION(:, :, :) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:, :, :) :: VarOut
+
+    CALL Check_buffer_i(size(VarIn))
+    CALL reduce_sum_omp_igen(VarIn, Varout, Size(VarIn), buffer_i)
+
   END SUBROUTINE reduce_sum_omp_i3
 
@@ -633,10 +617,10 @@
     IMPLICIT NONE
 
-    INTEGER,INTENT(IN),DIMENSION(:,:,:,:)  :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
-  
-    CALL Check_buffer_i(size(VarIn))   
-    CALL reduce_sum_omp_igen(VarIn,Varout,Size(VarIn),buffer_i)
-  
+    INTEGER, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut
+
+    CALL Check_buffer_i(size(VarIn))
+    CALL reduce_sum_omp_igen(VarIn, Varout, Size(VarIn), buffer_i)
+
   END SUBROUTINE reduce_sum_omp_i4
 
@@ -644,38 +628,38 @@
   SUBROUTINE reduce_sum_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_sum_omp_rgen(VarIn_tmp,Varout_tmp,1,buffer_r)
-    VarOut=VarOut_tmp(1)
-  
+
+    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_sum_omp_rgen(VarIn_tmp, Varout_tmp, 1, buffer_r)
+    VarOut = VarOut_tmp(1)
+
   END SUBROUTINE reduce_sum_omp_r
 
   SUBROUTINE reduce_sum_omp_r1(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:)  :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:) :: VarOut
-    
-    CALL Check_buffer_r(size(VarIn))   
-    CALL reduce_sum_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r)
-   
+
+    REAL, INTENT(IN), DIMENSION(:) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:) :: VarOut
+
+    CALL Check_buffer_r(size(VarIn))
+    CALL reduce_sum_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r)
+
   END SUBROUTINE reduce_sum_omp_r1
-  
-  
+
+
   SUBROUTINE reduce_sum_omp_r2(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:,:)  :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
-    
-    CALL Check_buffer_r(size(VarIn))   
-    CALL reduce_sum_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r)
-  
+
+    REAL, INTENT(IN), DIMENSION(:, :) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:, :) :: VarOut
+
+    CALL Check_buffer_r(size(VarIn))
+    CALL reduce_sum_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r)
+
   END SUBROUTINE reduce_sum_omp_r2
 
@@ -683,11 +667,11 @@
   SUBROUTINE reduce_sum_omp_r3(VarIn, VarOut)
     IMPLICIT NONE
-  
-    REAL,INTENT(IN),DIMENSION(:,:,:)  :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
-    
-    CALL Check_buffer_r(size(VarIn))   
-    CALL reduce_sum_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r)
-  
+
+    REAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut
+
+    CALL Check_buffer_r(size(VarIn))
+    CALL reduce_sum_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r)
+
   END SUBROUTINE reduce_sum_omp_r3
 
@@ -696,50 +680,49 @@
     IMPLICIT NONE
 
-    REAL,INTENT(IN),DIMENSION(:,:,:,:)  :: VarIn
-    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
-  
-    CALL Check_buffer_r(size(VarIn))   
-    CALL reduce_sum_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r)
-  
+    REAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut
+
+    CALL Check_buffer_r(size(VarIn))
+    CALL reduce_sum_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r)
+
   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)
-    
+
+    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)
-   
+
+    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)
-  
+
+    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
 
@@ -747,11 +730,11 @@
   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)
-  
+
+    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
 
@@ -760,10 +743,10 @@
     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)
-  
+    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
 
@@ -771,38 +754,38 @@
   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)
-  
+
+    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)
-   
+
+    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)
-  
+
+    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
 
@@ -810,11 +793,11 @@
   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)
-  
+
+    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
 
@@ -823,254 +806,248 @@
     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)
-  
+    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    !
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-  SUBROUTINE bcast_omp_cgen(Var,Nb,Buff)
-  IMPLICIT NONE
-    
-    CHARACTER(LEN=*),INTENT(INOUT) :: Var
-    CHARACTER(LEN=*),INTENT(INOUT) :: Buff
-    INTEGER,INTENT(IN) :: Nb
-    
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !    LES ROUTINES GENERIQUES    !
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  SUBROUTINE bcast_omp_cgen(Var, Nb, Buff)
+    IMPLICIT NONE
+
+    CHARACTER(LEN = *), INTENT(INOUT) :: Var
+    CHARACTER(LEN = *), INTENT(INOUT) :: Buff
+    INTEGER, INTENT(IN) :: Nb
+
     INTEGER :: i
-  
-  !$OMP MASTER
-      Buff=Var
-  !$OMP END MASTER
-  !$OMP BARRIER
-
-    DO i=1,Nb
-      Var=Buff
-    ENDDO
-  !$OMP BARRIER      
-  
+
+    !$OMP MASTER
+    Buff = Var
+    !$OMP END MASTER
+    !$OMP BARRIER
+
+    DO i = 1, Nb
+      Var = Buff
+    ENDDO
+    !$OMP BARRIER
+
   END SUBROUTINE bcast_omp_cgen
 
 
-      
-  SUBROUTINE bcast_omp_igen(Var,Nb,Buff)
-  IMPLICIT NONE
-    
-    INTEGER,INTENT(IN) :: Nb
-    INTEGER,DIMENSION(Nb),INTENT(INOUT) :: Var
-    INTEGER,DIMENSION(Nb),INTENT(INOUT) :: Buff
+  SUBROUTINE bcast_omp_igen(Var, Nb, Buff)
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN) :: Nb
+    INTEGER, DIMENSION(Nb), INTENT(INOUT) :: Var
+    INTEGER, DIMENSION(Nb), INTENT(INOUT) :: Buff
 
     INTEGER :: i
-    
-  !$OMP MASTER
-    DO i=1,Nb
-      Buff(i)=Var(i)
-    ENDDO
-  !$OMP END MASTER
-  !$OMP BARRIER
-
-    DO i=1,Nb
-      Var(i)=Buff(i)
-    ENDDO
-  !$OMP BARRIER        
+
+    !$OMP MASTER
+    DO i = 1, Nb
+      Buff(i) = Var(i)
+    ENDDO
+    !$OMP END MASTER
+    !$OMP BARRIER
+
+    DO i = 1, Nb
+      Var(i) = Buff(i)
+    ENDDO
+    !$OMP BARRIER
 
   END SUBROUTINE bcast_omp_igen
 
 
-  SUBROUTINE bcast_omp_rgen(Var,Nb,Buff)
-  IMPLICIT NONE
-    
-    INTEGER,INTENT(IN) :: Nb
-    REAL,DIMENSION(Nb),INTENT(INOUT) :: Var
-    REAL,DIMENSION(Nb),INTENT(INOUT) :: Buff
+  SUBROUTINE bcast_omp_rgen(Var, Nb, Buff)
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN) :: Nb
+    REAL, DIMENSION(Nb), INTENT(INOUT) :: Var
+    REAL, DIMENSION(Nb), INTENT(INOUT) :: Buff
 
     INTEGER :: i
-    
-  !$OMP MASTER
-    DO i=1,Nb
-      Buff(i)=Var(i)
-    ENDDO
-  !$OMP END MASTER
-  !$OMP BARRIER
-
-    DO i=1,Nb
-      Var(i)=Buff(i)
-    ENDDO
-  !$OMP BARRIER        
+
+    !$OMP MASTER
+    DO i = 1, Nb
+      Buff(i) = Var(i)
+    ENDDO
+    !$OMP END MASTER
+    !$OMP BARRIER
+
+    DO i = 1, Nb
+      Var(i) = Buff(i)
+    ENDDO
+    !$OMP BARRIER
 
   END SUBROUTINE bcast_omp_rgen
 
-  SUBROUTINE bcast_omp_lgen(Var,Nb,Buff)
-  IMPLICIT NONE
-    
-    INTEGER,INTENT(IN) :: Nb
-    LOGICAL,DIMENSION(Nb),INTENT(INOUT) :: Var
-    LOGICAL,DIMENSION(Nb),INTENT(INOUT) :: Buff
-  
+  SUBROUTINE bcast_omp_lgen(Var, Nb, Buff)
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN) :: Nb
+    LOGICAL, DIMENSION(Nb), INTENT(INOUT) :: Var
+    LOGICAL, DIMENSION(Nb), INTENT(INOUT) :: Buff
+
     INTEGER :: i
-    
-  !$OMP MASTER
-    DO i=1,Nb
-      Buff(i)=Var(i)
-    ENDDO
-  !$OMP END MASTER
-  !$OMP BARRIER
-
-    DO i=1,Nb
-      Var(i)=Buff(i)
-    ENDDO
-  !$OMP BARRIER        
+
+    !$OMP MASTER
+    DO i = 1, Nb
+      Buff(i) = Var(i)
+    ENDDO
+    !$OMP END MASTER
+    !$OMP BARRIER
+
+    DO i = 1, Nb
+      Var(i) = Buff(i)
+    ENDDO
+    !$OMP BARRIER
 
   END SUBROUTINE bcast_omp_lgen
 
 
-  SUBROUTINE scatter_omp_igen(VarIn,VarOut,dimsize,Buff)
+  SUBROUTINE scatter_omp_igen(VarIn, VarOut, dimsize, Buff)
     USE lmdz_phys_omp_data
     USE lmdz_phys_mpi_data, ONLY: klon_mpi
     IMPLICIT NONE
 
-    INTEGER,INTENT(IN) :: dimsize
-    INTEGER,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(klon_omp,dimsize) :: VarOut
-    INTEGER,INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff
-
-    INTEGER :: i,ij
-    
-  !$OMP MASTER
-    DO i=1,dimsize
-      DO ij=1,klon_mpi
-        Buff(ij,i)=VarIn(ij,i)
+    INTEGER, INTENT(IN) :: dimsize
+    INTEGER, INTENT(IN), DIMENSION(klon_mpi, dimsize) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(klon_omp, dimsize) :: VarOut
+    INTEGER, INTENT(INOUT), DIMENSION(klon_mpi, dimsize) :: Buff
+
+    INTEGER :: i, ij
+
+    !$OMP MASTER
+    DO i = 1, dimsize
+      DO ij = 1, klon_mpi
+        Buff(ij, i) = VarIn(ij, i)
       ENDDO
-    ENDDO  
-  !$OMP END MASTER
-  !$OMP BARRIER
- 
-    DO i=1,dimsize
-      DO ij=1,klon_omp
-        VarOut(ij,i)=Buff(klon_omp_begin-1+ij,i)
+    ENDDO
+    !$OMP END MASTER
+    !$OMP BARRIER
+
+    DO i = 1, dimsize
+      DO ij = 1, klon_omp
+        VarOut(ij, i) = Buff(klon_omp_begin - 1 + ij, i)
       ENDDO
     ENDDO
-  !$OMP BARRIER  
- 
+    !$OMP BARRIER
+
   END SUBROUTINE scatter_omp_igen
 
 
-  SUBROUTINE scatter_omp_rgen(VarIn,VarOut,dimsize,Buff)
-  USE lmdz_phys_omp_data
-  USE lmdz_phys_mpi_data, ONLY: klon_mpi
-  IMPLICIT NONE
-
-    INTEGER,INTENT(IN) :: dimsize
-    REAL,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn
-    REAL,INTENT(OUT),DIMENSION(klon_omp,dimsize) :: VarOut
-    REAL,INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff
-
-    INTEGER :: i,ij
-    
-  !$OMP MASTER
-    DO i=1,dimsize
-      DO ij=1,klon_mpi
-        Buff(ij,i)=VarIn(ij,i)
+  SUBROUTINE scatter_omp_rgen(VarIn, VarOut, dimsize, Buff)
+    USE lmdz_phys_omp_data
+    USE lmdz_phys_mpi_data, ONLY: klon_mpi
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN) :: dimsize
+    REAL, INTENT(IN), DIMENSION(klon_mpi, dimsize) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(klon_omp, dimsize) :: VarOut
+    REAL, INTENT(INOUT), DIMENSION(klon_mpi, dimsize) :: Buff
+
+    INTEGER :: i, ij
+
+    !$OMP MASTER
+    DO i = 1, dimsize
+      DO ij = 1, klon_mpi
+        Buff(ij, i) = VarIn(ij, i)
       ENDDO
-    ENDDO  
-  !$OMP END MASTER
-  !$OMP BARRIER
-
-    DO i=1,dimsize
-      DO ij=1,klon_omp
-        VarOut(ij,i)=Buff(klon_omp_begin-1+ij,i)
+    ENDDO
+    !$OMP END MASTER
+    !$OMP BARRIER
+
+    DO i = 1, dimsize
+      DO ij = 1, klon_omp
+        VarOut(ij, i) = Buff(klon_omp_begin - 1 + ij, i)
       ENDDO
     ENDDO
-  !$OMP BARRIER  
+    !$OMP BARRIER
 
   END SUBROUTINE scatter_omp_rgen
 
 
-  SUBROUTINE scatter_omp_lgen(VarIn,VarOut,dimsize,Buff)
-  USE lmdz_phys_omp_data
-  USE lmdz_phys_mpi_data, ONLY: klon_mpi
-  IMPLICIT NONE
-
-    INTEGER,INTENT(IN) :: dimsize
-    LOGICAL,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn
-    LOGICAL,INTENT(OUT),DIMENSION(klon_omp,dimsize) :: VarOut
-    LOGICAL,INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff
-
-    INTEGER :: i,ij
-    
- !$OMP MASTER 
-    DO i=1,dimsize
-      DO ij=1,klon_mpi
-        Buff(ij,i)=VarIn(ij,i)
+  SUBROUTINE scatter_omp_lgen(VarIn, VarOut, dimsize, Buff)
+    USE lmdz_phys_omp_data
+    USE lmdz_phys_mpi_data, ONLY: klon_mpi
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN) :: dimsize
+    LOGICAL, INTENT(IN), DIMENSION(klon_mpi, dimsize) :: VarIn
+    LOGICAL, INTENT(OUT), DIMENSION(klon_omp, dimsize) :: VarOut
+    LOGICAL, INTENT(INOUT), DIMENSION(klon_mpi, dimsize) :: Buff
+
+    INTEGER :: i, ij
+
+    !$OMP MASTER
+    DO i = 1, dimsize
+      DO ij = 1, klon_mpi
+        Buff(ij, i) = VarIn(ij, i)
       ENDDO
-    ENDDO  
-  !$OMP END MASTER
-  !$OMP BARRIER
-
-    DO i=1,dimsize
-      DO ij=1,klon_omp
-        VarOut(ij,i)=Buff(klon_omp_begin-1+ij,i)
+    ENDDO
+    !$OMP END MASTER
+    !$OMP BARRIER
+
+    DO i = 1, dimsize
+      DO ij = 1, klon_omp
+        VarOut(ij, i) = Buff(klon_omp_begin - 1 + ij, i)
       ENDDO
     ENDDO
-  !$OMP BARRIER  
+    !$OMP BARRIER
 
   END SUBROUTINE scatter_omp_lgen
 
 
-
-
-
-  SUBROUTINE gather_omp_igen(VarIn,VarOut,dimsize,Buff)
-  USE lmdz_phys_omp_data
-  USE lmdz_phys_mpi_data, ONLY: klon_mpi
-  IMPLICIT NONE
-
-    INTEGER,INTENT(IN) :: dimsize
-    INTEGER,INTENT(IN),DIMENSION(klon_omp,dimsize) :: VarIn
-    INTEGER,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
-    INTEGER,INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff
-
-    INTEGER :: i,ij
-    
-    DO i=1,dimsize
-      DO ij=1,klon_omp
-        Buff(klon_omp_begin-1+ij,i)=VarIn(ij,i)
+  SUBROUTINE gather_omp_igen(VarIn, VarOut, dimsize, Buff)
+    USE lmdz_phys_omp_data
+    USE lmdz_phys_mpi_data, ONLY: klon_mpi
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN) :: dimsize
+    INTEGER, INTENT(IN), DIMENSION(klon_omp, dimsize) :: VarIn
+    INTEGER, INTENT(OUT), DIMENSION(klon_mpi, dimsize) :: VarOut
+    INTEGER, INTENT(INOUT), DIMENSION(klon_mpi, dimsize) :: Buff
+
+    INTEGER :: i, ij
+
+    DO i = 1, dimsize
+      DO ij = 1, klon_omp
+        Buff(klon_omp_begin - 1 + ij, i) = VarIn(ij, i)
       ENDDO
     ENDDO
-  !$OMP BARRIER  
-  
-  
-  !$OMP MASTER
-    DO i=1,dimsize
-      DO ij=1,klon_mpi
-        VarOut(ij,i)=Buff(ij,i)
+    !$OMP BARRIER
+
+
+    !$OMP MASTER
+    DO i = 1, dimsize
+      DO ij = 1, klon_mpi
+        VarOut(ij, i) = Buff(ij, i)
       ENDDO
-    ENDDO  
-  !$OMP END MASTER
-  !$OMP BARRIER
+    ENDDO
+    !$OMP END MASTER
+    !$OMP BARRIER
 
   END SUBROUTINE gather_omp_igen
 
 
-  SUBROUTINE gather_omp_rgen(VarIn,VarOut,dimsize)
-  USE lmdz_phys_omp_data
-  USE lmdz_phys_mpi_data, ONLY: klon_mpi
-  IMPLICIT NONE
-
-    INTEGER,INTENT(IN) :: dimsize
-    REAL,INTENT(IN),DIMENSION(klon_omp,dimsize) :: VarIn
-    REAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize),TARGET :: VarOut
-
-    REAL, POINTER, SAVE :: Varout_ptr(:,:) ! Shared between threads NOT THREADPRIVATE
-
-    INTEGER :: i,ij
-    
+  SUBROUTINE gather_omp_rgen(VarIn, VarOut, dimsize)
+    USE lmdz_phys_omp_data
+    USE lmdz_phys_mpi_data, ONLY: klon_mpi
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN) :: dimsize
+    REAL, INTENT(IN), DIMENSION(klon_omp, dimsize) :: VarIn
+    REAL, INTENT(OUT), DIMENSION(klon_mpi, dimsize), TARGET :: VarOut
+
+    REAL, POINTER, SAVE :: Varout_ptr(:, :) ! Shared between threads NOT THREADPRIVATE
+
+    INTEGER :: i, ij
+
     !$omp master
     Varout_ptr => VarOut
@@ -1078,7 +1055,7 @@
     !$omp barrier
 
-    DO i=1,dimsize
-      DO ij=1,klon_omp
-        Varout_ptr(klon_omp_begin-1+ij,i)=VarIn(ij,i)
+    DO i = 1, dimsize
+      DO ij = 1, klon_omp
+        Varout_ptr(klon_omp_begin - 1 + ij, i) = VarIn(ij, i)
       ENDDO
     ENDDO
@@ -1087,161 +1064,161 @@
 
 
-  SUBROUTINE gather_omp_lgen(VarIn,VarOut,dimsize,Buff)
-  USE lmdz_phys_omp_data
-  USE lmdz_phys_mpi_data, ONLY: klon_mpi
-  IMPLICIT NONE
-
-    INTEGER,INTENT(IN) :: dimsize
-    LOGICAL,INTENT(IN),DIMENSION(klon_omp,dimsize) :: VarIn
-    LOGICAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
-    LOGICAL,INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff
-
-    INTEGER :: i,ij
-    
-    DO i=1,dimsize
-      DO ij=1,klon_omp
-        Buff(klon_omp_begin-1+ij,i)=VarIn(ij,i)
+  SUBROUTINE gather_omp_lgen(VarIn, VarOut, dimsize, Buff)
+    USE lmdz_phys_omp_data
+    USE lmdz_phys_mpi_data, ONLY: klon_mpi
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN) :: dimsize
+    LOGICAL, INTENT(IN), DIMENSION(klon_omp, dimsize) :: VarIn
+    LOGICAL, INTENT(OUT), DIMENSION(klon_mpi, dimsize) :: VarOut
+    LOGICAL, INTENT(INOUT), DIMENSION(klon_mpi, dimsize) :: Buff
+
+    INTEGER :: i, ij
+
+    DO i = 1, dimsize
+      DO ij = 1, klon_omp
+        Buff(klon_omp_begin - 1 + ij, i) = VarIn(ij, i)
       ENDDO
     ENDDO
-  !$OMP BARRIER  
-
-
-  !$OMP MASTER
-    DO i=1,dimsize
-      DO ij=1,klon_mpi
-        VarOut(ij,i)=Buff(ij,i)
+    !$OMP BARRIER
+
+
+    !$OMP MASTER
+    DO i = 1, dimsize
+      DO ij = 1, klon_mpi
+        VarOut(ij, i) = Buff(ij, i)
       ENDDO
-    ENDDO  
-  !$OMP END MASTER
-  !$OMP BARRIER
+    ENDDO
+    !$OMP END MASTER
+    !$OMP BARRIER
 
   END SUBROUTINE gather_omp_lgen
 
 
-  SUBROUTINE reduce_sum_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
+  SUBROUTINE reduce_sum_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
 
-  !$OMP MASTER
-    Buff(:)=0
-  !$OMP END MASTER
-  !$OMP BARRIER
-  
-  !$OMP CRITICAL     
-    DO i=1,dimsize
-      Buff(i)=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
-  
+    !$OMP MASTER
+    Buff(:) = 0
+    !$OMP END MASTER
+    !$OMP BARRIER
+
+    !$OMP CRITICAL
+    DO i = 1, dimsize
+      Buff(i) = 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_sum_omp_igen
 
-  SUBROUTINE reduce_sum_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
+  SUBROUTINE reduce_sum_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
 
-  !$OMP MASTER
-    Buff(:)=0
-  !$OMP END MASTER
-  !$OMP BARRIER
-  
-  !$OMP CRITICAL     
-    DO i=1,dimsize
-      Buff(i)=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
-  
+    !$OMP MASTER
+    Buff(:) = 0
+    !$OMP END MASTER
+    !$OMP BARRIER
+
+    !$OMP CRITICAL
+    DO i = 1, dimsize
+      Buff(i) = 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_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
+  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
-  
+    !$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
+  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
-  
+    !$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
 
