Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/ICE/iceistate.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/ICE/iceistate.F90	(revision 13333)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/ICE/iceistate.F90	(revision 13334)
@@ -33,9 +33,6 @@
    USE fldread        ! read input fields
 
-# if defined key_agrif
-   USE agrif_oce
-   USE agrif_ice
-   USE agrif_ice_interp 
-# endif   
+   USE agrif_oce      ! initial state interpolation
+   USE agrif_ice_interp   
 
    IMPLICIT NONE
@@ -177,8 +174,9 @@
 
       IF( ln_iceini ) THEN
-         !                             !---------------!
-         
-         IF( Agrif_Root() ) THEN
-
+        
+#if defined key_agrif
+         IF ( ( Agrif_Root() ).OR.(.NOT.ln_init_chfrpar ) ) THEN
+#endif
+            !                             !---------------!
             IF( ln_iceini_file )THEN      ! Read a file   !
                !                          !---------------!
@@ -376,40 +374,9 @@
             t1_ice(:,:,:) = t_i (:,:,1,:)
             !
-         
-#if  defined key_agrif
+#if defined key_agrif
          ELSE
- 
-            Agrif_SpecialValue    = -9999.
-            Agrif_UseSpecialValue = .TRUE.
-            CALL Agrif_init_variable(tra_iceini_id,procname=interp_tra_ice)
-            use_sign_north = .TRUE.
-            sign_north = -1.
-            CALL Agrif_init_variable(u_iceini_id  ,procname=interp_u_ice)
-            CALL Agrif_init_variable(v_iceini_id  ,procname=interp_v_ice)
-            Agrif_SpecialValue    = 0._wp
-            use_sign_north = .FALSE.
-            Agrif_UseSpecialValue = .FALSE.
-        ! lbc ???? 
-   ! Here we know : a_i, v_i, v_s, sv_i, oa_i, a_ip, v_ip, t_su, e_s, e_i
-            CALL ice_var_glo2eqv
-            CALL ice_var_zapsmall
-            CALL ice_var_agg(2)
-
-            ! Melt ponds
-            WHERE( a_i > epsi10 )
-               a_ip_frac(:,:,:) = a_ip(:,:,:) / a_i(:,:,:)
-            ELSEWHERE
-               a_ip_frac(:,:,:) = 0._wp
-            END WHERE
-            WHERE( a_ip > 0._wp )       ! ???????    
-               h_ip(:,:,:) = v_ip(:,:,:) / a_ip(:,:,:)
-            ELSEWHERE
-               h_ip(:,:,:) = 0._wp
-            END WHERE   
-
-            tn_ice(:,:,:) = t_su(:,:,:)
-            t1_ice(:,:,:) = t_i (:,:,1,:)
+            CALL  agrif_istate_ice        
+         ENDIF
 #endif
-          ENDIF ! Agrif_Root
       ENDIF ! ln_iceini
       !
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/ICE/icerst.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/ICE/icerst.F90	(revision 13333)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/ICE/icerst.F90	(revision 13334)
@@ -25,4 +25,7 @@
    USE lib_mpp        ! MPP library
    USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
+
+   USE agrif_oce      ! initial state interpolation
+   USE agrif_ice_interp  
 
    IMPLICIT NONE
@@ -185,98 +188,112 @@
       ENDIF
 
-      CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir )
-
-      ! test if v_i exists 
-      id0 = iom_varid( numrir, 'v_i' , ldstop = .FALSE. )
-
-      !                    ! ------------------------------ !
-      IF( id0 > 0 ) THEN   ! == case of a normal restart == !
-         !                 ! ------------------------------ !
+#if defined key_agrif
+      IF( (.NOT.Agrif_Root()).AND.ln_init_chfrpar ) THEN
+         !                 ! -------------------------------- !
+         !                 ! == set ice fields from parent == !
+         !                 ! -------------------------------- !
+         !
+         CALL agrif_istate_ice
+         !
+      ELSE
+#endif
+
+         CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir )
+
+         ! test if v_i exists 
+         id0 = iom_varid( numrir, 'v_i' , ldstop = .FALSE. )
+
+         !                    ! ------------------------------ !
+         IF( id0 > 0 ) THEN   ! == case of a normal restart == !
+            !                 ! ------------------------------ !
          
