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 11823)
+++ NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfstp.F90	(revision 11852)
@@ -13,26 +13,18 @@
    !!   isfstp       : compute iceshelf melt and heat flux
    !!----------------------------------------------------------------------
-   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
-   USE sbc_oce        ! surface boundary condition: ocean fields
-   USE zdfdrg         ! vertical physics: top/bottom drag coef.
    !
+   USE isf            ! isf variables
+   USE isfload, ONLY: isf_load                      ! ice shelf load
+   USE isftbl , ONLY: isf_tbl_lvl                   ! ice shelf boundary layer
+   USE isfpar , ONLY: isf_par, isf_par_init         ! ice shelf parametrisation
+   USE isfcav , ONLY: isf_cav, isf_cav_init         ! ice shelf cavity
+   USE isfcpl , ONLY: isfcpl_rst_write, isfcpl_init ! isf variables
+
+   USE dom_oce, ONLY: ht_n, e3t_n, ln_isfcav, ln_linssh ! ocean space and time domain
+   USE domvvl,  ONLY: ln_vvl_zstar                      ! zstar logical
+   USE zdfdrg,  ONLY: r_Cdmin_top, r_ke0_top            ! vertical physics: top/bottom drag coef.
+   !
+   USE lib_mpp, ONLY: ctl_stop, ctl_nam
    USE in_out_manager ! I/O manager
-   USE iom            ! I/O library
-   USE fldread        ! read input field at current time step
-   USE lbclnk         !
-   USE lib_fortran    ! glob_sum
-   !
-   USE isfrst         ! iceshelf restart
-   USE isftbl         ! ice shelf boundary layer
-   USE isfpar         ! ice shelf parametrisation
-   USE isfcav         ! ice shelf cavity
-   USE isfload        ! ice shelf load
-   USE isfcpl         ! isf variables
-   USE isf            ! isf variables
-   USE isfutils
 
    IMPLICIT NONE
@@ -82,7 +74,4 @@
          CALL isf_cav( kt, risf_cav_tsc, fwfisf_cav)
          !
-         ! write restart variables (risf_cav_tsc, fwfisf for now and before)
-         IF (lrst_oce) CALL isfrst_write(kt, 'cav', risf_cav_tsc, fwfisf_cav)
-         !
       END IF
       ! 
@@ -102,14 +91,7 @@
          CALL isf_par( kt, risf_par_tsc, fwfisf_par)
          !
-         ! write restart variables (qoceisf, qhcisf, fwfisf for now and before)
-         IF (lrst_oce) CALL isfrst_write(kt, 'par', risf_par_tsc, fwfisf_par)
-         !
-      END IF
-
-      IF ( ln_isfcpl ) THEN
-         ! 
-         IF (lrst_oce) CALL isfcpl_rst_write(kt)
-         !
-      END IF
+      END IF
+      !
+      IF ( ln_isfcpl .AND. lrst_oce ) CALL isfcpl_rst_write(kt)
       !
    END SUBROUTINE isf_stp
@@ -148,52 +130,14 @@
          !
          !---------------------------------------------------------------------------------------------------------------------
-         ! initialisation ice sheet coupling
-         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')
-            IF( lwxios ) CALL iom_set_rstw_var_active('tmask')
-            IF( lwxios ) CALL iom_set_rstw_var_active('e3t_n')
-            IF( lwxios ) CALL iom_set_rstw_var_active('e3u_n')
-            IF( lwxios ) CALL iom_set_rstw_var_active('e3v_n')
-            !
-         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
+         IF ( ln_isfcav_mlt ) CALL isf_cav_init()
          !
          !---------------------------------------------------------------------------------------------------------------------
          ! 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
+         IF ( ln_isfpar_mlt ) CALL isf_par_init()
+         !
+         !---------------------------------------------------------------------------------------------------------------------
+         ! initialisation ice sheet coupling
+         IF( ln_isfcpl ) CALL isfcpl_init()
          !
       END IF
@@ -224,7 +168,8 @@
                WRITE(numout,*) '         gamma formulation                       cn_gammablk = ', TRIM(cn_gammablk) 
                IF ( TRIM(cn_gammablk) .NE. 'spe' ) THEN 
-                  WRITE(numout,*) '            gammat coefficient                      rn_gammat0  = ', rn_gammat0  
-                  WRITE(numout,*) '            gammas coefficient                      rn_gammas0  = ', rn_gammas0  
-                  WRITE(numout,*) '            top drag coef. used (from namdrg_top)   rn_Cd0      = ', r_Cdmin_top 
+                  WRITE(numout,*) '            gammat coefficient                       rn_gammat0  = ', rn_gammat0  
+                  WRITE(numout,*) '            gammas coefficient                       rn_gammas0  = ', rn_gammas0  
+                  WRITE(numout,*) '            top drag coef.    used (from namdrg_top) rn_Cd0      = ', r_Cdmin_top
+                  WRITE(numout,*) '            top background ke used (from namdrg_top) rn_ke0      = ', r_ke0_top
                END IF
             END IF
