Index: /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/CONFIG/SHARED/namelist_ice_lim3_ref
===================================================================
--- /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/CONFIG/SHARED/namelist_ice_lim3_ref	(revision 5319)
+++ /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/CONFIG/SHARED/namelist_ice_lim3_ref	(revision 5320)
@@ -72,4 +72,8 @@
    rn_ahi0_ref    = 350.0          !  horizontal sea ice diffusivity (m2/s) 
                                    !     if nn_ahi0 > 0, rn_ahi0_ref is the reference value at a nominal 2 deg resolution
+
+   cc_opt	  = .true.         !  convergence check optimization
+   cc_freq        = 5              !  convergence check frequency 
+
 /
 !------------------------------------------------------------------------------
Index: /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/NEMO/LIM_SRC_3/ice.F90
===================================================================
--- /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/NEMO/LIM_SRC_3/ice.F90	(revision 5319)
+++ /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/NEMO/LIM_SRC_3/ice.F90	(revision 5320)
@@ -181,5 +181,7 @@
    REAL(wp), PUBLIC ::   rn_ahi0_ref      !: sea-ice hor. eddy diffusivity coeff. (m2/s)
    REAL(wp), PUBLIC ::   rn_relast        !: ratio => telast/rdt_ice (1/3 or 1/9 depending on nb of subcycling nevp) 
-
+   LOGICAL , PUBLIC ::  cc_opt
+   INTEGER , PUBLIC ::  cc_freq
+   
    !                                     !!** ice-salinity namelist (namicesal) **
    REAL(wp), PUBLIC ::   rn_simax         !: maximum ice salinity [PSU]
@@ -398,4 +400,5 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_vice     !: ice volume variation   [m/s] 
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_vsnw     !: snw volume variation   [m/s] 
+
    !
    !!----------------------------------------------------------------------
Index: /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/NEMO/LIM_SRC_3/limdyn.F90
===================================================================
--- /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/NEMO/LIM_SRC_3/limdyn.F90	(revision 5319)
+++ /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/NEMO/LIM_SRC_3/limdyn.F90	(revision 5320)
@@ -244,5 +244,5 @@
       INTEGER  ::   ios                 ! Local integer output status for namelist read
       NAMELIST/namicedyn/ nn_icestr, ln_icestr_bvf, rn_pe_rdg, rn_pstar, rn_crhg, rn_cio,  rn_creepl, rn_ecc, &
-         &                nn_nevp, rn_relast, nn_ahi0, rn_ahi0_ref
+         &                nn_nevp, rn_relast, nn_ahi0, rn_ahi0_ref, cc_opt, cc_freq
       INTEGER  ::   ji, jj
       REAL(wp) ::   za00, zd_max
Index: /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/NEMO/LIM_SRC_3/limhdf.F90
===================================================================
--- /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/NEMO/LIM_SRC_3/limhdf.F90	(revision 5319)
+++ /branches/2015/dev_r5302_CNRS18_HPC_scalability/NEMOGCM/NEMO/LIM_SRC_3/limhdf.F90	(revision 5320)
@@ -121,11 +121,30 @@
          CALL lbc_lnk( zrlx, 'T', 1. )                   ! lateral boundary condition
          !
-         zconv = 0._wp                                   ! convergence test
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1
-               zconv = MAX( zconv, ABS( zrlx(ji,jj) - ptab(ji,jj) )  )
-            END DO
-         END DO
-         IF( lk_mpp )   CALL mpp_max( zconv )            ! max over the global domain
+
+         !! The convergence check optimization can be activated in the namelist using 
+         !! the parameters cc_opt to activate the optimization and cc_freq to set the frequency of 
+         !! Convergence Checks. These parameters must go into namicedyn section.
+
+         IF ( cc_opt == .true. ) THEN
+            !Convergence test every cc_freq time-steps
+            IF ( MOD( iter-1 , cc_freq ) == 0 )  THEN
+               zconv = 0._wp                                   ! convergence test
+               DO jj = 2, jpjm1
+                  DO ji = fs_2, fs_jpim1
+                     zconv = MAX( zconv, ABS( zrlx(ji,jj) - ptab(ji,jj) )  )
+                  END DO
+               END DO
+               IF( lk_mpp )   CALL mpp_max( zconv )            ! max over the global domain             
+            ENDIF
+         ELSE
+             zconv = 0._wp                                   ! convergence test
+             DO jj = 2, jpjm1
+                DO ji = fs_2, fs_jpim1
+                   zconv = MAX( zconv, ABS( zrlx(ji,jj) - ptab(ji,jj) )  )
+                END DO
+             END DO
+             IF( lk_mpp )   CALL mpp_max( zconv )            ! max over the global domain
+         END IF
+         
          !
          ptab(:,:) = zrlx(:,:)