-         ! Time info
-         CALL iom_get( numrir, 'nn_fsbc', zfice )
-         CALL iom_get( numrir, 'kt_ice' , ziter )    
-         IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter
-         IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1
-
-         ! Control of date
-         IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 )   &
-            &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nit000 in ice restart',  &
-            &                   '   verify the file or rerun with the value 0 for the',        &
-            &                   '   control of time parameter  nrstdt' )
-         IF( NINT(zfice) /= nn_fsbc          .AND. ABS( nrstdt ) == 1 )   &
-            &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nn_fsbc in ice restart',  &
-            &                   '   verify the file or rerun with the value 0 for the',         &
-            &                   '   control of time parameter  nrstdt' )
-
-         ! --- mandatory fields --- ! 
-         CALL iom_get( numrir, jpdom_auto, 'v_i'  , v_i   )
-         CALL iom_get( numrir, jpdom_auto, 'v_s'  , v_s   )
-         CALL iom_get( numrir, jpdom_auto, 'sv_i' , sv_i  )
-         CALL iom_get( numrir, jpdom_auto, 'a_i'  , a_i   )
-         CALL iom_get( numrir, jpdom_auto, 't_su' , t_su  )
-         CALL iom_get( numrir, jpdom_auto, 'u_ice', u_ice, cd_type = 'U', psgn = -1._wp )
-         CALL iom_get( numrir, jpdom_auto, 'v_ice', v_ice, cd_type = 'V', psgn = -1._wp )
-         ! Snow enthalpy
-         DO jk = 1, nlay_s
-            WRITE(zchar1,'(I2.2)') jk
-            znam = 'e_s'//'_l'//zchar1
-            CALL iom_get( numrir, jpdom_auto, znam , z3d )
-            e_s(:,:,jk,:) = z3d(:,:,:)
-         END DO
-         ! Ice enthalpy
-         DO jk = 1, nlay_i
-            WRITE(zchar1,'(I2.2)') jk
-            znam = 'e_i'//'_l'//zchar1
-            CALL iom_get( numrir, jpdom_auto, znam , z3d )
-            e_i(:,:,jk,:) = z3d(:,:,:)
-         END DO
-         ! -- optional fields -- !
-         ! ice age
-         id1 = iom_varid( numrir, 'oa_i' , ldstop = .FALSE. )
-         IF( id1 > 0 ) THEN                       ! fields exist
-            CALL iom_get( numrir, jpdom_auto, 'oa_i', oa_i )
-         ELSE                                     ! start from rest
-            IF(lwp) WRITE(numout,*) '   ==>>   previous run without ice age output then set it to zero'
-            oa_i(:,:,:) = 0._wp
+            ! Time info
+            CALL iom_get( numrir, 'nn_fsbc', zfice )
+            CALL iom_get( numrir, 'kt_ice' , ziter )    
+            IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter
+            IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1
+
+            ! Control of date
+            IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 )   &
+               &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nit000 in ice restart',  &
+               &                   '   verify the file or rerun with the value 0 for the',        &
+               &                   '   control of time parameter  nrstdt' )
+            IF( NINT(zfice) /= nn_fsbc          .AND. ABS( nrstdt ) == 1 )   &
+               &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nn_fsbc in ice restart',  &
+               &                   '   verify the file or rerun with the value 0 for the',         &
+               &                   '   control of time parameter  nrstdt' )
+
+            ! --- mandatory fields --- ! 
+            CALL iom_get( numrir, jpdom_auto, 'v_i'  , v_i   )
+            CALL iom_get( numrir, jpdom_auto, 'v_s'  , v_s   )
+            CALL iom_get( numrir, jpdom_auto, 'sv_i' , sv_i  )
+            CALL iom_get( numrir, jpdom_auto, 'a_i'  , a_i   )
+            CALL iom_get( numrir, jpdom_auto, 't_su' , t_su  )
+            CALL iom_get( numrir, jpdom_auto, 'u_ice', u_ice, cd_type = 'U', psgn = -1._wp )
+            CALL iom_get( numrir, jpdom_auto, 'v_ice', v_ice, cd_type = 'V', psgn = -1._wp )
+            ! Snow enthalpy
+            DO jk = 1, nlay_s
+               WRITE(zchar1,'(I2.2)') jk
+               znam = 'e_s'//'_l'//zchar1
+               CALL iom_get( numrir, jpdom_auto, znam , z3d )
+               e_s(:,:,jk,:) = z3d(:,:,:)
+            END DO
+            ! Ice enthalpy
+            DO jk = 1, nlay_i
+               WRITE(zchar1,'(I2.2)') jk
+               znam = 'e_i'//'_l'//zchar1
+               CALL iom_get( numrir, jpdom_auto, znam , z3d )
+               e_i(:,:,jk,:) = z3d(:,:,:)
+            END DO
+            ! -- optional fields -- !
+            ! ice age
+            id1 = iom_varid( numrir, 'oa_i' , ldstop = .FALSE. )
+            IF( id1 > 0 ) THEN                       ! fields exist
+               CALL iom_get( numrir, jpdom_auto, 'oa_i', oa_i )
+            ELSE                                     ! start from rest
+               IF(lwp) WRITE(numout,*) '   ==>>   previous run without ice age output then set it to zero'
+               oa_i(:,:,:) = 0._wp
+            ENDIF
+            ! melt ponds
+            id2 = iom_varid( numrir, 'a_ip' , ldstop = .FALSE. )
+            IF( id2 > 0 ) THEN                       ! fields exist
+               CALL iom_get( numrir, jpdom_auto, 'a_ip' , a_ip )
+               CALL iom_get( numrir, jpdom_auto, 'v_ip' , v_ip )
+            ELSE                                     ! start from rest
+               IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds output then set it to zero'
+               a_ip(:,:,:) = 0._wp
+               v_ip(:,:,:) = 0._wp
+            ENDIF
+            ! fields needed for Met Office (Jules) coupling
+            IF( ln_cpl ) THEN
+               id3 = iom_varid( numrir, 'cnd_ice' , ldstop = .FALSE. )
+               id4 = iom_varid( numrir, 't1_ice'  , ldstop = .FALSE. )
+               IF( id3 > 0 .AND. id4 > 0 ) THEN         ! fields exist
+                  CALL iom_get( numrir, jpdom_auto, 'cnd_ice', cnd_ice )
+                  CALL iom_get( numrir, jpdom_auto, 't1_ice' , t1_ice  )
+               ELSE                                     ! start from rest
+                  IF(lwp) WRITE(numout,*) '   ==>>   previous run without conductivity output then set it to zero'
+                  cnd_ice(:,:,:) = 0._wp
+                  t1_ice (:,:,:) = rt0
+               ENDIF
+            ENDIF
+
+            CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables
+
+            !                 ! ---------------------------------- !
+         ELSE                 ! == case of a simplified restart == !
+            !                 ! ---------------------------------- !
+            CALL ctl_warn('ice_rst_read: you are using a simplified ice restart')
+            !
+            CALL ice_istate_init
+            CALL ice_istate( nit000, Kbb, Kmm, Kaa )
+            !
+            IF( .NOT.ln_iceini .OR. .NOT.ln_iceini_file ) &
+               &   CALL ctl_stop('STOP', 'ice_rst_read: you need ln_ice_ini=T and ln_iceini_file=T')
+            !
          ENDIF
