Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/NST/agrif_user.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/NST/agrif_user.F90	(revision 13237)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/NST/agrif_user.F90	(revision 13238)
@@ -635,5 +635,4 @@
       USE Agrif_Util
       USE ice
-      USE par_oce, ONLY : nbghostcells, nbghostcells_x, nbghostcells_y_s
       !
       IMPLICIT NONE
@@ -888,7 +887,6 @@
       nbghostcells_y_n = nbghostcells
       !
-      IF (   jperio == 1  ) nbghostcells_x   = 0
-      IF ( .NOT. lk_south ) nbghostcells_y_s = 0
-PRINT*, 'seb ', narea, jpiglo, nbcellsx, nn_hls, nbghostcells_x
+      IF(   jperio == 1  )   nbghostcells_x   = 0
+      IF( .NOT. lk_south )   nbghostcells_y_s = 0
       ! Some checks
       IF( jpiglo /= nbcellsx + 2 + 2*nn_hls + nbghostcells_x   + nbghostcells_x   )   CALL ctl_stop( 'STOP',    &
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/USR/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/USR/usrdef_nam.F90	(revision 13237)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/USR/usrdef_nam.F90	(revision 13238)
@@ -69,12 +69,11 @@
       kk_cfg = nn_GYRE
       !
-      kpi = 30 * nn_GYRE + 2       ! Global Domain size: add 1 land point on each side
-      kpj = 20 * nn_GYRE + 2
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN
-         kpi  = nbcellsx + 2 * ( nbghostcells_x   + 1 )   ! Global Domain size: add nbghostcells + 1 "land" point on each side
+      IF( Agrif_Root() ) THEN         ! Global Domain size: add 1 land point on each side
+         kpi = 30 * nn_GYRE + 2       !                     
+         kpj = 20 * nn_GYRE + 2
+      ELSE                            ! Global Domain size: add nbghostcells + 1 "land" point on each side
+         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2
          kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2
       ENDIF
-#endif
       kpk = jpkglo
       !                             ! Set the lateral boundary condition of the global domain
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/par_oce.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/par_oce.F90	(revision 13237)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/par_oce.F90	(revision 13238)
@@ -47,10 +47,10 @@
    ! global domain size for AGRIF     !!! * total AGRIF computational domain *
    INTEGER, PUBLIC            ::   nbug_in_agrif_conv_do_not_remove_or_modify = 1 - 1
-   INTEGER, PUBLIC, PARAMETER ::   nbghostcells = 3 !: number of ghost cells: default value
-   INTEGER, PUBLIC            ::   nbghostcells_x   !: number of ghost cells in i-direction
+   INTEGER, PUBLIC, PARAMETER ::   nbghostcells = 3   !: number of ghost cells: default value
+   INTEGER, PUBLIC            ::   nbghostcells_x     !: number of ghost cells in i-direction
    INTEGER, PUBLIC            ::   nbghostcells_y_s   !: number of ghost cells in j-direction at south
-   INTEGER, PUBLIC            ::   nbghostcells_y_n   !: number of ghost cells in j-direction at north                       !: number of ghost cells
-   INTEGER, PUBLIC            ::   nbcellsx   ! = jpiglo - 2 - 2*nbghostcells_x   !: number of cells in i-direction
-   INTEGER, PUBLIC            ::   nbcellsy   ! = jpjglo - 2 - 2*nbghostcells-y   !: number of cells in j-direction
+   INTEGER, PUBLIC            ::   nbghostcells_y_n   !: number of ghost cells in j-direction at north
+   INTEGER, PUBLIC            ::   nbcellsx           !: number of cells in i-direction
+   INTEGER, PUBLIC            ::   nbcellsy           !: number of cells in j-direction
 
    ! local domain size                !!! * local computational domain *
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/CANAL/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/CANAL/MY_SRC/usrdef_nam.F90	(revision 13237)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/CANAL/MY_SRC/usrdef_nam.F90	(revision 13238)
@@ -106,14 +106,12 @@
       kk_cfg = INT( rn_dx )
       !
-      ! Global Domain size:  EW_CANAL global domain is  1800 km x 1800 Km x 5000 m
-      kpi = NINT( rn_domszx / rn_dx ) + 1
-      kpj = NINT( rn_domszy / rn_dy ) + 3
-      kpk = NINT( rn_domszz / rn_dz ) + 1
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN
-         kpi  = nbcellsx + 2 + 2*nbghostcells
-         kpj  = nbcellsy + 2 + 2*nbghostcells
+      IF( Agrif_Root() ) THEN        ! Global Domain size:  EW_CANAL global domain is  1800 km x 1800 Km x 5000 m
+         kpi = NINT( rn_domszx / rn_dx ) + 1
+         kpj = NINT( rn_domszy / rn_dy ) + 3
+      ELSE                           ! Global Domain size: add nbghostcells + 1 "land" point on each side
+         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2
+         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2
       ENDIF
-#endif
+      kpk = MAX( 2, NINT( rn_domszz / rn_dz ) + 1 )
       !
       zh  = (kpk-1)*rn_dz
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90	(revision 13237)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90	(revision 13238)
@@ -82,12 +82,12 @@
       kk_cfg = NINT( rn_dx )
       !
-      IF( Agrif_Root() ) THEN        ! Global Domain size:  ICE_AGRIF domain is  300 km x 300 Km x 10 m
+      IF( Agrif_Root() ) THEN        ! Global Domain size: ICE_AGRIF domain is  300 km x 300 Km x 10 m
          kpi = NINT( 300.e3 / rn_dx ) - 1
          kpj = NINT( 300.e3 / rn_dy ) - 1
-      ELSE
-         kpi = nbcellsx + 2 * ( nbghostcells + 1 )   ! Global Domain size: add nbghostcells + 1 "land" point on each side
-         kpj = nbcellsy + 2 * ( nbghostcells + 1 )
+      ELSE                           ! Global Domain size: add nbghostcells + 1 "land" point on each side
+         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2
+         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2
       ENDIF
-      kpk = 1
+      kpk = 2
       !
 !!      zlx = (kpi-2)*rn_dx*1.e-3
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90	(revision 13237)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90	(revision 13238)
@@ -87,7 +87,7 @@
          kpi = kpi - 2   ! for compatibility with old version (because kerio=7) --> to be removed
          kpj = kpj - 2   ! for compatibility with old version (because kerio=7) --> to be removed
-      ELSE
-         kpi  = nbcellsx + 2 * ( nbghostcells + 1 )   ! Global Domain size: add nbghostcells + 1 "land" point on each side
-         kpj  = nbcellsy + 2 * ( nbghostcells + 1 )
+      ELSE                           ! Global Domain size: add nbghostcells + 1 "land" point on each side
+         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2
+         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2
       ENDIF
       kpk = 2
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/usrdef_nam.F90	(revision 13237)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/tests/VORTEX/MY_SRC/usrdef_nam.F90	(revision 13238)
@@ -84,7 +84,7 @@
          kpi = NINT( 1800.e3  / rn_dx ) + 3  
          kpj = NINT( 1800.e3  / rn_dy ) + 3 
-      ELSE
-         kpi  = nbcellsx + 2 * ( nbghostcells + 1 )   ! Global Domain size: add nbghostcells + 1 "land" point on each side
-         kpj  = nbcellsy + 2 * ( nbghostcells + 1 )
+      ELSE                          ! Global Domain size: add nbghostcells + 1 "land" point on each side
+         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2
+         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2
       ENDIF
       kpk = NINT( 5000._wp / rn_dz ) + 1
