Index: /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DOM/domain.F90
===================================================================
--- /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DOM/domain.F90	(revision 11822)
+++ /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DOM/domain.F90	(revision 11823)
@@ -26,5 +26,4 @@
    !!----------------------------------------------------------------------
    USE oce            ! ocean variables
-   USE isfstp
    USE dom_oce        ! domain: ocean
    USE sbc_oce        ! surface boundary condition: ocean
@@ -449,8 +448,4 @@
 #endif
       !
-      ! need to know ln_isfcpl for istate (restart extrapolation)
-      ! and for domvvl_init (ssh extrapolation when recompute e3 variable
-      CALL isf_nam
-      !
    END SUBROUTINE dom_nam
 
Index: /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DOM/domvvl.F90
===================================================================
--- /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DOM/domvvl.F90	(revision 11822)
+++ /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DOM/domvvl.F90	(revision 11823)
@@ -19,6 +19,4 @@
    !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers
-   USE isfcpl
-   USE isf
    USE phycst          ! physical constant
    USE dom_oce         ! ocean space and time domain
@@ -38,4 +36,5 @@
 
    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_swp     ! called by step.F90
@@ -117,21 +116,47 @@
       !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling.
       !!----------------------------------------------------------------------
+      !
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+      !
+      CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer)
+      !
+      !                    ! Allocate module arrays
+      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' )
+      !
+      !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf
+      CALL dom_vvl_rst( nit000, 'READ' )
+      e3t_a(:,:,jpk) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all
+      !
+      CALL dom_vvl_zgr() ! interpolation scale factor, depth and water column
+      !
+   END SUBROUTINE dom_vvl_init
+   !
+   SUBROUTINE dom_vvl_zgr()
+      !!----------------------------------------------------------------------
+      !!                ***  ROUTINE dom_vvl_init  ***
+      !!                   
+      !! ** Purpose :  Interpolation of all scale factors, 
+      !!               depths and water column heights
+      !!
+      !! ** Method  :  - interpolate scale factors
+      !!
+      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b)
+      !!              - Regrid: e3(u/v)_n
+      !!                        e3(u/v)_b       
+      !!                        e3w_n           
+      !!                        e3(u/v)w_b      
+      !!                        e3(u/v)w_n      
+      !!                        gdept_n, gdepw_n and gde3w_n
+      !!              - h(t/u/v)_0
+      !!              - frq_rst_e3t and frq_rst_hdv
+      !!
+      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling.
+      !!----------------------------------------------------------------------
       INTEGER ::   ji, jj, jk
       INTEGER ::   ii0, ii1, ij0, ij1
       REAL(wp)::   zcoef
       !!----------------------------------------------------------------------
-      !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
-      !
-      CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer)
-      !
-      !                    ! Allocate module arrays
-      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' )
-      !
-      !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf
-      CALL dom_vvl_rst( nit000, 'READ' )
-      e3t_a(:,:,jpk) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all
       !
       !                    !== Set of all other vertical scale factors  ==!  (now and before)
@@ -265,6 +290,5 @@
       ENDIF
       !
-   END SUBROUTINE dom_vvl_init
-
+   END SUBROUTINE dom_vvl_zgr
 
    SUBROUTINE dom_vvl_sf_nxt( kt, kcall ) 
@@ -816,17 +840,8 @@
             id5 = iom_varid( numror, 'hdiv_lf', ldstop = .FALSE. )
             !
-            ! coupling with an ice sheet model (grounding/calving line migration)
-            IF ( ln_isfcpl ) THEN
-               !
-               ! extrapolate ssh over new water column if needed
-               CALL isfcpl_ssh()
-               !
-               ! e3t need to be computed where ice shelf draft changed (new ht_0)
-               id1 = 0 ; id2 = 0 ; id3 = 0 ; id4 = 0 ; id5 = 0
-               !
-            END IF
             !                             ! --------- !
             !                             ! all cases !
             !                             ! --------- !
+            !
             IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist
                CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lrxios )
@@ -1046,5 +1061,4 @@
       !
       IF( ioptio /= 1 )   CALL ctl_stop( 'Choose ONE vertical coordinate in namelist nam_vvl' )
-      IF( .NOT. ln_vvl_zstar .AND. ln_isf ) CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' )
       !
       IF(lwp) THEN                   ! Print the choice
Index: /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DYN/divhor.F90
===================================================================
--- /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DYN/divhor.F90	(revision 11822)
+++ /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DYN/divhor.F90	(revision 11823)
@@ -86,11 +86,5 @@
          END DO  
       END DO
-
-      ztmp = 0.0
-      DO jk = jpkm1,1,-1
-         ztmp(:,:) = ztmp(:,:) + hdivn(:,:,jk) * e3t_n(:,:,jk)
-      END DO
-      CALL debug('divhor 1',ztmp)
-
+      !
 #if defined key_agrif
       IF( .NOT. Agrif_Root() ) THEN
@@ -102,5 +96,5 @@
 #endif
       !