-         ! melt ponds
-         id2 = iom_varid( numrir, 'a_ip' , ldstop = .FALSE. )
-         IF( id2 > 0 ) THEN                       ! fields exist
-            CALL iom_get( numrir, jpdom_auto, 'a_ip' , a_ip )
-            CALL iom_get( numrir, jpdom_auto, 'v_ip' , v_ip )
-         ELSE                                     ! start from rest
-            IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds output then set it to zero'
-            a_ip(:,:,:) = 0._wp
-            v_ip(:,:,:) = 0._wp
-         ENDIF
-         ! fields needed for Met Office (Jules) coupling
-         IF( ln_cpl ) THEN
-            id3 = iom_varid( numrir, 'cnd_ice' , ldstop = .FALSE. )
-            id4 = iom_varid( numrir, 't1_ice'  , ldstop = .FALSE. )
-            IF( id3 > 0 .AND. id4 > 0 ) THEN         ! fields exist
-               CALL iom_get( numrir, jpdom_auto, 'cnd_ice', cnd_ice )
-               CALL iom_get( numrir, jpdom_auto, 't1_ice' , t1_ice  )
-            ELSE                                     ! start from rest
-               IF(lwp) WRITE(numout,*) '   ==>>   previous run without conductivity output then set it to zero'
-               cnd_ice(:,:,:) = 0._wp
-               t1_ice (:,:,:) = rt0
-            ENDIF
-         ENDIF
-
-         CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables
-
-         !                 ! ---------------------------------- !
-      ELSE                 ! == case of a simplified restart == !
-         !                 ! ---------------------------------- !
-         CALL ctl_warn('ice_rst_read: you are using a simplified ice restart')
-         !
-         CALL ice_istate_init
-         CALL ice_istate( nit000, Kbb, Kmm, Kaa )
-         !
-         IF( .NOT.ln_iceini .OR. .NOT.ln_iceini_file ) &
-            &   CALL ctl_stop('STOP', 'ice_rst_read: you need ln_ice_ini=T and ln_iceini_file=T')
-         !
-      ENDIF
+#if defined key_agrif
+      ENDIF
+#endif
 
    END SUBROUTINE ice_rst_read
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_ice_interp.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_ice_interp.F90	(revision 13333)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_ice_interp.F90	(revision 13334)
@@ -25,4 +25,6 @@
    USE agrif_oce
    USE phycst , ONLY: rt0
+   USE icevar
+   USE sbc_ice, ONLY : tn_ice
    
    IMPLICIT NONE
@@ -30,5 +32,5 @@
 
    PUBLIC   agrif_interp_ice   ! called by agrif_user.F90
-   PUBLIC   interp_tra_ice, interp_u_ice, interp_v_ice  ! called by iceistate.F90
+   PUBLIC   agrif_istate_ice   ! called by icerst.F90
 
    !!----------------------------------------------------------------------
@@ -39,4 +41,53 @@
 
 CONTAINS
+
+   SUBROUTINE agrif_istate_ice
+      !!-----------------------------------------------------------------------
+      !!                 *** ROUTINE agrif_istate_ice  ***
+      !!
+      !!  ** Method  : Set initial ice fields from parent grid
+      !!
+      !!-----------------------------------------------------------------------
+      IF(lwp) WRITE(numout,*) ' '
+      IF(lwp) WRITE(numout,*) 'Agrif_istate_ice : interp child ice initial state from parent'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~'
+      IF(lwp) WRITE(numout,*) ' '
+
+      ! Set a_i, v_i, v_s, sv_i, oa_i, a_ip, v_ip, t_su, e_s, e_i:
+      Agrif_SpecialValue    = -9999.
+      Agrif_UseSpecialValue = .TRUE.
+      CALL Agrif_init_variable(tra_iceini_id,procname=interp_tra_ice)
+      !
+      ! Set u_ice, v_ice:
+      use_sign_north = .TRUE.
+      sign_north = -1.
+      Agrif_UseSpecialValue = .TRUE.
+      CALL Agrif_init_variable(u_iceini_id  ,procname=interp_u_ice)
+      CALL Agrif_init_variable(v_iceini_id  ,procname=interp_v_ice)
+      Agrif_SpecialValue = 0._wp
+      use_sign_north = .FALSE.
+      Agrif_UseSpecialValue = .FALSE.
+      ! lbc ????
+      ! JC: do we really need the 3 lines below ?
+      CALL ice_var_glo2eqv
+      CALL ice_var_zapsmall
+      CALL ice_var_agg(2)
+
+      ! Melt ponds
+      WHERE( a_i > epsi10 )
+         a_ip_frac(:,:,:) = a_ip(:,:,:) / a_i(:,:,:)
+      ELSEWHERE
+         a_ip_frac(:,:,:) = 0._wp
+      END WHERE
+      WHERE( a_ip > 0._wp )       ! ???????    
+         h_ip(:,:,:) = v_ip(:,:,:) / a_ip(:,:,:)
+      ELSEWHERE
+         h_ip(:,:,:) = 0._wp
+      END WHERE   
+
+      tn_ice(:,:,:) = t_su(:,:,:)
+      t1_ice(:,:,:) = t_i (:,:,1,:) 
+
+   END SUBROUTINE agrif_istate_ice
 
    SUBROUTINE agrif_interp_ice( cd_type, kiter, kitermax )
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce.F90	(revision 13333)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce.F90	(revision 13334)
@@ -116,5 +116,4 @@
       !
    END FUNCTION agrif_oce_alloc
-
 #endif
    !!======================================================================
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_interp.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_interp.F90	(revision 13333)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_interp.F90	(revision 13334)
@@ -46,5 +46,5 @@
    PUBLIC   interpe3t, interpglamt, interpgphit
    PUBLIC   interpht0, interpmbkt
-   PUBLIC   agrif_initts, agrif_initssh
+   PUBLIC   agrif_istate_oce, agrif_istate_ssh   ! called by icestate.F90 and domvvl.F90
 
    INTEGER ::   bdy_tinterp = 0
@@ -56,4 +56,102 @@
    !!----------------------------------------------------------------------
 CONTAINS
