Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/LBC/lbclnk.F90
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/LBC/lbclnk.F90	(revision 14197)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/LBC/lbclnk.F90	(revision 14644)
@@ -23,4 +23,7 @@
    USE lbcnfd         ! north fold
    USE in_out_manager ! I/O manager
+#if ! defined key_mpi_off
+   USE MPI
+#endif
 
    IMPLICIT NONE
@@ -28,22 +31,14 @@
 
    INTERFACE lbc_lnk
-      MODULE PROCEDURE   mpp_lnk_2d_sp   , mpp_lnk_3d_sp   , mpp_lnk_4d_sp
-      MODULE PROCEDURE   mpp_lnk_2d_dp   , mpp_lnk_3d_dp   , mpp_lnk_4d_dp
-   END INTERFACE
-   INTERFACE lbc_lnk_ptr
-      MODULE PROCEDURE   mpp_lnk_2d_ptr_sp , mpp_lnk_3d_ptr_sp , mpp_lnk_4d_ptr_sp
-      MODULE PROCEDURE   mpp_lnk_2d_ptr_dp , mpp_lnk_3d_ptr_dp , mpp_lnk_4d_ptr_dp
-   END INTERFACE
-   INTERFACE lbc_lnk_multi
-      MODULE PROCEDURE   lbc_lnk_2d_multi_sp , lbc_lnk_3d_multi_sp, lbc_lnk_4d_multi_sp
-      MODULE PROCEDURE   lbc_lnk_2d_multi_dp , lbc_lnk_3d_multi_dp, lbc_lnk_4d_multi_dp
-   END INTERFACE
-   INTERFACE lbc_lnk_nc_multi
-      MODULE PROCEDURE   lbc_lnk_nc_2d_sp, lbc_lnk_nc_3d_sp, lbc_lnk_nc_4d_sp
-      MODULE PROCEDURE   lbc_lnk_nc_2d_dp, lbc_lnk_nc_3d_dp, lbc_lnk_nc_4d_dp
-   END INTERFACE
-   INTERFACE lbc_lnk_nc
-      MODULE PROCEDURE   mpp_lnk_nc_2d_sp, mpp_lnk_nc_3d_sp, mpp_lnk_nc_4d_sp
-      MODULE PROCEDURE   mpp_lnk_nc_2d_dp, mpp_lnk_nc_3d_dp, mpp_lnk_nc_4d_dp
+      MODULE PROCEDURE   lbc_lnk_call_2d_sp, lbc_lnk_call_3d_sp, lbc_lnk_call_4d_sp
+      MODULE PROCEDURE   lbc_lnk_call_2d_dp, lbc_lnk_call_3d_dp, lbc_lnk_call_4d_dp
+   END INTERFACE
+
+   INTERFACE lbc_lnk_pt2pt
+      MODULE PROCEDURE   lbc_lnk_pt2pt_sp, lbc_lnk_pt2pt_dp
+   END INTERFACE
+
+   INTERFACE lbc_lnk_neicoll
+      MODULE PROCEDURE   lbc_lnk_neicoll_sp ,lbc_lnk_neicoll_dp
    END INTERFACE
    !
@@ -52,32 +47,13 @@
    END INTERFACE
 
-   INTERFACE mpp_nfd
-      MODULE PROCEDURE   mpp_nfd_2d_sp    , mpp_nfd_3d_sp    , mpp_nfd_4d_sp
-      MODULE PROCEDURE   mpp_nfd_2d_dp    , mpp_nfd_3d_dp    , mpp_nfd_4d_dp
-      MODULE PROCEDURE   mpp_nfd_2d_ptr_sp, mpp_nfd_3d_ptr_sp, mpp_nfd_4d_ptr_sp
-      MODULE PROCEDURE   mpp_nfd_2d_ptr_dp, mpp_nfd_3d_ptr_dp, mpp_nfd_4d_ptr_dp
-
-   END INTERFACE
-
    PUBLIC   lbc_lnk            ! ocean/ice lateral boundary conditions
