Index: /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90
===================================================================
--- /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 3380)
+++ /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 3381)
@@ -48,11 +48,11 @@
 
    TYPE, PUBLIC ::   icebergs_gridded   !: various icebergs properties on model grid
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   calving       => NULL()   ! Calving mass rate  (into stored ice)         [kg/s]
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   calving_hflx  => NULL()   ! Calving heat flux [heat content of calving]  [W/m2]
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   floating_melt => NULL()   ! Net melting rate to icebergs + bits      [kg/s/m^2]
-      INTEGER , DIMENSION(:,:)  , POINTER ::   maxclass      => NULL()   ! maximum class number at calving source point
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   tmp           => NULL()   ! Temporary work space
-      REAL(wp), DIMENSION(:,:,:), POINTER ::   stored_ice    => NULL()   ! Accumulated ice mass flux at calving locations [kg]
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   stored_heat   => NULL()   ! Heat content of stored ice                      [J]
+      REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   calving         ! Calving mass rate  (into stored ice)         [kg/s]
+      REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   calving_hflx    ! Calving heat flux [heat content of calving]  [W/m2]
+      REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   floating_melt   ! Net melting rate to icebergs + bits      [kg/s/m^2]
+      INTEGER , DIMENSION(:,:)  , ALLOCATABLE ::   maxclass        ! maximum class number at calving source point
+      REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   tmp             ! Temporary work space
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   stored_ice      ! Accumulated ice mass flux at calving locations [kg]
+      REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   stored_heat     ! Heat content of stored ice                      [J]
    END TYPE icebergs_gridded
 
@@ -79,9 +79,9 @@
 
    !                                                             !!! parameters controlling iceberg characteristics and modelling
-   REAL(wp)                        ::   berg_dt                   !: Time-step between iceberg CALLs (should make adaptive?)
-   INTEGER                         ::   current_year              !: 
-   REAL(wp)                        ::   current_yearday           !: 1.00-365.99
-   REAL(wp), DIMENSION(:), POINTER ::   first_width, first_length !: 
-   LOGICAL                         ::   l_restarted_bergs=.FALSE.  ! Indicate whether we read state from a restart or not
+   REAL(wp)                            ::   berg_dt                   !: Time-step between iceberg CALLs (should make adaptive?)
+   INTEGER                             ::   current_year              !: 
+   REAL(wp)                            ::   current_yearday           !: 1.00-365.99
+   REAL(wp), DIMENSION(:), ALLOCATABLE ::   first_width, first_length !: 
+   LOGICAL                             ::   l_restarted_bergs=.FALSE.  ! Indicate whether we read state from a restart or not
    !                                                               ! arbitrary numbers for diawri entry
    REAL(wp), DIMENSION(nclasses), PUBLIC ::   class_num=(/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 /)
@@ -140,16 +140,18 @@
 
    ! Single instance of an icebergs type initialised in icebergs_init and updated in icebergs_run
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   src_calving, src_calving_hflx    !: ???
-   INTEGER , PUBLIC             , SAVE                     ::   numicb                           !: ???
-   INTEGER , PUBLIC             , SAVE, DIMENSION(nkounts) ::   num_bergs                        !: ???
-   INTEGER , PUBLIC             , SAVE                     ::   nicbdi, nicbei, nicbdj, nicbej   !: ???
-   REAL(wp), PUBLIC             , SAVE                     ::   ricb_left, ricb_right            !: ???
-   INTEGER , PUBLIC             , SAVE                     ::   nicbpack                         !: ???
-   INTEGER , PUBLIC             , SAVE                     ::   nktberg, nknberg                 !: ???
-   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   nicbfldpts                       !: ???
-   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   nicbflddest                      !: ???
-   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   nicbfldproc                      !: ???
-
-   TYPE(FLD), ALLOCATABLE, PUBLIC     , DIMENSION(:)       ::   sf_icb   !: structure: file information, fields read
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   src_calving, src_calving_hflx    !: accumulate input ice
+   INTEGER , PUBLIC             , SAVE                     ::   numicb                           !: iceberg IO
+   INTEGER , PUBLIC             , SAVE, DIMENSION(nkounts) ::   num_bergs                        !: iceberg counter
+   INTEGER , PUBLIC             , SAVE                     ::   nicbdi, nicbei, nicbdj, nicbej   !: processor bounds
+   REAL(wp), PUBLIC             , SAVE                     ::   ricb_left, ricb_right            !: cyclical bounds
+   INTEGER , PUBLIC             , SAVE                     ::   nicbpack                         !: packing integer
+   INTEGER , PUBLIC             , SAVE                     ::   nktberg, nknberg                 !: helpers
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   nicbfldpts                       !: nfold packed points
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   nicbflddest                      !: nfold destination proc
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   nicbfldproc                      !: nfold destination proc
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   :: griddata                           !: work array for icbrst
+
+   TYPE(FLD), PUBLIC, ALLOCATABLE     , DIMENSION(:)       ::   sf_icb   !: structure: file information, fields read
 
    !!----------------------------------------------------------------------