+
+   SUBROUTINE Agrif_istate_oce( Kbb, Kmm, Kaa )
+      !!----------------------------------------------------------------------
+      !!                 *** ROUTINE agrif_istate_oce ***
+      !!
+      !!                 set initial t, s, u, v, ssh from parent
+      !!----------------------------------------------------------------------
+      !
+      IMPLICIT NONE
+      !
+      INTEGER, INTENT(in)  :: Kbb, Kmm, Kaa
+      INTEGER :: jn
+      !!----------------------------------------------------------------------
+      IF(lwp) WRITE(numout,*) ' '
+      IF(lwp) WRITE(numout,*) 'Agrif_istate_oce : interp child initial state from parent'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~'
+      IF(lwp) WRITE(numout,*) ' '
+
+      IF ( ln_rstart ) & 
+         & CALL ctl_stop('AGRIF hot start should be desactivated in restarting mode')
+
+      IF ( .NOT.Agrif_Parent(ln_1st_euler) ) & 
+         & CALL ctl_stop('AGRIF hot start requires to force Euler first step on parent')
+
+      l_ini_child           = .TRUE.
+      Agrif_SpecialValue    = 0.0_wp
+      Agrif_UseSpecialValue = .TRUE.
+
+      ts(:,:,:,:,:) = 0.0_wp
+      uu(:,:,:,:)   = 0.0_wp
+      vv(:,:,:,:)   = 0.0_wp 
+      ssh(:,:,:)    = 0._wp
+       
+      Krhs_a = Kbb   ;   Kmm_a = Kbb
+
+      CALL Agrif_Init_Variable(tsini_id, procname=interptsn)
+      CALL Agrif_Init_Variable(sshini_id, procname=interpsshn)
+
+      Agrif_UseSpecialValue = ln_spc_dyn
+      use_sign_north = .TRUE.
+      sign_north = -1._wp
+      CALL Agrif_Init_Variable(uini_id , procname=interpun )
+      CALL Agrif_Init_Variable(vini_id , procname=interpvn )
+      use_sign_north = .FALSE.
+
+      Agrif_UseSpecialValue = .FALSE.
+      l_ini_child           = .FALSE.
+
+      Krhs_a = Kaa   ;   Kmm_a = Kmm
+
+      ssh(:,:,Kbb) = ssh(:,:,Kbb) * tmask(:,:,1)
+
+      DO jn = 1, jpts
+         ts(:,:,:,jn,Kbb) = ts(:,:,:,jn,Kbb) * tmask(:,:,:)
+      END DO
+      uu(:,:,:,Kbb) = uu(:,:,:,Kbb) * umask(:,:,:)     
+      vv(:,:,:,Kbb) = vv(:,:,:,Kbb) * vmask(:,:,:) 
+
+      CALL lbc_lnk_multi( 'agrif_istate_oce', uu(:,:,:  ,Kbb), 'U', -1.0_wp , vv(:,:,:,Kbb), 'V', -1.0_wp )
+      CALL lbc_lnk( 'agrif_istate_oce', ts(:,:,:,:,Kbb), 'T',  1.0_wp )
+      CALL lbc_lnk( 'agrif_istate_oce', ssh(:,:,Kbb), 'T', 1.0_wp )
+
+   END SUBROUTINE Agrif_istate_oce
+
+   SUBROUTINE Agrif_istate_ssh( Kbb, Kmm )
+      !!----------------------------------------------------------------------
+      !!                 *** ROUTINE agrif_istate_ssh ***
+      !!
+      !!                    set initial ssh from parent
+      !!----------------------------------------------------------------------
+      !
+      IMPLICIT NONE
+      !
+      INTEGER, INTENT(in)  :: Kbb, Kmm 
+      !!----------------------------------------------------------------------
+      IF(lwp) WRITE(numout,*) ' '
+      IF(lwp) WRITE(numout,*) 'Agrif_istate_ssh : interp child ssh from parent'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~'
+      IF(lwp) WRITE(numout,*) ' '
+
+      IF ( ln_rstart ) & 
+         & CALL ctl_stop('AGRIF hot start should be desactivated in restarting mode')
+
+      IF ( .NOT.Agrif_Parent(ln_1st_euler) ) & 
+         & CALL ctl_stop('AGRIF hot start requires to force Euler first step on parent')
+
+      Kmm_a = Kmm
+      ssh(:,:,Kmm) = 0._wp
+      l_ini_child = .TRUE.
+      Agrif_SpecialValue    = 0._wp
+      Agrif_UseSpecialValue = .TRUE.
+      CALL Agrif_Init_Variable(sshini_id, procname=interpsshn)
+      Agrif_UseSpecialValue = .FALSE.
+      l_ini_child = .FALSE.
+      CALL lbc_lnk( 'dom_vvl_rst', ssh(:,:,Kmm), 'T', 1._wp )
+
+   END SUBROUTINE Agrif_istate_ssh
+
 
    SUBROUTINE Agrif_tra
@@ -828,5 +926,9 @@
          ptab(i1:i2,j1:j2) = ssh(i1:i2,j1:j2,Kmm_a)
       ELSE
-         hbdy(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) * tmask(i1:i2,j1:j2,1)
+         IF( l_ini_child ) THEN
+            ssh(i1:i2,j1:j2,Kmm_a) = ptab(i1:i2,j1:j2) * tmask(i1:i2,j1:j2,1)
+         ELSE
+            hbdy(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) * tmask(i1:i2,j1:j2,1)
+         ENDIF
       ENDIF
       !
@@ -869,5 +971,5 @@
          END DO
 
-        IF( l_vremap .OR. l_ini_child) THEN
+        IF( l_vremap .OR. l_ini_child ) THEN
          ! Extrapolate thicknesses in partial bottom cells:
          ! Set them to Agrif_SpecialValue (0.). Correct bottom thicknesses are retrieved later on
@@ -1462,42 +1564,4 @@
       !
    END SUBROUTINE interpht0
