Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/floblk.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/floblk.F90	(revision 2334)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/floblk.F90	(revision 2335)
@@ -8,9 +8,6 @@
    !!   'key_floats'                                     float trajectories
    !!----------------------------------------------------------------------
-
-   !!----------------------------------------------------------------------
    !!    flotblk     : compute float trajectories with Blanke algorithme
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE flo_oce         ! ocean drifting floats
    USE oce             ! ocean dynamics and tracers
@@ -23,6 +20,5 @@
    PRIVATE
 
-   !! * Accessibility
-   PUBLIC flo_blk      ! routine called by floats.F90
+   PUBLIC   flo_blk    ! routine called by floats.F90
 
    !! * Substitutions
@@ -31,7 +27,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -46,10 +41,7 @@
       !!      algorithm. We need to know the velocity field, the old positions
       !!      of the floats and the grid defined on the domain.
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT( in  ) ::   kt ! ocean time step
       !!
-      !!----------------------------------------------------------------------
-      !! * arguments
-      INTEGER, INTENT( in  ) ::   kt ! ocean time step
-
-      !! * Local declarations
       INTEGER :: jfl              ! dummy loop arguments
       INTEGER :: ind, ifin, iloop
@@ -78,6 +70,5 @@
          zsurfz,                    &     ! surface of the face of the mesh 
          zind
-      REAL(wp), DIMENSION ( 2 )  ::   &
-         zsurfx, zsurfy                   ! surface of the face of the mesh
+      REAL(wp), DIMENSION ( 2 )  ::   zsurfx, zsurfy   ! surface of the face of the mesh
       !!---------------------------------------------------------------------
       
@@ -111,5 +102,5 @@
       iloop = 0
 222   DO jfl = 1, jpnfl
-# if   defined key_mpp_mpi   ||   defined key_mpp_shmem
+# if   defined key_mpp_mpi
          IF( (iil(jfl) >= (mig(nldi)-jpizoom+1)) .AND. (iil(jfl) <= (mig(nlei)-jpizoom+1)) .AND.   &
              (ijl(jfl) >= (mjg(nldj)-jpjzoom+1)) .AND. (ijl(jfl) <= (mjg(nlej)-jpjzoom+1)) ) THEN
@@ -327,5 +318,5 @@
             ! reinitialisation of the age of FLOAT
             zagefl(jfl) = zagenewfl(jfl)
-# if   defined key_mpp_mpi   ||   defined key_mpp_shmem
+# if   defined key_mpp_mpi
          ELSE
             ! we put zgifl, zgjfl, zgkfl, zagefl
@@ -413,5 +404,5 @@
          GO TO 222
       ENDIF
-
+      !
    END SUBROUTINE flo_blk
 
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90	(revision 2334)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90	(revision 2335)
@@ -4,4 +4,6 @@
    !! Ocean floats :   domain
    !!======================================================================
+   !! History :  OPA  ! 1998-07 (Y.Drillet, CLIPPER)  Original code
+   !!----------------------------------------------------------------------
 #if   defined key_floats   ||   defined key_esopa
    !!----------------------------------------------------------------------
@@ -12,5 +14,4 @@
    !!   dstnce         : compute distance between face mesh and floats 
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
@@ -20,8 +21,7 @@
 
    IMPLICIT NONE
-
-   !! * Accessibility
-   PRIVATE  dstnce
-   PUBLIC flo_dom     ! routine called by floats.F90
+   PRIVATE
+
+   PUBLIC   flo_dom    ! routine called by floats.F90
 
    !! * Substitutions
@@ -30,7 +30,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -42,17 +41,14 @@
       !!
       !!  ** Method  :   We put the floats  in the domain with the latitude,
-      !!       the longitude (degree) and the depth (m).
-      !!
+      !!               the longitude (degree) and the depth (m).
       !!----------------------------------------------------------------------      
-      !! * Local declarations
-      LOGICAL  :: llinmesh
-      INTEGER  :: ji, jj, jk               ! DO loop index on 3 directions
-      INTEGER  :: jfl, jfl1                ! number of floats   
-      INTEGER  :: inum                     ! logical unit for file read
-      INTEGER, DIMENSION ( jpnfl    )  ::   &
-         iimfl, ijmfl, ikmfl,    &          ! index mesh of floats
-         idomfl,  ivtest, ihtest
-      REAL(wp) :: zdxab, zdyad
-      REAL(wp), DIMENSION ( jpnnewflo+1 )  :: zgifl, zgjfl,  zgkfl
+      LOGICAL  ::   llinmesh
+      INTEGER  ::   ji, jj, jk   ! DO loop index on 3 directions
+      INTEGER  ::   jfl, jfl1    ! number of floats   
+      INTEGER  ::   inum         ! logical unit for file read
+      INTEGER, DIMENSION(jpnfl) ::   iimfl, ijmfl, ikmfl       ! index mesh of floats
+      INTEGER, DIMENSION(jpnfl) ::   idomfl,  ivtest, ihtest   !   -             -
+      REAL(wp) ::   zdxab, zdyad
+      REAL(wp), DIMENSION(jpnnewflo+1)  :: zgifl, zgjfl,  zgkfl
       !!---------------------------------------------------------------------
       
@@ -102,5 +98,5 @@
                ivtest(jfl) = 0
                ikmfl(jfl) = 0
-# if   defined key_mpp_mpi   ||   defined key_mpp_shmem
+# if   defined key_mpp_mpi
                DO ji = MAX(nldi,2), nlei
                   DO jj = MAX(nldj,2), nlej   ! NO vector opt.
@@ -139,5 +135,5 @@
             
             ! A zero in the sum of the arrays "ihtest" and "ivtest"             
-# if   defined key_mpp_mpi   ||   defined key_mpp_shmem
+# if   defined key_mpp_mpi
             CALL mpp_sum(ihtest,jpnfl)
             CALL mpp_sum(ivtest,jpnfl)
@@ -233,5 +229,5 @@
             ivtest(jfl) = 0
             ikmfl(jfl) = 0
-# if   defined key_mpp_mpi   ||   defined key_mpp_shmem
+# if   defined key_mpp_mpi
             DO ji = MAX(nldi,2), nlei
                DO jj = MAX(nldj,2), nlej   ! NO vector opt.
@@ -357,9 +353,5 @@
       !!
       !! ** Method  : 