@@ -191,4 +193,7 @@
       icb_alloc = icb_alloc + ill
 
+      ALLOCATE( griddata(jpi,jpj,1), STAT=ill )
+      icb_alloc = icb_alloc + ill
+
       IF( lk_mpp        )   CALL mpp_sum ( icb_alloc )
       IF( icb_alloc > 0 )   CALL ctl_warn('icb_alloc: allocation of arrays failed')
Index: /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbdia.F90
===================================================================
--- /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbdia.F90	(revision 3380)
+++ /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbdia.F90	(revision 3381)
@@ -37,19 +37,19 @@
    PUBLIC   icb_dia_income    ! routine called in icbclv.F90 module
 
-   REAL(wp), DIMENSION(:,:)  , POINTER, PUBLIC  ::   berg_melt    => NULL()   ! Melting+erosion rate of icebergs     [kg/s/m2]
-   REAL(wp), DIMENSION(:,:)  , POINTER, PUBLIC  ::   buoy_melt    => NULL()   ! Buoyancy component of melting rate   [kg/s/m2]
-   REAL(wp), DIMENSION(:,:)  , POINTER, PUBLIC  ::   eros_melt    => NULL()   ! Erosion component of melting rate    [kg/s/m2]
-   REAL(wp), DIMENSION(:,:)  , POINTER, PUBLIC  ::   conv_melt    => NULL()   ! Convective component of melting rate [kg/s/m2]
-   REAL(wp), DIMENSION(:,:)  , POINTER, PUBLIC  ::   bits_src     => NULL()   ! Mass flux from berg erosion into bergy bits [kg/s/m2]
-   REAL(wp), DIMENSION(:,:)  , POINTER, PUBLIC  ::   bits_melt    => NULL()   ! Melting rate of bergy bits           [kg/s/m2]
-   REAL(wp), DIMENSION(:,:)  , POINTER, PUBLIC  ::   bits_mass    => NULL()   ! Mass distribution of bergy bits      [kg/s/m2]
-   REAL(wp), DIMENSION(:,:)  , POINTER, PUBLIC  ::   virtual_area => NULL()   ! Virtual surface coverage by icebergs [m2]
-   REAL(wp), DIMENSION(:,:)  , POINTER, PUBLIC  ::   berg_mass    => NULL()   ! Mass distribution                    [kg/m2]
-   REAL(wp), DIMENSION(:,:,:), POINTER, PUBLIC  ::   real_calving => NULL()   ! Calving rate into iceberg class at
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, PUBLIC  ::   berg_melt       ! Melting+erosion rate of icebergs     [kg/s/m2]
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, PUBLIC  ::   buoy_melt       ! Buoyancy component of melting rate   [kg/s/m2]
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, PUBLIC  ::   eros_melt       ! Erosion component of melting rate    [kg/s/m2]
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, PUBLIC  ::   conv_melt       ! Convective component of melting rate [kg/s/m2]
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, PUBLIC  ::   bits_src        ! Mass flux from berg erosion into bergy bits [kg/s/m2]
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, PUBLIC  ::   bits_melt       ! Melting rate of bergy bits           [kg/s/m2]
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, PUBLIC  ::   bits_mass       ! Mass distribution of bergy bits      [kg/s/m2]
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, PUBLIC  ::   virtual_area    ! Virtual surface coverage by icebergs [m2]
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, PUBLIC  ::   berg_mass       ! Mass distribution                    [kg/m2]
+   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, PUBLIC  ::   real_calving    ! Calving rate into iceberg class at
    !                                                                          ! calving locations                    [kg/s]
    