-
-   
-   SUBROUTINE agrif_initts(tabres,i1,i2,j1,j2,k1,k2,m1,m2,before)
-       INTEGER :: i1, i2, j1, j2, k1, k2, m1, m2
-       REAL(wp):: tabres(i1:i2,j1:j2,k1:k2,m1:m2)
-       LOGICAL :: before
-
-       INTEGER :: jm
-
-       IF (before) THEN
-         DO jm=1,jpts
-             tabres(i1:i2,j1:j2,k1:k2,jm) = ts(i1:i2,j1:j2,k1:k2,jm,Kbb_a)
-         END DO
-       ELSE
-         DO jm=1,jpts
-             ts(i1:i2,j1:j2,k1:k2,jm,Kbb_a)=tabres(i1:i2,j1:j2,k1:k2,jm)
-         END DO
-       ENDIF
-   END SUBROUTINE agrif_initts 
-
-   
-   SUBROUTINE agrif_initssh( ptab, i1, i2, j1, j2, before )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE interpsshn  ***
-      !!----------------------------------------------------------------------  
-      INTEGER                         , INTENT(in   ) ::   i1, i2, j1, j2
-      REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) ::   ptab
-      LOGICAL                         , INTENT(in   ) ::   before
-      !
-      !!----------------------------------------------------------------------  
-      !
-      IF( before) THEN
-         ptab(i1:i2,j1:j2) = ssh(i1:i2,j1:j2,Kbb_a)
-      ELSE
-         ssh(i1:i2,j1:j2,Kbb_a) = ptab(i1:i2,j1:j2)*tmask(i1:i2,j1:j2,1)
-      ENDIF
-      !
-   END SUBROUTINE agrif_initssh
    
 #else
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_user.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_user.F90	(revision 13333)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_user.F90	(revision 13334)
@@ -40,67 +40,4 @@
       !    
    END SUBROUTINE Agrif_initvalues
-
-   
-   SUBROUTINE Agrif_Istate( Kbb, Kmm, Kaa )
-      !!----------------------------------------------------------------------
-      !!                 *** ROUTINE agrif_istate ***
-      !!----------------------------------------------------------------------
-      USE domvvl
-      USE domain
-      USE par_oce
-      USE agrif_oce
-      USE agrif_oce_interp
-      USE oce
-      USE lib_mpp
-      USE lbclnk
-      !
-      IMPLICIT NONE
-      !
-      INTEGER, INTENT(in)  :: Kbb, Kmm, Kaa
-      INTEGER :: jn
-      !!----------------------------------------------------------------------
-      IF(lwp) WRITE(numout,*) ' '
-      IF(lwp) WRITE(numout,*) 'AGRIF: interp child initial state from parent'
-      IF(lwp) WRITE(numout,*) ' '
-
-      l_ini_child           = .TRUE.
-      Agrif_SpecialValue    = 0.0_wp
-      Agrif_UseSpecialValue = .TRUE.
-      uu(:,:,:,:) = 0.0_wp   ;   vv(:,:,:,:) = 0.0_wp   ;   ts(:,:,:,:,:) = 0.0_wp
-       
-      Krhs_a = Kbb   ;   Kmm_a = Kbb
-
-      ! Brutal fix to pas 1x1 refinment. 
-  !    IF(Agrif_Irhox() == 1) THEN
-  !       CALL Agrif_Init_Variable(tsini_id, procname=agrif_initts)
-  !    ELSE
-      CALL Agrif_Init_Variable(tsini_id, procname=interptsn)
-
-  !    ENDIF
-! just for VORTEX because Parent velocities can actually be exactly zero
-!      Agrif_UseSpecialValue = .FALSE.
-      Agrif_UseSpecialValue = ln_spc_dyn
-      use_sign_north = .TRUE.
-      sign_north = -1.
-      CALL Agrif_Init_Variable(uini_id , procname=interpun )
-      CALL Agrif_Init_Variable(vini_id , procname=interpvn )
-      use_sign_north = .FALSE.
-
-      Agrif_UseSpecialValue = .FALSE.
-      l_ini_child           = .FALSE.
-
-      Krhs_a = Kaa   ;   Kmm_a = Kmm
-
-      DO jn = 1, jpts
-         ts(:,:,:,jn,Kbb) = ts(:,:,:,jn,Kbb)*tmask(:,:,:)
-      END DO
-      uu(:,:,:,Kbb) = uu(:,:,:,Kbb) * umask(:,:,:)     
-      vv(:,:,:,Kbb) = vv(:,:,:,Kbb) * vmask(:,:,:) 
-
-
-      CALL lbc_lnk_multi( 'agrif_istate', uu(:,:,:  ,Kbb), 'U', -1.0_wp , vv(:,:,:,Kbb), 'V', -1.0_wp )
-      CALL lbc_lnk(       'agrif_istate', ts(:,:,:,:,Kbb), 'T',  1.0_wp )
-
-   END SUBROUTINE Agrif_Istate
 
    
@@ -285,13 +222,4 @@
       mbkv_parent(:,:) = MAX( NINT( zk(:,:) ), 1 )   
 
-      IF ( ln_init_chfrpar ) THEN 
-         CALL Agrif_Init_Variable(sshini_id, procname=agrif_initssh)
-         CALL lbc_lnk( 'Agrif_Init_Domain', ssh(:,:,Kbb), 'T', 1. )
-         DO jk = 1, jpk
-               e3t(:,:,jk,Kbb) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb)  ) &
-                        &             / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   &
-                        &              + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )
-         END DO
-      ENDIF
 
       ! check if masks and bathymetries match
@@ -904,4 +832,5 @@
          &   'agrif_nemo_init: Agrif children requires jpjglo == nbcellsy + 2 + 2*nn_hls + nbghostcells_y_s + nbghostcells_y_n' )
       IF( ln_use_jattr )   CALL ctl_stop( 'STOP', 'agrif_nemo_init:Agrif children requires ln_use_jattr = .false. ' )
+      !
       !
    END SUBROUTINE agrif_nemo_init
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/DOM/domain.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/DOM/domain.F90	(revision 13333)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/DOM/domain.F90	(revision 13334)
@@ -329,4 +329,6 @@
             nn_it000 = (Agrif_Parent(nn_it000)-1)*Agrif_IRhot() + 1
             nn_itend =  Agrif_Parent(nn_itend)   *Agrif_IRhot()
+            nn_date0 =  Agrif_Parent(ndastp)
+            nn_time0 =  Agrif_Parent(nn_time0)
       ENDIF
 #endif
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/DOM/domvvl.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/DOM/domvvl.F90	(revision 13333)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/DOM/domvvl.F90	(revision 13334)
@@ -25,4 +25,7 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE timing          ! Timing
+
+   USE agrif_oce       ! initial state interpolation
+   USE agrif_oce_interp 
 
    IMPLICIT NONE
@@ -803,14 +806,23 @@
       IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
          !                                   ! ===============
