Index: branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 5883)
+++ branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 6004)
@@ -27,9 +27,9 @@
 
    !!----------------------------------------------------------------------
-   !!   ctl_stop   : update momentum and tracer Kz from a tke scheme
-   !!   ctl_warn   : initialization, namelist read, and parameters control
-   !!   ctl_opn    : Open file and check if required file is available.
-   !!   ctl_nam    : Prints informations when an error occurs while reading a namelist
-   !!   get_unit   : give the index of an unused logical unit
+   !!   ctl_stop      : update momentum and tracer Kz from a tke scheme
+   !!   ctl_warn      : initialization, namelist read, and parameters control
+   !!   ctl_opn       : Open file and check if required file is available.
+   !!   ctl_nam       : Prints informations when an error occurs while reading a namelist
+   !!   get_unit      : give the index of an unused logical unit
    !!----------------------------------------------------------------------
 #if   defined key_mpp_mpi
@@ -43,5 +43,5 @@
    !!   mpp_lnk_e     : interface (defined in lbclnk) for message passing of 2d array with extra halo (mpp_lnk_2d_e)
    !!   mpp_lnk_icb   : interface for message passing of 2d arrays with extra halo for icebergs (mpp_lnk_2d_icb)
-   !!   mpprecv         :
+   !!   mpprecv       :
    !!   mppsend       :   SUBROUTINE mpp_ini_znl
    !!   mppscatter    :
@@ -94,5 +94,5 @@
    END INTERFACE
    INTERFACE mpp_sum
-      MODULE PROCEDURE mppsum_a_int, mppsum_int, mppsum_a_real, mppsum_real, &
+      MODULE PROCEDURE mppsum_a_int, mppsum_int, mppsum_a_real, mppsum_real,   &
                        mppsum_realdd, mppsum_a_realdd
    END INTERFACE
@@ -175,11 +175,11 @@
       !! ** Purpose :   Find processor unit
       !!----------------------------------------------------------------------
-      CHARACTER(len=*),DIMENSION(:), INTENT(  out) ::   ldtxt
-      CHARACTER(len=*)             , INTENT(in   ) ::   ldname
-      INTEGER                      , INTENT(in   ) ::   kumnam_ref     ! logical unit for reference namelist
-      INTEGER                      , INTENT(in   ) ::   kumnam_cfg     ! logical unit for configuration namelist
-      INTEGER                      , INTENT(inout) ::   kumond         ! logical unit for namelist output
-      INTEGER                      , INTENT(inout) ::   kstop          ! stop indicator
-      INTEGER, OPTIONAL            , INTENT(in   ) ::   localComm
+      CHARACTER(len=*),DIMENSION(:), INTENT(  out) ::   ldtxt        !
+      CHARACTER(len=*)             , INTENT(in   ) ::   ldname       !
+      INTEGER                      , INTENT(in   ) ::   kumnam_ref   ! logical unit for reference namelist
+      INTEGER                      , INTENT(in   ) ::   kumnam_cfg   ! logical unit for configuration namelist
+      INTEGER                      , INTENT(inout) ::   kumond       ! logical unit for namelist output
+      INTEGER                      , INTENT(inout) ::   kstop        ! stop indicator
+      INTEGER         , OPTIONAL   , INTENT(in   ) ::   localComm    !
       !
       INTEGER ::   mynode, ierr, code, ji, ii, ios
@@ -190,7 +190,7 @@
       !
       ii = 1
-      WRITE(ldtxt(ii),*)                                                                          ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) 'mynode : mpi initialisation'                                            ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '~~~~~~ '                                                                ;   ii = ii + 1
+      WRITE(ldtxt(ii),*)                                                                  ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) 'mynode : mpi initialisation'                                    ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '~~~~~~ '                                                        ;   ii = ii + 1
       !
 
@@ -204,7 +204,7 @@
 
       !                              ! control print
-      WRITE(ldtxt(ii),*) '   Namelist nammpp'                                                     ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '      mpi send type                      cn_mpi_send = ', cn_mpi_send   ;   ii = ii + 1
-      WRITE(ldtxt(ii),*) '      size in bytes of exported buffer   nn_buffer   = ', nn_buffer     ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '   Namelist nammpp'                                             ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '      mpi send type          cn_mpi_send = ', cn_mpi_send       ;   ii = ii + 1
+      WRITE(ldtxt(ii),*) '      size exported buffer   nn_buffer   = ', nn_buffer,' bytes';   ii = ii + 1
 
 #if defined key_agrif