-   REAL(wp), DIMENSION(:,:)  , POINTER ::   tmpc         => NULL()   ! Temporary work space
-   REAL(wp), DIMENSION(:)    , POINTER ::   rsumbuf      => NULL()   ! Temporary work space to reduce mpp exchanges
-   INTEGER , DIMENSION(:)    , POINTER ::   nsumbuf      => NULL()   ! Temporary work space to reduce mpp exchanges
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   tmpc                     ! Temporary work space
+   REAL(wp), DIMENSION(:)    , ALLOCATABLE ::   rsumbuf                  ! Temporary work space to reduce mpp exchanges
+   INTEGER , DIMENSION(:)    , ALLOCATABLE ::   nsumbuf                  ! Temporary work space to reduce mpp exchanges
 
    REAL(wp)                      ::  berg_melt_net
Index: /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbdyn.F90
===================================================================
--- /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbdyn.F90	(revision 3380)
+++ /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbdyn.F90	(revision 3381)
@@ -158,5 +158,5 @@
          ! update actual position
          pt%lon  = icb_utl_bilin_x(glamt, pt%xi, pt%yj )
-         pt%lat  = icb_utl_bilin(gphit, pt%xi, pt%yj, 'T', 0, 0 )
+         pt%lat  = icb_utl_bilin(gphit, pt%xi, pt%yj, 'T' )
 
          berg => berg%next                         ! switch to the next berg
Index: /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90
===================================================================
--- /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 3380)
+++ /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 3381)
@@ -308,6 +308,6 @@
                localpt%xi = REAL( mig(ji), wp )
                localpt%yj = REAL( mjg(jj), wp )
-               localpt%lon = icb_utl_bilin(glamt, localpt%xi, localpt%yj, 'T', 0, 0 )
-               localpt%lat = icb_utl_bilin(gphit, localpt%xi, localpt%yj, 'T', 0, 0 )
+               localpt%lon = icb_utl_bilin(glamt, localpt%xi, localpt%yj, 'T' )
+               localpt%lat = icb_utl_bilin(gphit, localpt%xi, localpt%yj, 'T' )
                localpt%mass      = rn_initial_mass     (iberg)
                localpt%thickness = rn_initial_thickness(iberg)
@@ -315,5 +315,5 @@
                localpt%length = first_length(iberg)
                localpt%year = iyr
-               localpt%day = FLOAT(iday)+(FLOAT(ihr)+FLOAT(imin)/60._wp)/24._wp
+               localpt%day = REAL(iday,wp)+(REAL(ihr,wp)+REAL(imin,wp)/60._wp)/24._wp
                localpt%mass_of_bits = 0._wp
                localpt%heat_density = 0._wp
Index: /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90
===================================================================
--- /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90	(revision 3380)
+++ /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90	(revision 3381)
@@ -38,6 +38,5 @@
    INTEGER ::   nret, ncid, nc_dim
    
-   INTEGER,  DIMENSION(3)              :: nstrt3, nlngth3
-   REAL(wp), DIMENSION(:,:,:), POINTER :: griddata => NULL()    ! need 2d array to read in with
+   INTEGER,  DIMENSION(3)                  :: nstrt3, nlngth3
 
    !!----------------------------------------------------------------------
@@ -70,6 +69,4 @@
       TYPE(point)                  ::   localpt   ! NOT a pointer but an actual local variable
       !!----------------------------------------------------------------------
-
-      IF( .NOT. ASSOCIATED(griddata) ) ALLOCATE( griddata(jpi,jpj,1) )
 
       ! Find a restart file
@@ -236,6 +233,4 @@
       !!----------------------------------------------------------------------
 
-      IF( .NOT. ASSOCIATED(griddata) ) ALLOCATE( griddata(jpi,jpj,1) )
-
       IF( lk_mpp ) THEN
          WRITE(cl_filename,'("icebergs_",I8.8,"_restart_",I4.4,".nc")') kt, narea-1
Index: /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbutl.F90
===================================================================
--- /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbutl.F90	(revision 3380)
+++ /branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbutl.F90	(revision 3381)
@@ -24,5 +24,5 @@
 #if defined key_lim2
    USE ice_2,         ONLY: u_ice, v_ice   ! LIM-2 ice velocities  (CAUTION in C-grid do not use key_vp option)
-   USE ice_2,         ONLY: hi => hicif    ! LIM-2 ice thickness
+   USE ice_2,         ONLY: hicif          ! LIM-2 ice thickness
 #elif defined key_lim3
    USE ice,           ONLY: u_ice, v_ice   ! LIM-3 variables  (always in C-grid)
@@ -137,12 +137,12 @@
       pe2 = icb_utl_bilin_e( e2t, e2u, e2v, e2f, pi, pj )
       !
