Index: branches/devukmo2010/NEMO/OPA_SRC/BDY/bdyice.F90
===================================================================
--- branches/devukmo2010/NEMO/OPA_SRC/BDY/bdyice.F90	(revision 2128)
+++ branches/devukmo2010/NEMO/OPA_SRC/BDY/bdyice.F90	(revision 2185)
@@ -1,34 +1,32 @@
 MODULE bdyice
-   !!=================================================================================
+   !!======================================================================
    !!                       ***  MODULE  bdyice  ***
-   !! Ocean tracers:   Flow Relaxation Scheme of sea-ice fields on each open boundary
-   !!=================================================================================
-#if defined key_bdy && defined key_lim2
-   !!---------------------------------------------------------------------------------
-   !!   'key_bdy'      :                         Unstructured Open Boundary Conditions
-   !!---------------------------------------------------------------------------------
+   !! 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        : Relaxation of tracers on unstructured open boundaries
-   !!---------------------------------------------------------------------------------
-   !! * Modules used
+   !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers variables
-#if defined key_lim2
    USE ice_2           ! LIM_2 ice variables
-#endif
    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
+   
    IMPLICIT NONE
    PRIVATE
 
-   !! * Accessibility
-   PUBLIC bdy_ice     ! routine called in stp
+   PUBLIC   bdy_ice    ! routine called in sbcmod
 
-   !! * Substitutions
-
-   !!---------------------------------------------------------------------------------
-   !!   OPA 9.0 , LODYC-IPSL  (2003)
-   !!---------------------------------------------------------------------------------
-
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -37,59 +35,38 @@
       !!                 ***  SUBROUTINE bdy_ice  ***
       !!                    
-      !! ** Purpose : Apply the Flow Relaxation Scheme for sea-ice fields in the  
-      !!              case of unstructured open boundaries. Currently only tested
-      !!              for LIM2.
+      !! ** 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.
-      !!  History :
-      !!   NEMO 3.3  !  2010-09 (D. Storkey) Original code
+      !! Reference : Engedahl H., 1995: Use of the flow relaxation scheme in a three-
+      !!             dimensional baroclinic ocean model with realistic topography. Tellus, 365-382.
       !!------------------------------------------------------------------------------
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kt
-
-      !! * Local declarations
-      REAL(wp) :: zwgt                       ! boundary weight
-      INTEGER ::   jb, jk, jgrd              ! dummy loop indices
-      INTEGER ::   ii, ij                    ! 2D addresses
+      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_bdy_ice_frs) THEN
- 
-        DO jb = 1, nblen(jgrd)
-          DO jk = 1, jpkm1
-            ii = nbi(jb,jgrd)
-            ij = nbj(jb,jgrd)
-            zwgt = nbw(jb,jgrd)
-
-            ! Leads fraction relaxation at the boundary   
-            frld(ii,ij) = ( frld(ii,ij)*(1.-zwgt)  +  frld_bdy(jb)*zwgt ) &
-                                                          * tmask(ii,ij,1)         
-
-            ! Ice depth relaxation at the boundary   
-            hicif(ii,ij) = ( hicif(ii,ij)*(1.-zwgt)  +  hicif_bdy(jb)*zwgt ) &
-                                                          * tmask(ii,ij,1)
-            ! Snow depth relaxation at the boundary   
-            hsnif(ii,ij) = ( hsnif(ii,ij)*(1.-zwgt)  +  hsnif_bdy(jb)*zwgt ) &
-                                                          * tmask(ii,ij,1)
-   
-          END DO
-        END DO 
-
-        CALL lbc_lnk( frld, 'T', 1. )  ! Boundary points should be updated
-        CALL lbc_lnk( hicif, 'T', 1. ) !
-        CALL lbc_lnk( hsnif, 'T', 1. ) !
-      
-      ELSE
-        ! we have called this routine without ln_bdy_ice_frs not set
-        IF(kt .EQ. nit000) THEN
-          WRITE(numout,*) 'E R R O R (possible) called bdy_ice when'
-          WRITE(numout,*) 'ln_bdy_ice_frs is false?'
-        ENDIF
-      ENDIF ! if ln_bdy_ice_frs
-      
+      !
+      jgrd = 1      ! Everything is at T-points here
+      !
+      IF( ln_bdy_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_bdy_ice_frs not set
+         IF( kt == nit000 )   CALL ctl_warn( 'E R R O R (possible) called bdy_ice when ln_bdy_ice_frs is false?' )
+      ENDIF
+      !      
    END SUBROUTINE bdy_ice
 #else
@@ -99,4 +76,5 @@
 CONTAINS
    SUBROUTINE bdy_ice( kt )      ! Empty routine
+      WRITE(*,*) 'bdy_ice: You should not have seen this print! error?', kt
    END SUBROUTINE bdy_ice
 #endif