@@ -223,9 +223,9 @@
 
       IF( (jpni < 1) .OR. (jpnj < 1) )THEN
-         WRITE(ldtxt(ii),*) '      jpni, jpnj and jpnij will be calculated automatically'; ii = ii + 1
+         WRITE(ldtxt(ii),*) '      jpni, jpnj and jpnij will be calculated automatically' ;   ii = ii + 1
       ELSE
-         WRITE(ldtxt(ii),*) '      processor grid extent in i         jpni = ',jpni; ii = ii + 1
-         WRITE(ldtxt(ii),*) '      processor grid extent in j         jpnj = ',jpnj; ii = ii + 1
-         WRITE(ldtxt(ii),*) '      number of local domains           jpnij = ',jpnij; ii = ii +1
+         WRITE(ldtxt(ii),*) '      processor grid extent in i         jpni = ',jpni       ;   ii = ii + 1
+         WRITE(ldtxt(ii),*) '      processor grid extent in j         jpnj = ',jpnj       ;   ii = ii + 1
+         WRITE(ldtxt(ii),*) '      number of local domains           jpnij = ',jpnij      ;   ii = ii + 1
       END IF
 
@@ -246,35 +246,35 @@
          SELECT CASE ( cn_mpi_send )
          CASE ( 'S' )                ! Standard mpi send (blocking)
-            WRITE(ldtxt(ii),*) '           Standard blocking mpi send (send)'                     ;   ii = ii + 1
+            WRITE(ldtxt(ii),*) '           Standard blocking mpi send (send)'             ;   ii = ii + 1
          CASE ( 'B' )                ! Buffer mpi send (blocking)
-            WRITE(ldtxt(ii),*) '           Buffer blocking mpi send (bsend)'                      ;   ii = ii + 1
+            WRITE(ldtxt(ii),*) '           Buffer blocking mpi send (bsend)'              ;   ii = ii + 1
             IF( Agrif_Root() )   CALL mpi_init_opa( ldtxt, ii, ierr )
          CASE ( 'I' )                ! Immediate mpi send (non-blocking send)
-            WRITE(ldtxt(ii),*) '           Immediate non-blocking send (isend)'                   ;   ii = ii + 1
+            WRITE(ldtxt(ii),*) '           Immediate non-blocking send (isend)'           ;   ii = ii + 1
             l_isend = .TRUE.
          CASE DEFAULT
-            WRITE(ldtxt(ii),cform_err)                                                            ;   ii = ii + 1
-            WRITE(ldtxt(ii),*) '           bad value for cn_mpi_send = ', cn_mpi_send             ;   ii = ii + 1
+            WRITE(ldtxt(ii),cform_err)                                                    ;   ii = ii + 1
+            WRITE(ldtxt(ii),*) '           bad value for cn_mpi_send = ', cn_mpi_send     ;   ii = ii + 1
             kstop = kstop + 1
          END SELECT
       ELSE IF ( PRESENT(localComm) .and. .not. mpi_was_called ) THEN
-         WRITE(ldtxt(ii),*) ' lib_mpp: You cannot provide a local communicator '                  ;   ii = ii + 1
-         WRITE(ldtxt(ii),*) '          without calling MPI_Init before ! '                        ;   ii = ii + 1
+         WRITE(ldtxt(ii),*) ' lib_mpp: You cannot provide a local communicator '          ;   ii = ii + 1
+         WRITE(ldtxt(ii),*) '          without calling MPI_Init before ! '                ;   ii = ii + 1
          kstop = kstop + 1
       ELSE
          SELECT CASE ( cn_mpi_send )
          CASE ( 'S' )                ! Standard mpi send (blocking)
-            WRITE(ldtxt(ii),*) '           Standard blocking mpi send (send)'                     ;   ii = ii + 1
+            WRITE(ldtxt(ii),*) '           Standard blocking mpi send (send)'             ;   ii = ii + 1
             CALL mpi_init( ierr )
          CASE ( 'B' )                ! Buffer mpi send (blocking)