-      puo  = icb_utl_bilin( uo_e, pi, pj, 'U', 1, 1 )             ! ocean velocities
-      pvo  = icb_utl_bilin( vo_e, pi, pj, 'V', 1, 1 )
-      psst = icb_utl_bilin( sst_m, pi, pj, 'T', 0, 0 )            ! SST
-      pcn  = icb_utl_bilin( fr_i , pi, pj, 'T', 0, 0 )            ! ice concentration
-      pff  = icb_utl_bilin( ff_e , pi, pj, 'F', 1, 1 )            ! Coriolis parameter
-      !
-      pua  = icb_utl_bilin( ua_e , pi, pj, 'U', 1, 1 )            ! 10m wind
-      pva  = icb_utl_bilin( va_e , pi, pj, 'V', 1, 1 )            ! here (ua,va) are stress => rough conversion from stress to speed
+      puo  = icb_utl_bilin_h( uo_e, pi, pj, 'U' )             ! ocean velocities
+      pvo  = icb_utl_bilin_h( vo_e, pi, pj, 'V' )
+      psst = icb_utl_bilin( sst_m, pi, pj, 'T' )            ! SST
+      pcn  = icb_utl_bilin( fr_i , pi, pj, 'T' )            ! ice concentration
+      pff  = icb_utl_bilin_h( ff_e , pi, pj, 'F' )            ! Coriolis parameter
+      !
+      pua  = icb_utl_bilin_h( ua_e , pi, pj, 'U' )            ! 10m wind
+      pva  = icb_utl_bilin_h( va_e , pi, pj, 'V' )            ! here (ua,va) are stress => rough conversion from stress to speed
       zcd  = 1.22_wp * 1.5e-3_wp                                  ! air density * drag coefficient
       zmod = 1._wp / MAX(  1.e-20, SQRT(  zcd * SQRT( pua*pua + pva*pva)  )  )
@@ -151,7 +151,7 @@
 
 #if defined key_lim2 || defined key_lim3
-      pui = icb_utl_bilin( ui_e, pi, pj, 'U', 1, 1 )              ! sea-ice velocities
-      pvi = icb_utl_bilin( vi_e, pi, pj, 'V', 1, 1 )
-      phi = icb_utl_bilin( hi  , pi, pj, 'T', 0, 0 )              ! ice thickness
+      pui = icb_utl_bilin_h( ui_e, pi, pj, 'U' )              ! sea-ice velocities
+      pvi = icb_utl_bilin_h( vi_e, pi, pj, 'V' )
+      phi = icb_utl_bilin(hicif, pi, pj, 'T' )              ! ice thickness
 #else
       pui = 0._wp
@@ -161,17 +161,18 @@
 
       ! Estimate SSH gradient in i- and j-direction (centred evaluation)
-      pssh_i = ( icb_utl_bilin( ssh_e, pi+0.1_wp, pj, 'T', 1, 1 ) -   &
-          &      icb_utl_bilin( ssh_e, pi-0.1_wp, pj, 'T', 1, 1 )  ) / ( 0.2_wp * pe1 )
-      pssh_j = ( icb_utl_bilin( ssh_e, pi, pj+0.1_wp, 'T', 1, 1 ) -   &
-          &      icb_utl_bilin( ssh_e, pi, pj-0.1_wp, 'T', 1, 1 )  ) / ( 0.2_wp * pe2 )
+      pssh_i = ( icb_utl_bilin_h( ssh_e, pi+0.1_wp, pj, 'T' ) -   &
+          &      icb_utl_bilin_h( ssh_e, pi-0.1_wp, pj, 'T' )  ) / ( 0.2_wp * pe1 )
+      pssh_j = ( icb_utl_bilin_h( ssh_e, pi, pj+0.1_wp, 'T' ) -   &
+          &      icb_utl_bilin_h( ssh_e, pi, pj-0.1_wp, 'T' )  ) / ( 0.2_wp * pe2 )
       !
    END SUBROUTINE icb_utl_interp
 
 
-   REAL(wp) FUNCTION icb_utl_bilin( pfld, pi, pj, cd_type, kdi, kdj )
+   REAL(wp) FUNCTION icb_utl_bilin_h( pfld, pi, pj, cd_type )
       !!----------------------------------------------------------------------
       !!                  ***  FUNCTION icb_utl_bilin  ***
       !!
       !! ** Purpose :   bilinear interpolation at berg location depending on the grid-point type
+      !!                this version deals with extra halo points
       !!
       !!       !!gm  CAUTION an optional argument should be added to handle