-      !!
-      !! History :
-      !!   8.0  !  98-07 (Y.Drillet)  Original code
       !!----------------------------------------------------------------------
-      !! * Arguments
       REAL(wp) ::   &
          pax, pay, pbx, pby,    &     ! ???
@@ -368,15 +360,13 @@
          ptx, pty                     ! ???
       LOGICAL ::  ldinmesh            ! ???
-
-      !! * local declarations
-      REAL(wp) ::   &
-         zabt, zbct, zcdt, zdat, zabpt, zbcpt, zcdpt, zdapt,  &
-         psax,psay,psbx,psby,psx,psy
-      REAL(wp) ::  fsline                ! Statement function
-
-      !! * Substitutions
-      fsline(psax, psay, psbx, psby, psx, psy) = psy  * ( psbx - psax )   &
-                                               - psx  * ( psby - psay )   &
-                                               + psax *   psby - psay * psbx
+      !!
+      REAL(wp) ::   zabt, zbct, zcdt, zdat, zabpt, zbcpt, zcdpt, zdapt
+      !!---------------------------------------------------------------------
+      !! Statement function
+      REAL(wp) ::   fsline
+      REAL(wp) ::   psax, psay, psbx, psby, psx, psy
+      fsline( psax, psay, psbx, psby, psx, psy ) = psy  * ( psbx - psax )   &
+         &                                       - psx  * ( psby - psay )   &
+         &                                       + psax *   psby - psay * psbx
       !!---------------------------------------------------------------------
       
@@ -411,5 +401,5 @@
          ldinmesh=.FALSE.
       ENDIF
-
+      !
    END SUBROUTINE findmesh
 
@@ -422,14 +412,11 @@
       !!                points
       !! ** Method  : 
-      !!         
       !!----------------------------------------------------------------------
-      !! * Arguments
       REAL(wp), INTENT(in) ::   pla1, phi1, pla2, phi2   ! ???
-
-      !! * Local variables
+      !!
       REAL(wp) ::   dly1, dly2, dlx1, dlx2, dlx, dls, dld, dpi
       REAL(wp) ::   dstnce
       !!---------------------------------------------------------------------
-      
+      !
       dpi  = 2.* ASIN(1.)
       dls  = dpi / 180.
@@ -438,12 +425,12 @@
       dlx1 = pla1 * dls
       dlx2 = pla2 * dls
-
+      !
       dlx = SIN(dly1) * SIN(dly2) + COS(dly1) * COS(dly2) * COS(dlx2-dlx1)
- 
+      !
       IF( ABS(dlx) > 1.0 ) dlx = 1.0
-
+      !
       dld = ATAN(DSQRT( ( 1-dlx )/( 1+dlx ) )) * 222.24 / dls
       dstnce = dld * 1000.
-
+      !
    END FUNCTION dstnce
 
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/flowri.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/flowri.F90	(revision 2334)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/flowri.F90	(revision 2335)
@@ -8,5 +8,4 @@
    !!   NEMO      1.0  ! 2002-11  (G. Madec, A. Bozec)  F90: Free form and module
    !!----------------------------------------------------------------------
-
 #if   defined key_floats   ||   defined key_esopa
    !!----------------------------------------------------------------------
@@ -34,7 +33,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -52,12 +50,11 @@
       CHARACTER (len=21) ::  clname
       INTEGER ::   inum   ! temporary logical unit for restart file
-      INTEGER ::   iafl, ibfl, icfl, ia1fl, ib1fl, ic1fl, jfl, irecflo,   &
+      INTEGER ::   iafl, ibfl, icfl, ia1fl, ib1fl, ic1fl, jfl, irecflo
       INTEGER ::   iafloc, ibfloc, ia1floc, ib1floc, iafln, ibfln
       INTEGER  ::    ic, jc , jpn
-      INTEGER, DIMENSION ( jpnij )  :: iproc
-
-      REAL(wp) :: zafl,zbfl,zcfl,zdtj
-      REAL(wp) :: zxxu, zxxu_01,zxxu_10, zxxu_11
-      REAL(wp), DIMENSION (jpk,jpnfl) :: ztemp, zsal
+      INTEGER, DIMENSION ( jpnij )  ::   iproc
+      REAL(wp) ::   zafl,zbfl,zcfl,zdtj
+      REAL(wp) ::   zxxu, zxxu_01,zxxu_10, zxxu_11
+      REAL(wp), DIMENSION (jpk,jpnfl) ::   ztemp, zsal   ! 2D workspace
       !!---------------------------------------------------------------------
       
