Index: branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90
===================================================================
--- branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90	(revision 4220)
+++ branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90	(revision 4332)
@@ -50,4 +50,5 @@
    PUBLIC   lim_rhg        ! routine called by lim_dyn (or lim_dyn_2)
 
+   REAL(wp) ::   epsi10 = 1.e-10_wp   !
    REAL(wp) ::   rzero   = 0._wp   ! constant values
    REAL(wp) ::   rone    = 1._wp   ! constant values
@@ -486,12 +487,4 @@
          CALL lbc_lnk( zs12(:,:), 'F', 1. )
 
-!#if defined key_bdy
-!         ! clem: change zs1, zs2, zs12 at the boundary for each iteration
-!         CALL bdy_ice_lim_dyn( 2, zs1, zs2, zs12 )
-!         CALL lbc_lnk( zs1 (:,:), 'T', 1. )
-!         CALL lbc_lnk( zs2 (:,:), 'T', 1. )
-!         CALL lbc_lnk( zs12(:,:), 'F', 1. )
-!#endif         
-
          ! Ice internal stresses (Appendix C of Hunke and Dukowicz, 2002)
          DO jj = k_j1+1, k_jpj-1
@@ -544,4 +537,8 @@
             CALL agrif_rhg_lim2( jter, nevp, 'U' )
 #endif
+#if defined key_bdy
+         ! clem: change u_ice and v_ice at the boundary for each iteration
+         CALL bdy_ice_lim_dyn( 'U' )
+#endif         
 
 !CDIR NOVERRCHK
@@ -572,4 +569,8 @@
             CALL agrif_rhg_lim2( jter, nevp, 'V' )
 #endif
+#if defined key_bdy
+         ! clem: change u_ice and v_ice at the boundary for each iteration
+         CALL bdy_ice_lim_dyn( 'V' )
+#endif         
 
          ELSE 
@@ -599,6 +600,10 @@
             CALL lbc_lnk( v_ice(:,:), 'V', -1. )
 #if defined key_agrif && defined key_lim2
-            CALL agrif_rhg_lim2( jter, nevp , 'V' )
-#endif
+            CALL agrif_rhg_lim2( jter, nevp, 'V' )
+#endif
+#if defined key_bdy
+         ! clem: change u_ice and v_ice at the boundary for each iteration
+         CALL bdy_ice_lim_dyn( 'V' )
+#endif         
 
 !CDIR NOVERRCHK
@@ -632,12 +637,11 @@
             CALL agrif_rhg_lim2( jter, nevp, 'U' )
 #endif
+#if defined key_bdy
+         ! clem: change u_ice and v_ice at the boundary for each iteration
+         CALL bdy_ice_lim_dyn( 'U' )
+#endif         
 
          ENDIF
          
-!#if defined key_bdy
-!         ! clem: change u_ice and v_ice at the boundary for each iteration
-!         CALL bdy_ice_lim_dyn( 1 )
-!#endif         
-
          IF(ln_ctl) THEN
             !---  Convergence test.
@@ -666,6 +670,6 @@
 !CDIR NOVERRCHK
          DO ji = fs_2, fs_jpim1
-            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - 1.0e-6 ) ) 
-            !zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , 1.0e-06 )
+            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - epsi10 ) ) 
+            !zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , epsi10 )
             zdummy = vt_i(ji,jj)
             IF ( zdummy .LE. hminrhg ) THEN
@@ -684,11 +688,12 @@
 #if defined key_bdy
       ! clem: change u_ice and v_ice at the boundary
-      CALL bdy_ice_lim_dyn( 1 )
+      CALL bdy_ice_lim_dyn( 'U' )
+      CALL bdy_ice_lim_dyn( 'V' )
 #endif         
 
       DO jj = k_j1+1, k_jpj-1 
          DO ji = fs_2, fs_jpim1
-            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - 1.0e-6 ) ) 
-            !zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , 1.0e-06 )
+            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - epsi10 ) ) 
+            !zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , epsi10 )
             zdummy = vt_i(ji,jj)
             IF ( zdummy .LE. hminrhg ) THEN
@@ -714,6 +719,6 @@
             !- zdd(:,:), zdt(:,:): divergence and tension at centre 
             !- zds(:,:): shear on northeast corner of grid cells
-            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - 1.0e-6 ) ) 
-            !zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , 1.0e-06 )
+            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - epsi10 ) ) 
+            !zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , epsi10 )
             zdummy = vt_i(ji,jj)
             IF ( zdummy .LE. hminrhg ) THEN