-            WRITE(ldtxt(ii),*) '           Buffer blocking mpi send (bsend)'                      ;   ii = ii + 1
+            WRITE(ldtxt(ii),*) '           Buffer blocking mpi send (bsend)'              ;   ii = ii + 1
             IF( Agrif_Root() )   CALL mpi_init_opa( ldtxt, ii, ierr )
          CASE ( 'I' )                ! Immediate mpi send (non-blocking send)
-            WRITE(ldtxt(ii),*) '           Immediate non-blocking send (isend)'                   ;   ii = ii + 1
+            WRITE(ldtxt(ii),*) '           Immediate non-blocking send (isend)'           ;   ii = ii + 1
             l_isend = .TRUE.
             CALL mpi_init( ierr )
          CASE DEFAULT
-            WRITE(ldtxt(ii),cform_err)                                                            ;   ii = ii + 1
-            WRITE(ldtxt(ii),*) '           bad value for cn_mpi_send = ', cn_mpi_send             ;   ii = ii + 1
+            WRITE(ldtxt(ii),cform_err)                                                    ;   ii = ii + 1
+            WRITE(ldtxt(ii),*) '           bad value for cn_mpi_send = ', cn_mpi_send     ;   ii = ii + 1
             kstop = kstop + 1
          END SELECT
@@ -319,4 +319,5 @@
    END FUNCTION mynode
 
+
    SUBROUTINE mpp_lnk_3d( ptab, cd_type, psgn, cd_mpp, pval )
       !!----------------------------------------------------------------------
@@ -347,14 +348,12 @@
       CHARACTER(len=3), OPTIONAL      , INTENT(in   ) ::   cd_mpp   ! fill the overlap area only
       REAL(wp)        , OPTIONAL      , INTENT(in   ) ::   pval     ! background value (used at closed boundaries)
-      !!
+      !
       INTEGER  ::   ji, jj, jk, jl             ! dummy loop indices
       INTEGER  ::   imigr, iihom, ijhom        ! temporary integers
       INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend
       REAL(wp) ::   zland
-      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend
-      !
+      INTEGER , DIMENSION(MPI_STATUS_SIZE)      ::   ml_stat        ! for key_mpi_isend
       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ns, zt3sn   ! 3d for north-south & south-north
       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ew, zt3we   ! 3d for east-west & west-east
-
       !!----------------------------------------------------------------------
       
@@ -364,5 +363,5 @@
       !
       IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value
-      ELSE                         ;   zland = 0.e0      ! zero by default
+      ELSE                         ;   zland = 0._wp     ! zero by default
       ENDIF
 
@@ -455,5 +454,4 @@
       END SELECT
 
-
       ! 3. North and south directions
       ! -----------------------------
@@ -508,5 +506,4 @@
       END SELECT
 
-
       ! 4. north fold treatment
       ! -----------------------
@@ -524,4 +521,5 @@
       !
    END SUBROUTINE mpp_lnk_3d
+
 
    SUBROUTINE mpp_lnk_2d_multiple( pt2d_array , type_array , psgn_array , num_fields , cd_mpp, pval )
@@ -542,9 +540,5 @@
       !!                    noso   : number for local neighboring processors
       !!                    nono   : number for local neighboring processors
-      !!
-      !!----------------------------------------------------------------------
-
-      INTEGER :: num_fields
-      TYPE( arrayptr ), DIMENSION(:) :: pt2d_array
+      !!----------------------------------------------------------------------
       CHARACTER(len=1), DIMENSION(:), INTENT(in   ) ::   type_array   ! define the nature of ptab array grid-points
       !                                                               ! = T , U , V , F , W and I points
@@ -558,19 +552,18 @@
       INTEGER  ::   imigr, iihom, ijhom        ! temporary integers
       INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend
-
+      INTEGER :: num_fields
+      TYPE( arrayptr ), DIMENSION(:) :: pt2d_array
       REAL(wp) ::   zland
-      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend
-      !
+      INTEGER , DIMENSION(MPI_STATUS_SIZE)    ::   ml_stat       ! for key_mpi_isend
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ns, zt2sn   ! 2d for north-south & south-north
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ew, zt2we   ! 2d for east-west & west-east
 
       !!----------------------------------------------------------------------