@@ -74,5 +71,4 @@
          ! open the file numflo 
          CALL ctl_opn( numflo, 'trajec_float', 'REPLACE', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
-         !      REWIND numflo
 
          IF( kt == nit000 ) THEN
@@ -80,5 +76,5 @@
             IF(lwp) WRITE(numflo)cexper,no,irecflo,jpnfl,nn_writefl
          ENDIF
-         zdtj = rdt / 86400.      !!bug   use of 86400 instead of the phycst parameter
+         zdtj = rdt / 86400._wp
 
          ! translation of index position in geographical position
@@ -195,5 +191,5 @@
       !         iafln=NINT(tpifl(jfl))
       !         ibfln=NINT(tpjfl(jfl))
-      !# if defined key_mpp_mpi   ||   defined key_mpp_shmem
+      !# if defined key_mpp_mpi   
       !        IF ( (iafl >= (mig(nldi)-jpizoom+1)) .AND.
       !     $       (iafl <= (mig(nlei)-jpizoom+1)) .AND.
@@ -214,5 +210,5 @@
       !         ztemp(jfl)=tn(iafloc,ibfloc,jk)
       !         zsal(jfl)=sn(iaflo!,ibfloc,jk)
-      !# if defined key_mpp_mpi   ||   defined key_mpp_shmem
+      !# if defined key_mpp_mpi   
       !        ELSE
       !         ztemp(jfl) = 0.
@@ -298,5 +294,5 @@
 
       IF( kt == nitend )   CLOSE( numflo ) 
-    
+      !
    END SUBROUTINE flo_wri
 
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBC/obc_vectopt_loop_substitute.h90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBC/obc_vectopt_loop_substitute.h90	(revision 2334)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBC/obc_vectopt_loop_substitute.h90	(revision 2335)
@@ -5,10 +5,5 @@
    !!      to allow unrolling of do-loop using CPP macro.
    !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-#if defined key_vectopt_loop && defined key_obc && ! defined key_mpp_mpi && ! defined key_mpp_shmem
+#if defined key_vectopt_loop && defined key_obc && ! defined key_mpp_mpi
 #  define fs_niw0  jpiwob 
 #  define fs_niw1  jpiwob
@@ -29,2 +24,7 @@
 #  define fs_njs1  njs1
 #endif
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBS/mpp_map.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBS/mpp_map.F90	(revision 2334)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBS/mpp_map.F90	(revision 2335)
@@ -4,49 +4,30 @@
    !! NEMOVAR: MPP global grid point mapping to processors
    !!======================================================================
+   !! History :  2.0  ! 2007-08  (K. Mogensen)  Original code
+   !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
-   !! mppmap      : Global array which maps i,j to area number.
-   !! mppmap_init : Initialize mppmap.
+   !!  mppmap_init : Initialize mppmap.
    !!----------------------------------------------------------------------
-   !! * Modules used   
-   USE par_kind, ONLY : &   ! Precision variables
-      & wp
-   USE par_oce, ONLY : &    ! Ocean parameters
-      & jpi,   &
-      & jpj
-   USE dom_oce, ONLY : &    ! Ocean space and time domain variables
-      & mig,   &
-      & mjg,   &  
-      & nldi,  &
-      & nlei,  &
-      & nldj,  &
-      & nlej,  &
-      & narea 
+   USE par_kind, ONLY :   wp            ! Precision variables
+   USE par_oce , ONLY :   jpi, jpj      ! Ocean parameters
+   USE dom_oce , ONLY :   mig, mjg, nldi, nlei, nldj, nlej, narea   ! Ocean space and time domain variables
 #if defined key_mpp_mpi
-   USE lib_mpp, ONLY : &    ! MPP library
-      & mpi_comm_opa
+   USE lib_mpp, ONLY :   mpi_comm_opa   ! MPP library
 #endif
-   USE in_out_manager
+   USE in_out_manager   ! I/O manager
 
    IMPLICIT NONE
-
-   !! * Routine accessibility
    PRIVATE
 
-   PUBLIC &
-      & mppmap_init,        &
-      & mppmap
+   PUBLIC ::   mppmap_init, mppmap   !: ???
 
-   !! * Module variables
-
-   INTEGER, DIMENSION(:,:), ALLOCATABLE :: &
-      & mppmap
+   INTEGER, DIMENSION(:,:), ALLOCATABLE ::   mppmap   ! ???
 
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -60,19 +41,13 @@
       !!
       !! ** Action  : This does only work for MPI. 
-      !!              It does not work for SHMEM.
       !!
       !! References : http://www.mpi-forum.org
-      !!
-      !! History :
-      !!        !  07-08  (K. Mogensen)  Original code
       !!----------------------------------------------------------------------
-
-      !! * Arguments
-      INTEGER, DIMENSION(:,:), ALLOCATABLE :: imppmap
+      INTEGER, DIMENSION(:,:), ALLOCATABLE ::   imppmap   !
 #if defined key_mpp_mpi
-      !! * Local declarations
       INTEGER :: ierr
 INCLUDE 'mpif.h'
 #endif
+      !!----------------------------------------------------------------------
 
       ALLOCATE( &
@@ -95,18 +70,14 @@
 
       ! Call the MPI library to find the max across processors
-
-      CALL mpi_allreduce( imppmap, mppmap, jpiglo*jpjglo, mpi_integer, &
+      CALL mpi_allreduce( imppmap, mppmap, jpiglo*jpjglo, mpi_integer,   &
          &                mpi_max, mpi_comm_opa, ierr )
-#elif defined key_mpp_shmem
-#error "Only MPI support for MPP in NEMOVAR"
 #else      
       
-      ! Just copy the data
-
+      ! No MPP: Just copy the data
       mppmap(:,:) = imppmap(:,:)
-
 #endif
-
+      !
    END SUBROUTINE mppmap_init
 
+   !!======================================================================
 END MODULE mpp_map
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90	(revision 2334)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90	(revision 2335)
@@ -1,9 +1,2 @@
-#if defined key_mpp_mpi
-#if defined key_sp
-#define mpivar mpi_real
-#else
-#define mpivar mpi_double_precision
-#endif
-#endif
 MODULE obs_mpp
    !!======================================================================
@@ -11,35 +4,36 @@
    !! Observation diagnostics: Various MPP support routines
    !!======================================================================
-
+   !! History :  2.0  ! 2006-03  (K. Mogensen)  Original code
+   !!             -   ! 2006-05  (K. Mogensen)  Reformatted
+   !!             -   ! 2008-01  (K. Mogensen)  add mpp_global_max
    !!----------------------------------------------------------------------
-   !! obs_mpp_bcast_integer : Broadcast an integer array from a processor 
-   !!                         to all processors
-   !! obs_mpp_max_integer   : Find maximum on all processors of each
-   !!                         value in an integer on all processors
+#if defined key_mpp_mpi
+# if defined key_sp
+#  define mpivar mpi_real
+# else
+#  define mpivar mpi_double_precision
+# endif
+#endif
+   !!----------------------------------------------------------------------
+   !! obs_mpp_bcast_integer : Broadcast an integer array from a processor to all processors
+   !! obs_mpp_max_integer   : Find maximum on all processors of each value in an integer on all processors
    !! obs_mpp_find_obs_proc : Find processors which should hold the observations
    !! obs_mpp_sum_integers  : Sum an integer array from all processors
    !! obs_mpp_sum_integer   : Sum an integer from all processors
    !!----------------------------------------------------------------------
-   !! * Modules used   
-   USE dom_oce, ONLY : &    ! Ocean space and time domain variables
-      & nproc, &
-      & mig,mjg
-   USE mpp_map, ONLY : &
-      & mppmap
+   USE dom_oce, ONLY :   nproc, mig, mjg   ! Ocean space and time domain variables
+   USE mpp_map, ONLY :   mppmap
    USE in_out_manager
 #if defined key_mpp_mpi
-   USE lib_mpp, ONLY : &    ! MPP library
-      & mpi_comm_opa
+   USE lib_mpp, ONLY :   mpi_comm_opa      ! MPP library
 #endif
    IMPLICIT NONE
-
-   !! * Routine accessibility
    PRIVATE
 
-   PUBLIC obs_mpp_bcast_integer, & ! Broadcast an integer array from a proc to all procs
-      &   obs_mpp_max_integer,   & ! Find maximum across processors in an integer array
-      &   obs_mpp_find_obs_proc, & ! Find processors which should hold the observations
-      &   obs_mpp_sum_integers,  & ! Sum an integer array from all processors
-      &   obs_mpp_sum_integer,   & ! Sum an integer from all processors
+   PUBLIC obs_mpp_bcast_integer, & !: Broadcast an integer array from a proc to all procs
+      &   obs_mpp_max_integer,   & !: Find maximum across processors in an integer array
+      &   obs_mpp_find_obs_proc, & !: Find processors which should hold the observations
+      &   obs_mpp_sum_integers,  & !: Sum an integer array from all processors
+      &   obs_mpp_sum_integer,   & !: Sum an integer from all processors
       &   mpp_alltoall_int,      &
       &   mpp_alltoallv_int,     &
@@ -50,10 +44,9 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
-   SUBROUTINE obs_mpp_bcast_integer(kvals,kno,kroot)
+   SUBROUTINE obs_mpp_bcast_integer( kvals, kno, kroot )
       !!----------------------------------------------------------------------
       !!               ***  ROUTINE obs_mpp_bcast_integer ***
@@ -64,36 +57,27 @@
       !!
       !! ** Action  : This does only work for MPI. 
-      !!              It does not work for SHMEM.
       !!              MPI_COMM_OPA needs to be replace for OASIS4.!
       !!
       !! References : http://www.mpi-forum.org
-      !!
-      !! History :
-      !!        !  06-03  (K. Mogensen)  Original code
-      !!        !  06-05  (K. Mogensen)  Reformatted
-      !!----------------------------------------------------------------------
-
-      !! * Arguments
-      INTEGER, INTENT(IN) :: kno       ! Number of elements in array
-      INTEGER, INTENT(IN) :: kroot      ! Processor to send data
-      INTEGER, DIMENSION(kno), INTENT(INOUT) :: &
-         & kvals         ! Array to send on kroot, receive for non-kroot
+      !!----------------------------------------------------------------------
+      INTEGER                , INTENT(in   ) ::   kno     ! Number of elements in array
+      INTEGER                , INTENT(in   ) ::   kroot   ! Processor to send data
+      INTEGER, DIMENSION(kno), INTENT(inout) ::   kvals   ! Array to send on kroot, receive for non-kroot
+      !!
+#if defined key_mpp_mpi
+      INTEGER :: ierr
+INCLUDE 'mpif.h'
+      !!----------------------------------------------------------------------
+
+      ! Call the MPI library to broadcast data
+      CALL mpi_bcast( kvals, kno, mpi_integer,  &
+         &            kroot, mpi_comm_opa, ierr )
+#else
+      ! no MPI: empty routine
+#endif
+      !
+   END SUBROUTINE obs_mpp_bcast_integer
+
   
-#if defined key_mpp_mpi
-      !! * Local declarations
-      INTEGER :: ierr
-INCLUDE 'mpif.h'
-
-      !-----------------------------------------------------------------------
-      ! Call the MPI library to broadcast data
-      !-----------------------------------------------------------------------
-      CALL mpi_bcast( kvals, kno, mpi_integer, &
-         &            kroot, mpi_comm_opa, ierr )
-#elif defined key_mpp_shmem
-error "Only MPI support for MPP in NEMOVAR"
-#endif
-
-   END SUBROUTINE obs_mpp_bcast_integer
-    
    SUBROUTINE obs_mpp_max_integer( kvals, kno )
       !!----------------------------------------------------------------------
@@ -109,34 +93,25 @@
       !!
       !! References : http://www.mpi-forum.org
-      !!
-      !! History :
-      !!        !  06-03  (K. Mogensen)  Original code
-      !!        !  06-05  (K. Mogensen)  Reformatted
-      !!----------------------------------------------------------------------
-
-      !! * Arguments
-      INTEGER, INTENT(IN) ::kno       ! Number of elements in array
-      INTEGER, DIMENSION(kno), INTENT(INOUT) :: &
-         & kvals     ! Array to send on kroot, receive for non-kroot  
-
-#if defined key_mpp_mpi
-      !! * Local declarations
-      INTEGER :: ierr
-      INTEGER, DIMENSION(kno) :: &
-         & ivals
-INCLUDE 'mpif.h'
-
-      !-----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      INTEGER                , INTENT(in   ) ::   kno     ! Number of elements in array
+      INTEGER, DIMENSION(kno), INTENT(inout) ::   kvals   ! Array to send on kroot, receive for non-kroot  
+      !!
+#if defined key_mpp_mpi
+      INTEGER :: ierr
+      INTEGER, DIMENSION(kno) ::   ivals
+INCLUDE 'mpif.h'
+      !!----------------------------------------------------------------------
+
       ! Call the MPI library to find the maximum across processors
-      !-----------------------------------------------------------------------
-      CALL mpi_allreduce( kvals, ivals, kno, mpi_integer, &
+      CALL mpi_allreduce( kvals, ivals, kno, mpi_integer,   &
          &                mpi_max, mpi_comm_opa, ierr )
       kvals(:) = ivals(:)
-#elif defined key_mpp_shmem
-error "Only MPI support for MPP in NEMOVAR"
+#else
+      ! no MPI: empty routine
 #endif
    END SUBROUTINE obs_mpp_max_integer
 
-   SUBROUTINE obs_mpp_find_obs_proc(kobsp,kobsi,kobsj,kno)
+
+   SUBROUTINE obs_mpp_find_obs_proc( kobsp, kobsi, kobsj, kno )
       !!----------------------------------------------------------------------
       !!               ***  ROUTINE obs_mpp_find_obs_proc ***
@@ -155,19 +130,10 @@
       !!
       !! References : http://www.mpi-forum.org
-      !!
-      !! History :
-      !!        !  06-07  (K. Mogensen)  Original code
-      !!----------------------------------------------------------------------
-
-      !! * Arguments
-      INTEGER, INTENT(IN) :: kno
-      INTEGER, DIMENSION(kno), INTENT(IN) :: &
-         & kobsi, &
-         & kobsj
-      INTEGER, DIMENSION(kno), INTENT(INOUT) :: &
-         & kobsp
-
-#if defined key_mpp_mpi
-      !! * Local declarations
+      !!----------------------------------------------------------------------
+      INTEGER                , INTENT(in   ) ::   kno
+      INTEGER, DIMENSION(kno), INTENT(in   ) ::   kobsi, kobsj
+      INTEGER, DIMENSION(kno), INTENT(inout) ::   kobsp
+      !!
+#if defined key_mpp_mpi
       INTEGER :: ji
       INTEGER :: jj
@@ -177,11 +143,9 @@
       INTEGER :: iobsjp
       INTEGER :: num_sus_obs
-      INTEGER, DIMENSION(kno) :: &
-         & iobsig, &
-         & iobsjg
-      INTEGER, ALLOCATABLE, DIMENSION(:,:) :: &
-         & iobsp, iobsi, iobsj
-
-INCLUDE 'mpif.h'
+      INTEGER, DIMENSION(kno) ::   iobsig, iobsjg
+      INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   iobsp, iobsi, iobsj
+      !!
+INCLUDE 'mpif.h'
+      !!----------------------------------------------------------------------
 
       !-----------------------------------------------------------------------
@@ -258,10 +222,11 @@
       DEALLOCATE( iobsi )
       DEALLOCATE( iobsp )
-#elif defined key_mpp_shmem
-error "Only MPI support for MPP in NEMOVAR"
-#endif
-
+#else
+      ! no MPI: empty routine
+#endif
+      !
    END SUBROUTINE obs_mpp_find_obs_proc
 
+
    SUBROUTINE obs_mpp_sum_integers( kvalsin, kvalsout, kno )
       !!----------------------------------------------------------------------
@@ -276,21 +241,15 @@
       !!
       !! References : http://www.mpi-forum.org
-      !!
-      !! History :
-      !!        !  06-07  (K. Mogensen)  Original code
-      !!----------------------------------------------------------------------
-
-      !! * Arguments
-      INTEGER, INTENT(IN) :: kno
-      INTEGER, DIMENSION(kno), INTENT(IN) :: &
-         & kvalsin
-      INTEGER, DIMENSION(kno), INTENT(OUT) :: &
-         & kvalsout
-
-#if defined key_mpp_mpi
-      !! * Local declarations
-      INTEGER :: ierr
-INCLUDE 'mpif.h'
- 
+      !!----------------------------------------------------------------------
+      INTEGER                , INTENT(in   ) :: kno
+      INTEGER, DIMENSION(kno), INTENT(in   ) ::   kvalsin
+      INTEGER, DIMENSION(kno), INTENT(  out) ::   kvalsout
+      !!
+#if defined key_mpp_mpi
+      INTEGER :: ierr
+      !!
+INCLUDE 'mpif.h'
+      !!----------------------------------------------------------------------
+      !
       !-----------------------------------------------------------------------
       ! Call the MPI library to find the sum across processors
@@ -298,8 +257,5 @@
       CALL mpi_allreduce( kvalsin, kvalsout, kno, mpi_integer, &
          &                mpi_sum, mpi_comm_opa, ierr )
-#elif defined key_mpp_shmem
-error "Only MPI support for MPP in NEMOVAR"
-#else
-
+#else
       !-----------------------------------------------------------------------
       ! For no-MPP just return input values
@@ -307,7 +263,8 @@
       kvalsout(:) = kvalsin(:)
 #endif
-
+      !
    END SUBROUTINE obs_mpp_sum_integers
 
+
    SUBROUTINE obs_mpp_sum_integer( kvalin, kvalout )
       !!----------------------------------------------------------------------
@@ -322,27 +279,20 @@
       !!
       !! References : http://www.mpi-forum.org
-      !!
-      !! History :
-      !!        !  06-07  (K. Mogensen)  Original code
-      !!----------------------------------------------------------------------
-
-      !! * Arguments
-      INTEGER, INTENT(IN) :: kvalin
-      INTEGER, INTENT(OUT) :: kvalout
-
-#if defined key_mpp_mpi
-      !! * Local declarations
-      INTEGER :: ierr
-INCLUDE 'mpif.h'
-
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in   ) ::   kvalin
+      INTEGER, INTENT(  out) ::   kvalout
+      !!
+#if defined key_mpp_mpi
+      INTEGER :: ierr
+      !!
+INCLUDE 'mpif.h'
+      !!----------------------------------------------------------------------
+      !
       !-----------------------------------------------------------------------
       ! Call the MPI library to find the sum across processors
       !-----------------------------------------------------------------------
-      CALL mpi_allreduce( kvalin, kvalout, 1, mpi_integer, &
+      CALL mpi_allreduce( kvalin, kvalout, 1, mpi_integer,   &
          &                mpi_sum, mpi_comm_opa, ierr )
-#elif defined key_mpp_shmem
-error "Only MPI support for MPP in NEMOVAR"
-#else
-
+#else
       !-----------------------------------------------------------------------
       ! For no-MPP just return input values
@@ -350,5 +300,7 @@
       kvalout = kvalin
 #endif
+      !
    END SUBROUTINE obs_mpp_sum_integer
+
 
    SUBROUTINE mpp_global_max( pval )
@@ -365,18 +317,12 @@
       !!
       !! References : http://www.mpi-forum.org
-      !!
-      !! History :
-      !!        !  08-01  (K. Mogensen)  Original code
-      !!----------------------------------------------------------------------
-
-      !! * Arguments
-      REAL(KIND=wp), DIMENSION(jpiglo,jpjglo), INTENT(INOUT) :: &
-         & pval
-      !! * Local declarations
-      INTEGER :: ierr
-#if defined key_mpp_mpi
-INCLUDE 'mpif.h'
-      REAL(KIND=wp), DIMENSION(:,:), ALLOCATABLE :: &
-         & zcp
+      !!----------------------------------------------------------------------
+      REAL(KIND=wp), DIMENSION(jpiglo,jpjglo), INTENT(inout) ::   pval
+      !!
+      INTEGER :: ierr
+#if defined key_mpp_mpi
+INCLUDE 'mpif.h'
+      REAL(KIND=wp), DIMENSION(:,:), ALLOCATABLE ::   zcp
+      !!----------------------------------------------------------------------
 
       ! Copy data for input to MPI
@@ -396,10 +342,11 @@
          & )
 
-#elif defined key_mpp_shmem
-error "Only MPI support for MPP in NEMOVAR"
-#endif
-      
+#else
+      ! no MPI: empty routine
+#endif
+      !
    END SUBROUTINE mpp_global_max
 
+
    SUBROUTINE mpp_alltoall_int( kno, kvalsin, kvalsout )
       !!----------------------------------------------------------------------
@@ -414,16 +361,9 @@
       !!
       !! References : http://www.mpi-forum.org
-      !!
-      !! History :
-      !!        !  06-09  (K. Mogensen)  Original code
-      !!----------------------------------------------------------------------
-
-      !! * Arguments
-      INTEGER, INTENT(IN) :: kno
-      INTEGER, DIMENSION(kno*jpnij), INTENT(IN) :: &
-         & kvalsin
-      INTEGER, DIMENSION(kno*jpnij), INTENT(OUT) :: &
-         & kvalsout
-      !! * Local declarations
+      !!----------------------------------------------------------------------
+      INTEGER                      , INTENT(in   ) ::   kno
+      INTEGER, DIMENSION(kno*jpnij), INTENT(in   ) ::   kvalsin
+      INTEGER, DIMENSION(kno*jpnij), INTENT(  out) ::   kvalsout
+      !!
       INTEGER :: ierr
 #if defined key_mpp_mpi
@@ -435,6 +375,4 @@
          &               kvalsout, kno, mpi_integer, &
          &               mpi_comm_opa, ierr )
-#elif defined key_mpp_shmem
-error "Only MPI support for MPP in NEMOVAR"
 #else
       !-----------------------------------------------------------------------
@@ -443,9 +381,10 @@
       kvalsout = kvalsin
 #endif
-      
+      !
    END SUBROUTINE mpp_alltoall_int
 
-   SUBROUTINE mpp_alltoallv_int( kvalsin, knoin, kinv, kvalsout, &
-      &                              knoout, koutv )
+
+   SUBROUTINE mpp_alltoallv_int( kvalsin, knoin , kinv , kvalsout,   &
+      &                                   knoout, koutv )
       !!----------------------------------------------------------------------
       !!               ***  ROUTINE mpp_alltoallv_int ***
@@ -459,27 +398,16 @@
       !!
       !! References : http://www.mpi-forum.org
-      !!
-      !! History :
-      !!        !  06-09  (K. Mogensen)  Original code
-      !!----------------------------------------------------------------------
-
-      !! * Arguments
-      INTEGER, INTENT(IN) :: knoin
-      INTEGER, INTENT(IN) :: knoout
-      INTEGER, DIMENSION(jpnij) :: &
-         & kinv, &
-         & koutv
-      INTEGER, DIMENSION(knoin), INTENT(IN) :: &
-         & kvalsin
-      INTEGER, DIMENSION(knoout), INTENT(OUT) :: &
-         & kvalsout
-      !! * Local declarations
+      !!----------------------------------------------------------------------
+      INTEGER                   , INTENT(in) :: knoin
+      INTEGER                   , INTENT(in) :: knoout
+      INTEGER, DIMENSION(jpnij)                 ::   kinv, koutv
+      INTEGER, DIMENSION(knoin) , INTENT(in   ) ::   kvalsin
+      INTEGER, DIMENSION(knoout), INTENT(  out) ::   kvalsout
+      !!
       INTEGER :: ierr
       INTEGER :: jproc
 #if defined key_mpp_mpi
 INCLUDE 'mpif.h'
-      INTEGER, DIMENSION(jpnij) :: &
-         & irdsp, &
-         & isdsp
+      INTEGER, DIMENSION(jpnij) ::   irdsp, isdsp
       !-----------------------------------------------------------------------
       ! Compute displacements
@@ -497,6 +425,4 @@
          &                kvalsout, koutv, irdsp, mpi_integer, &
          &                mpi_comm_opa, ierr )
-#elif defined key_mpp_shmem
-error "Only MPI support for MPP in NEMOVAR"
 #else
       !-----------------------------------------------------------------------
@@ -505,9 +431,10 @@
       kvalsout = kvalsin
 #endif
-      
+      !
    END SUBROUTINE mpp_alltoallv_int
 
-   SUBROUTINE mpp_alltoallv_real( pvalsin, knoin, kinv, pvalsout, &
-      &                               knoout, koutv )
+
+   SUBROUTINE mpp_alltoallv_real( pvalsin, knoin , kinv , pvalsout,   &
+      &                                    knoout, koutv )
       !!----------------------------------------------------------------------
       !!               ***  ROUTINE mpp_alltoallv_real ***
@@ -521,27 +448,18 @@
       !!
       !! References : http://www.mpi-forum.org
-      !!
-      !! History :
-      !!        !  06-09  (K. Mogensen)  Original code
-      !!----------------------------------------------------------------------
-
-      !! * Arguments
-      INTEGER, INTENT(IN) :: knoin
-      INTEGER, INTENT(IN) :: knoout
-      INTEGER, DIMENSION(jpnij) :: &
-         & kinv, &
-         & koutv
-      REAL(KIND=wp), DIMENSION(knoin), INTENT(IN) :: &
-         & pvalsin
-      REAL(KIND=wp), DIMENSION(knoout), INTENT(OUT) :: &
-         & pvalsout
-      !! * Local declarations
+      !!----------------------------------------------------------------------
+      INTEGER                    , INTENT(in   ) :: knoin
+      INTEGER                    , INTENT(in   ) :: knoout
+      INTEGER , DIMENSION(jpnij)                 ::   kinv, koutv
+      REAL(wp), DIMENSION(knoin) , INTENT(in   ) ::   pvalsin
+      REAL(wp), DIMENSION(knoout), INTENT(  out) ::   pvalsout
+      !!
       INTEGER :: ierr
       INTEGER :: jproc
 #if defined key_mpp_mpi
 INCLUDE 'mpif.h'
-      INTEGER, DIMENSION(jpnij) :: &
-         & irdsp, &
-         & isdsp
+      INTEGER, DIMENSION(jpnij) ::   irdsp, isdsp
+      !!----------------------------------------------------------------------
+      !
       !-----------------------------------------------------------------------
       ! Compute displacements
@@ -559,6 +477,4 @@
          &                pvalsout, koutv, irdsp, mpivar, &
          &                mpi_comm_opa, ierr )
-#elif defined key_mpp_shmem
-error "Only MPI support for MPP in NEMOVAR"
 #else
       !-----------------------------------------------------------------------
@@ -567,6 +483,7 @@
       pvalsout = pvalsin
 #endif
-      
+      !
    END SUBROUTINE mpp_alltoallv_real
 
+   !!======================================================================
 END MODULE obs_mpp
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/lbclnk.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/lbclnk.F90	(revision 2334)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/lbclnk.F90	(revision 2335)
@@ -4,32 +4,32 @@
    !! Ocean        : lateral boundary conditions
    !!=====================================================================
+   !! History :  OPA  ! 1997-06  (G. Madec)     Original code
+   !!   NEMO     1.0  ! 2002-09  (G. Madec)     F90: Free form and module
+   !!            3.2  ! 2009-03  (R. Benshila)  External north fold treatment  
+   !!----------------------------------------------------------------------
+#if   defined key_mpp_mpi
+   !!----------------------------------------------------------------------
+   !!   'key_mpp_mpi'             MPI massively parallel processing library
+   !!----------------------------------------------------------------------
+   !!   lbc_lnk      : generic interface for mpp_lnk_3d and mpp_lnk_2d routines defined in lib_mpp
+   !!   lbc_lnk_e    : generic interface for mpp_lnk_2d_e routine defined in lib_mpp
+   !!----------------------------------------------------------------------
+   USE lib_mpp          ! distributed memory computing library
+
+   INTERFACE lbc_lnk
+      MODULE PROCEDURE mpp_lnk_3d_gather, mpp_lnk_3d, mpp_lnk_2d
+   END INTERFACE
+
+   INTERFACE lbc_lnk_e
+      MODULE PROCEDURE mpp_lnk_2d_e
+   END INTERFACE
+
+   PUBLIC lbc_lnk       ! ocean lateral boundary conditions
+   PUBLIC lbc_lnk_e
+
+   !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-#if   defined key_mpp_mpi   ||   defined key_mpp_shmem
-   !!----------------------------------------------------------------------
-   !!   'key_mpp_mpi'     OR      MPI massively parallel processing library
-   !!   'key_mpp_shmem'         SHMEM massively parallel processing library
-   !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
-   !!   lbc_lnk      : generic interface for mpp_lnk_3d and mpp_lnk_2d
-   !!                  routines defined in lib_mpp
-   !!   lbc_lnk_e    : generic interface for mpp_lnk_2d_e
-   !!                   routinee defined in lib_mpp
-   !!----------------------------------------------------------------------
-   !! * Modules used
-   USE lib_mpp          ! distributed memory computing library
-
-   INTERFACE lbc_lnk
-      MODULE PROCEDURE mpp_lnk_3d_gather, mpp_lnk_3d, mpp_lnk_2d
-   END INTERFACE
-
-   INTERFACE lbc_lnk_e
-      MODULE PROCEDURE mpp_lnk_2d_e
-   END INTERFACE
-
-   PUBLIC lbc_lnk       ! ocean lateral boundary conditions
-   PUBLIC lbc_lnk_e
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 
@@ -39,10 +39,7 @@
    !!----------------------------------------------------------------------
    !!   lbc_lnk      : generic interface for lbc_lnk_3d and lbc_lnk_2d
-   !!   lbc_lnk_3d   : set the lateral boundary condition on a 3D variable
-   !!                  on OPA ocean mesh
-   !!   lbc_lnk_2d   : set the lateral boundary condition on a 2D variable
-   !!                  on OPA ocean mesh
-   !!----------------------------------------------------------------------
-   !! * Modules used
+   !!   lbc_lnk_3d   : set the lateral boundary condition on a 3D variable on ocean mesh
+   !!   lbc_lnk_2d   : set the lateral boundary condition on a 2D variable on ocean mesh
+   !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers   
    USE dom_oce         ! ocean space and time domain 
@@ -61,8 +58,12 @@
    END INTERFACE
 
-   PUBLIC lbc_lnk       ! ocean/ice  lateral boundary conditions
-   PUBLIC  lbc_lnk_e 
-   !!----------------------------------------------------------------------
-
+   PUBLIC   lbc_lnk       ! ocean/ice  lateral boundary conditions
+   PUBLIC   lbc_lnk_e 
+   
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -71,29 +72,20 @@
       !!                  ***  ROUTINE lbc_lnk_3d_gather  ***
       !!
-      !! ** Purpose :   set lateral boundary conditions (non mpp case)
-      !!
-      !! ** Method  :
-      !!
-      !! History :
-      !!        !  97-06  (G. Madec)     Original code
-      !!   8.5  !  02-09  (G. Madec)     F90: Free form and module
-      !!        !  09-03  (R. Benshila)  External north fold treatment  
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      CHARACTER(len=1), INTENT( in ) ::   &
-         cd_type1, cd_type2       ! nature of pt3d grid-points
-      !             !   = T ,  U , V , F or W  gridpoints
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) ::   &
-         pt3d1, pt3d2          ! 3D array on which the boundary condition is applied
-      REAL(wp), INTENT( in ) ::   &
-         psgn          ! control of the sign change
-      !             !   =-1 , the sign is changed if north fold boundary
-      !             !   = 1 , no sign change
-      !             !   = 0 , no sign change and > 0 required (use the inner
-      !             !         row/column if closed boundary)
-
+      !! ** Purpose :   set lateral boundary conditions on two 3D arrays (non mpp case)
+      !!
+      !! ** Method  :   psign = -1 :    change the sign across the north fold
+      !!                      =  1 : no change of the sign across the north fold
+      !!                      =  0 : no change of the sign across the north fold and
+      !!                             strict positivity preserved: use inner row/column
+      !!                             for closed boundaries.
+      !!----------------------------------------------------------------------
+      CHARACTER(len=1)                , INTENT(in   ) ::   cd_type1, cd_type2   ! nature of pt3d grid-points
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pt3d1   , pt3d2      ! 3D array on which the lbc is applied
+      REAL(wp)                        , INTENT(in   ) ::   psgn                 ! control of the sign 
+      !!----------------------------------------------------------------------
+      !
       CALL lbc_lnk_3d( pt3d1, cd_type1, psgn)
       CALL lbc_lnk_3d( pt3d2, cd_type2, psgn)
