Index: /utils/tools_ticket2457/DOMAINcfg/src/domisf.F90
===================================================================
--- /utils/tools_ticket2457/DOMAINcfg/src/domisf.F90	(revision 12870)
+++ /utils/tools_ticket2457/DOMAINcfg/src/domisf.F90	(revision 12871)
@@ -109,8 +109,35 @@
       INTEGER  :: ji, jj                             ! loop indexes
       INTEGER  :: imskjp1, imskjm1, imskip1, imskim1 ! local variable
+      INTEGER  :: ibtest, icompt                     ! local variables
       INTEGER, DIMENSION(jpi,jpj) :: imask           ! isf mask
       !
+      REAL(wp) ::   zdummy       ! dummy variable used for the lnclnk
       REAL(wp) ::   zisfdep_min  ! minimal ice shelf draft allowed
       !!---------------------------------------------------------------------
+      !
+      ! 0.0 fill isolated grid point in the bathymetry
+      ! will be done again later on in zgr_bat_ctl, but need to be done here to adjust risfdep/misfdep respectively
+      icompt = 0
+      DO jj = 2, jpjm1
+         DO ji = 2, jpim1
+            ibtest = MAX(  mbathy(ji-1,jj), mbathy(ji+1,jj),   &
+               &           mbathy(ji,jj-1), mbathy(ji,jj+1)  )
+               IF( ibtest < mbathy(ji,jj) ) THEN
+                  mbathy(ji,jj) = ibtest
+                  bathy(ji,jj)  = gdepw_1d(ibtest+1)
+                  icompt = icompt + 1
+               END IF
+         END DO
+      END DO
+      !
+      ! ensure halo correct 
+      zdummy(:,:) = FLOAT( mbathy(:,:) ) ; CALL lbc_lnk('domisf', zdummy, 'T', 1._wp ) ; mbathy(:,:) = INT( zdummy(:,:) )
+      !
+      IF( lk_mpp )   CALL mpp_sum('domisf', icompt )
+      IF( icompt == 0 ) THEN
+         IF(lwp) WRITE(numout,*)'     no isolated ocean grid points'
+      ELSE
+         IF(lwp) WRITE(numout,*)'    ',icompt,' ocean grid points suppressed'
+      ENDIF
       !
       ! 1.0 set iceshelf to the minimum depth allowed
@@ -220,28 +247,4 @@
          WHERE( risfdep(:,:) > 0._wp .AND. risfdep(:,:) >= zdepth )   misfdep(:,:) = jk+1 
       END DO 
-      !
-      ! 2.1 fill isolated grid point in the bathymetry
-      ! will be done again later on in zgr_bat_ctl, but need to be done here to adjust misfdep respectively
-      icompt = 0
-      DO jj = 2, jpjm1
-         DO ji = 2, jpim1
-            ibtest = MAX(  mbathy(ji-1,jj), mbathy(ji+1,jj),   &
-               &           mbathy(ji,jj-1), mbathy(ji,jj+1)  )
-               IF( ibtest < mbathy(ji,jj) ) THEN
-                  mbathy(ji,jj) = ibtest
-                  icompt = icompt + 1
-               END IF
-         END DO
-      END DO
-      !
-      ! ensure halo correct 
-      zdummy(:,:) = FLOAT( mbathy(:,:) ) ; CALL lbc_lnk('domisf', zdummy, 'T', 1._wp ) ; mbathy(:,:) = INT( zdummy(:,:) )
-      !
-      IF( lk_mpp )   CALL mpp_sum('domisf', icompt )
-      IF( icompt == 0 ) THEN
-         IF(lwp) WRITE(numout,*)'     no isolated ocean grid points'
-      ELSE
-         IF(lwp) WRITE(numout,*)'    ',icompt,' ocean grid points suppressed'
-      ENDIF
       !
       ! 2.2 be sure misfdep not below mbathy 
Index: /utils/tools_ticket2457/DOMAINcfg/src/domzgr.F90
===================================================================
--- /utils/tools_ticket2457/DOMAINcfg/src/domzgr.F90	(revision 12870)
+++ /utils/tools_ticket2457/DOMAINcfg/src/domzgr.F90	(revision 12871)
@@ -895,8 +895,4 @@
       IF(lwp) WRITE(numout,*) '              mbathy is recomputed : bathy_level file is NOT used'
 
-      ! compute position of the ice shelf grounding line
-      ! set bathy and isfdraft to 0 where grounded
-      IF ( ln_isfcav ) CALL zgr_isf_zspace
-
       ! bathymetry in level (from bathy_meter)
       ! ===================
@@ -916,8 +912,13 @@
       END DO
 
-      ! Check compatibility between bathy and iceshelf draft
-      ! insure at least 2 wet level on the vertical under an ice shelf
-      ! compute misfdep and adjust isf draft if needed
-      IF ( ln_isfcav ) CALL zgr_isf_kspace
+      ! isf draft in z and level
+      ! ========================
+      ! if under ice shelf cavities, compute misfdep for ocean point (i.e. the top level)
+      IF ( ln_isfcav ) THEN
+         ! compute position of the ice shelf grounding line
+         CALL zgr_isf_zspace
+         ! compute misfdep and adjust isf draft if needed
+         CALL zgr_isf_kspace
+      END IF
 
       ! Scale factors and depth at T- and W-points
