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 5839)
+++ branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 5883)
@@ -23,5 +23,5 @@
    !!                          the mppobc routine to optimize the BDY and OBC communications
    !!            3.5  !  2013  ( C. Ethe, G. Madec ) message passing arrays as local variables 
-   !!            3.5  !  2013 (S.Mocavero, I.Epicoco - CMCC) north fold optimizations
+   !!            3.5  !  2013  (S.Mocavero, I.Epicoco - CMCC) north fold optimizations
    !!----------------------------------------------------------------------
 
@@ -2662,5 +2662,6 @@
    END SUBROUTINE mpp_lbc_north_e
 
-      SUBROUTINE mpp_lnk_bdy_3d( ptab, cd_type, psgn, ib_bdy )
+
+   SUBROUTINE mpp_lnk_bdy_3d( ptab, cd_type, psgn, ib_bdy )
       !!----------------------------------------------------------------------
       !!                  ***  routine mpp_lnk_bdy_3d  ***
@@ -2683,9 +2684,4 @@
       !!
       !!----------------------------------------------------------------------
-
-      USE lbcnfd          ! north fold
-
-      INCLUDE 'mpif.h'
-
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptab     ! 3D array on which the boundary condition is applied
       CHARACTER(len=1)                , INTENT(in   ) ::   cd_type  ! define the nature of ptab array grid-points
@@ -2694,48 +2690,44 @@
       !                                                             ! =  1. , the sign is kept
       INTEGER                         , INTENT(in   ) ::   ib_bdy   ! BDY boundary set
+      !
       INTEGER  ::   ji, jj, jk, jl             ! dummy loop indices
-      INTEGER  ::   imigr, iihom, ijhom        ! temporary integers
+      INTEGER  ::   imigr, iihom, ijhom        ! local integers
       INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend
-      REAL(wp) ::   zland
+      REAL(wp) ::   zland                      ! local scalar
       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
-
-      !!----------------------------------------------------------------------
-      
+      !!----------------------------------------------------------------------
+      !
       ALLOCATE( zt3ns(jpi,jprecj,jpk,2), zt3sn(jpi,jprecj,jpk,2),   &
          &      zt3ew(jpj,jpreci,jpk,2), zt3we(jpj,jpreci,jpk,2)  )
 
-      zland = 0.e0
+      zland = 0.-WP
 
       ! 1. standard boundary treatment
       ! ------------------------------
-      
       !                                   ! East-West boundaries
       !                                        !* Cyclic east-west
-
       IF( nbondi == 2) THEN
-        IF (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) THEN
-          ptab( 1 ,:,:) = ptab(jpim1,:,:)
-          ptab(jpi,:,:) = ptab(  2  ,:,:)
-        ELSE
-          IF( .NOT. cd_type == 'F' )   ptab(     1       :jpreci,:,:) = zland    ! south except F-point
-          ptab(nlci-jpreci+1:jpi   ,:,:) = zland    ! north
-        ENDIF
+         IF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN
+            ptab( 1 ,:,:) = ptab(jpim1,:,:)
+            ptab(jpi,:,:) = ptab(  2  ,:,:)
+         ELSE
+            IF( .NOT. cd_type == 'F' )   ptab(1:jpreci,:,:) = zland    ! south except F-point
+            ptab(nlci-jpreci+1:jpi,:,:) = zland    ! north
+         ENDIF
       ELSEIF(nbondi == -1) THEN
-        IF( .NOT. cd_type == 'F' )   ptab(     1       :jpreci,:,:) = zland    ! south except F-point
+         IF( .NOT. cd_type == 'F' )   ptab(1:jpreci,:,:) = zland    ! south except F-point
       ELSEIF(nbondi == 1) THEN
-        ptab(nlci-jpreci+1:jpi   ,:,:) = zland    ! north
+         ptab(nlci-jpreci+1:jpi,:,:) = zland    ! north
       ENDIF                                     !* closed
 
       IF (nbondj == 2 .OR. nbondj == -1) THEN
-        IF( .NOT. cd_type == 'F' )   ptab(:,     1       :jprecj,:) = zland       ! south except F-point
+        IF( .NOT. cd_type == 'F' )   ptab(:,1:jprecj,:) = zland       ! south except F-point
       ELSEIF (nbondj == 2 .OR. nbondj == 1) THEN