-
+      !
       ALLOCATE( zt2ns(jpi,jprecj,2*num_fields), zt2sn(jpi,jprecj,2*num_fields),  &
          &      zt2ew(jpj,jpreci,2*num_fields), zt2we(jpj,jpreci,2*num_fields)   )
-
       !
       IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value
-      ELSE                         ;   zland = 0.e0      ! zero by default
+      ELSE                         ;   zland = 0._wp     ! zero by default
       ENDIF
 
@@ -744,5 +737,5 @@
          !
       END DO
-      
+      !
       DEALLOCATE( zt2ns, zt2sn, zt2ew, zt2we )
       !
@@ -750,18 +743,18 @@
 
    
-   SUBROUTINE load_array(pt2d,cd_type,psgn,pt2d_array, type_array, psgn_array,num_fields)
+   SUBROUTINE load_array( pt2d, cd_type, psgn, pt2d_array, type_array, psgn_array, num_fields )
       !!---------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), TARGET   ,   INTENT(inout) ::   pt2d    ! Second 2D array on which the boundary condition is applied
-      CHARACTER(len=1)            , INTENT(in   ) ::   cd_type ! define the nature of ptab array grid-points
-      REAL(wp)                    , INTENT(in   ) ::   psgn    ! =-1 the sign change across the north fold boundary
+      REAL(wp), DIMENSION(jpi,jpj), TARGET, INTENT(inout) ::   pt2d    ! Second 2D array on which the boundary condition is applied
+      CHARACTER(len=1)                    , INTENT(in   ) ::   cd_type ! define the nature of ptab array grid-points
+      REAL(wp)                            , INTENT(in   ) ::   psgn    ! =-1 the sign change across the north fold boundary
       TYPE(arrayptr)   , DIMENSION(9) ::   pt2d_array
       CHARACTER(len=1) , DIMENSION(9) ::   type_array    ! define the nature of ptab array grid-points
       REAL(wp)         , DIMENSION(9) ::   psgn_array    ! =-1 the sign change across the north fold boundary
-      INTEGER                      , INTENT (inout):: num_fields 
+      INTEGER                            , INTENT (inout) :: num_fields 
       !!---------------------------------------------------------------------
-      num_fields=num_fields+1
-      pt2d_array(num_fields)%pt2d=>pt2d
-      type_array(num_fields)=cd_type
-      psgn_array(num_fields)=psgn
+      num_fields = num_fields + 1
+      pt2d_array(num_fields)%pt2d => pt2d
+      type_array(num_fields)      =  cd_type
+      psgn_array(num_fields)      =  psgn
    END SUBROUTINE load_array
    
@@ -792,21 +785,22 @@
       INTEGER :: num_fields
       !!---------------------------------------------------------------------
-
+      !
       num_fields = 0