-   PUBLIC   lbc_lnk_multi      ! modified ocean/ice lateral boundary conditions
    PUBLIC   lbc_lnk_icb        ! iceberg lateral boundary conditions
-   PUBLIC   lbc_lnk_nc         ! ocean/ice lateral boundary conditions (MPI3 version)
-   PUBLIC   lbc_lnk_nc_multi   ! modified ocean/ice lateral boundary conditions (MPI3 version)
-
-#if   defined key_mpp_mpi
-!$AGRIF_DO_NOT_TREAT
-   INCLUDE 'mpif.h'
-!$AGRIF_END_DO_NOT_TREAT
-#endif
-
-   INTEGER, PUBLIC, PARAMETER ::   jpfillnothing = 1
-   INTEGER, PUBLIC, PARAMETER ::   jpfillcst     = 2
-   INTEGER, PUBLIC, PARAMETER ::   jpfillcopy    = 3
-   INTEGER, PUBLIC, PARAMETER ::   jpfillperio   = 4
-   INTEGER, PUBLIC, PARAMETER ::   jpfillmpi     = 5
-
+
+   REAL(dp), DIMENSION(:), ALLOCATABLE ::   buffsnd_dp, buffrcv_dp   ! MPI send/recv buffers
+   REAL(sp), DIMENSION(:), ALLOCATABLE ::   buffsnd_sp, buffrcv_sp   ! 
+   INTEGER,  DIMENSION(8)              ::   nreq_p2p                 ! request id for MPI_Isend in point-2-point communication
+   
    !! * Substitutions
-#  include "do_loop_substitute.h90"
+   !!#  include "do_loop_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
@@ -88,8 +64,9 @@
 
    !!----------------------------------------------------------------------
-   !!                   ***   load_ptr_(2,3,4)d   ***
+   !!                   ***   lbc_lnk_call_[234]d_[sd]p   ***
    !!
    !!   * Dummy Argument :
-   !!       in    ==>   ptab       ! array to be loaded (2D, 3D or 4D)
+   !!       in    ==>   cdname     ! name of the calling subroutine (for monitoring)
+   !!                   ptab       ! array to be loaded (2D, 3D or 4D)
    !!                   cd_nat     ! nature of pt2d array grid-points
    !!                   psgn       ! sign used across the north fold boundary
@@ -99,406 +76,79 @@
    !!                   kfld       ! number of elements that has been attributed
    !!----------------------------------------------------------------------
-
-   !!----------------------------------------------------------------------
-   !!                  ***   lbc_lnk_(2,3,4)d_multi   ***
-   !!                     ***   load_ptr_(2,3,4)d   ***
-   !!
-   !!   * Argument : dummy argument use in lbc_lnk_multi_... routines
-   !!
-   !!----------------------------------------------------------------------
-
+   !
+   !!----------------------------------------------------------------------
+   !!
+   !!                  ***   lbc_lnk_call_[234]d_[sd]p   ***
+   !!                  ***     load_ptr_[234]d_[sd]p     ***
+   !!
+   !!----------------------------------------------------------------------
    !!
    !!   ----   SINGLE PRECISION VERSIONS
    !!
-#  define SINGLE_PRECISION
-#  define DIM_2d
-#     define ROUTINE_LOAD           load_ptr_2d_sp
-#     define ROUTINE_MULTI          lbc_lnk_2d_multi_sp
-#     include "lbc_lnk_multi_generic.h90"
-#     undef ROUTINE_MULTI
-#     undef ROUTINE_LOAD
-#  undef DIM_2d
-
-#  define DIM_3d
-#     define ROUTINE_LOAD           load_ptr_3d_sp
-#     define ROUTINE_MULTI          lbc_lnk_3d_multi_sp
-#     include "lbc_lnk_multi_generic.h90"
-#     undef ROUTINE_MULTI
-#     undef ROUTINE_LOAD
-#  undef DIM_3d
-
-#  define DIM_4d
-#     define ROUTINE_LOAD           load_ptr_4d_sp
-#     define ROUTINE_MULTI          lbc_lnk_4d_multi_sp
-#     include "lbc_lnk_multi_generic.h90"
-#     undef ROUTINE_MULTI
-#     undef ROUTINE_LOAD
-#  undef DIM_4d
-#  undef SINGLE_PRECISION
+#define PRECISION sp
+# define DIM_2d
+#    include "lbc_lnk_call_generic.h90"
+# undef  DIM_2d
+# define DIM_3d
+#    include "lbc_lnk_call_generic.h90"
+# undef  DIM_3d
+# define DIM_4d
+#    include "lbc_lnk_call_generic.h90"
+# undef  DIM_4d
+#undef PRECISION
    !!
    !!   ----   DOUBLE PRECISION VERSIONS
    !!
