Index: /NEMO/branches/2019/fix_ticket2229/src/OCE/ICB/icb_oce.F90
===================================================================
--- /NEMO/branches/2019/fix_ticket2229/src/OCE/ICB/icb_oce.F90	(revision 10677)
+++ /NEMO/branches/2019/fix_ticket2229/src/OCE/ICB/icb_oce.F90	(revision 10678)
@@ -89,4 +89,5 @@
    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ua_e, va_e
    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ssh_e
+   REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   tmask_e, umask_e, vmask_e
 #if defined key_si3 || defined key_cice
    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ui_e, vi_e
@@ -169,16 +170,20 @@
       !
       ! expanded arrays for bilinear interpolation
-      ALLOCATE( uo_e(0:jpi+1,0:jpj+1) , ua_e(0:jpi+1,0:jpj+1) ,   &
-         &      vo_e(0:jpi+1,0:jpj+1) , va_e(0:jpi+1,0:jpj+1) ,   &
+      ALLOCATE( uo_e(0:jpi+1,0:jpj+1) , ua_e(0:jpi+1,0:jpj+1) ,      &
+         &      vo_e(0:jpi+1,0:jpj+1) , va_e(0:jpi+1,0:jpj+1) ,      &
 #if defined key_si3 || defined key_cice
-         &      ui_e(0:jpi+1,0:jpj+1) ,                            &
-         &      vi_e(0:jpi+1,0:jpj+1) ,                            &
+         &      ui_e(0:jpi+1,0:jpj+1) ,                              &
+         &      vi_e(0:jpi+1,0:jpj+1) ,                              &
 #endif
-         &      ff_e(0:jpi+1,0:jpj+1) , fr_e(0:jpi+1,0:jpj+1)  ,   &
-         &      tt_e(0:jpi+1,0:jpj+1) , ssh_e(0:jpi+1,0:jpj+1) ,   &
-         &      hicth(0:jpi+1,0:jpj+1),                            &
-         &      first_width(nclasses) , first_length(nclasses) ,   &
-         &      src_calving (jpi,jpj) ,                            &
+         &      ff_e(0:jpi+1,0:jpj+1)   , fr_e(0:jpi+1,0:jpj+1)  ,   &
+         &      tt_e(0:jpi+1,0:jpj+1)   , ssh_e(0:jpi+1,0:jpj+1) ,   &
+         &      hicth(0:jpi+1,0:jpj+1),                              &
+         &      first_width(nclasses) , first_length(nclasses) ,     &
+         &      src_calving (jpi,jpj) ,                              &
          &      src_calving_hflx(jpi,jpj) , STAT=ill)
+      icb_alloc = icb_alloc + ill
+
+      ALLOCATE( tmask_e(0:jpi+1,0:jpj+1), umask_e(0:jpi+1,0:jpj+1), vmask_e(0:jpi+1,0:jpj+1), &
+         &      STAT=ill)
       icb_alloc = icb_alloc + ill
 
Index: /NEMO/branches/2019/fix_ticket2229/src/OCE/ICB/icbini.F90
===================================================================
--- /NEMO/branches/2019/fix_ticket2229/src/OCE/ICB/icbini.F90	(revision 10677)
+++ /NEMO/branches/2019/fix_ticket2229/src/OCE/ICB/icbini.F90	(revision 10678)
@@ -224,4 +224,12 @@
       src_calving_hflx(:,:) = 0._wp
 
+      ! definition of extended surface masked needed by icb_bilin_h
+      tmask_e(:,:) = 0._wp   ;   tmask_e(1:jpi,1:jpj) = tmask(:,:,1)
+      umask_e(:,:) = 0._wp   ;   umask_e(1:jpi,1:jpj) = umask(:,:,1)
+      vmask_e(:,:) = 0._wp   ;   vmask_e(1:jpi,1:jpj) = vmask(:,:,1)
+      CALL lbc_lnk_icb( 'icbini', tmask_e, 'T', +1._wp, 1, 1 )
+      CALL lbc_lnk_icb( 'icbini', umask_e, 'T', +1._wp, 1, 1 )
+      CALL lbc_lnk_icb( 'icbini', vmask_e, 'T', +1._wp, 1, 1 )
+      !
       ! assign each new iceberg with a unique number constructed from the processor number
       ! and incremented by the total number of processors
Index: /NEMO/branches/2019/fix_ticket2229/src/OCE/ICB/icbutl.F90
===================================================================
--- /NEMO/branches/2019/fix_ticket2229/src/OCE/ICB/icbutl.F90	(revision 10677)
+++ /NEMO/branches/2019/fix_ticket2229/src/OCE/ICB/icbutl.F90	(revision 10678)
@@ -246,9 +246,9 @@
          SELECT CASE ( cd_type )
          CASE ( 'T' )
-            zmask = (/tmask(ii,ij,1), tmask(ii+1,ij,1), tmask(ii,ij+1,1), tmask(ii+1,ij+1,1)/)
+            zmask = (/tmask_e(ii,ij), tmask_e(ii+1,ij), tmask_e(ii,ij+1), tmask_e(ii+1,ij+1)/)
          CASE ( 'U' )
-            zmask = (/umask(ii,ij,1), umask(ii+1,ij,1), umask(ii,ij+1,1), umask(ii+1,ij+1,1)/)
+            zmask = (/umask_e(ii,ij), umask_e(ii+1,ij), umask_e(ii,ij+1), umask_e(ii+1,ij+1)/)
          CASE ( 'V' )
-            zmask = (/vmask(ii,ij,1), vmask(ii+1,ij,1), vmask(ii,ij+1,1), vmask(ii+1,ij+1,1)/)
+            zmask = (/vmask_e(ii,ij), vmask_e(ii+1,ij), vmask_e(ii,ij+1), vmask_e(ii+1,ij+1)/)
          CASE ( 'F' )
             ! F case only used for coriolis, ff_f is not mask so zmask = 1