-
-      !! Load the first array
-      CALL load_array(pt2dA,cd_typeA,psgnA,pt2d_array, type_array, psgn_array,num_fields)
-
-      !! Look if more arrays are added
-      IF(PRESENT (psgnB) )CALL load_array(pt2dB,cd_typeB,psgnB,pt2d_array, type_array, psgn_array,num_fields)
-      IF(PRESENT (psgnC) )CALL load_array(pt2dC,cd_typeC,psgnC,pt2d_array, type_array, psgn_array,num_fields)
-      IF(PRESENT (psgnD) )CALL load_array(pt2dD,cd_typeD,psgnD,pt2d_array, type_array, psgn_array,num_fields)
-      IF(PRESENT (psgnE) )CALL load_array(pt2dE,cd_typeE,psgnE,pt2d_array, type_array, psgn_array,num_fields)
-      IF(PRESENT (psgnF) )CALL load_array(pt2dF,cd_typeF,psgnF,pt2d_array, type_array, psgn_array,num_fields)
-      IF(PRESENT (psgnG) )CALL load_array(pt2dG,cd_typeG,psgnG,pt2d_array, type_array, psgn_array,num_fields)
-      IF(PRESENT (psgnH) )CALL load_array(pt2dH,cd_typeH,psgnH,pt2d_array, type_array, psgn_array,num_fields)
-      IF(PRESENT (psgnI) )CALL load_array(pt2dI,cd_typeI,psgnI,pt2d_array, type_array, psgn_array,num_fields)
-      
-      CALL mpp_lnk_2d_multiple(pt2d_array,type_array,psgn_array,num_fields,cd_mpp,pval)
+      !
+      ! Load the first array
+      CALL load_array( pt2dA, cd_typeA, psgnA, pt2d_array, type_array, psgn_array, num_fields )
+      !
+      ! Look if more arrays are added
+      IF( PRESENT(psgnB) )   CALL load_array(pt2dB,cd_typeB,psgnB,pt2d_array, type_array, psgn_array,num_fields)
+      IF( PRESENT(psgnC) )   CALL load_array(pt2dC,cd_typeC,psgnC,pt2d_array, type_array, psgn_array,num_fields)
+      IF( PRESENT(psgnD) )   CALL load_array(pt2dD,cd_typeD,psgnD,pt2d_array, type_array, psgn_array,num_fields)
+      IF( PRESENT(psgnE) )   CALL load_array(pt2dE,cd_typeE,psgnE,pt2d_array, type_array, psgn_array,num_fields)
+      IF( PRESENT(psgnF) )   CALL load_array(pt2dF,cd_typeF,psgnF,pt2d_array, type_array, psgn_array,num_fields)
+      IF( PRESENT(psgnG) )   CALL load_array(pt2dG,cd_typeG,psgnG,pt2d_array, type_array, psgn_array,num_fields)
+      IF( PRESENT(psgnH) )   CALL load_array(pt2dH,cd_typeH,psgnH,pt2d_array, type_array, psgn_array,num_fields)
+      IF( PRESENT(psgnI) )   CALL load_array(pt2dI,cd_typeI,psgnI,pt2d_array, type_array, psgn_array,num_fields)
+      !
+      CALL mpp_lnk_2d_multiple( pt2d_array, type_array, psgn_array, num_fields, cd_mpp,pval )
+      !
    END SUBROUTINE mpp_lnk_2d_9
 
@@ -843,17 +837,14 @@
       INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend
       REAL(wp) ::   zland
-      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend
-      !
+      INTEGER, DIMENSION(MPI_STATUS_SIZE)     ::   ml_stat       ! for key_mpi_isend
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ns, zt2sn   ! 2d for north-south & south-north
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ew, zt2we   ! 2d for east-west & west-east
-
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      !
       ALLOCATE( zt2ns(jpi,jprecj,2), zt2sn(jpi,jprecj,2),  &
          &      zt2ew(jpj,jpreci,2), zt2we(jpj,jpreci,2)   )
-
       !
       IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value
-      ELSE                         ;   zland = 0.e0      ! zero by default
+      ELSE                         ;   zland = 0._wp     ! zero by default
       ENDIF
 
@@ -1046,14 +1037,12 @@
       INTEGER  ::   imigr, iihom, ijhom        ! temporary integers
       INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend
-      INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend
-      !
+      INTEGER , DIMENSION(MPI_STATUS_SIZE)        ::   ml_stat   ! for key_mpi_isend
       REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE ::   zt4ns, zt4sn   ! 2 x 3d for north-south & south-north
       REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE ::   zt4ew, zt4we   ! 2 x 3d for east-west & west-east
-
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      !
       ALLOCATE( zt4ns(jpi,jprecj,jpk,2,2), zt4sn(jpi,jprecj,jpk,2,2) ,    &
          &      zt4ew(jpj,jpreci,jpk,2,2), zt4we(jpj,jpreci,jpk,2,2) )
-
-
+      !
       ! 1. standard boundary treatment
       ! ------------------------------
@@ -1399,5 +1388,5 @@
          END DO
       END SELECT
-
+      !
    END SUBROUTINE mpp_lnk_2d_e
 
@@ -1449,12 +1438,9 @@
       !!----------------------------------------------------------------------
       !
-
       ! If a specific process number has been passed to the receive call,
       ! use that one. Default is to use mpi_any_source
-      use_source=mpi_any_source
-      if(present(ksource)) then
-         use_source=ksource
-      end if
-
+      use_source = mpi_any_source
+      IF( PRESENT(ksource) )   use_source = ksource
+      !
       CALL mpi_recv( pmess, kbytes, mpi_double_precision, use_source, ktyp, mpi_comm_opa, istatus, iflag )
       !