-
-#  define DIM_2d
-#     define ROUTINE_LOAD           load_ptr_2d_dp
-#     define ROUTINE_MULTI          lbc_lnk_2d_multi_dp
-#     include "lbc_lnk_multi_generic.h90"
-#     undef ROUTINE_MULTI
-#     undef ROUTINE_LOAD
-#  undef DIM_2d
-
-#  define DIM_3d
-#     define ROUTINE_LOAD           load_ptr_3d_dp
-#     define ROUTINE_MULTI          lbc_lnk_3d_multi_dp
-#     include "lbc_lnk_multi_generic.h90"
-#     undef ROUTINE_MULTI
-#     undef ROUTINE_LOAD
-#  undef DIM_3d
-
-#  define DIM_4d
-#     define ROUTINE_LOAD           load_ptr_4d_dp
-#     define ROUTINE_MULTI          lbc_lnk_4d_multi_dp
-#     include "lbc_lnk_multi_generic.h90"
-#     undef ROUTINE_MULTI
-#     undef ROUTINE_LOAD
-#  undef DIM_4d
-
-   !!----------------------------------------------------------------------
-   !!                   ***  routine mpp_lnk_(2,3,4)d  ***
-   !!
-   !!   * Argument : dummy argument use in mpp_lnk_... routines
-   !!                ptab      :   array or pointer of arrays on which the boundary condition is applied
+#define PRECISION dp
+# define DIM_2d
+#    include "lbc_lnk_call_generic.h90"
+# undef  DIM_2d
+# define DIM_3d
+#    include "lbc_lnk_call_generic.h90"
+# undef  DIM_3d
+# define DIM_4d
+#    include "lbc_lnk_call_generic.h90"
+# undef  DIM_4d
+#undef PRECISION
+   !
+   !!----------------------------------------------------------------------
+   !!                   ***  lbc_lnk_pt2pt_[sd]p  ***
+   !!                  ***  lbc_lnk_neicoll_[sd]p  ***
+   !!
+   !!   * Argument : dummy argument use in lbc_lnk_... routines
+   !!                cdname    :   name of the calling subroutine (for monitoring)
+   !!                ptab      :   pointer of arrays on which the boundary condition is applied
    !!                cd_nat    :   nature of array grid-points
    !!                psgn      :   sign used across the north fold boundary
-   !!                kfld      :   optional, number of pt3d arrays
+   !!                kfld      :   number of pt3d arrays
    !!                kfillmode :   optional, method to be use to fill the halos (see jpfill* variables)
    !!                pfillval  :   optional, background value (used with jpfillcopy)
    !!----------------------------------------------------------------------
-   !
-   !                       !==  2D array and array of 2D pointer  ==!
-   !
    !!
    !!   ----   SINGLE PRECISION VERSIONS
    !!