@@ -179,8 +180,61 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER                                         , INTENT(in) ::   kdi, kdj  ! extra halo on grid
-      REAL(wp), DIMENSION(1-kdi:jpi+kdi,1-kdj:jpj+kdj), INTENT(in) ::   pfld      ! field to be interpolated
-      REAL(wp)                                        , INTENT(in) ::   pi, pj    ! targeted coordinates in (i,j) referential
-      CHARACTER(len=1)                                , INTENT(in) ::   cd_type   ! type of pfld array grid-points: = T , U , V or F points
+      REAL(wp), DIMENSION(0:jpi+1,0:jpj+1), INTENT(in) ::   pfld      ! field to be interpolated
+      REAL(wp)                            , INTENT(in) ::   pi, pj    ! targeted coordinates in (i,j) referential
+      CHARACTER(len=1)                    , INTENT(in) ::   cd_type   ! type of pfld array grid-points: = T , U , V or F points
+      !
+      INTEGER  ::   ii, ij   ! local integer
+      REAL(wp) ::   zi, zj   ! local real
+      !!----------------------------------------------------------------------
+      !
+      SELECT CASE ( cd_type )
+         CASE ( 'T' )
+            ! note that here there is no +0.5 added
+            ! since we're looking for four T points containing quadrant we're in of 
+            ! current T cell
+            ii = INT( pi     )
+            ij = INT( pj      )    ! T-point
+            zi = pi - REAL(ii,wp)
+            zj = pj - REAL(ij,wp)
+         CASE ( 'U' )
+            ii = INT( pi-0.5 )
+            ij = INT( pj      )    ! U-point
+            zi = pi - 0.5 - REAL(ii,wp)
+            zj = pj - REAL(ij,wp)
+         CASE ( 'V' )
+            ii = INT( pi     )
+            ij = INT( pj -0.5 )    ! V-point
+            zi = pi - REAL(ii,wp)
+            zj = pj - 0.5 - REAL(ij,wp)
+         CASE ( 'F' )
+            ii = INT( pi-0.5 )
+            ij = INT( pj -0.5 )    ! F-point
+            zi = pi - 0.5 - REAL(ii,wp)
+            zj = pj - 0.5 - REAL(ij,wp)
+      END SELECT
+      !
+      ! find position in this processor
+      ii = mi1( ii )
+      ij = mj1( ij )
+      !
+      icb_utl_bilin_h = ( pfld(ii,ij  ) * (1.-zi) + pfld(ii+1,ij  ) * zi ) * (1.-zj)   &
+         &            + ( pfld(ii,ij+1) * (1.-zi) + pfld(ii+1,ij+1) * zi ) *     zj
+      !
+   END FUNCTION icb_utl_bilin_h
+
+
+   REAL(wp) FUNCTION icb_utl_bilin( pfld, pi, pj, cd_type )
+      !!----------------------------------------------------------------------
+      !!                  ***  FUNCTION icb_utl_bilin  ***
+      !!
+      !! ** Purpose :   bilinear interpolation at berg location depending on the grid-point type
+      !!
+      !!       !!gm  CAUTION an optional argument should be added to handle
+      !!             the slip/no-slip conditions  ==>>> to be done later
+      !!
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pfld      ! field to be interpolated
+      REAL(wp)                    , INTENT(in) ::   pi, pj    ! targeted coordinates in (i,j) referential
+      CHARACTER(len=1)            , INTENT(in) ::   cd_type   ! type of pfld array grid-points: = T , U , V or F points
       !
       INTEGER  ::   ii, ij   ! local integer
@@ -407,8 +461,7 @@
       !
       IF( ASSOCIATED( first_berg ) ) THEN
-!        last = last_berg()
-         last=>first_berg
+         last => first_berg
          DO WHILE (ASSOCIATED(last%next))
-            last=>last%next
+            last => last%next
          ENDDO
          newberg%prev => last
@@ -438,6 +491,6 @@
       !!----------------------------------------------------------------------
       !
-      icb_utl_yearday = FLOAT( SUM( imonths(1:kmon) ) )
-      icb_utl_yearday = icb_utl_yearday + FLOAT(kday-1) + (FLOAT(khr) + (FLOAT(kmin) + FLOAT(ksec)/60.)/60.)/24.
+      icb_utl_yearday = REAL( SUM( imonths(1:kmon) ), wp )
+      icb_utl_yearday = icb_utl_yearday + REAL(kday-1,wp) + (REAL(khr,wp) + (REAL(kmin,wp) + REAL(ksec,wp)/60.)/60.)/24.
       !
    END FUNCTION icb_utl_yearday