-      IF( ln_rnf )   CALL sbc_rnf_div( hdivn )              !==  runoffs    ==!   (update hdivn field)
+      IF( ln_rnf )                      CALL sbc_rnf_div( hdivn )       !==  runoffs    ==!   (update hdivn field)
       !
 #if defined key_asminc 
@@ -109,13 +103,7 @@
 #endif
       !
-      IF( ln_isf .OR. ln_isfcpl )   CALL isf_hdiv( kt, hdivn )      !==  ice shelf  ==!   (update hdivn field)
+      IF( ln_isf .AND. kt /= 0 )        CALL isf_hdiv( kt, hdivn )      !==  ice shelf  ==!   (update hdivn field)
       !
       CALL lbc_lnk( 'divhor', hdivn, 'T', 1. )   !   (no sign change)
-      !
-      ztmp = 0.0
-      DO jk = jpkm1,1,-1
-         ztmp(:,:) = ztmp(:,:) + hdivn(:,:,jk) * e3t_n(:,:,jk)
-      END DO
-      CALL debug('divhor 2',ztmp)
       !
       IF( ln_timing )   CALL timing_stop('div_hor')
Index: /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/IOM/restart.F90
===================================================================
--- /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/IOM/restart.F90	(revision 11822)
+++ /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/IOM/restart.F90	(revision 11823)
@@ -19,6 +19,4 @@
    !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers 
-   USE isf             ! ice shelf
-   USE isfcpl          ! ice shelf coupling
    USE dom_oce         ! ocean space and time domain
    USE sbc_ice         ! only lk_si3 
@@ -284,7 +282,4 @@
       ENDIF
       !
-      ! ice sheet coupling: extrapolation of restart to fill new wet cell and compute divergence correction
-      IF ( ln_isfcpl ) CALL isfcpl_init()
-      !
       IF( neuler == 0 ) THEN                                  ! Euler restart (neuler=0)
          tsb  (:,:,:,:) = tsn  (:,:,:,:)                             ! all before fields set to now values
Index: /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfcpl.F90
===================================================================
--- /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfcpl.F90	(revision 11822)
+++ /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfcpl.F90	(revision 11823)
@@ -16,4 +16,5 @@
    USE isfutils       ! debuging
    USE lib_mpp        ! mpp routine
+   USE domvvl         ! vertical scale factor interpolation
    !
    USE in_out_manager ! I/O manager
@@ -62,6 +63,6 @@
       !
       ! mask velocity properly (mask used in restart not compatible with new mask)
-      un(:,:,:) = un(:,:,:,) * umask(:,:,:)
-      vn(:,:,:) = vn(:,:,:,) * vmask(:,:,:)
+      un(:,:,:) = un(:,:,:) * umask(:,:,:)
+      vn(:,:,:) = vn(:,:,:) * vmask(:,:,:)
       !
       ! Need to : - include in the cpl cons the risfcpl_vol/tsc contribution
@@ -91,5 +92,5 @@
    END SUBROUTINE isfcpl_rst_write
 
-   SUBROUTINE isfcpl_ssh ()
+   SUBROUTINE isfcpl_ssh
       !!---------------------------------------------------------------------- 
       !!                   ***  ROUTINE iscpl_ssh  ***
@@ -149,12 +150,12 @@
       sshn(:,:) = zssh(:,:) * ssmask(:,:)
       !
-      ! force to start on an euler time step
-      neuler = 0
-      !
       sshb(:,:) = sshn(:,:)
       !
+      ! recompute the vertical scale factor, depth and water thickness
+      CALL dom_vvl_zgr
+      !
    END SUBROUTINE isfcpl_ssh
 
-   SUBROUTINE isfcpl_tra ()
+   SUBROUTINE isfcpl_tra
       !!---------------------------------------------------------------------- 
       !!                   ***  ROUTINE iscpl_tra  ***
@@ -297,4 +298,6 @@
       tsn(:,:,:,jp_sal) = zts0(:,:,:,jp_sal) * tmask(:,:,:)
       !
+      tsb(:,:,:,:) = tsn(:,:,:,:)
+      !
       ! sanity check
       ! -----------------------------------------------------------------------------------------
@@ -383,10 +386,4 @@
       CALL lbc_lnk( 'iscpl', zqvolb, 'T', 1. )
       CALL lbc_lnk( 'iscpl', zqvoln, 'T', 1. )
-      DO jk = 1,jpk
-      CALL debug('zqvolb',zqvolb(:,:,jk))
-      END DO
-      DO jk = 1,jpk
-      CALL debug('zqvoln',zqvoln(:,:,jk))
-      END DO
       !
       ! get 3d tra increment to apply at the first time step
Index: /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfload.F90
===================================================================
--- /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfload.F90	(revision 11822)
+++ /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfload.F90	(revision 11823)
@@ -76,5 +76,5 @@
       !
       !                                !- assume water displaced by the ice shelf is at T=-1.9 and S=34.4 (rude)