-# define SINGLE_PRECISION
-#  define DIM_2d
-#     define ROUTINE_LNK           mpp_lnk_2d_sp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     define MULTI
-#     define ROUTINE_LNK           mpp_lnk_2d_ptr_sp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     undef MULTI
-#  undef DIM_2d
-   !
-   !                       !==  3D array and array of 3D pointer  ==!
-   !
-#  define DIM_3d
-#     define ROUTINE_LNK           mpp_lnk_3d_sp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     define MULTI
-#     define ROUTINE_LNK           mpp_lnk_3d_ptr_sp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     undef MULTI
-#  undef DIM_3d
-   !
-   !                       !==  4D array and array of 4D pointer  ==!
-   !
-#  define DIM_4d
-#     define ROUTINE_LNK           mpp_lnk_4d_sp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     define MULTI
-#     define ROUTINE_LNK           mpp_lnk_4d_ptr_sp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     undef MULTI
-#  undef DIM_4d
-# undef SINGLE_PRECISION
-
+#define PRECISION sp
+#  define MPI_TYPE MPI_REAL
+#  define BUFFSND buffsnd_sp
+#  define BUFFRCV buffrcv_sp
+#  include "lbc_lnk_pt2pt_generic.h90"
+#  include "lbc_lnk_neicoll_generic.h90"
+#  undef MPI_TYPE
+#  undef BUFFSND
+#  undef BUFFRCV
+#undef PRECISION
    !!
    !!   ----   DOUBLE PRECISION VERSIONS
    !!