-         IF( ln_rstart ) THEN                   !* Read the restart file
-            CALL rst_read_open                  !  open the restart file if necessary
-            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    )
-            !
-            id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. )
-            id2 = iom_varid( numror, 'e3t_n', ldstop = .FALSE. )
-            id3 = iom_varid( numror, 'tilde_e3t_b', ldstop = .FALSE. )
-            id4 = iom_varid( numror, 'tilde_e3t_n', ldstop = .FALSE. )
-            id5 = iom_varid( numror, 'hdiv_lf', ldstop = .FALSE. )
-            !
+         IF( ln_rstart ) THEN
+                   !* Read the restart file
+#if defined key_agrif
+            IF ( (.NOT.Agrif_root()).AND.(ln_init_chfrpar) ) THEN
+               ! skip reading restart if initialized from parent:
+               id1 = -1 ; id2 = -1 ; id3 = -1 ; id4 = -1 ; id5 = -1
+            ELSE
+#endif
+               CALL rst_read_open                  !  open the restart file if necessary
+               CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    )
+               !
+               id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. )
+               id2 = iom_varid( numror, 'e3t_n', ldstop = .FALSE. )
+               id3 = iom_varid( numror, 'tilde_e3t_b', ldstop = .FALSE. )
+               id4 = iom_varid( numror, 'tilde_e3t_n', ldstop = .FALSE. )
+               id5 = iom_varid( numror, 'hdiv_lf', ldstop = .FALSE. )
+#if defined key_agrif
+            ENDIF
+#endif
             !                             ! --------- !
             !                             ! all cases !
@@ -926,13 +938,14 @@
                ! is set up:
 !               CALL usr_def_istate( gdept_0, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  )
-!               !
+               !
 !               DO jk=1,jpk
 !                  e3t(:,:,jk,Kbb) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb) ) &
-!                     &            / ( ht_0(:,:) + 1._wp -ssmask(:,:) ) * tmask(:,:,jk)
+!                     &                             / ( ht_0(:,:) + 1._wp -ssmask(:,:) ) * tmask(:,:,jk) &
+!                     &             + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )
 !               END DO
 !               e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb)
-                ssh(:,:,Kmm)=0._wp
-                e3t(:,:,:,Kmm)=e3t_0(:,:,:)
-                e3t(:,:,:,Kbb)=e3t_0(:,:,:)
+               ssh(:,:,Kmm)=0._wp
+               e3t(:,:,:,Kmm)=e3t_0(:,:,:)
+               e3t(:,:,:,Kbb)=e3t_0(:,:,:)
                !
             END IF           ! end of ll_wd edits
@@ -944,4 +957,18 @@
             END IF
          ENDIF
+
+#if defined key_agrif
+         IF ( .NOT.Agrif_root().AND.(ln_init_chfrpar) ) THEN
+            ! Interpolate initial ssh from parent:
+            CALL Agrif_istate_ssh( Kbb, Kmm )
+            !
+            DO jk = 1, jpk
+               e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm)  ) &
+                 &                              / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   &
+                 &              + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )
+            END DO
+            e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm)
+         ENDIF
+#endif
          !
       ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/DOM/istate.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/DOM/istate.F90	(revision 13333)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/DOM/istate.F90	(revision 13334)
@@ -34,8 +34,7 @@
    USE lib_mpp         ! MPP library
    USE restart         ! restart
-#if defined key_agrif
-   USE agrif_oce_interp
-   USE agrif_oce
-#endif   
+
+   USE agrif_oce       ! initial state interpolation
+   USE agrif_oce_interp   
 
    IMPLICIT NONE
@@ -89,58 +88,58 @@
 #endif
 
+      IF ( (.NOT.Agrif_root()).AND.ln_init_chfrpar ) THEN
 #if defined key_agrif
-      IF ( (.NOT.Agrif_root()).AND.ln_init_chfrpar ) THEN
          numror = 0                           ! define numror = 0 -> no restart file to read
          ln_1st_euler = .true.                ! Set time-step indicator at nit000 (euler forward)
          CALL day_init 
-         CALL agrif_istate( Kbb, Kmm, Kaa )   ! Interp from parent
+         CALL agrif_istate_oce( Kbb, Kmm, Kaa )   ! Interp from parent
          !
-         ts  (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb) 
-         ssh (:,:,Kmm)     = ssh(:,:,Kbb)
-         uu   (:,:,:,Kmm)   = uu  (:,:,:,Kbb)
-         vv   (:,:,:,Kmm)   = vv  (:,:,:,Kbb)
+         ts (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb) 
+         ssh(:,:,Kmm)     = ssh(:,:,Kbb)
+         uu (:,:,:,Kmm)   = uu (:,:,:,Kbb)
+         vv (:,:,:,Kmm)   = vv (:,:,:,Kbb)
       ELSE
 #endif
-      IF( ln_rstart ) THEN                    ! Restart from a file
-         !                                    ! -------------------
-         CALL rst_read( Kbb, Kmm )            ! Read the restart file
-         CALL day_init                        ! model calendar (using both namelist and restart infos)
-         !
-      ELSE                                    ! Start from rest
-         !                                    ! ---------------
-         numror = 0                           ! define numror = 0 -> no restart file to read
-         l_1st_euler = .true.                 ! Set time-step indicator at nit000 (euler forward)
-         CALL day_init                        ! model calendar (using both namelist and restart infos)
-         !                                    ! Initialization of ocean to zero
-         !
-         IF( ln_tsd_init ) THEN               
-            CALL dta_tsd( nit000, ts(:,:,:,:,Kbb) )       ! read 3D T and S data at nit000
+         IF( ln_rstart ) THEN                    ! Restart from a file
+            !                                    ! -------------------
+            CALL rst_read( Kbb, Kmm )            ! Read the restart file
+            CALL day_init                        ! model calendar (using both namelist and restart infos)
             !
-            ssh(:,:,Kbb)   = 0._wp               ! set the ocean at rest
-            uu  (:,:,:,Kbb) = 0._wp
-            vv  (:,:,:,Kbb) = 0._wp  
+         ELSE                                    ! Start from rest
+            !                                    ! ---------------
+            numror = 0                           ! define numror = 0 -> no restart file to read
+            l_1st_euler = .true.                 ! Set time-step indicator at nit000 (euler forward)
+            CALL day_init                        ! model calendar (using both namelist and restart infos)
+            !                                    ! Initialization of ocean to zero
             !