-
+      !
    END SUBROUTINE lbc_lnk_3d_gather
 
@@ -103,36 +95,23 @@
       !!                  ***  ROUTINE lbc_lnk_3d  ***
       !!
-      !! ** Purpose :   set lateral boundary conditions (non mpp case)
-      !!
-      !! ** Method  :
-      !!
-      !! History :
-      !!        !  97-06  (G. Madec)  Original code
-      !!   8.5  !  02-09  (G. Madec)  F90: Free form and module
-      !!        !  09-03  (R. Benshila)  External north fold treatment  
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      CHARACTER(len=1), INTENT( in ) ::   &
-         cd_type       ! nature of pt3d grid-points
-      !             !   = T ,  U , V , F or W  gridpoints
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) ::   &
-         pt3d          ! 3D array on which the boundary condition is applied
-      REAL(wp), INTENT( in ) ::   &
-         psgn          ! control of the sign change
-      !             !   =-1 , the sign is changed if north fold boundary
-      !             !   = 1 , no sign change
-      !             !   = 0 , no sign change and > 0 required (use the inner
-      !             !         row/column if closed boundary)
-      CHARACTER(len=3), INTENT( in ), OPTIONAL ::    &
-         cd_mpp        ! fill the overlap area only (here do nothing)
-      REAL(wp)        , INTENT(in   ), OPTIONAL           ::   pval      ! background value (used at closed boundaries)
-
-      !! * Local declarations
+      !! ** Purpose :   set lateral boundary conditions on a 3D array (non mpp case)
+      !!
+      !! ** Method  :   psign = -1 :    change the sign across the north fold
+      !!                      =  1 : no change of the sign across the north fold
+      !!                      =  0 : no change of the sign across the north fold and
+      !!                             strict positivity preserved: use inner row/column
+      !!                             for closed boundaries.
+      !!----------------------------------------------------------------------
+      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)           ::   pt3d      ! 3D array on which the lbc is applied
+      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign 
+      CHARACTER(len=3)                , INTENT(in   ), OPTIONAL ::   cd_mpp    ! MPP only (here do nothing)
+      REAL(wp)                        , INTENT(in   ), OPTIONAL ::   pval      ! background value (for closed boundaries)
+      !!
       REAL(wp) ::   zland