-#  define DIM_2d
-#     define ROUTINE_LNK           mpp_lnk_2d_dp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     define MULTI
-#     define ROUTINE_LNK           mpp_lnk_2d_ptr_dp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     undef MULTI
-#  undef DIM_2d
-   !
-   !                       !==  3D array and array of 3D pointer  ==!
-   !
-#  define DIM_3d
-#     define ROUTINE_LNK           mpp_lnk_3d_dp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     define MULTI
-#     define ROUTINE_LNK           mpp_lnk_3d_ptr_dp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     undef MULTI
-#  undef DIM_3d
-   !
-   !                       !==  4D array and array of 4D pointer  ==!
-   !
-#  define DIM_4d
-#     define ROUTINE_LNK           mpp_lnk_4d_dp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     define MULTI
-#     define ROUTINE_LNK           mpp_lnk_4d_ptr_dp
-#     include "mpp_lnk_generic.h90"
-#     undef ROUTINE_LNK
-#     undef MULTI
-#  undef DIM_4d
-
-   !!----------------------------------------------------------------------
-   !!                   ***   load_ptr_(2,3,4)d   ***
-   !!
-   !!   * Dummy Argument :
-   !!       in    ==>   ptab       ! array to be loaded (2D, 3D or 4D)
-   !!                   cd_nat     ! nature of pt2d array grid-points
-   !!                   psgn       ! sign used across the north fold boundary
-   !!       inout <=>   ptab_ptr   ! array of 2D, 3D or 4D pointers
-   !!                   cdna_ptr   ! nature of ptab array grid-points
-   !!                   psgn_ptr   ! sign used across the north fold boundary
-   !!                   kfld       ! number of elements that has been attributed
-   !!----------------------------------------------------------------------
-
-   !!----------------------------------------------------------------------
-   !!                  ***   lbc_lnk_nc(2,3,4)d_multi   ***
-   !!                     ***   load_ptr_(2,3,4)d   ***
-   !!
-   !!   * Argument : dummy argument use in lbc_lnk_nc_multi_... routines
-   !!
-   !!----------------------------------------------------------------------
-
-   !!
-   !!   ----   SINGLE PRECISION VERSIONS
-   !!
-#  define SINGLE_PRECISION
-#  define DIM_2d
-#     define ROUTINE_NC_LOAD           load_ptr_nc_2d_sp
-#     define ROUTINE_MULTI_NC          lbc_lnk_nc_2d_sp
-#     include "lbc_lnk_nc_generic.h90"
-#     undef ROUTINE_MULTI_NC
-#     undef ROUTINE_NC_LOAD
-#  undef DIM_2d
-
-#  define DIM_3d
-#     define ROUTINE_NC_LOAD           load_ptr_nc_3d_sp
-#     define ROUTINE_MULTI_NC          lbc_lnk_nc_3d_sp
-#     include "lbc_lnk_nc_generic.h90"
-#     undef ROUTINE_MULTI_NC
-#     undef ROUTINE_NC_LOAD
-#  undef DIM_3d
-
-#  define DIM_4d
-#     define ROUTINE_NC_LOAD           load_ptr_nc_4d_sp
-#     define ROUTINE_MULTI_NC          lbc_lnk_nc_4d_sp
-#     include "lbc_lnk_nc_generic.h90"
-#     undef ROUTINE_MULTI_NC
-#     undef ROUTINE_NC_LOAD
-#  undef DIM_4d
-#  undef SINGLE_PRECISION
-   !!
-   !!   ----   DOUBLE PRECISION VERSIONS
-   !!
-
-#  define DIM_2d
-#     define ROUTINE_NC_LOAD           load_ptr_nc_2d_dp
-#     define ROUTINE_MULTI_NC          lbc_lnk_nc_2d_dp
-#     include "lbc_lnk_nc_generic.h90"
-#     undef ROUTINE_MULTI_NC
-#     undef ROUTINE_NC_LOAD
-#  undef DIM_2d
-
-#  define DIM_3d
-#     define ROUTINE_NC_LOAD           load_ptr_nc_3d_dp
-#     define ROUTINE_MULTI_NC          lbc_lnk_nc_3d_dp
-#     include "lbc_lnk_nc_generic.h90"
-#     undef ROUTINE_MULTI_NC
-#     undef ROUTINE_NC_LOAD
-#  undef DIM_3d
-
-#  define DIM_4d
-#     define ROUTINE_NC_LOAD           load_ptr_nc_4d_dp
-#     define ROUTINE_MULTI_NC          lbc_lnk_nc_4d_dp
-#     include "lbc_lnk_nc_generic.h90"
-#     undef ROUTINE_MULTI_NC
-#     undef ROUTINE_NC_LOAD
-#  undef DIM_4d
-
-   !!----------------------------------------------------------------------
-   !!                   ***  routine mpp_lnk_nc_(2,3,4)d  ***
-   !!
-   !!   * Argument : dummy argument use in mpp_lnk_... routines
-   !!                ptab      :   array or pointer of arrays on which the boundary condition is applied
-   !!                cd_nat    :   nature of array grid-points
-   !!                psgn      :   sign used across the north fold boundary
-   !!                kfld      :   optional, number of pt3d arrays
-   !!                kfillmode :   optional, method to be use to fill the halos (see jpfill* variables)
-   !!                pfillval  :   optional, background value (used with jpfillcopy)
-   !!----------------------------------------------------------------------
-   !
-   !                       !==  2D array and array of 2D pointer  ==!
-   !
-   !!
-   !!   ----   SINGLE PRECISION VERSIONS
-   !!
-# define SINGLE_PRECISION
-#  define DIM_2d
-#     define ROUTINE_NC           mpp_lnk_nc_2d_sp
-#     include "mpp_nc_generic.h90"
-#     undef ROUTINE_NC
-#  undef DIM_2d
-   !
-   !                       !==  3D array and array of 3D pointer  ==!
-   !
-#  define DIM_3d
-#     define ROUTINE_NC           mpp_lnk_nc_3d_sp
-#     include "mpp_nc_generic.h90"
-#     undef ROUTINE_NC
-#  undef DIM_3d
-   !
-   !                       !==  4D array and array of 4D pointer  ==!
-   !
-#  define DIM_4d
-#     define ROUTINE_NC           mpp_lnk_nc_4d_sp
-#     include "mpp_nc_generic.h90"
-#     undef ROUTINE_NC
-#  undef DIM_4d
-# undef SINGLE_PRECISION
-
-   !!
-   !!   ----   DOUBLE PRECISION VERSIONS
-   !!
-#  define DIM_2d
-#     define ROUTINE_NC           mpp_lnk_nc_2d_dp
-#     include "mpp_nc_generic.h90"
-#     undef ROUTINE_NC
-#  undef DIM_2d
-   !
-   !                       !==  3D array and array of 3D pointer  ==!
-   !
-#  define DIM_3d
-#     define ROUTINE_NC           mpp_lnk_nc_3d_dp
-#     include "mpp_nc_generic.h90"
-#     undef ROUTINE_NC
-#  undef DIM_3d
-   !
-   !                       !==  4D array and array of 4D pointer  ==!
-   !
-#  define DIM_4d
-#     define ROUTINE_NC           mpp_lnk_nc_4d_dp
-#     include "mpp_nc_generic.h90"
-#     undef ROUTINE_NC
-#  undef DIM_4d
-
-   !!----------------------------------------------------------------------
-   !!                   ***  routine mpp_nfd_(2,3,4)d  ***
-   !!
-   !!   * Argument : dummy argument use in mpp_nfd_... routines
-   !!                ptab      :   array or pointer of arrays on which the boundary condition is applied
-   !!                cd_nat    :   nature of array grid-points
-   !!                psgn      :   sign used across the north fold boundary
-   !!                kfld      :   optional, number of pt3d arrays
-   !!                kfillmode :   optional, method to be use to fill the halos (see jpfill* variables)
-   !!                pfillval  :   optional, background value (used with jpfillcopy)
-   !!----------------------------------------------------------------------
-   !
-   !                       !==  2D array and array of 2D pointer  ==!
-   !
-   !!
-   !!   ----   SINGLE PRECISION VERSIONS
-   !!
-#  define SINGLE_PRECISION
-#  define DIM_2d
-#     define ROUTINE_NFD           mpp_nfd_2d_sp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           mpp_nfd_2d_ptr_sp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     undef MULTI
-#  undef DIM_2d
-   !
-   !                       !==  3D array and array of 3D pointer  ==!
-   !
-#  define DIM_3d
-#     define ROUTINE_NFD           mpp_nfd_3d_sp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           mpp_nfd_3d_ptr_sp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     undef MULTI
-#  undef DIM_3d
-   !
-   !                       !==  4D array and array of 4D pointer  ==!
-   !
-#  define DIM_4d
-#     define ROUTINE_NFD           mpp_nfd_4d_sp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           mpp_nfd_4d_ptr_sp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     undef MULTI
-#  undef DIM_4d
-#  undef SINGLE_PRECISION
-
-   !!
-   !!   ----   DOUBLE PRECISION VERSIONS
-   !!
-#  define DIM_2d
-#     define ROUTINE_NFD           mpp_nfd_2d_dp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           mpp_nfd_2d_ptr_dp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     undef MULTI
-#  undef DIM_2d
-   !
-   !                       !==  3D array and array of 3D pointer  ==!
-   !
-#  define DIM_3d
-#     define ROUTINE_NFD           mpp_nfd_3d_dp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           mpp_nfd_3d_ptr_dp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     undef MULTI
-#  undef DIM_3d
-   !
-   !                       !==  4D array and array of 4D pointer  ==!
-   !
-#  define DIM_4d
-#     define ROUTINE_NFD           mpp_nfd_4d_dp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           mpp_nfd_4d_ptr_dp
-#     include "mpp_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     undef MULTI
-#  undef DIM_4d
-
-   !!======================================================================
-
+#define PRECISION dp
+#  define MPI_TYPE MPI_DOUBLE_PRECISION
+#  define BUFFSND buffsnd_dp
+#  define BUFFRCV buffrcv_dp
+#  include "lbc_lnk_pt2pt_generic.h90"
+#  include "lbc_lnk_neicoll_generic.h90"
+#  undef MPI_TYPE
+#  undef BUFFSND
+#  undef BUFFRCV
+#undef PRECISION
 
    !!======================================================================
@@ -541,12 +191,5 @@
       !!                    jpi    : first dimension of the local subdomain
       !!                    jpj    : second dimension of the local subdomain
-      !!                    kexti  : number of columns for extra outer halo
-      !!                    kextj  : number of rows for extra outer halo
-      !!                    nbondi : mark for "east-west local boundary"
-      !!                    nbondj : mark for "north-south local boundary"
-      !!                    noea   : number for local neighboring processors
-      !!                    nowe   : number for local neighboring processors
-      !!                    noso   : number for local neighboring processors
-      !!                    nono   : number for local neighboring processors
+      !!                    mpinei : number of neighboring domains (starting at 0, -1 if no neighbourg)
       !!----------------------------------------------------------------------
 