-            IF( ll_wd ) THEN
-               ssh(:,:,Kbb) =  -ssh_ref  ! Added in 30 here for bathy that adds 30 as Iterative test CEOD 
+            IF( ln_tsd_init ) THEN               
+               CALL dta_tsd( nit000, ts(:,:,:,:,Kbb) )       ! read 3D T and S data at nit000
                !
-               ! Apply minimum wetdepth criterion
+               ssh(:,:,Kbb)   = 0._wp               ! set the ocean at rest
+               uu  (:,:,:,Kbb) = 0._wp
+               vv  (:,:,:,Kbb) = 0._wp  
                !
-               DO_2D( 1, 1, 1, 1 )
-                  IF( ht_0(ji,jj) + ssh(ji,jj,Kbb)  < rn_wdmin1 ) THEN
-                     ssh(ji,jj,Kbb) = tmask(ji,jj,1)*( rn_wdmin1 - (ht_0(ji,jj)) )
-                  ENDIF
-               END_2D
-            ENDIF 
-             !
-         ELSE                                 ! user defined initial T and S
-            DO jk = 1, jpk
-               zgdept(:,:,jk) = gdept(:,:,jk,Kbb)
-            END DO
-            CALL usr_def_istate( zgdept, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  )         
-         ENDIF
-         ts  (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb)       ! set now values from to before ones
-         ssh (:,:,Kmm)     = ssh(:,:,Kbb)   
-         uu   (:,:,:,Kmm)   = uu  (:,:,:,Kbb)
-         vv   (:,:,:,Kmm)   = vv  (:,:,:,Kbb)
+               IF( ll_wd ) THEN
+                  ssh(:,:,Kbb) =  -ssh_ref  ! Added in 30 here for bathy that adds 30 as Iterative test CEOD 
+                  !
+                  ! Apply minimum wetdepth criterion
+                  !
+                  DO_2D( 1, 1, 1, 1 )
+                     IF( ht_0(ji,jj) + ssh(ji,jj,Kbb)  < rn_wdmin1 ) THEN
+                        ssh(ji,jj,Kbb) = tmask(ji,jj,1)*( rn_wdmin1 - (ht_0(ji,jj)) )
+                     ENDIF
+                  END_2D
+               ENDIF 
+               !
+            ELSE                                 ! user defined initial T and S
+               DO jk = 1, jpk
+                  zgdept(:,:,jk) = gdept(:,:,jk,Kbb)
+               END DO
+               CALL usr_def_istate( zgdept, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  )         
+            ENDIF
+            ts  (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb)       ! set now values from to before ones
+            ssh (:,:,Kmm)     = ssh(:,:,Kbb)   
+            uu   (:,:,:,Kmm)   = uu  (:,:,:,Kbb)
+            vv   (:,:,:,Kmm)   = vv  (:,:,:,Kbb)
 
 !!gm POTENTIAL BUG :
@@ -169,8 +168,7 @@
 !!gm 
          ! 
-      ENDIF 
-#if defined key_agrif
+         ENDIF 
+
       ENDIF
-#endif
       ! 
       ! Initialize "now" and "before" barotropic velocities:
Index: /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/tests/VORTEX/MY_SRC/domvvl.F90
===================================================================
--- /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/tests/VORTEX/MY_SRC/domvvl.F90	(revision 13333)
+++ /NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/tests/VORTEX/MY_SRC/domvvl.F90	(revision 13334)
@@ -9,14 +9,7 @@
    !!            3.6  !  2014-11  (P. Mathiot) add ice shelf capability
    !!            4.1  !  2019-08  (A. Coward, D. Storkey) rename dom_vvl_sf_swp -> dom_vvl_sf_update for new timestepping
+   !!            4.x  ! 2020-02  (G. Madec, S. Techene) introduce ssh to h0 ratio
    !!----------------------------------------------------------------------
 
-   !!----------------------------------------------------------------------
-   !!   dom_vvl_init     : define initial vertical scale factors, depths and column thickness
-   !!   dom_vvl_sf_nxt   : Compute next vertical scale factors
-   !!   dom_vvl_sf_update   : Swap vertical scale factors and update the vertical grid
-   !!   dom_vvl_interpol : Interpolate vertical scale factors from one grid point to another
-   !!   dom_vvl_rst      : read/write restart file
-   !!   dom_vvl_ctl      : Check the vvl options
-   !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers
    USE phycst          ! physical constant
@@ -33,12 +26,9 @@
    USE timing          ! Timing
 
+   USE agrif_oce ! initial state interpolation
+   USE agrif_oce_interp
+
    IMPLICIT NONE
    PRIVATE
-
-   PUBLIC  dom_vvl_init       ! called by domain.F90
-   PUBLIC  dom_vvl_zgr        ! called by isfcpl.F90
-   PUBLIC  dom_vvl_sf_nxt     ! called by step.F90
-   PUBLIC  dom_vvl_sf_update  ! called by step.F90
-   PUBLIC  dom_vvl_interpol   ! called by dynnxt.F90
 
    !                                                      !!* Namelist nam_vvl
@@ -63,4 +53,28 @@
    REAL(wp)        , ALLOCATABLE, SAVE, DIMENSION(:,:)   :: frq_rst_hdv                 ! retoring period for low freq. divergence
 
