Index: NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/lbcnfd.F90
===================================================================
--- NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/lbcnfd.F90	(revision 12586)
+++ NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/lbcnfd.F90	(revision 13247)
@@ -26,26 +26,43 @@
 
    INTERFACE lbc_nfd
-      MODULE PROCEDURE   lbc_nfd_2d    , lbc_nfd_3d    , lbc_nfd_4d
-      MODULE PROCEDURE   lbc_nfd_2d_ptr, lbc_nfd_3d_ptr, lbc_nfd_4d_ptr
-      MODULE PROCEDURE   lbc_nfd_2d_ext
+      MODULE PROCEDURE   lbc_nfd_2d_sp    , lbc_nfd_3d_sp    , lbc_nfd_4d_sp
+      MODULE PROCEDURE   lbc_nfd_2d_ptr_sp, lbc_nfd_3d_ptr_sp, lbc_nfd_4d_ptr_sp
+      MODULE PROCEDURE   lbc_nfd_2d_ext_sp
+      MODULE PROCEDURE   lbc_nfd_2d_dp    , lbc_nfd_3d_dp    , lbc_nfd_4d_dp
+      MODULE PROCEDURE   lbc_nfd_2d_ptr_dp, lbc_nfd_3d_ptr_dp, lbc_nfd_4d_ptr_dp
+      MODULE PROCEDURE   lbc_nfd_2d_ext_dp
    END INTERFACE
    !
    INTERFACE lbc_nfd_nogather
 !                        ! Currently only 4d array version is needed
-     MODULE PROCEDURE   lbc_nfd_nogather_2d    , lbc_nfd_nogather_3d
-     MODULE PROCEDURE   lbc_nfd_nogather_4d
-     MODULE PROCEDURE   lbc_nfd_nogather_2d_ptr, lbc_nfd_nogather_3d_ptr
+     MODULE PROCEDURE   lbc_nfd_nogather_2d_sp    , lbc_nfd_nogather_3d_sp
+     MODULE PROCEDURE   lbc_nfd_nogather_4d_sp
+     MODULE PROCEDURE   lbc_nfd_nogather_2d_ptr_sp, lbc_nfd_nogather_3d_ptr_sp
+     MODULE PROCEDURE   lbc_nfd_nogather_2d_dp    , lbc_nfd_nogather_3d_dp
+     MODULE PROCEDURE   lbc_nfd_nogather_4d_dp
+     MODULE PROCEDURE   lbc_nfd_nogather_2d_ptr_dp, lbc_nfd_nogather_3d_ptr_dp
 !     MODULE PROCEDURE   lbc_nfd_nogather_4d_ptr
    END INTERFACE
 
-   TYPE, PUBLIC ::   PTR_2D   !: array of 2D pointers (also used in lib_mpp)
-      REAL(wp), DIMENSION (:,:)    , POINTER ::   pt2d
-   END TYPE PTR_2D
-   TYPE, PUBLIC ::   PTR_3D   !: array of 3D pointers (also used in lib_mpp)
-      REAL(wp), DIMENSION (:,:,:)  , POINTER ::   pt3d
-   END TYPE PTR_3D
-   TYPE, PUBLIC ::   PTR_4D   !: array of 4D pointers (also used in lib_mpp)
-      REAL(wp), DIMENSION (:,:,:,:), POINTER ::   pt4d
-   END TYPE PTR_4D
+   TYPE, PUBLIC ::   PTR_2D_dp   !: array of 2D pointers (also used in lib_mpp)
+      REAL(dp), DIMENSION (:,:)    , POINTER ::   pt2d
+   END TYPE PTR_2D_dp
+   TYPE, PUBLIC ::   PTR_3D_dp   !: array of 3D pointers (also used in lib_mpp)
+      REAL(dp), DIMENSION (:,:,:)  , POINTER ::   pt3d
+   END TYPE PTR_3D_dp
+   TYPE, PUBLIC ::   PTR_4D_dp   !: array of 4D pointers (also used in lib_mpp)
+      REAL(dp), DIMENSION (:,:,:,:), POINTER ::   pt4d
+   END TYPE PTR_4D_dp
+
+   TYPE, PUBLIC ::   PTR_2D_sp   !: array of 2D pointers (also used in lib_mpp)
+      REAL(sp), DIMENSION (:,:)    , POINTER ::   pt2d
+   END TYPE PTR_2D_sp
+   TYPE, PUBLIC ::   PTR_3D_sp   !: array of 3D pointers (also used in lib_mpp)
+      REAL(sp), DIMENSION (:,:,:)  , POINTER ::   pt3d
+   END TYPE PTR_3D_sp
+   TYPE, PUBLIC ::   PTR_4D_sp   !: array of 4D pointers (also used in lib_mpp)
+      REAL(sp), DIMENSION (:,:,:,:), POINTER ::   pt4d
+   END TYPE PTR_4D_sp
+
 
    PUBLIC   lbc_nfd            ! north fold conditions
