Index: /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/cfgs/SHARED/field_def_nemo-ice.xml
===================================================================
--- /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/cfgs/SHARED/field_def_nemo-ice.xml	(revision 12918)
+++ /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/cfgs/SHARED/field_def_nemo-ice.xml	(revision 12919)
@@ -308,5 +308,6 @@
 
           <!-- heat diffusion convergence tests -->
-          <field id="tice_cvg"   long_name="sea ice temperature convergence"   standard_name="sea_ice_temperature_convergence"   unit="K" />
+          <field id="tice_cvgerr" long_name="sea ice temperature convergence error"      standard_name="sea_ice_temperature_convergence_err" unit="K" />
+          <field id="tice_cvgstp" long_name="sea ice temperature convergence iterations" standard_name="sea_ice_temperature_convergence_stp" unit=""  />
 
 	</field_group> <!-- SBC_3D -->
Index: /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/cfgs/SHARED/namelist_ice_ref
===================================================================
--- /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/cfgs/SHARED/namelist_ice_ref	(revision 12918)
+++ /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/cfgs/SHARED/namelist_ice_ref	(revision 12919)
@@ -149,5 +149,5 @@
    rn_kappa_smlt    =   7.0           !  nn_qtrice = 1: radiation attenuation coefficient in melting snow [1/m]
    rn_kappa_sdry    =  10.0           !                 radiation attenuation coefficient in dry snow     [1/m]
-   ln_zdf_chkcvg    = .false.         !  check convergence of heat diffusion scheme (output variable: tice_cvg)
+   ln_zdf_chkcvg    = .false.         !  check convergence of heat diffusion scheme (outputs: tice_cvgerr, tice_cvgstp)
 /
 !------------------------------------------------------------------------------
Index: /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/ice.F90
===================================================================
--- /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/ice.F90	(revision 12918)
+++ /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/ice.F90	(revision 12919)
@@ -417,9 +417,4 @@
    !
    !!----------------------------------------------------------------------
-   !! * Check convergence
-   !!----------------------------------------------------------------------
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tice_cvg        !: convergence of ice/snow temperature (dT in K)
-   !
-   !!----------------------------------------------------------------------
    !! NEMO/ICE 4.0 , NEMO Consortium (2018)
    !! $Id$
@@ -434,5 +429,5 @@
       INTEGER :: ice_alloc
       !
-      INTEGER :: ierr(18), ii
+      INTEGER :: ierr(17), ii
       !!-----------------------------------------------------------------
       ierr(:) = 0
@@ -520,8 +515,4 @@
       ALLOCATE( a_i_last_couple(jpi,jpj,jpl) , STAT=ierr(ii) )
 
-      ! * Check convergence
-      ii = ii + 1
-      ALLOCATE( tice_cvg(jpi,jpj,jpl) , STAT=ierr(ii) )
-
       ice_alloc = MAXVAL( ierr(:) )
       IF( ice_alloc /= 0 )   CALL ctl_stop( 'STOP', 'ice_alloc: failed to allocate arrays.' )
Index: /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/ice1d.F90
===================================================================
--- /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/ice1d.F90	(revision 12918)
+++ /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/ice1d.F90	(revision 12919)
@@ -147,5 +147,6 @@
 
    ! convergence check
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   tice_cvg_1d   !: convergence of ice/snow temperature (dT) [K]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   tice_cvgerr_1d   !: convergence of ice/snow temp (dT)          [K]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   tice_cvgstp_1d   !: convergence of ice/snow temp (subtimestep) [-]
    ! 
    !!----------------------
@@ -227,5 +228,5 @@
       !
       ii = ii + 1
-      ALLOCATE( tice_cvg_1d(jpij) , STAT=ierr(ii) )
+      ALLOCATE( tice_cvgerr_1d(jpij) , tice_cvgstp_1d(jpij) , STAT=ierr(ii) )
       !
       ii = ii + 1
Index: /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icestp.F90
===================================================================
--- /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icestp.F90	(revision 12918)
+++ /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icestp.F90	(revision 12919)
@@ -435,7 +435,4 @@
       diag_trp_ei(:,:) = 0._wp   ;   diag_trp_es(:,:) = 0._wp
       diag_trp_sv(:,:) = 0._wp
-
-      ! for convergence check
-      IF( ln_zdf_chkcvg )   tice_cvg(:,:,:) = 0._wp
       
    END SUBROUTINE diag_set0
Index: /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icethd.F90
===================================================================
--- /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icethd.F90	(revision 12918)
+++ /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icethd.F90	(revision 12919)
@@ -54,4 +54,7 @@
    LOGICAL ::   ln_leadhfx       !  heat in the leads is used to melt sea-ice before warming the ocean
 
+   !! for convergence tests
+   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztice_cvgerr, ztice_cvgstp
+
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
@@ -104,4 +107,10 @@
          WRITE(numout,*) '~~~~~~~'
       ENDIF
+
+      ! convergence tests
+      IF( ln_zdf_chkcvg ) THEN
+         ALLOCATE( ztice_cvgerr(jpi,jpj,jpl) , ztice_cvgstp(jpi,jpj,jpl) )
+         ztice_cvgerr = 0._wp ; ztice_cvgstp = 0._wp
+      ENDIF
       
       !---------------------------------------------!