+#if defined key_qco
+   !!----------------------------------------------------------------------
+   !!   'key_qco'      EMPTY MODULE      Quasi-Eulerian vertical coordonate
+   !!----------------------------------------------------------------------
+#else
+   !!----------------------------------------------------------------------
+   !!   Default key      Old management of time varying vertical coordinate
+   !!----------------------------------------------------------------------
+   
+   !!----------------------------------------------------------------------
+   !!   dom_vvl_init     : define initial vertical scale factors, depths and column thickness
+   !!   dom_vvl_sf_nxt   : Compute next vertical scale factors
+   !!   dom_vvl_sf_update   : Swap vertical scale factors and update the vertical grid
+   !!   dom_vvl_interpol : Interpolate vertical scale factors from one grid point to another
+   !!   dom_vvl_rst      : read/write restart file
+   !!   dom_vvl_ctl      : Check the vvl options
+   !!----------------------------------------------------------------------
+
+   PUBLIC  dom_vvl_init       ! called by domain.F90
+   PUBLIC  dom_vvl_zgr        ! called by isfcpl.F90
+   PUBLIC  dom_vvl_sf_nxt     ! called by step.F90
+   PUBLIC  dom_vvl_sf_update  ! called by step.F90
+   PUBLIC  dom_vvl_interpol   ! called by dynnxt.F90
+   
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -135,5 +149,6 @@
       !
    END SUBROUTINE dom_vvl_init
-   !
+
+
    SUBROUTINE dom_vvl_zgr(Kbb, Kmm, Kaa)
       !!----------------------------------------------------------------------
@@ -261,6 +276,6 @@
             IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN
                IF( nn_cfg == 3 ) THEN   ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2
-                  ii0 = 103   ;   ii1 = 111       
-                  ij0 = 128   ;   ij1 = 135   ;   
+                  ii0 = 103 + nn_hls - 1   ;   ii1 = 111 + nn_hls - 1      
+                  ij0 = 128 + nn_hls       ;   ij1 = 135 + nn_hls
                   frq_rst_e3t( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  0.0_wp
                   frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rn_Dt
@@ -450,9 +465,9 @@
             ELSE
                ijk_max = MAXLOC( ze3t(:,:,:) )
-               ijk_max(1) = mig0_oldcmp(ijk_max(1))
-               ijk_max(2) = mjg0_oldcmp(ijk_max(2))
+               ijk_max(1) = ijk_max(1) + nimpp - 1
+               ijk_max(2) = ijk_max(2) + njmpp - 1
                ijk_min = MINLOC( ze3t(:,:,:) )
-               ijk_min(1) = mig0_oldcmp(ijk_min(1))
-               ijk_min(2) = mjg0_oldcmp(ijk_min(2))
+               ijk_min(1) = ijk_min(1) + nimpp - 1
+               ijk_min(2) = ijk_min(2) + njmpp - 1
             ENDIF
             IF (lwp) THEN
@@ -792,13 +807,21 @@
          !                                   ! ===============
          IF( ln_rstart ) THEN                   !* Read the restart file
-            CALL rst_read_open                  !  open the restart file if necessary
-            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    )
-            !
-            id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. )
-            id2 = iom_varid( numror, 'e3t_n', ldstop = .FALSE. )
-            id3 = iom_varid( numror, 'tilde_e3t_b', ldstop = .FALSE. )
-            id4 = iom_varid( numror, 'tilde_e3t_n', ldstop = .FALSE. )
-            id5 = iom_varid( numror, 'hdiv_lf', ldstop = .FALSE. )
-            !
+#if defined key_agrif
+            IF ( (.NOT.Agrif_root()).AND.(ln_init_chfrpar) ) THEN
+               ! skip reading restart if initialized from parent:
+               id1 = -1 ; id2 = -1 ; id3 = -1 ; id4 = -1 ; id5 = -1
+            ELSE
+#endif
+               CALL rst_read_open                  !  open the restart file if necessary
+               CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    )
+               !
+               id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. )
+               id2 = iom_varid( numror, 'e3t_n', ldstop = .FALSE. )
+               id3 = iom_varid( numror, 'tilde_e3t_b', ldstop = .FALSE. )
+               id4 = iom_varid( numror, 'tilde_e3t_n', ldstop = .FALSE. )
+               id5 = iom_varid( numror, 'hdiv_lf', ldstop = .FALSE. )
+#if defined key_agrif
+            ENDIF
+#endif
             !                             ! --------- !
             !                             ! all cases !
@@ -837,6 +860,6 @@
                DO jk = 1, jpk
                   e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm) ) &
-                      &                          / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   &
-                      &          + e3t_0(:,:,jk)                               * (1._wp -tmask(:,:,jk))
+                      &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   &
+                      &            + e3t_0(:,:,jk)                               * (1._wp -tmask(:,:,jk))
                END DO
                e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm)
@@ -911,17 +934,17 @@
             ELSE
                !
-               ! usr_def_istate called here only to get ssh(Kbb) needed to initialize e3t(Kbb) and e3t(Kmm)
-               !
-               CALL usr_def_istate( gdept_0, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  )  
-               !
-               ! usr_def_istate will be called again in istate_init to initialize ts, ssh, u and v
+               ! Just to read set ssh in fact, called latter once vertical grid
+               ! is set up:
+               CALL usr_def_istate( gdept_0, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  )
                !
                DO jk=1,jpk
                   e3t(:,:,jk,Kbb) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb) ) &
-                    &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   &
-                    &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )   ! make sure e3t(:,:,:,Kbb) != 0 on land points
+                     &                             / ( ht_0(:,:) + 1._wp -ssmask(:,:) ) * tmask(:,:,jk) &
+                     &             + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )
                END DO
                e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb)
-               ssh(:,:,Kmm) = ssh(:,:,Kbb)                                     ! needed later for gde3w
+!               ssh(:,:,Kmm)=0._wp
+!               e3t(:,:,:,Kmm)=e3t_0(:,:,:)
+!               e3t(:,:,:,Kbb)=e3t_0(:,:,:)
                !
             END IF           ! end of ll_wd edits
@@ -933,4 +956,18 @@
             END IF
          ENDIF
+
+#if defined key_agrif
+         IF ( .NOT.Agrif_root().AND.(ln_init_chfrpar) ) THEN
+            ! Interpolate initial ssh from parent:
+            CALL Agrif_istate_ssh( Kbb, Kmm )
+            !
+            DO jk = 1, jpk
+               e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm)  ) &
+                 &                              / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   &
+                 &              + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )
+            END DO
+            e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm)
+         ENDIF
+#endif
          !
       ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
@@ -1030,4 +1067,6 @@
    END SUBROUTINE dom_vvl_ctl
 
+#endif
+
    !!======================================================================
 END MODULE domvvl
