Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn2d.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn2d.F90	(revision 3117)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn2d.F90	(revision 3117)
@@ -0,0 +1,194 @@
+MODULE bdydyn2d
+   !!======================================================================
+   !!                       ***  MODULE  bdydyn  ***
+   !! Unstructured Open Boundary Cond. :   Flow relaxation scheme on velocities
+   !!======================================================================
+   !! History :  1.0  !  2005-02  (J. Chanut, A. Sellar)  Original code
+   !!             -   !  2007-07  (D. Storkey) Move Flather implementation to separate routine.
+   !!            3.0  !  2008-04  (NEMO team)  add in the reference version
+   !!            3.2  !  2008-04  (R. Benshila) consider velocity instead of transport 
+   !!            3.3  !  2010-09  (E.O'Dea) modifications for Shelf configurations 
+   !!            3.3  !  2010-09  (D.Storkey) add ice boundary conditions
+   !!----------------------------------------------------------------------
+#if defined key_bdy 
+   !!----------------------------------------------------------------------
+   !!   'key_bdy' :                    Unstructured Open Boundary Condition
+   !!----------------------------------------------------------------------
+   !!   bdy_dyn2d      : Apply open boundary conditions to barotropic variables.
+   !!   bdy_dyn2d_fla    : Apply Flather condition
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers 
+   USE dom_oce         ! ocean space and time domain
+   USE bdy_oce         ! ocean open boundary conditions
+   USE dynspg_oce      ! for barotropic variables
+   USE phycst          ! physical constants
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE in_out_manager  !
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   bdy_dyn2d     ! routine called in dynspg_ts and dyn_nxt and dynspg_flt
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! $Id: bdydyn.F90 2528 2010-12-27 17:33:53Z rblod $ 
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE bdy_dyn2d( kt )
+      !!----------------------------------------------------------------------
+      !!                  ***  SUBROUTINE bdy_dyn2d  ***
+      !!
+      !! ** Purpose : - Apply open boundary conditions for barotropic variables
+      !!
+      !!----------------------------------------------------------------------
+      INTEGER,                      INTENT(in) ::   kt   ! Main time step counter
+      !!
+      INTEGER                                  ::   ib_bdy ! Loop counter
+
+      DO ib_bdy=1, nb_bdy
+
+         SELECT CASE( nn_dyn2d(ib_bdy) )
+         CASE(jp_none)
+            CYCLE
+         CASE(jp_frs)
+            CALL bdy_dyn2d_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy) )
+         CASE(jp_flather)
+            CALL bdy_dyn2d_fla( idx_bdy(ib_bdy), dta_bdy(ib_bdy) )
+         CASE DEFAULT
+            CALL ctl_stop( 'bdy_dyn3d : unrecognised option for open boundaries for barotropic variables' )
+         END SELECT
+      ENDDO
+
+   END SUBROUTINE bdy_dyn2d
+
+   SUBROUTINE bdy_dyn2d_frs( idx, dta )
+      !!----------------------------------------------------------------------
+      !!                  ***  SUBROUTINE bdy_dyn2d_frs  ***
+      !!
+      !! ** Purpose : - Apply the Flow Relaxation Scheme for barotropic velocities
+      !!                at open boundaries.
+      !!
+      !! References :- Engedahl H., 1995: Use of the flow relaxation scheme in 
+      !!               a three-dimensional baroclinic ocean model with realistic
+      !!               topography. Tellus, 365-382.
+      !!----------------------------------------------------------------------
+      TYPE(OBC_INDEX), INTENT(in) ::   idx  ! OBC indices
+      TYPE(OBC_DATA),  INTENT(in) ::   dta  ! OBC external data
+      !!
+      INTEGER  ::   jb, jk         ! dummy loop indices
+      INTEGER  ::   ii, ij, igrd   ! local integers
+      REAL(wp) ::   zwgt           ! boundary weight
+      !!----------------------------------------------------------------------
+      !
+      !
+      igrd = 2                      ! Relaxation of zonal velocity
+      DO jb = 1, idx%nblen(igrd)
+         ii   = idx%nbi(jb,igrd)
+         ij   = idx%nbj(jb,igrd)
+         zwgt = idx%nbw(jb,igrd)
+         pu2d(ii,ij) = ( pu2d(ii,ij) + zwgt * ( dta%u2d(jb) - pu2d(ii,ij) ) ) * umask(ii,ij,1)
+      END DO
+      !
+      igrd = 3                      ! Relaxation of meridional velocity
+      DO jb = 1, idx%nblen(igrd)
+         ii   = idx%nbi(jb,igrd)
+         ij   = idx%nbj(jb,igrd)
+         zwgt = idx%nbw(jb,igrd)
+         pv2d(ii,ij) = ( pv2d(ii,ij) + zwgt * ( dta%v2d(jb) - pv2d(ii,ij) ) ) * vmask(ii,ij,1)
+      END DO 
+      CALL lbc_lnk( pu2d, 'U', -1. ) 
+      CALL lbc_lnk( pv2d, 'V', -1. )   ! Boundary points should be updated
+      !
+
+   END SUBROUTINE bdy_dyn2d_frs
+
+
+   SUBROUTINE bdy_dyn2d_fla( idx, dta )
+      !!----------------------------------------------------------------------
+      !!                 ***  SUBROUTINE bdy_dyn2d_fla  ***
+      !!             
+      !!              - Apply Flather boundary conditions on normal barotropic velocities 
+      !!
+      !! ** WARNINGS about FLATHER implementation:
+      !!1. According to Palma and Matano, 1998 "after ssh" is used. 
+      !!   In ROMS and POM implementations, it is "now ssh". In the current 
+      !!   implementation (tested only in the EEL-R5 conf.), both cases were unstable. 
+      !!   So I use "before ssh" in the following.
+      !!
+      !!2. We assume that the normal ssh gradient at the bdy is zero. As a matter of 
+      !!   fact, the model ssh just inside the dynamical boundary is used (the outside  
+      !!   ssh in the code is not updated).
+      !!
+      !! References:  Flather, R. A., 1976: A tidal model of the northwest European
+      !!              continental shelf. Mem. Soc. R. Sci. Liege, Ser. 6,10, 141-164.     
+      !!----------------------------------------------------------------------
+      TYPE(OBC_INDEX),              INTENT(in) ::   idx  ! OBC indices
+      TYPE(OBC_DATA),               INTENT(in) ::   dta  ! OBC external data
+
+      INTEGER  ::   jb, igrd                         ! dummy loop indices
+      INTEGER  ::   ii, ij, iim1, iip1, ijm1, ijp1   ! 2D addresses
+      REAL(wp) ::   zcorr                            ! Flather correction
+      REAL(wp) ::   zforc                            ! temporary scalar
+      !!----------------------------------------------------------------------
+
+      ! ---------------------------------!
+      ! Flather boundary conditions     :!
+      ! ---------------------------------! 
+     
+!!! REPLACE spgu with nemo_wrk work space
+
+      ! Fill temporary array with ssh data (here spgu):
+      igrd = 1
+      spgu(:,:) = 0.0
+      DO jb = 1, idx%nblenrim(igrd)
+         ii = idx%nbi(jb,igrd)
+         ij = idx%nbj(jb,igrd)
+         spgu(ii, ij) = dta%ssh(jb)
+      END DO
+      !
+      igrd = 2      ! Flather bc on u-velocity; 
+      !             ! remember that flagu=-1 if normal velocity direction is outward
+      !             ! I think we should rather use after ssh ?
+      DO jb = 1, idx%nblenrim(igrd)
+         ii  = idx%nbi(jb,igrd)
+         ij  = idx%nbj(jb,igrd) 
+         iim1 = ii + MAX( 0, INT( idx%flagu(jb) ) )   ! T pts i-indice inside the boundary
+         iip1 = ii - MIN( 0, INT( idx%flagu(jb) ) )   ! T pts i-indice outside the boundary 
+         !
+         zcorr = - idx%flagu(jb) * SQRT( grav * phur(ii, ij) ) * ( pssh(iim1, ij) - spgu(iip1,ij) )
+         zforc = dta%u2d(jb)
+         pu2d(ii,ij) = zforc + zcorr * umask(ii,ij,1) 
+      END DO
+      !
+      igrd = 3      ! Flather bc on v-velocity
+      !             ! remember that flagv=-1 if normal velocity direction is outward
+      DO jb = 1, idx%nblenrim(igrd)
+         ii  = idx%nbi(jb,igrd)
+         ij  = idx%nbj(jb,igrd) 
+         ijm1 = ij + MAX( 0, INT( idx%flagv(jb) ) )   ! T pts j-indice inside the boundary
+         ijp1 = ij - MIN( 0, INT( idx%flagv(jb) ) )   ! T pts j-indice outside the boundary 
+         !
+         zcorr = - idx%flagv(jb) * SQRT( grav * phvr(ii, ij) ) * ( pssh(ii, ijm1) - spgu(ii,ijp1) )
+         zforc = dta%v2d(jb)
+         pv2d(ii,ij) = zforc + zcorr * vmask(ii,ij,1)
+      END DO
+      CALL lbc_lnk( pu2d, 'U', -1. )   ! Boundary points should be updated
+      CALL lbc_lnk( pv2d, 'V', -1. )   !
+      !
+      !
+   END SUBROUTINE bdy_dyn2d_fla
+#else
+   !!----------------------------------------------------------------------
+   !!   Dummy module                   NO Unstruct Open Boundary Conditions
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE bdy_dyn2d( kt )      ! Empty routine
+      WRITE(*,*) 'bdy_dyn_frs: You should not have seen this print! error?', kt
+   END SUBROUTINE bdy_dyn2d
+#endif
+
+   !!======================================================================
+END MODULE bdydyn2d
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn3d.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn3d.F90	(revision 3117)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn3d.F90	(revision 3117)
@@ -0,0 +1,126 @@
+MODULE bdydyn3d
+   !!======================================================================
+   !!                       ***  MODULE  bdydyn  ***
+   !! Unstructured Open Boundary Cond. :   Flow relaxation scheme on velocities
+   !!======================================================================
+   !! History :  1.0  !  2005-02  (J. Chanut, A. Sellar)  Original code
+   !!             -   !  2007-07  (D. Storkey) Move Flather implementation to separate routine.
+   !!            3.0  !  2008-04  (NEMO team)  add in the reference version
+   !!            3.2  !  2008-04  (R. Benshila) consider velocity instead of transport 
+   !!            3.3  !  2010-09  (E.O'Dea) modifications for Shelf configurations 
+   !!            3.3  !  2010-09  (D.Storkey) add ice boundary conditions
+   !!----------------------------------------------------------------------
+#if defined key_bdy 
+   !!----------------------------------------------------------------------
+   !!   'key_bdy' :                    Unstructured Open Boundary Condition
+   !!----------------------------------------------------------------------
+   !!   bdy_dyn3d        : apply open boundary conditions to baroclinic velocities
+   !!   bdy_dyn3d_frs    : apply Flow Relaxation Scheme
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers 
+   USE dom_oce         ! ocean space and time domain
+   USE bdy_oce         ! ocean open boundary conditions
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE in_out_manager  !
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   bdy_dyn3d     ! routine called in dynspg_flt (free surface case ONLY)
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! $Id: bdydyn.F90 2528 2010-12-27 17:33:53Z rblod $ 
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE bdy_dyn3d( kt )
+      !!----------------------------------------------------------------------
+      !!                  ***  SUBROUTINE bdy_dyn3d  ***
+      !!
+      !! ** Purpose : - Apply open boundary conditions for baroclinic velocities
+      !!
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT( in ) :: kt     ! Main time step counter
+      !!
+      INTEGER               :: ib_bdy ! loop index
+      !!
+
+      DO ib_bdy=1, nb_bdy
+
+!!$         IF ( using Orlanski radiation conditions ) THEN 
+!!$            CALL bdy_rad( kt,  bdyidx(ib_bdy) )
+!!$         ENDIF
+
+         SELECT CASE( nn_dyn3d(ib_bdy) )
+         CASE(jp_none)
+            CYCLE
+         CASE(jp_frs)
+            CALL bdy_dyn3d_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt )
+         CASE DEFAULT
+            CALL ctl_stop( 'bdy_dyn3d : unrecognised option for open boundaries for baroclinic velocities' )
+         END SELECT
+      ENDDO
+
+   END SUBROUTINE bdy_dyn3d
+
+   SUBROUTINE bdy_dyn3d_frs( idx, dta, kt )
+      !!----------------------------------------------------------------------
+      !!                  ***  SUBROUTINE bdy_dyn3d_frs  ***
+      !!
+      !! ** Purpose : - Apply the Flow Relaxation Scheme for baroclinic velocities
+      !!                at open boundaries.
+      !!
+      !! References :- Engedahl H., 1995: Use of the flow relaxation scheme in 
+      !!               a three-dimensional baroclinic ocean model with realistic
+      !!               topography. Tellus, 365-382.
+      !!----------------------------------------------------------------------
+      INTEGER                     ::   kt
+      TYPE(OBC_INDEX), INTENT(in) ::   idx  ! OBC indices
+      TYPE(OBC_DATA),  INTENT(in) ::   dta  ! OBC external data
+      !!
+      INTEGER  ::   jb, jk         ! dummy loop indices
+      INTEGER  ::   ii, ij, igrd   ! local integers
+      REAL(wp) ::   zwgt           ! boundary weight
+      !!----------------------------------------------------------------------
+      !
+      !
+      igrd = 2                      ! Relaxation of zonal velocity
+      DO jb = 1, idx%nblen(igrd)
+         DO jk = 1, jpkm1
+            ii   = idx%nbi(jb,igrd)
+            ij   = idx%nbj(jb,igrd)
+            zwgt = idx%nbw(jb,igrd)
+            ua(ii,ij,jk) = ( ua(ii,ij,jk) + zwgt * ( dta%u3d(jb,jk) - ua(ii,ij,jk) ) ) * umask(ii,ij,jk)
+         END DO
+      END DO
+      !
+      igrd = 3                      ! Relaxation of meridional velocity
+      DO jb = 1, idx%nblen(igrd)
+         DO jk = 1, jpkm1
+            ii   = idx%nbi(jb,igrd)
+            ij   = idx%nbj(jb,igrd)
+            zwgt = idx%nbw(jb,igrd)
+            va(ii,ij,jk) = ( va(ii,ij,jk) + zwgt * ( dta%v3d(jb,jk) - va(ii,ij,jk) ) ) * vmask(ii,ij,jk)
+         END DO
+      END DO 
+      CALL lbc_lnk( ua, 'U', -1. )   ;   CALL lbc_lnk( va, 'V', -1. )   ! Boundary points should be updated
+      !
+      IF( kt .eq. nit000 ) CLOSE( unit = 102 )
+
+   END SUBROUTINE bdy_dyn3d_frs
+
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Dummy module                   NO Unstruct Open Boundary Conditions
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE bdy_dyn3d( kt )      ! Empty routine
+      WRITE(*,*) 'bdy_dyn_frs: You should not have seen this print! error?', kt
+   END SUBROUTINE bdy_dyn3d
+#endif
+
+   !!======================================================================
+END MODULE bdydyn3d
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice.F90	(revision 3116)
+++ 	(revision )
@@ -1,85 +1,0 @@
-MODULE bdyice
-   !!======================================================================
-   !!                       ***  MODULE  bdyice  ***
-   !! Unstructured Open Boundary Cond. :  Flow Relaxation Scheme applied sea-ice
-   !!======================================================================
-   !!  History :  3.3  !  2010-09 (D. Storkey)  Original code
-   !!----------------------------------------------------------------------
-#if defined   key_bdy   &&   defined key_lim2
-   !!----------------------------------------------------------------------
-   !!   'key_bdy'            and                 Unstructured Open Boundary Conditions
-   !!   'key_lim2'                                                 LIM-2 sea ice model
-   !!----------------------------------------------------------------------
-   !!   bdy_ice_frs        : Relaxation of tracers on unstructured open boundaries
-   !!----------------------------------------------------------------------
-   USE oce             ! ocean dynamics and tracers variables
-   USE ice_2           ! LIM_2 ice variables
-   USE dom_oce         ! ocean space and time domain variables 
-   USE bdy_oce         ! ocean open boundary conditions
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE in_out_manager  ! write to numout file
-   USE lib_mpp         ! distributed memory computing
-   
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC   bdy_ice_frs    ! routine called in sbcmod
-
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-CONTAINS
-
-   SUBROUTINE bdy_ice_frs( kt )
-      !!------------------------------------------------------------------------------
-      !!                 ***  SUBROUTINE bdy_ice_frs  ***
-      !!                    
-      !! ** Purpose : Apply the Flow Relaxation Scheme for sea-ice fields in the case 
-      !!              of unstructured open boundaries. Currently only tested for LIM2.
-      !! 
-      !! Reference : Engedahl H., 1995: Use of the flow relaxation scheme in a three-
-      !!             dimensional baroclinic ocean model with realistic topography. Tellus, 365-382.
-      !!------------------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt   ! model time step index
-      !!
-      INTEGER  ::   jb, jk, jgrd   ! dummy loop indices
-      INTEGER  ::   ii, ij         ! local scalar
-      REAL(wp) ::   zwgt, zwgt1    ! local scalar
-      !!------------------------------------------------------------------------------
-      !
-      jgrd = 1      ! Everything is at T-points here
-      !
-      IF( ln_ice_frs ) THEN     ! update ice fields by relaxation at the boundary
-         DO jb = 1, nblen(jgrd)
-            DO jk = 1, jpkm1
-               ii    = nbi(jb,jgrd)
-               ij    = nbj(jb,jgrd)
-               zwgt  = nbw(jb,jgrd)
-               zwgt1 = 1.e0 - nbw(jb,jgrd)
-               frld (ii,ij) = ( frld (ii,ij) * zwgt1 + frld_bdy (jb) * zwgt ) * tmask(ii,ij,1)     ! Leads fraction 
-               hicif(ii,ij) = ( hicif(ii,ij) * zwgt1 + hicif_bdy(jb) * zwgt ) * tmask(ii,ij,1)     ! Ice depth 
-               hsnif(ii,ij) = ( hsnif(ii,ij) * zwgt1 + hsnif_bdy(jb) * zwgt ) * tmask(ii,ij,1)     ! Snow depth
-            END DO
-         END DO 
-         CALL lbc_lnk( frld, 'T', 1. )                                         ! lateral boundary conditions
-         CALL lbc_lnk( hicif, 'T', 1. )   ;   CALL lbc_lnk( hsnif, 'T', 1. )
-         !
-      ELSE                          ! we have called this routine without ln_ice_frs not set
-         IF( kt == nit000 )   CALL ctl_warn( 'E R R O R (possible) called bdy_ice_frs when ln_ice_frs is false?' )
-      ENDIF
-      !      
-   END SUBROUTINE bdy_ice_frs
-#else
-   !!---------------------------------------------------------------------------------
-   !!   Default option                                                    Empty module
-   !!---------------------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE bdy_ice_frs( kt )      ! Empty routine
-      WRITE(*,*) 'bdy_ice_frs: You should not have seen this print! error?', kt
-   END SUBROUTINE bdy_ice_frs
-#endif
-
-   !!=================================================================================
-END MODULE bdyice
Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim2.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim2.F90	(revision 3117)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim2.F90	(revision 3117)
@@ -0,0 +1,107 @@
+MODULE bdyice_lim2
+   !!======================================================================
+   !!                       ***  MODULE  bdyice_lim2  ***
+   !! Unstructured Open Boundary Cond. :  Flow Relaxation Scheme applied sea-ice (LIM2)
+   !!======================================================================
+   !!  History :  3.3  !  2010-09 (D. Storkey)  Original code
+   !!----------------------------------------------------------------------
+#if defined   key_bdy   &&   defined key_lim2
+   !!----------------------------------------------------------------------
+   !!   'key_bdy'            and                 Unstructured Open Boundary Conditions
+   !!   'key_lim2'                                                 LIM-2 sea ice model
+   !!----------------------------------------------------------------------
+   !!   bdy_ice_lim_2      : Application of open boundaries to ice
+   !!   bdy_ice_frs        : Application of Flow Relaxation Scheme
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers variables
+   USE ice_2           ! LIM_2 ice variables
+   USE dom_oce         ! ocean space and time domain variables 
+   USE bdy_oce         ! ocean open boundary conditions
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE in_out_manager  ! write to numout file
+   USE lib_mpp         ! distributed memory computing
+   
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   bdy_ice_lim_2    ! routine called in sbcmod
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! $Id: bdyice.F90 2715 2011-03-30 15:58:35Z rblod $
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE bdy_ice_lim_2( kt )
+      !!----------------------------------------------------------------------
+      !!                  ***  SUBROUTINE bdy_ice_lim_2  ***
+      !!
+      !! ** Purpose : - Apply open boundary conditions for ice (LIM2)
+      !!
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT( in ) :: kt     ! Main time step counter
+      !!
+      INTEGER               :: ib_bdy ! Loop index
+
+      DO ib_bdy=1, nb_bdy
+
+         SELECT CASE( nn_ice_lim2(ib_bdy) )
+         CASE(jp_none)
+            CYCLE
+         CASE(jp_frs)
+            CALL bdy_ice_frs( idx_bdy(ib_bdy), dta_idx(ib_bdy) )
+         CASE DEFAULT
+            CALL ctl_stop( 'bdy_tra : unrecognised option for open boundaries for T an S' )
+         END SELECT
+      ENDDO
+
+   END SUBROUTINE bdy_ice_lim_2
+
+   SUBROUTINE bdy_ice_frs( idx, dta )
+      !!------------------------------------------------------------------------------
+      !!                 ***  SUBROUTINE bdy_ice_frs  ***
+      !!                    
+      !! ** Purpose : Apply the Flow Relaxation Scheme for sea-ice fields in the case 
+      !!              of unstructured open boundaries. Currently only tested for LIM2.
+      !! 
+      !! Reference : Engedahl H., 1995: Use of the flow relaxation scheme in a three-
+      !!             dimensional baroclinic ocean model with realistic topography. Tellus, 365-382.
+      !!------------------------------------------------------------------------------
+      TYPE(OBC_INDEX), INTENT(in) ::   idx  ! OBC indices
+      TYPE(OBC_DATA),  INTENT(in) ::   dta  ! OBC external data
+      !!
+      INTEGER  ::   jb, jk, jgrd   ! dummy loop indices
+      INTEGER  ::   ii, ij         ! local scalar
+      REAL(wp) ::   zwgt, zwgt1    ! local scalar
+      !!------------------------------------------------------------------------------
+      !
+      jgrd = 1      ! Everything is at T-points here
+      !
+      DO jb = 1, idx%nblen(jgrd)
+         DO jk = 1, jpkm1
+            ii    = idx%nbi(jb,jgrd)
+            ij    = idx%nbj(jb,jgrd)
+            zwgt  = idx%nbw(jb,jgrd)
+            zwgt1 = 1.e0 - idx%nbw(jb,jgrd)
+            frld (ii,ij) = ( frld (ii,ij) * zwgt1 + dta%frld (jb) * zwgt ) * tmask(ii,ij,1)     ! Leads fraction 
+            hicif(ii,ij) = ( hicif(ii,ij) * zwgt1 + dta%hicif(jb) * zwgt ) * tmask(ii,ij,1)     ! Ice depth 
+            hsnif(ii,ij) = ( hsnif(ii,ij) * zwgt1 + dta%hsnif(jb) * zwgt ) * tmask(ii,ij,1)     ! Snow depth
+         END DO
+      END DO 
+      CALL lbc_lnk( frld, 'T', 1. )                                         ! lateral boundary conditions
+      CALL lbc_lnk( hicif, 'T', 1. )   ;   CALL lbc_lnk( hsnif, 'T', 1. )
+      !      
+   END SUBROUTINE bdy_ice_frs
+#else
+   !!---------------------------------------------------------------------------------
+   !!   Default option                                                    Empty module
+   !!---------------------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE bdy_ice_lim_2( kt )      ! Empty routine
+      WRITE(*,*) 'bdy_ice_frs: You should not have seen this print! error?', kt
+   END SUBROUTINE bdy_ice_lim_2
+#endif
+
+   !!=================================================================================
+END MODULE bdyice_lim2
