Index: NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90
===================================================================
--- NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90	(revision 14769)
+++ NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90	(revision 14770)
@@ -79,9 +79,6 @@
       IF( Agrif_Root() ) THEN
 #endif
-         ! Compatibility WITH old version: 
-         ! jperio = 7 =>  Ni0glo = jpigo_old_version - 2
-         !            =>  jpiglo-1 replaced by Ni0glo+1
-         zlam0 = -REAL( (Ni0glo+1)/2, wp) * 1.e-3 * rn_dx
-         zphi0 = -REAL( (Nj0glo+1)/2, wp) * 1.e-3 * rn_dy   ! +1 for compatibility with old version --> to be replaced by -1 as before
+         zlam0 = -REAL(Ni0glo, wp) * 0.5 * 1.e-3 * rn_dx
+         zphi0 = -REAL(Nj0glo, wp) * 0.5 * 1.e-3 * rn_dy
 #if defined key_agrif 
       ELSE
@@ -89,18 +86,15 @@
 !clem         zlam0  = Agrif_Parent(zlam0) + (Agrif_ix())*Agrif_Parent(rn_dx) * 1.e-5
 !clem         zphi0  = Agrif_Parent(zphi0) + (Agrif_iy())*Agrif_Parent(rn_dy) * 1.e-5
-         ! Compatibility WITH old version: 
-         ! jperio = 0 =>  Ni0glo = jpigo_old_version
-         !            =>  Agrif_parent(jpiglo)-1 replaced by  Agrif_parent(Ni0glo)-1
-         zlam0 = ( 0.5_wp - REAL( ( Agrif_parent(Ni0glo)-1 ) / 2, wp) ) * 1.e-3 * Agrif_irhox() * rn_dx  &
+         zlam0 = ( 0.5_wp - REAL(Ni0glo, wp) * 0.5 ) * 1.e-3 * Agrif_irhox() * rn_dx  &
             &  + ( Agrif_Ix() + nbghostcells - 1 ) * Agrif_irhox() * rn_dx * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dx * 1.e-3
-         zphi0 = ( 0.5_wp - REAL( ( Agrif_parent(Nj0glo)-1 ) / 2, wp) ) * 1.e-3 * Agrif_irhoy() * rn_dy  &
+         zphi0 = ( 0.5_wp - REAL(Nj0glo, wp) * 0.5 ) * 1.e-3 * Agrif_irhoy() * rn_dy  &
             &  + ( Agrif_Iy() + nbghostcells - 1 ) * Agrif_irhoy() * rn_dy * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dy * 1.e-3
       ENDIF
 #endif         
 
-      DO_2D( 1, 1, 1, 1 )
-         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos
-         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos
-         
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+         zti = REAL( mig0(ji), wp ) - 0.5_wp  ! start at i=0.5 in the global grid without halos
+         ztj = REAL( mjg0(jj), wp ) - 0.5_wp  ! start at j=0.5 in the global grid without halos
+          
          plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 *   zti
          plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * ( zti + 0.5_wp )
Index: NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90
===================================================================
--- NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90	(revision 14769)
+++ NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90	(revision 14770)
@@ -40,5 +40,5 @@
 CONTAINS
 
-   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio )
+   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, ldIperio, ldJperio, ldNFold, cdNFtype )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE dom_nam  ***
@@ -52,8 +52,10 @@
       !! ** input   : - namusr_def namelist found in namelist_cfg
       !!----------------------------------------------------------------------
-      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name
-      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution
-      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes 
-      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c. 
+      CHARACTER(len=*), INTENT(out) ::   cd_cfg               ! configuration name
+      INTEGER         , INTENT(out) ::   kk_cfg               ! configuration resolution
+      INTEGER         , INTENT(out) ::   kpi, kpj, kpk        ! global domain sizes 
+      LOGICAL         , INTENT(out) ::   ldIperio, ldJperio   ! i- and j- periodicity
+      LOGICAL         , INTENT(out) ::   ldNFold              ! North pole folding
+      CHARACTER(len=1), INTENT(out) ::   cdNFtype             ! Folding type: T or F
       !
       INTEGER ::   ios       ! Local integer
@@ -83,8 +85,6 @@
       !
       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
-         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
+         kpi = NINT( 300.e3 / rn_dx ) - 3 
+         kpj = NINT( 300.e3 / rn_dy ) - 3
       ELSE                           ! Global Domain size: add nbghostcells + 1 "land" point on each side
          kpi  = nbcellsx + 2 * ( nbghostcells + 1 )
@@ -100,7 +100,9 @@
       zly = kpj*rn_dy*1.e-3
       !
-      IF( Agrif_Root() ) THEN   ;   kperio = 7     ! ICE_AGRIF configuration : bi-periodic basin
-      ELSE                      ;   kperio = 0     ! closed periodicity for the zoom
+      IF( Agrif_Root() ) THEN   ;   ldIperio =  .TRUE.   ;   ldJperio =  .TRUE.     ! ICE_AGRIF configuration : bi-periodic basin
+      ELSE                      ;   ldIperio = .FALSE.   ;   ldJperio = .FALSE.     ! closed periodicity for the zoom
       ENDIF
+      ldNFold  = .FALSE.   ;   cdNFtype = '-'
+      !
       !                             ! control print
       IF(lwp) THEN
@@ -119,6 +121,4 @@
          WRITE(numout,*) '         Coriolis:', ln_corio
          WRITE(numout,*) '   '
-         WRITE(numout,*) '   Lateral boundary condition of the global domain'
-         WRITE(numout,*) '      ICE_AGRIF : bi-periodic basin            jperio = ', kperio
       ENDIF
       !
Index: NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90
===================================================================
--- NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90	(revision 14769)
+++ NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90	(revision 14770)
@@ -20,4 +20,5 @@
    USE ice, ONLY       : at_i_b, a_i_b
    USE icethd_dh       ! for CALL ice_thd_snwblow
+   USE sbc_phy, ONLY : pp_cldf
    !
    USE in_out_manager  ! I/O manager
@@ -118,10 +119,11 @@
       emp_oce (:,:)   = 0._wp   ! uniform value for freshwater budget (E-P)
       qsr_oce (:,:)   = 0._wp   ! uniform value for     solar radiation
-      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar radiation
+      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar heat flux
 
       ! ice variables
       alb_ice (:,:,:) = 0.7_wp  ! useless
       qsr_ice (:,:,:) = 0._wp   ! uniform value for     solar radiation
-      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar radiation
+      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar heat flux
+      dqns_ice(:,:,:) = 0._wp   ! uniform value for non solar heat flux sensitivity for ice
       sprecip (:,:)   = 0._wp   ! uniform value for snow precip
       evap_ice(:,:,:) = 0._wp   ! uniform value for sublimation