@@ -76,12 +93,16 @@
    !!----------------------------------------------------------------------
    !
-   !                       !==  2D array and array of 2D pointer  ==!
-   !
-#  define DIM_2d
-#     define ROUTINE_NFD           lbc_nfd_2d
-#     include "lbc_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           lbc_nfd_2d_ptr
+   !                       !==  SINGLE PRECISION VERSIONS
+   !
+   !
+   !                       !==  2D array and array of 2D pointer  ==!
+   !
+#  define SINGLE_PRECISION
+#  define DIM_2d
+#     define ROUTINE_NFD           lbc_nfd_2d_sp
+#     include "lbc_nfd_generic.h90"
+#     undef ROUTINE_NFD
+#     define MULTI
+#     define ROUTINE_NFD           lbc_nfd_2d_ptr_sp
 #     include "lbc_nfd_generic.h90"
 #     undef ROUTINE_NFD
@@ -92,5 +113,5 @@
    !
 #  define DIM_2d
-#     define ROUTINE_NFD           lbc_nfd_2d_ext
+#     define ROUTINE_NFD           lbc_nfd_2d_ext_sp
 #     include "lbc_nfd_ext_generic.h90"
 #     undef ROUTINE_NFD
@@ -100,22 +121,22 @@
    !
 #  define DIM_3d
-#     define ROUTINE_NFD           lbc_nfd_3d
-#     include "lbc_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           lbc_nfd_3d_ptr
-#     include "lbc_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     undef MULTI
-#  undef DIM_3d
-   !
-   !                       !==  4D array and array of 4D pointer  ==!
-   !
-#  define DIM_4d
-#     define ROUTINE_NFD           lbc_nfd_4d
-#     include "lbc_nfd_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           lbc_nfd_4d_ptr
+#     define ROUTINE_NFD           lbc_nfd_3d_sp
+#     include "lbc_nfd_generic.h90"
+#     undef ROUTINE_NFD
+#     define MULTI
+#     define ROUTINE_NFD           lbc_nfd_3d_ptr_sp
+#     include "lbc_nfd_generic.h90"
+#     undef ROUTINE_NFD
+#     undef MULTI
+#  undef DIM_3d
+   !
+   !                       !==  4D array and array of 4D pointer  ==!
+   !
+#  define DIM_4d
+#     define ROUTINE_NFD           lbc_nfd_4d_sp
+#     include "lbc_nfd_generic.h90"
+#     undef ROUTINE_NFD
+#     define MULTI
+#     define ROUTINE_NFD           lbc_nfd_4d_ptr_sp
 #     include "lbc_nfd_generic.h90"
 #     undef ROUTINE_NFD
@@ -128,31 +149,31 @@
    !
 #  define DIM_2d
-#     define ROUTINE_NFD           lbc_nfd_nogather_2d
-#     include "lbc_nfd_nogather_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           lbc_nfd_nogather_2d_ptr
-#     include "lbc_nfd_nogather_generic.h90"
-#     undef ROUTINE_NFD
-#     undef MULTI
-#  undef DIM_2d
-   !
-   !                       !==  3D array and array of 3D pointer  ==!
-   !
-#  define DIM_3d
-#     define ROUTINE_NFD           lbc_nfd_nogather_3d
-#     include "lbc_nfd_nogather_generic.h90"
-#     undef ROUTINE_NFD
-#     define MULTI
-#     define ROUTINE_NFD           lbc_nfd_nogather_3d_ptr
-#     include "lbc_nfd_nogather_generic.h90"
-#     undef ROUTINE_NFD
-#     undef MULTI
-#  undef DIM_3d
-   !
-   !                       !==  4D array and array of 4D pointer  ==!
-   !
-#  define DIM_4d
-#     define ROUTINE_NFD           lbc_nfd_nogather_4d
+#     define ROUTINE_NFD           lbc_nfd_nogather_2d_sp
+#     include "lbc_nfd_nogather_generic.h90"
+#     undef ROUTINE_NFD
+#     define MULTI
+#     define ROUTINE_NFD           lbc_nfd_nogather_2d_ptr_sp
+#     include "lbc_nfd_nogather_generic.h90"
+#     undef ROUTINE_NFD
+#     undef MULTI
+#  undef DIM_2d
+   !
+   !                       !==  3D array and array of 3D pointer  ==!
+   !
+#  define DIM_3d
+#     define ROUTINE_NFD           lbc_nfd_nogather_3d_sp
+#     include "lbc_nfd_nogather_generic.h90"
+#     undef ROUTINE_NFD
+#     define MULTI
+#     define ROUTINE_NFD           lbc_nfd_nogather_3d_ptr_sp
+#     include "lbc_nfd_nogather_generic.h90"
+#     undef ROUTINE_NFD
+#     undef MULTI
+#  undef DIM_3d
+   !
+   !                       !==  4D array and array of 4D pointer  ==!
+   !
+#  define DIM_4d
+#     define ROUTINE_NFD           lbc_nfd_nogather_4d_sp
 #     include "lbc_nfd_nogather_generic.h90"
 #     undef ROUTINE_NFD