-
-      IF( PRESENT( pval ) ) THEN      ! set land value (zero by default)
-         zland = pval
-      ELSE
-         zland = 0.e0
+      !!----------------------------------------------------------------------
+
+      IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value (zero by default)
+      ELSE                         ;   zland = 0.e0
       ENDIF
 
@@ -142,5 +121,5 @@
          ! this is in mpp case. In this module, just do nothing
       ELSE
-
+         !
          !                                     !  East-West boundaries
          !                                     ! ======================
@@ -161,5 +140,5 @@
             !
          END SELECT
-
+         !
          !                                     ! North-South boundaries
          !                                     ! ======================
@@ -196,7 +175,7 @@
             !
          END SELECT
-
-      ENDIF
-
+         !
+      ENDIF
+      !
    END SUBROUTINE lbc_lnk_3d
 
@@ -206,36 +185,23 @@
       !!                 ***  ROUTINE lbc_lnk_2d  ***
       !!
-      !! ** Purpose :   set lateral boundary conditions (non mpp case)
-      !!
-      !! ** Method  :
-      !!
-      !! History :
-      !!        !  97-06  (G. Madec)  Original code
-      !!        !  01-05  (E. Durand)  correction
-      !!   8.5  !  02-09  (G. Madec)  F90: Free form and module
-      !!        !  09-03  (R. Benshila)  External north fold treatment  
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      CHARACTER(len=1), INTENT( in ) ::   &
-         cd_type       ! nature of pt2d grid-point
-         !             !   = T , U , V , F or W  gridpoints
-         !             !   = I sea-ice U-V gridpoint (= F ocean grid point with indice shift)
-      REAL(wp), INTENT( in ) ::   &
-         psgn          ! control of the sign change
-         !             !   =-1 , the sign is modified following the type of b.c. used
-         !             !   = 1 , no sign change
-      REAL(wp), DIMENSION(jpi,jpj), INTENT( inout ) ::   &
-         pt2d          ! 2D array on which the boundary condition is applied
-      CHARACTER(len=3), INTENT( in ), OPTIONAL ::    &
-         cd_mpp        ! fill the overlap area only (here do nothing)
-      REAL(wp)        , INTENT(in   ), OPTIONAL           ::   pval      ! background value (used at closed boundaries)
-
-      !! * Local declarations
+      !! ** Purpose :   set lateral boundary conditions on a 2D array (non mpp case)
+      !!
+      !! ** Method  :   psign = -1 :    change the sign across the north fold
+      !!                      =  1 : no change of the sign across the north fold
+      !!                      =  0 : no change of the sign across the north fold and
+      !!                             strict positivity preserved: use inner row/column
+      !!                             for closed boundaries.
+      !!----------------------------------------------------------------------
+      CHARACTER(len=1)            , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout)           ::   pt3d      ! 2D array on which the lbc is applied
+      REAL(wp)                    , INTENT(in   )           ::   psgn      ! control of the sign 
+      CHARACTER(len=3)            , INTENT(in   ), OPTIONAL ::   cd_mpp    ! MPP only (here do nothing)
+      REAL(wp)                    , INTENT(in   ), OPTIONAL ::   pval      ! background value (for closed boundaries)
+      !!
       REAL(wp) ::   zland
-
-      IF( PRESENT( pval ) ) THEN      ! set land value (zero by default)
-         zland = pval
-      ELSE
-         zland = 0.e0
+      !!----------------------------------------------------------------------
+
+      IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value (zero by default)
+      ELSE                         ;   zland = 0.e0
       ENDIF
 
@@ -244,5 +210,5 @@
          ! this is in mpp case. In this module, just do nothing
       ELSE      
-      
+         !
          !                                     ! East-West boundaries
          !                                     ! ====================
@@ -263,5 +229,5 @@
             !
          END SELECT
- 
+         !
          !                                     ! North-South boundaries
          !                                     ! ======================
@@ -299,7 +265,7 @@
             !
          END SELECT
-
-      ENDIF
-      
+         !
+      ENDIF
+      !    
    END SUBROUTINE lbc_lnk_2d
 