-        ptab(:,nlcj-jprecj+1:jpj   ,:) = zland       ! north
-      ENDIF
-      
-      !
-
+        ptab(:,nlcj-jprecj+1:jpj,:) = zland       ! north
+      ENDIF
+      !
       ! 2. East and west directions exchange
       ! ------------------------------------
@@ -2794,10 +2786,10 @@
       CASE ( 0 )
          DO jl = 1, jpreci
-            ptab(jl      ,:,:) = zt3we(:,jl,:,2)
+            ptab(      jl,:,:) = zt3we(:,jl,:,2)
             ptab(iihom+jl,:,:) = zt3ew(:,jl,:,2)
          END DO
       CASE ( 1 )
          DO jl = 1, jpreci
-            ptab(jl      ,:,:) = zt3we(:,jl,:,2)
+            ptab(      jl,:,:) = zt3we(:,jl,:,2)
          END DO
       END SELECT
@@ -2885,5 +2877,6 @@
    END SUBROUTINE mpp_lnk_bdy_3d
 
-      SUBROUTINE mpp_lnk_bdy_2d( ptab, cd_type, psgn, ib_bdy )
+
+   SUBROUTINE mpp_lnk_bdy_2d( ptab, cd_type, psgn, ib_bdy )
       !!----------------------------------------------------------------------
       !!                  ***  routine mpp_lnk_bdy_2d  ***
@@ -2906,17 +2899,13 @@
       !!
       !!----------------------------------------------------------------------
-
-      USE lbcnfd          ! north fold
-
-      INCLUDE 'mpif.h'
-
-      REAL(wp), DIMENSION(jpi,jpj)    , INTENT(inout) ::   ptab     ! 3D array on which the boundary condition is applied
-      CHARACTER(len=1)                , INTENT(in   ) ::   cd_type  ! define the nature of ptab array grid-points
-      !                                                             ! = T , U , V , F , W points
-      REAL(wp)                        , INTENT(in   ) ::   psgn     ! =-1 the sign change across the north fold boundary
-      !                                                             ! =  1. , the sign is kept
-      INTEGER                         , INTENT(in   ) ::   ib_bdy   ! BDY boundary set
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   ptab     ! 3D array on which the boundary condition is applied
+      CHARACTER(len=1)            , INTENT(in   ) ::   cd_type  ! define the nature of ptab array grid-points
+      !                                                         ! = T , U , V , F , W points
+      REAL(wp)                    , INTENT(in   ) ::   psgn     ! =-1 the sign change across the north fold boundary
+      !                                                         ! =  1. , the sign is kept
+      INTEGER                     , INTENT(in   ) ::   ib_bdy   ! BDY boundary set
+      !
       INTEGER  ::   ji, jj, jl             ! dummy loop indices
-      INTEGER  ::   imigr, iihom, ijhom        ! temporary integers
+      INTEGER  ::   imigr, iihom, ijhom        ! local integers
       INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend
       REAL(wp) ::   zland
@@ -2925,5 +2914,4 @@
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ns, zt2sn   ! 2d for north-south & south-north
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ew, zt2we   ! 2d for east-west & west-east
-
       !!----------------------------------------------------------------------
 
@@ -2931,34 +2919,30 @@
          &      zt2ew(jpj,jpreci,2), zt2we(jpj,jpreci,2)   )
 
-      zland = 0.e0
+      zland = 0._wp
 
       ! 1. standard boundary treatment
       ! ------------------------------
-      
       !                                   ! East-West boundaries