-      zts_top(:,:,jp_tem) = -1.9_wp   ;   zts_top(:,:,jp_sal) = 35.4_wp
+      zts_top(:,:,jp_tem) = -1.9_wp   ;   zts_top(:,:,jp_sal) = 34.4_wp
       !
       DO jk = 1, jpk                   !- compute density of the water displaced by the ice shelf 
Index: /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfstp.F90
===================================================================
--- /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfstp.F90	(revision 11822)
+++ /NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfstp.F90	(revision 11823)
@@ -15,4 +15,5 @@
    USE oce            ! ocean dynamics and tracers
    USE dom_oce        ! ocean space and time domain
+   USE domvvl, ONLY : ln_vvl_zstar
    USE phycst         ! physical constants
    USE eosbn2         ! equation of state
@@ -120,10 +121,11 @@
       !! ** Purpose :   Initialisation of the ice shelf public variables
       !!
-      !! ** Method  :   Read the namsbc namelist and set derived parameters
-      !!                Call init routines for all other SBC modules that have one
-      !!
-      !! ** Action  : - read namsbc parameters
+      !! ** Method  :   Read the namisf namelist, check option compatibility and set derived parameters
+      !!
+      !! ** Action  : - read namisf parameters
       !!              - allocate memory
-      !!              - call cav/param init routine
+      !!              - output print
+      !!              - ckeck option compatibility
+      !!              - call cav/param/isfcpl init routine
       !!----------------------------------------------------------------------
       !
@@ -144,28 +146,4 @@
       ! terminate routine now if no ice shelf melt formulation specify
       IF ( ln_isf ) THEN
-         !
-         !---------------------------------------------------------------------------------------------------------------------
-         ! initialisation melt in the cavity
-         IF ( ln_isfcav_mlt ) THEN
-            !
-            ! initialisation  of cav variable
-            CALL isf_cav_init()
-            !
-            ! read cav variable from restart
-            IF ( ln_rstart ) CALL isfrst_read('cav', risf_cav_tsc, fwfisf_cav, risf_cav_tsc_b, fwfisf_cav_b)
-            !
-         END IF
-         !
-         !---------------------------------------------------------------------------------------------------------------------
-         ! initialisation parametrised melt
-         IF ( ln_isfpar_mlt ) THEN
-            !
-            ! initialisation  of par variable
-            CALL isf_par_init()
-            !
-            ! read par variable from restart
-            IF ( ln_rstart ) CALL isfrst_read('par', risf_par_tsc, fwfisf_par, risf_par_tsc_b, fwfisf_par_b)
-            !
-         END IF
          !
          !---------------------------------------------------------------------------------------------------------------------
@@ -173,4 +151,17 @@
          IF( ln_isfcpl ) THEN 
             !
+            ! start on an euler time step
+            neuler = 0
+            !
+            ! ice sheet coupling: extrapolation of restart to fill new wet cell and compute divergence correction
+            CALL isfcpl_init()
+            !
+            ! all before fields set to now values
+            tsb  (:,:,:,:) = tsn  (:,:,:,:)
+            ub   (:,:,:)   = un   (:,:,:)
+            vb   (:,:,:)   = vn   (:,:,:)
+            sshb (:,:)     = sshn (:,:)
+            e3t_b(:,:,:)   = e3t_n(:,:,:)
+ 
             ! prepare writing restart
             IF( lwxios ) CALL iom_set_rstw_var_active('ssmask')
@@ -182,9 +173,39 @@
          END IF
          !
+         !---------------------------------------------------------------------------------------------------------------------
+         ! initialisation melt in the cavity
+         IF ( ln_isfcav_mlt ) THEN
+            !
+            ! initialisation  of cav variable
+            CALL isf_cav_init()
+            !
+            ! read cav variable from restart
+            IF ( ln_rstart ) CALL isfrst_read('cav', risf_cav_tsc, fwfisf_cav, risf_cav_tsc_b, fwfisf_cav_b)
+            !
+         END IF
+         !
+         !---------------------------------------------------------------------------------------------------------------------
+         ! initialisation parametrised melt
+         IF ( ln_isfpar_mlt ) THEN
+            !
+            ! initialisation  of par variable
+            CALL isf_par_init()
+            !
+            ! read par variable from restart
+            IF ( ln_rstart ) CALL isfrst_read('par', risf_par_tsc, fwfisf_par, risf_par_tsc_b, fwfisf_par_b)
+            !
+         END IF
+         !
       END IF
          
   END SUBROUTINE isf_init
 
-  SUBROUTINE isf_ctl()!
+  SUBROUTINE isf_ctl()
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE isf_ctl  ***
+      !!
+      !! ** Purpose :   output print and option compatibility check
+      !!
+      !!----------------------------------------------------------------------
       IF (lwp) THEN
          WRITE(numout,*)
@@ -272,4 +293,7 @@
          END IF
          !
+         ! compatibility ice shelf and vvl
+         IF( .NOT. ln_vvl_zstar .AND. ln_isf ) CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' )
+         !
       END IF
    END SUBROUTINE isf_ctl