@@ -163,6 +184,101 @@
 !#     undef MULTI
 #  undef DIM_4d
-
-   !!----------------------------------------------------------------------
+#  undef SINGLE_PRECISION
+
+   !!----------------------------------------------------------------------
+   !
+   !                       !==  DOUBLE PRECISION VERSIONS
+   !
+   !
+   !                       !==  2D array and array of 2D pointer  ==!
+   !
+#  define DIM_2d
+#     define ROUTINE_NFD           lbc_nfd_2d_dp
+#     include "lbc_nfd_generic.h90"
+#     undef ROUTINE_NFD
+#     define MULTI
+#     define ROUTINE_NFD           lbc_nfd_2d_ptr_dp
+#     include "lbc_nfd_generic.h90"
+#     undef ROUTINE_NFD
+#     undef MULTI
+#  undef DIM_2d
+   !
+   !                       !==  2D array with extra haloes  ==!
+   !
+#  define DIM_2d
+#     define ROUTINE_NFD           lbc_nfd_2d_ext_dp
+#     include "lbc_nfd_ext_generic.h90"
+#     undef ROUTINE_NFD
+#  undef DIM_2d
+   !
+   !                       !==  3D array and array of 3D pointer  ==!
+   !
+#  define DIM_3d
+#     define ROUTINE_NFD           lbc_nfd_3d_dp
+#     include "lbc_nfd_generic.h90"
+#     undef ROUTINE_NFD
+#     define MULTI
+#     define ROUTINE_NFD           lbc_nfd_3d_ptr_dp
+#     include "lbc_nfd_generic.h90"
+#     undef ROUTINE_NFD
+#     undef MULTI
+#  undef DIM_3d
+   !
+   !                       !==  4D array and array of 4D pointer  ==!
+   !
+#  define DIM_4d
+#     define ROUTINE_NFD           lbc_nfd_4d_dp
+#     include "lbc_nfd_generic.h90"
+#     undef ROUTINE_NFD
+#     define MULTI
+#     define ROUTINE_NFD           lbc_nfd_4d_ptr_dp
+#     include "lbc_nfd_generic.h90"
+#     undef ROUTINE_NFD
+#     undef MULTI
+#  undef DIM_4d
+   !
+   !  lbc_nfd_nogather routines
+   !
+   !                       !==  2D array and array of 2D pointer  ==!
+   !
+#  define DIM_2d
+#     define ROUTINE_NFD           lbc_nfd_nogather_2d_dp
+#     include "lbc_nfd_nogather_generic.h90"
+#     undef ROUTINE_NFD
+#     define MULTI
+#     define ROUTINE_NFD           lbc_nfd_nogather_2d_ptr_dp
+#     include "lbc_nfd_nogather_generic.h90"
+#     undef ROUTINE_NFD
+#     undef MULTI
+#  undef DIM_2d
+   !
+   !                       !==  3D array and array of 3D pointer  ==!
+   !
+#  define DIM_3d
+#     define ROUTINE_NFD           lbc_nfd_nogather_3d_dp
+#     include "lbc_nfd_nogather_generic.h90"
+#     undef ROUTINE_NFD
+#     define MULTI
+#     define ROUTINE_NFD           lbc_nfd_nogather_3d_ptr_dp
+#     include "lbc_nfd_nogather_generic.h90"
+#     undef ROUTINE_NFD
+#     undef MULTI
+#  undef DIM_3d
+   !
+   !                       !==  4D array and array of 4D pointer  ==!
+   !
+#  define DIM_4d
+#     define ROUTINE_NFD           lbc_nfd_nogather_4d_dp
+#     include "lbc_nfd_nogather_generic.h90"
+#     undef ROUTINE_NFD
+!#     define MULTI
+!#     define ROUTINE_NFD           lbc_nfd_nogather_4d_ptr
+!#     include "lbc_nfd_nogather_generic.h90"
+!#     undef ROUTINE_NFD
+!#     undef MULTI
+#  undef DIM_4d
+
+   !!----------------------------------------------------------------------
+
 
 