-      !                                        !* Cyclic east-west
-
-      IF( nbondi == 2) THEN
-        IF (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) THEN
-          ptab( 1 ,:) = ptab(jpim1,:)
-          ptab(jpi,:) = ptab(  2  ,:)
-        ELSE
-          IF( .NOT. cd_type == 'F' )   ptab(     1       :jpreci,:) = zland    ! south except F-point
-          ptab(nlci-jpreci+1:jpi   ,:) = zland    ! north
-        ENDIF
+      !                                      !* Cyclic east-west
+      IF( nbondi == 2 ) THEN
+         IF (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) THEN
+            ptab( 1 ,:) = ptab(jpim1,:)
+            ptab(jpi,:) = ptab(  2  ,:)
+         ELSE
+            IF(.NOT.cd_type == 'F' )  ptab(     1       :jpreci,:) = zland    ! south except F-point
+                                      ptab(nlci-jpreci+1:jpi   ,:) = zland    ! north
+         ENDIF
       ELSEIF(nbondi == -1) THEN
-        IF( .NOT. cd_type == 'F' )   ptab(     1       :jpreci,:) = zland    ! south except F-point
+         IF( .NOT.cd_type == 'F' )    ptab(     1       :jpreci,:) = zland    ! south except F-point
       ELSEIF(nbondi == 1) THEN
-        ptab(nlci-jpreci+1:jpi   ,:) = zland    ! north
-      ENDIF                                     !* closed
-
-      IF (nbondj == 2 .OR. nbondj == -1) THEN
-        IF( .NOT. cd_type == 'F' )   ptab(:,     1       :jprecj) = zland       ! south except F-point
+                                      ptab(nlci-jpreci+1:jpi   ,:) = zland    ! north
+      ENDIF
+      !                                      !* closed
+      IF( nbondj == 2 .OR. nbondj == -1 ) THEN
+         IF( .NOT.cd_type == 'F' )    ptab(:,     1       :jprecj) = zland    ! south except F-point
       ELSEIF (nbondj == 2 .OR. nbondj == 1) THEN
-        ptab(:,nlcj-jprecj+1:jpj) = zland       ! north
-      ENDIF
-      
-      !
-
+                                      ptab(:,nlcj-jprecj+1:jpj   ) = zland    ! north
+      ENDIF
+      !
       ! 2. East and west directions exchange
       ! ------------------------------------
@@ -3107,4 +3091,5 @@
       !
    END SUBROUTINE mpp_lnk_bdy_2d
+
 
    SUBROUTINE mpi_init_opa( ldtxt, ksft, code )
@@ -3196,4 +3181,5 @@
    END SUBROUTINE DDPDD_MPI
 
+
    SUBROUTINE mpp_lbc_north_icb( pt2d, cd_type, psgn, pr2dj)
       !!---------------------------------------------------------------------
@@ -3218,4 +3204,5 @@
       !!                                                    ! north fold, =  1. otherwise
       INTEGER, OPTIONAL       , INTENT(in   ) ::   pr2dj
+      !
       INTEGER ::   ji, jj, jr
       INTEGER ::   ierr, itaille, ildi, ilei, iilb
@@ -3224,5 +3211,4 @@
       REAL(wp), DIMENSION(:,:)  , ALLOCATABLE  ::  ztab_e, znorthloc_e
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE  ::  znorthgloio_e
-
       !!----------------------------------------------------------------------
       !
@@ -3234,9 +3220,8 @@
       ENDIF
       ALLOCATE( ztab_e(jpiglo,4+2*ipr2dj), znorthloc_e(jpi,4+2*ipr2dj), znorthgloio_e(jpi,4+2*ipr2dj,jpni) )
-
-      !
-      ztab_e(:,:) = 0.e0
-
-      ij=0
+      !
+      ztab_e(:,:) = 0._wp
+      !
+      ij = 0
       ! put in znorthloc_e the last 4 jlines of pt2d
       DO jj = nlcj - ijpj + 1 - ipr2dj, nlcj +ipr2dj
@@ -3280,4 +3265,5 @@
       !
    END SUBROUTINE mpp_lbc_north_icb
+
 
    SUBROUTINE mpp_lnk_2d_icb( pt2d, cd_type, psgn, jpri, jprj )
@@ -3300,5 +3286,4 @@
       !!                    noso   : number for local neighboring processors
       !!                    nono   : number for local neighboring processors
-      !!
       !!----------------------------------------------------------------------
       INTEGER                                             , INTENT(in   ) ::   jpri
@@ -3459,4 +3444,5 @@
 
    END SUBROUTINE mpp_lnk_2d_icb
+   
 #else
    !!----------------------------------------------------------------------