@@ -220,5 +229,5 @@
             !                                                       ! --- & Change units of e_i, e_s from J/m2 to J/m3 --- !
             !
-            s_i_new   (1:npti) = 0._wp ; dh_s_tot(1:npti) = 0._wp  ! --- some init --- !  (important to have them here) 
+            s_i_new   (1:npti) = 0._wp ; dh_s_tot(1:npti) = 0._wp   ! --- some init --- !  (important to have them here) 
             dh_i_sum  (1:npti) = 0._wp ; dh_i_bom(1:npti) = 0._wp ; dh_i_itm  (1:npti) = 0._wp 
             dh_i_sub  (1:npti) = 0._wp ; dh_i_bog(1:npti) = 0._wp
@@ -254,6 +263,11 @@
       IF( ln_icedO )          CALL ice_thd_do                       ! --- Frazil ice growth in leads --- !
       !
+      ! convergence tests
+      IF( ln_zdf_chkcvg ) THEN
+         CALL iom_put( 'tice_cvgerr', ztice_cvgerr ) ; DEALLOCATE( ztice_cvgerr )
+         CALL iom_put( 'tice_cvgstp', ztice_cvgstp ) ; DEALLOCATE( ztice_cvgstp )
+      ENDIF
+      !
       ! controls
-      IF( ln_zdf_chkcvg .AND. iom_use('tice_cvg') )  CALL iom_put( 'tice_cvg', tice_cvg ) ! convergence of zdf scheme
       IF( ln_icectl )   CALL ice_prt    (kt, iiceprt, jiceprt, 1, ' - ice thermodyn. - ') ! prints
       IF( ln_ctl    )   CALL ice_prt3D  ('icethd')                                        ! prints
@@ -523,5 +537,6 @@
          ! check convergence of heat diffusion scheme
          IF( ln_zdf_chkcvg ) THEN
-            CALL tab_1d_2d( npti, nptidx(1:npti), tice_cvg_1d(1:npti), tice_cvg(:,:,kl) )
+            CALL tab_1d_2d( npti, nptidx(1:npti), tice_cvgerr_1d(1:npti), ztice_cvgerr(:,:,kl) )
+            CALL tab_1d_2d( npti, nptidx(1:npti), tice_cvgstp_1d(1:npti), ztice_cvgstp(:,:,kl) )
          ENDIF
          !
Index: /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icethd_zdf_bl99.F90
===================================================================
--- /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icethd_zdf_bl99.F90	(revision 12918)
+++ /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icethd_zdf_bl99.F90	(revision 12919)
@@ -586,6 +586,11 @@
                      zdti_max      =  MAX( zdti_max, ABS( t_i_1d(ji,jk) - ztib(ji,jk) ) )
                   END DO
-
-                  IF ( zdti_max < zdti_bnd ) l_T_converged(ji) = .TRUE.
+                  ! convergence test
+                  IF( ln_zdf_chkcvg ) THEN
+                     tice_cvgerr_1d(ji) = zdti_max
+                     tice_cvgstp_1d(ji) = REAL(iconv)
+                  ENDIF
+
+                  IF( zdti_max < zdti_bnd )   l_T_converged(ji) = .TRUE.
 
                ENDIF
@@ -761,6 +766,11 @@
                      zdti_max      =  MAX ( zdti_max, ABS( t_i_1d(ji,jk) - ztib(ji,jk) ) )
                   END DO
-
-                  IF ( zdti_max < zdti_bnd ) l_T_converged(ji) = .TRUE.
+                  ! convergence test
+                  IF( ln_zdf_chkcvg ) THEN
+                     tice_cvgerr_1d(ji) = zdti_max
+                     tice_cvgstp_1d(ji) = REAL(iconv)
+                  ENDIF
+
+                  IF( zdti_max < zdti_bnd )   l_T_converged(ji) = .TRUE.
 
                ENDIF
@@ -769,26 +779,6 @@
 
          ENDIF ! k_cnd
-         
+
       END DO  ! End of the do while iterative procedure
-      !
-      ! convergence tests (only for output)
-      IF( ln_zdf_chkcvg ) THEN
-         tice_cvg_1d(1:npti) = 0._wp
-         DO jk = 1, nlay_s          ! snow temperature
-            DO ji = 1, npti
-               tice_cvg_1d(ji) = MAX( tice_cvg_1d(ji), ABS( t_s_1d(ji,jk) - ztsb(ji,jk) ) )
-            ENDDO
-         ENDDO
-         DO jk = 1, nlay_i          ! ice temperature
-            DO ji = 1, npti
-               tice_cvg_1d(ji) = MAX( tice_cvg_1d(ji), ABS( t_i_1d(ji,jk) - ztib(ji,jk) ) )
-            ENDDO
-         ENDDO
-         IF( k_cnd == np_cnd_OFF .OR. k_cnd == np_cnd_EMU ) THEN
-            DO ji = 1, npti         ! surface temperature
-               tice_cvg_1d(ji) = MAX( tice_cvg_1d(ji), ABS( t_su_1d(ji) - ztsub(ji) ) )
-            ENDDO
-         ENDIF
-      ENDIF
       !
       !-----------------------------