@@ -1470,6 +1456,6 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj),       INTENT(in   ) ::   ptab   ! subdomain input array
-      INTEGER ,                           INTENT(in   ) ::   kp     ! record length
+      REAL(wp), DIMENSION(jpi,jpj)      , INTENT(in   ) ::   ptab   ! subdomain input array
+      INTEGER                           , INTENT(in   ) ::   kp     ! record length
       REAL(wp), DIMENSION(jpi,jpj,jpnij), INTENT(  out) ::   pio    ! subdomain input array
       !!
@@ -1492,12 +1478,12 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpnij)  ::  pio        ! output array
-      INTEGER                             ::   kp        ! Tag (not used with MPI
-      REAL(wp), DIMENSION(jpi,jpj)        ::  ptab       ! subdomain array input
+      REAL(wp), DIMENSION(jpi,jpj,jpnij)  ::   pio    ! output array
+      INTEGER                             ::   kp     ! Tag (not used with MPI
+      REAL(wp), DIMENSION(jpi,jpj)        ::   ptab   ! subdomain array input
       !!
       INTEGER :: itaille, ierror   ! temporary integer
       !!---------------------------------------------------------------------
       !
-      itaille=jpi*jpj
+      itaille = jpi * jpj
       !
       CALL mpi_scatter( pio, itaille, mpi_double_precision, ptab, itaille     ,   &
@@ -1517,5 +1503,5 @@
       INTEGER , INTENT(inout), DIMENSION(kdim) ::   ktab   ! input array
       INTEGER , INTENT(in   ), OPTIONAL        ::   kcom   !
-      !!
+      !
       INTEGER :: ierror, localcomm   ! temporary integer
       INTEGER, DIMENSION(kdim) ::   iwork
@@ -1539,7 +1525,7 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER, INTENT(inout)           ::   ktab      ! ???
-      INTEGER, INTENT(in   ), OPTIONAL ::   kcom      ! ???
-      !!
+      INTEGER, INTENT(inout)           ::   ktab   ! ???
+      INTEGER, INTENT(in   ), OPTIONAL ::   kcom   ! ???
+      !
       INTEGER ::   ierror, iwork, localcomm   ! temporary integer
       !!----------------------------------------------------------------------
@@ -1548,5 +1534,5 @@
       IF( PRESENT(kcom) )   localcomm = kcom
       !
-      CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_max, localcomm, ierror)
+      CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_max, localcomm, ierror )
       !
       ktab = iwork
@@ -1562,7 +1548,7 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER , INTENT( in  )                  ::   kdim        ! size of array
-      INTEGER , INTENT(inout), DIMENSION(kdim) ::   ktab        ! input array
-      INTEGER , INTENT( in  ), OPTIONAL        ::   kcom        ! input array
+      INTEGER , INTENT( in  )                  ::   kdim   ! size of array
+      INTEGER , INTENT(inout), DIMENSION(kdim) ::   ktab   ! input array
+      INTEGER , INTENT( in  ), OPTIONAL        ::   kcom   ! input array
       !!
       INTEGER ::   ierror, localcomm   ! temporary integer
@@ -1596,5 +1582,5 @@
       IF( PRESENT(kcom) )   localcomm = kcom
       !
-     CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_min, localcomm, ierror )
+      CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_min, localcomm, ierror )
       !
       ktab = iwork
@@ -1610,7 +1596,7 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER, INTENT(in   )                   ::   kdim      ! ???
-      INTEGER, INTENT(inout), DIMENSION (kdim) ::   ktab      ! ???
-      !!
+      INTEGER, INTENT(in   )                   ::   kdim   ! ???
+      INTEGER, INTENT(inout), DIMENSION (kdim) ::   ktab   ! ???
+      !
       INTEGER :: ierror
       INTEGER, DIMENSION (kdim) ::  iwork
@@ -1653,5 +1639,5 @@
       REAL(wp), INTENT(inout), DIMENSION(kdim) ::   ptab
       INTEGER , INTENT(in   ), OPTIONAL        ::   kcom
-      !!
+      !
       INTEGER :: ierror, localcomm
       REAL(wp), DIMENSION(kdim) ::  zwork
@@ -1785,4 +1771,5 @@
    END SUBROUTINE mppsum_real
 
+
    SUBROUTINE mppsum_realdd( ytab, kcom )
       !!----------------------------------------------------------------------
@@ -1793,20 +1780,19 @@
       !!
       !!-----------------------------------------------------------------------
-      COMPLEX(wp), INTENT(inout)         :: ytab    ! input scalar
-      INTEGER , INTENT( in  ), OPTIONAL :: kcom
-
-      !! * Local variables   (MPI version)
-      INTEGER  ::    ierror
-      INTEGER  ::   localcomm
-      COMPLEX(wp) :: zwork
-
+      COMPLEX(wp), INTENT(inout)           ::   ytab    ! input scalar
+      INTEGER    , INTENT(in   ), OPTIONAL ::   kcom
+      !
+      INTEGER     ::   ierror
+      INTEGER     ::   localcomm
+      COMPLEX(wp) ::   zwork
+      !!-----------------------------------------------------------------------
+      !
       localcomm = mpi_comm_opa
-      IF( PRESENT(kcom) ) localcomm = kcom
-
+      IF( PRESENT(kcom) )   localcomm = kcom
+      !
       ! reduce local sums into global sum
-      CALL MPI_ALLREDUCE (ytab, zwork, 1, MPI_DOUBLE_COMPLEX, &
-                       MPI_SUMDD,localcomm,ierror)
+      CALL MPI_ALLREDUCE (ytab, zwork, 1, MPI_DOUBLE_COMPLEX, MPI_SUMDD, localcomm, ierror )
       ytab = zwork
-
+      !
    END SUBROUTINE mppsum_realdd
 
@@ -1820,21 +1806,20 @@
       !!
       !!-----------------------------------------------------------------------
-      INTEGER , INTENT( in )                        ::   kdim      ! size of ytab
-      COMPLEX(wp), DIMENSION(kdim), INTENT( inout ) ::   ytab      ! input array
-      INTEGER , INTENT( in  ), OPTIONAL :: kcom
-
-      !! * Local variables   (MPI version)
-      INTEGER                      :: ierror    ! temporary integer
-      INTEGER                      ::   localcomm
+      INTEGER                     , INTENT(in   ) ::   kdim   ! size of ytab
+      COMPLEX(wp), DIMENSION(kdim), INTENT(inout) ::   ytab   ! input array
+      INTEGER    , OPTIONAL       , INTENT(in   ) ::   kcom
+      !
+      INTEGER:: ierror, localcomm    ! local integer
       COMPLEX(wp), DIMENSION(kdim) :: zwork     ! temporary workspace
-
+      !!-----------------------------------------------------------------------
+      !
       localcomm = mpi_comm_opa
-      IF( PRESENT(kcom) ) localcomm = kcom
-
-      CALL MPI_ALLREDUCE (ytab, zwork, kdim, MPI_DOUBLE_COMPLEX, &
-                       MPI_SUMDD,localcomm,ierror)
+      IF( PRESENT(kcom) )   localcomm = kcom
+      !
+      CALL MPI_ALLREDUCE( ytab, zwork, kdim, MPI_DOUBLE_COMPLEX, MPI_SUMDD, localcomm, ierror )
       ytab(:) = zwork(:)
-
+      !
    END SUBROUTINE mppsum_a_realdd
+
 
    SUBROUTINE mpp_minloc2d( ptab, pmask, pmin, ki,kj )
@@ -1852,7 +1837,7 @@
       REAL(wp)                     , INTENT(  out) ::   pmin    ! Global minimum of ptab
       INTEGER                      , INTENT(  out) ::   ki, kj   ! index of minimum in global frame
-      !!
+      !
+      INTEGER :: ierror
       INTEGER , DIMENSION(2)   ::   ilocs
-      INTEGER :: ierror
       REAL(wp) ::   zmin   ! local minimum
       REAL(wp), DIMENSION(2,1) ::   zain, zaout
@@ -2704,5 +2689,5 @@
          &      zt3ew(jpj,jpreci,jpk,2), zt3we(jpj,jpreci,jpk,2)  )
 
-      zland = 0.-WP
+      zland = 0._wp
 
       ! 1. standard boundary treatment
