Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/1_namelist_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/1_namelist_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/1_namelist_cfg	(revision 13121)
@@ -81,6 +81,7 @@
    ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
                      ! Sea-ice :
-   nn_ice      = 2         !  =2 or 3 automatically for SI3 or CICE    ("key_si3" or "key_cice")
-                           !          except in AGRIF zoom where it has to be specified
+   nn_ice      = 2         !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
                      ! Misc. options of sbc : 
    ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr)
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/2_namelist_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/2_namelist_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/2_namelist_cfg	(revision 13121)
@@ -78,5 +78,7 @@
    ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
                      ! Sea-ice :
-   nn_ice      = 2         !  =0   Use SI3 model
+   nn_ice      = 2         !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
                      ! Misc. options of sbc : 
    ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr)
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/3_namelist_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/3_namelist_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/3_namelist_cfg	(revision 13121)
@@ -78,5 +78,7 @@
    ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
                      ! Sea-ice :
-   nn_ice      = 2         !  =0   Use SI3 model
+   nn_ice      = 2         !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
                      ! Misc. options of sbc : 
    ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr)
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/namelist_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/namelist_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/AGRIF_DEMO/EXPREF/namelist_cfg	(revision 13121)
@@ -81,6 +81,7 @@
    ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
                      ! Sea-ice :
-   nn_ice      = 2         !  =2 or 3 automatically for SI3 or CICE    ("key_si3" or "key_cice")
-                           !          except in AGRIF zoom where it has to be specified
+   nn_ice      = 2         !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
                      ! Misc. options of sbc : 
    ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr)
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/ORCA2_ICE_ABL/EXPREF/namelist_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/ORCA2_ICE_ABL/EXPREF/namelist_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/ORCA2_ICE_ABL/EXPREF/namelist_cfg	(revision 13121)
@@ -84,6 +84,7 @@
    ln_abl      = .true.    !  ABL  formulation                          (T => fill namsbc_abl )
                      ! Sea-ice :
-   nn_ice      = 2         !  =2 or 3 automatically for SI3 or CICE    ("key_si3" or "key_cice")
-                           !          except in AGRIF zoom where it has to be specified
+   nn_ice      = 2         !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
                      ! Misc. options of sbc : 
    ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr)
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/ORCA2_ICE_PISCES/EXPREF/namelist_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/ORCA2_ICE_PISCES/EXPREF/namelist_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/ORCA2_ICE_PISCES/EXPREF/namelist_cfg	(revision 13121)
@@ -80,6 +80,7 @@
    ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
                      ! Sea-ice :
-   nn_ice      = 2         !  =2 or 3 automatically for SI3 or CICE    ("key_si3" or "key_cice")
-                           !          except in AGRIF zoom where it has to be specified
+   nn_ice      = 2         !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
                      ! Misc. options of sbc : 
    ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr)
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/ORCA2_SAS_ICE/EXPREF/namelist_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/ORCA2_SAS_ICE/EXPREF/namelist_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/ORCA2_SAS_ICE/EXPREF/namelist_cfg	(revision 13121)
@@ -59,5 +59,7 @@
    nn_fsbc     = 1         !  frequency of SBC module call
    ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
-   nn_ice      = 2         !  =2  sea-ice model                         ("key_SI3" or "key_cice")
+   nn_ice      = 2         !  =0 no ice boundary condition
+      !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
+      !                    !  =2 or 3 for SI3 and CICE, respectively
 /
 !-----------------------------------------------------------------------
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/SHARED/field_def_nemo-oce.xml
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/SHARED/field_def_nemo-oce.xml	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/SHARED/field_def_nemo-oce.xml	(revision 13121)
@@ -369,4 +369,12 @@
           <field id="taum_oce"     long_name="wind stress module over open ocean"           standard_name="magnitude_of_surface_downward_stress"               unit="N/m2"  />
 
+          <field id="Cd_oce"      long_name="Drag coefficient over open ocean"              standard_name="drag_coefficient_water"                 unit=""  />
+          <field id="Ce_oce"      long_name="Evaporaion coefficient over open ocean"        standard_name="evap_coefficient_water"                 unit=""  />
+          <field id="Ch_oce"      long_name="Sensible heat coefficient over open ocean"     standard_name="sensible_heat_coefficient_water"        unit=""  />          
+
+          <field id="Cd_ice"      long_name="Drag coefficient over ice"                     standard_name="drag_coefficient_ice"                 unit=""  />
+          <field id="Ce_ice"      long_name="Evaporaion coefficient over ice"               standard_name="evap_coefficient_ice"                 unit=""  />
+          <field id="Ch_ice"      long_name="Sensible heat coefficient over ice"            standard_name="sensible_heat_coefficient_ice"        unit=""  />          
+
           <!-- available key_oasis3 -->
           <field id="snow_ao_cea"  long_name="Snow over ice-free ocean (cell average)"   standard_name="snowfall_flux"                             unit="kg/m2/s"  />
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/SHARED/namelist_ref
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/SHARED/namelist_ref	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/SHARED/namelist_ref	(revision 13121)
@@ -1134,4 +1134,10 @@
    !                       !                 = 3 as =2 with distinct dissipative an mixing length scale
    ln_mxl0     = .true.    !  surface mixing length scale = F(wind stress) (T) or not (F)
+      nn_mxlice    = 0        ! type of scaling under sea-ice
+                              !    = 0 no scaling under sea-ice
+                              !    = 1 scaling with constant sea-ice thickness
+                              !    = 2  scaling with mean sea-ice thickness ( only with SI3 sea-ice model )
+                              !    = 3  scaling with maximum sea-ice thickness
+      rn_mxlice   = 10.       ! max constant ice thickness value when scaling under sea-ice ( nn_mxlice=1)
    rn_mxl0     =   0.04    !  surface  buoyancy lenght scale minimum value
    ln_drg      = .false.   !  top/bottom friction added as boundary condition of TKE
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/WED025/EXPREF/namelist_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/WED025/EXPREF/namelist_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/cfgs/WED025/EXPREF/namelist_cfg	(revision 13121)
@@ -116,8 +116,7 @@
    ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
                      ! Sea-ice :
-   nn_ice      = 2         !  =0 no ice boundary condition    
+   nn_ice      = 2         !  =0 no ice boundary condition
       !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif )
-      !                    !  =2 or 3 automatically for SI3 or CICE    ("key_si3" or "key_cice")
-      !                    !          except in AGRIF zoom where it has to be specified
+      !                    !  =2 or 3 for SI3 and CICE, respectively
    ln_ice_embd = .false.   !  =T embedded sea-ice (pressure + mass and salt exchanges)
       !                    !  =F levitating ice (no pressure, mass and salt exchanges)
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DIA/diaar5.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DIA/diaar5.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DIA/diaar5.F90	(revision 13121)
@@ -77,5 +77,5 @@
       REAL(wp), ALLOCATABLE, DIMENSION(:,:)     :: zarea_ssh , zbotpres       ! 2D workspace 
       REAL(wp), ALLOCATABLE, DIMENSION(:,:)     :: zpe, z2d                   ! 2D workspace 
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   :: zrhd , zrhop, ztpot   ! 3D workspace
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   :: zrhd , ztpot               ! 3D workspace
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: ztsn                       ! 4D workspace
 
@@ -87,5 +87,5 @@
       IF( l_ar5 ) THEN 
          ALLOCATE( zarea_ssh(jpi,jpj), zbotpres(jpi,jpj), z2d(jpi,jpj) )
-         ALLOCATE( zrhd(jpi,jpj,jpk) , zrhop(jpi,jpj,jpk) )
+         ALLOCATE( zrhd(jpi,jpj,jpk) )
          ALLOCATE( ztsn(jpi,jpj,jpk,jpts) )
          zarea_ssh(:,:) = e1e2t(:,:) * ssh(:,:,Kmm)
@@ -155,11 +155,7 @@
       
          !                                         ! steric sea surface height
-         CALL eos( ts(:,:,:,:,Kmm), zrhd, zrhop, gdept(:,:,:,Kmm) )                 ! now in situ and potential density
-         zrhop(:,:,jpk) = 0._wp
-         CALL iom_put( 'rhop', zrhop )
-         !
          zbotpres(:,:) = 0._wp                        ! no atmospheric surface pressure, levitating sea-ice
          DO jk = 1, jpkm1
-            zbotpres(:,:) = zbotpres(:,:) + e3t(:,:,jk,Kmm) * zrhd(:,:,jk)
+            zbotpres(:,:) = zbotpres(:,:) + e3t(:,:,jk,Kmm) * rhd(:,:,jk)
          END DO
          IF( ln_linssh ) THEN
@@ -168,9 +164,9 @@
                   DO jj = 1,jpj
                      iks = mikt(ji,jj)
-                     zbotpres(ji,jj) = zbotpres(ji,jj) + ssh(ji,jj,Kmm) * zrhd(ji,jj,iks) + riceload(ji,jj)
+                     zbotpres(ji,jj) = zbotpres(ji,jj) + ssh(ji,jj,Kmm) * rhd(ji,jj,iks) + riceload(ji,jj)
                   END DO
                END DO
             ELSE
-               zbotpres(:,:) = zbotpres(:,:) + ssh(:,:,Kmm) * zrhd(:,:,1)
+               zbotpres(:,:) = zbotpres(:,:) + ssh(:,:,Kmm) * rhd(:,:,1)
             END IF
          END IF
@@ -293,5 +289,4 @@
       IF( l_ar5 ) THEN
         DEALLOCATE( zarea_ssh , zbotpres, z2d )
-        DEALLOCATE( zrhd      , zrhop    )
         DEALLOCATE( ztsn                 )
       ENDIF
@@ -367,5 +362,6 @@
       IF(   iom_use( 'voltot'  ) .OR. iom_use( 'sshtot'    )  .OR. iom_use( 'sshdyn' )  .OR.  & 
          &  iom_use( 'masstot' ) .OR. iom_use( 'temptot'   )  .OR. iom_use( 'saltot' ) .OR.  &    
-         &  iom_use( 'botpres' ) .OR. iom_use( 'sshthster' )  .OR. iom_use( 'sshsteric' )  ) L_ar5 = .TRUE.
+         &  iom_use( 'botpres' ) .OR. iom_use( 'sshthster' )  .OR. iom_use( 'sshsteric' ) .OR. &
+         &  iom_use( 'rhop' )  ) L_ar5 = .TRUE.
   
       IF( l_ar5 ) THEN
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DIA/diawri.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DIA/diawri.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DIA/diawri.F90	(revision 13121)
@@ -171,4 +171,6 @@
          CALL iom_put( "sbs", z2d )                ! bottom salinity
       ENDIF
+
+      CALL iom_put( "rhop", rhop(:,:,:) )          ! 3D potential density (sigma0)
 
       IF ( iom_use("taubot") ) THEN                ! bottom stress
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DOM/dommsk.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DOM/dommsk.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DOM/dommsk.F90	(revision 13121)
@@ -259,12 +259,4 @@
                ENDIF
             END DO
-#if defined key_agrif 
-            IF( .NOT. AGRIF_Root() ) THEN 
-               IF ((nbondi ==  1).OR.(nbondi == 2)) fmask(nlci-1 , :     ,jk) = 0.e0      ! east 
-               IF ((nbondi == -1).OR.(nbondi == 2)) fmask(1      , :     ,jk) = 0.e0      ! west 
-               IF ((nbondj ==  1).OR.(nbondj == 2)) fmask(:      ,nlcj-1 ,jk) = 0.e0      ! north 
-               IF ((nbondj == -1).OR.(nbondj == 2)) fmask(:      ,1      ,jk) = 0.e0      ! south 
-            ENDIF 
-#endif 
          END DO
          !
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DOM/istate.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DOM/istate.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DOM/istate.F90	(revision 13121)
@@ -24,5 +24,4 @@
    USE dom_oce        ! ocean space and time domain 
    USE daymod         ! calendar
-   USE divhor         ! horizontal divergence            (div_hor routine)
    USE dtatsd         ! data temperature and salinity   (dta_tsd routine)
    USE dtauvd         ! data: U & V current             (dta_uvd routine)
@@ -121,7 +120,4 @@
          uu   (:,:,:,Kmm)   = uu  (:,:,:,Kbb)
          vv   (:,:,:,Kmm)   = vv  (:,:,:,Kbb)
-         hdiv(:,:,jpk) = 0._wp               ! bottom divergence set one for 0 to zero at jpk level
-         CALL div_hor( 0, Kbb, Kmm )         ! compute interior hdiv value  
-!!gm                                    hdiv(:,:,:) = 0._wp
 
 !!gm POTENTIAL BUG :
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DYN/divhor.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DYN/divhor.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DYN/divhor.F90	(revision 13121)
@@ -84,13 +84,4 @@
       END_3D
       !
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN
-         IF( nbondi == -1 .OR. nbondi == 2 )   hdiv(   2   ,  :   ,:) = 0._wp      ! west
-         IF( nbondi ==  1 .OR. nbondi == 2 )   hdiv( nlci-1,  :   ,:) = 0._wp      ! east
-         IF( nbondj == -1 .OR. nbondj == 2 )   hdiv(   :   ,  2   ,:) = 0._wp      ! south
-         IF( nbondj ==  1 .OR. nbondj == 2 )   hdiv(   :   ,nlcj-1,:) = 0._wp      ! north
-      ENDIF
-#endif
-      !
       IF( ln_rnf )   CALL sbc_rnf_div( hdiv, Kmm )                     !==  runoffs    ==!   (update hdiv field)
       !
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DYN/sshwzv.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DYN/sshwzv.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/DYN/sshwzv.F90	(revision 13121)
@@ -202,8 +202,33 @@
 #if defined key_agrif 
       IF( .NOT. AGRIF_Root() ) THEN 
-         IF ((nbondi ==  1).OR.(nbondi == 2)) pww(nlci-1 , :     ,:) = 0.e0      ! east 
-         IF ((nbondi == -1).OR.(nbondi == 2)) pww(2      , :     ,:) = 0.e0      ! west 
-         IF ((nbondj ==  1).OR.(nbondj == 2)) pww(:      ,nlcj-1 ,:) = 0.e0      ! north 
-         IF ((nbondj == -1).OR.(nbondj == 2)) pww(:      ,2      ,:) = 0.e0      ! south 
+         ! Mask vertical velocity at first/last columns/row 
+         ! inside computational domain (cosmetic) 
+         ! --- West --- !
+         DO ji = mi0(2), mi1(2)
+            DO jj = 1, jpj
+               pww(ji,jj,:) = 0._wp 
+            ENDDO
+         ENDDO
+         !
+         ! --- East --- !
+         DO ji = mi0(jpiglo-1), mi1(jpiglo-1)
+            DO jj = 1, jpj
+               pww(ji,jj,:) = 0._wp
+            ENDDO
+         ENDDO
+         !
+         ! --- South --- !
+         DO jj = mj0(2), mj1(2)
+            DO ji = 1, jpi
+               pww(ji,jj,:) = 0._wp
+            ENDDO
+         ENDDO
+         !
+         ! --- North --- !
+         DO jj = mj0(jpjglo-1), mj1(jpjglo-1)
+            DO ji = 1, jpi
+               pww(ji,jj,:) = 0._wp
+            ENDDO
+         ENDDO
       ENDIF 
 #endif 
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/ICB/icbrst.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/ICB/icbrst.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/ICB/icbrst.F90	(revision 13121)
@@ -192,5 +192,5 @@
       CHARACTER(len=256)     :: cl_path
       CHARACTER(len=256)     :: cl_filename
-      CHARACTER(len=256)     :: cl_kt
+      CHARACTER(len=8  )     :: cl_kt
       CHARACTER(LEN=12 )     :: clfmt            ! writing format
       TYPE(iceberg), POINTER :: this
@@ -213,11 +213,11 @@
          ! file name
          WRITE(cl_kt, '(i8.8)') kt
-         cl_filename = TRIM(cexper)//"_"//TRIM(ADJUSTL(cl_kt))//"_"//TRIM(cn_icbrst_out)
+         cl_filename = TRIM(cexper)//"_"//cl_kt//"_"//TRIM(cn_icbrst_out)
          IF( lk_mpp ) THEN
-            idg = MAX( INT(LOG10(REAL(jpnij-1,wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9
-            WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg   ! '(a,a,ix.x,a)'
-            WRITE(cl_filename,clfmt) TRIM(cl_filename), '_', narea-1, '.nc'
+            idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9
+            WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg          ! '(a,a,ix.x,a)'
+            WRITE(cl_filename,  clfmt) TRIM(cl_filename), '_', narea-1, '.nc'
          ELSE
-            WRITE(cl_filename,'(A,".nc")') TRIM(cl_filename)
+            WRITE(cl_filename,'(a,a)') TRIM(cl_filename),               '.nc'
          ENDIF
 
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/ICB/icbtrj.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/ICB/icbtrj.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/ICB/icbtrj.F90	(revision 13121)
@@ -66,5 +66,5 @@
       CHARACTER(len=80)      ::   cl_filename
       CHARACTER(LEN=12)      ::   clfmt            ! writing format
-      CHARACTER(LEN=20)      ::   cldate_ini, cldate_end
+      CHARACTER(LEN=8 )      ::   cldate_ini, cldate_end
       TYPE(iceberg), POINTER ::   this
       TYPE(point)  , POINTER ::   pt
@@ -82,11 +82,11 @@
 
       ! define trajectory output name
-      cl_filename = 'trajectory_icebergs_'//TRIM(ADJUSTL(cldate_ini))//'-'//TRIM(ADJUSTL(cldate_end))
+      cl_filename = 'trajectory_icebergs_'//cldate_ini//'-'//cldate_end
       IF ( lk_mpp ) THEN
-         idg = MAX( INT(LOG10(REAL(jpnij-1,wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9
-         WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg   ! '(a,a,ix.x,a)'
-         WRITE(cl_filename,clfmt) TRIM(cl_filename), '_', narea-1, '.nc'
+         idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9
+         WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg          ! '(a,a,ix.x,a)'
+         WRITE(cl_filename,  clfmt) TRIM(cl_filename), '_', narea-1, '.nc'
       ELSE
-         WRITE(cl_filename,'(A,".nc")') TRIM(cl_filename)
+         WRITE(cl_filename,'(a,a)') TRIM(cl_filename),               '.nc'
       ENDIF
       IF( lwp .AND. nn_verbose_level >= 0 )   WRITE(numout,'(2a)') 'icebergs, icb_trj_init: creating ',TRIM(cl_filename)
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/IOM/iom_def.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/IOM/iom_def.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/IOM/iom_def.F90	(revision 13121)
@@ -33,5 +33,5 @@
    INTEGER, PARAMETER, PUBLIC ::   jpmax_vars   = 1200 !: maximum number of variables in one file
    INTEGER, PARAMETER, PUBLIC ::   jpmax_dims   =  4   !: maximum number of dimensions for one variable
-   INTEGER, PARAMETER, PUBLIC ::   jpmax_digits =  5   !: maximum number of digits for the cpu number in the file name
+   INTEGER, PARAMETER, PUBLIC ::   jpmax_digits =  9   !: maximum number of digits for the cpu number in the file name
 
 
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/IOM/iom_nf90.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/IOM/iom_nf90.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/IOM/iom_nf90.F90	(revision 13121)
@@ -111,6 +111,6 @@
          IF( ldwrt ) THEN              !* the file should be open in write mode so we create it...
             IF( jpnij > 1 ) THEN
-               idg = MAX( INT(LOG10(REAL(jpnij-1,wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9
-               WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg   ! '(a,a,ix.x,a)'
+               idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9
+               WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg          ! '(a,a,ix.x,a)'
                WRITE(cltmp,clfmt) cdname(1:iln-1), '_', narea-1, '.nc'
                cdname = TRIM(cltmp)
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/LBC/lib_mpp.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/LBC/lib_mpp.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/LBC/lib_mpp.F90	(revision 13121)
@@ -1114,20 +1114,17 @@
       !
       CHARACTER(LEN=8) ::   clfmt            ! writing format
-      INTEGER ::   inum
-      INTEGER ::   idg  ! number of digits
+      INTEGER          ::   inum
       !!----------------------------------------------------------------------
       !
       nstop = nstop + 1
       !
-      IF( numout == 6 ) THEN                          ! force to open ocean.output file if not already opened
-         CALL ctl_opn( numout, 'ocean.output', 'APPEND', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. )
-      ELSE
-         IF( narea > 1 .AND. cd1 == 'STOP' ) THEN     ! add an error message in ocean.output
-            CALL ctl_opn( inum,'ocean.output', 'APPEND', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. )
-            WRITE(inum,*)
-            idg = MAX( INT(LOG10(REAL(jpnij-1,wp))) + 1, 4 )        ! how many digits to we need to write? min=4, max=9
-            WRITE(clfmt, "('(a,i', i1, '.', i1, ')')") idg, idg     ! '(a,ix.x)'
-            WRITE(inum,clfmt) ' ===>>> : see E R R O R in ocean.output_', narea - 1
-         ENDIF
+      IF( cd1 == 'STOP' .AND. narea /= 1 ) THEN    ! Immediate stop: add an arror message in 'ocean.output' file
+         CALL ctl_opn( inum, 'ocean.output', 'APPEND', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. )
+         WRITE(inum,*)
+         WRITE(inum,*) ' ==>>>   Look for "E R R O R" messages in all existing *ocean.output* files'
+         CLOSE(inum)
+      ENDIF
+      IF( numout == 6 ) THEN                       ! force to open ocean.output file if not already opened
+         CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., narea )
       ENDIF
       !
@@ -1224,5 +1221,5 @@
       CHARACTER(LEN=10) ::   clfmt            ! writing format
       INTEGER           ::   iost
-      INTEGER           ::   idg  ! number of digits
+      INTEGER           ::   idg              ! number of digits
       !!----------------------------------------------------------------------
       !
@@ -1232,6 +1229,7 @@
       IF( PRESENT( karea ) ) THEN
          IF( karea > 1 ) THEN
-            idg = MAX( INT(LOG10(REAL(jpnij-1,wp))) + 1, 4 )        ! how many digits to we need to write? min=4, max=9
-            WRITE(clfmt, "('(a,a,i', i1, '.', i1, ')')") idg, idg   ! '(a,a,ix.x)'
+            ! Warning: jpnij is maybe not already defined when calling ctl_opn -> use mppsize instead of jpnij
+            idg = MAX( INT(LOG10(REAL(MAX(1,mppsize-1),wp))) + 1, 4 )      ! how many digits to we need to write? min=4, max=9
+            WRITE(clfmt, "('(a,a,i', i1, '.', i1, ')')") idg, idg          ! '(a,a,ix.x)'
             WRITE(clfile, clfmt) TRIM(clfile), '_', karea-1
          ENDIF
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbcblk.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbcblk.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbcblk.F90	(revision 13121)
@@ -628,4 +628,8 @@
       END SELECT
 
+      CALL iom_put("Cd_oce", zcd_oce)
+      CALL iom_put("Ce_oce", zce_oce)
+      CALL iom_put("Ch_oce", zch_oce)
+      
       IF( ln_skin_cs .OR. ln_skin_wl ) THEN
          !! ptsk and pssq have been updated!!!
@@ -878,8 +882,9 @@
          Ce_ice(:,:) = Ch_ice(:,:)       ! sensible and latent heat transfer coef. are considered identical
       ENDIF
-
-      !! IF ( iom_use("Cd_ice") ) CALL iom_put("Cd_ice", Cd_ice)   ! output value of pure ice-atm. transfer coef.
-      !! IF ( iom_use("Ch_ice") ) CALL iom_put("Ch_ice", Ch_ice)   ! output value of pure ice-atm. transfer coef.
-
+      
+      CALL iom_put("Cd_ice", Cd_ice)
+      CALL iom_put("Ce_ice", Ce_ice)
+      CALL iom_put("Ch_ice", Ch_ice)
+      
       ! local scalars ( place there for vector optimisation purposes)
       zcd_dui(:,:) = wndm_ice(:,:) * Cd_ice(:,:)
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbccpl.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbccpl.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbccpl.F90	(revision 13121)
@@ -1785,7 +1785,6 @@
             ENDDO
          ELSE
-            qns_tot(:,:) = qns_tot(:,:) + picefr(:,:) * frcv(jpr_qnsice)%z3(:,:,1)
+            zqns_tot(:,:) = zqns_tot(:,:) + picefr(:,:) * frcv(jpr_qnsice)%z3(:,:,1)
             DO jl = 1, jpl
-               zqns_tot(:,:   ) = zqns_tot(:,:) + picefr(:,:) * frcv(jpr_qnsice)%z3(:,:,1)
                zqns_ice(:,:,jl) = frcv(jpr_qnsice)%z3(:,:,1)
             END DO
@@ -1928,7 +1927,6 @@
             END DO
          ELSE
-            qsr_tot(:,:   ) = qsr_tot(:,:) + picefr(:,:) * frcv(jpr_qsrice)%z3(:,:,1)
+            zqsr_tot(:,:) = zqsr_tot(:,:) + picefr(:,:) * frcv(jpr_qsrice)%z3(:,:,1)
             DO jl = 1, jpl
-               zqsr_tot(:,:   ) = zqsr_tot(:,:) + picefr(:,:) * frcv(jpr_qsrice)%z3(:,:,1)
                zqsr_ice(:,:,jl) = frcv(jpr_qsrice)%z3(:,:,1)
             END DO
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbcmod.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbcmod.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbcmod.F90	(revision 13121)
@@ -120,15 +120,4 @@
       ncom_fsbc = nn_fsbc    ! make nn_fsbc available for lib_mpp
 #endif
-      !                             !* overwrite namelist parameter using CPP key information
-#if defined key_agrif
-      IF( Agrif_Root() ) THEN                ! AGRIF zoom (cf r1242: possibility to run without ice in fine grid)
-         IF( lk_si3  )   nn_ice      = 2
-         IF( lk_cice )   nn_ice      = 3
-      ENDIF
-!!GS: TBD
-!#else
-!      IF( lk_si3  )   nn_ice      = 2
-!      IF( lk_cice )   nn_ice      = 3
-#endif
       !
       IF(lwp) THEN                  !* Control print
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbcwave.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbcwave.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/SBC/sbcwave.F90	(revision 13121)
@@ -210,13 +210,4 @@
       END_3D
       !
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN
-         IF( nbondi == -1 .OR. nbondi == 2 )   ze3divh( 2:nbghostcells+1,:        ,:) = 0._wp      ! west
-         IF( nbondi ==  1 .OR. nbondi == 2 )   ze3divh( nlci-nbghostcells:nlci-1,:,:) = 0._wp      ! east
-         IF( nbondj == -1 .OR. nbondj == 2 )   ze3divh( :,2:nbghostcells+1        ,:) = 0._wp      ! south
-         IF( nbondj ==  1 .OR. nbondj == 2 )   ze3divh( :,nlcj-nbghostcells:nlcj-1,:) = 0._wp      ! north
-      ENDIF
-#endif
-      !
       CALL lbc_lnk( 'sbcwave', ze3divh, 'T', 1. )
       !
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/TRD/trdtra.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/TRD/trdtra.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/TRD/trdtra.F90	(revision 13121)
@@ -82,5 +82,6 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::   ptra    ! now tracer variable
       !
-      INTEGER ::   jk   ! loop indices
+      INTEGER ::   jk    ! loop indices
+      INTEGER ::   i01   ! 0 or 1
       REAL(wp),        DIMENSION(jpi,jpj,jpk) ::   ztrds             ! 3D workspace
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zwt, zws, ztrdt   ! 3D workspace
@@ -90,8 +91,10 @@
          IF( trd_tra_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trd_tra : unable to allocate arrays' )
       ENDIF
-
+      !
+      i01 = COUNT( (/ PRESENT(pu) .OR. ( ktrd /= jptra_xad .AND. ktrd /= jptra_yad .AND. ktrd /= jptra_zad ) /) )
+      !
       IF( ctype == 'TRA' .AND. ktra == jp_tem ) THEN   !==  Temperature trend  ==!
          !
-         SELECT CASE( ktrd )
+         SELECT CASE( ktrd*i01 )
          !                            ! advection: transform the advective flux into a trend
          CASE( jptra_xad )   ;   CALL trd_tra_adv( ptrd, pu, ptra, 'X', trdtx, Kmm ) 
@@ -112,5 +115,5 @@
       IF( ctype == 'TRA' .AND. ktra == jp_sal ) THEN      !==  Salinity trends  ==!
          !
-         SELECT CASE( ktrd )
+         SELECT CASE( ktrd*i01 )
          !                            ! advection: transform the advective flux into a trend
          !                            !            and send T & S trends to trd_tra_mng
@@ -163,5 +166,5 @@
       IF( ctype == 'TRC' ) THEN                           !==  passive tracer trend  ==!
          !
-         SELECT CASE( ktrd )
+         SELECT CASE( ktrd*i01 )
          !                            ! advection: transform the advective flux into a masked trend
          CASE( jptra_xad )   ;   CALL trd_tra_adv( ptrd , pu , ptra, 'X', ztrds, Kmm ) 
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/ZDF/zdftke.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/ZDF/zdftke.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/ZDF/zdftke.F90	(revision 13121)
@@ -45,4 +45,10 @@
    USE zdfdrg         ! vertical physics: top/bottom drag coef.
    USE zdfmxl         ! vertical physics: mixed layer
+#if defined key_si3
+   USE ice, ONLY: hm_i, h_i
+#endif
+#if defined key_cice
+   USE sbc_ice, ONLY: h_i
+#endif
    !
    USE in_out_manager ! I/O manager
@@ -64,4 +70,6 @@
    INTEGER  ::   nn_mxl    ! type of mixing length (=0/1/2/3)
    REAL(wp) ::   rn_mxl0   ! surface  min value of mixing length (kappa*z_o=0.4*0.1 m)  [m]
+   INTEGER  ::      nn_mxlice ! type of scaling under sea-ice
+   REAL(wp) ::      rn_mxlice ! max constant ice thickness value when scaling under sea-ice ( nn_mxlice=1)
    INTEGER  ::   nn_pdl    ! Prandtl number or not (ratio avt/avm) (=0/1)
    REAL(wp) ::   rn_ediff  ! coefficient for avt: avt=rn_ediff*mxl*sqrt(e)
@@ -422,5 +430,5 @@
       REAL(wp) ::   zrn2, zraug, zcoef, zav   ! local scalars
       REAL(wp) ::   zdku,   zdkv, zsqen       !   -      -
-      REAL(wp) ::   zemxl, zemlm, zemlp       !   -      -
+      REAL(wp) ::   zemxl, zemlm, zemlp, zmaxice       !   -      -
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zmxlm, zmxld   ! 3D workspace
       !!--------------------------------------------------------------------
@@ -436,12 +444,51 @@
       zmxld(:,:,:)  = rmxl_min
       !
-      IF( ln_mxl0 ) THEN            ! surface mixing length = F(stress) : l=vkarmn*2.e5*taum/(rho0*g)
+     IF( ln_mxl0 ) THEN            ! surface mixing length = F(stress) : l=vkarmn*2.e5*taum/(rho0*g)
+         !
          zraug = vkarmn * 2.e5_wp / ( rho0 * grav )
+#if ! defined key_si3 && ! defined key_cice
          DO_2D_00_00
-            zmxlm(ji,jj,1) = MAX( rn_mxl0, zraug * taum(ji,jj) * tmask(ji,jj,1) )
+            zmxlm(ji,jj,1) =  zraug * taum(ji,jj) * tmask(ji,jj,1)
          END_2D
-      ELSE 
+#else
+         SELECT CASE( nn_mxlice )             ! Type of scaling under sea-ice
+         !
+         CASE( 0 )                      ! No scaling under sea-ice
+            DO_2D_00_00
+               zmxlm(ji,jj,1) = zraug * taum(ji,jj) * tmask(ji,jj,1)
+            END_2D
+            !
+         CASE( 1 )                           ! scaling with constant sea-ice thickness
+            DO_2D_00_00
+               zmxlm(ji,jj,1) =  ( ( 1. - fr_i(ji,jj) ) * zraug * taum(ji,jj) + fr_i(ji,jj) * rn_mxlice ) * tmask(ji,jj,1)
+            END_2D
+            !
+         CASE( 2 )                                 ! scaling with mean sea-ice thickness
+            DO_2D_00_00
+#if defined key_si3
+               zmxlm(ji,jj,1) = ( ( 1. - fr_i(ji,jj) ) * zraug * taum(ji,jj) + fr_i(ji,jj) * hm_i(ji,jj) * 2. ) * tmask(ji,jj,1)
+#elif defined key_cice
+               zmaxice = MAXVAL( h_i(ji,jj,:) )
+               zmxlm(ji,jj,1) = ( ( 1. - fr_i(ji,jj) ) * zraug * taum(ji,jj) + fr_i(ji,jj) * zmaxice ) * tmask(ji,jj,1)
+#endif
+            END_2D
+            !
+         CASE( 3 )                                 ! scaling with max sea-ice thickness
+            DO_2D_00_00
+               zmaxice = MAXVAL( h_i(ji,jj,:) )
+               zmxlm(ji,jj,1) = ( ( 1. - fr_i(ji,jj) ) * zraug * taum(ji,jj) + fr_i(ji,jj) * zmaxice ) * tmask(ji,jj,1)
+            END_2D
+            !
+         END SELECT
+#endif
+         !
+         DO_2D_00_00
+            zmxlm(ji,jj,1) = MAX( rn_mxl0, zmxlm(ji,jj,1) )
+         END_2D
+         !
+      ELSE
          zmxlm(:,:,1) = rn_mxl0
       ENDIF
+
       !
       DO_3D_00_00( 2, jpkm1 )
@@ -547,8 +594,9 @@
       INTEGER             ::   ios
       !!
-      NAMELIST/namzdf_tke/ rn_ediff, rn_ediss , rn_ebb , rn_emin  ,          &
-         &                 rn_emin0, rn_bshear, nn_mxl , ln_mxl0  ,          &
-         &                 rn_mxl0 , nn_pdl   , ln_drg , ln_lc    , rn_lc,   &
-         &                 nn_etau , nn_htau  , rn_efr , rn_eice  
+      NAMELIST/namzdf_tke/ rn_ediff, rn_ediss , rn_ebb   , rn_emin  ,  &
+         &                 rn_emin0, rn_bshear, nn_mxl   , ln_mxl0  ,  &
+         &                 rn_mxl0 , nn_mxlice, rn_mxlice,             &
+         &                 nn_pdl  , ln_drg   , ln_lc    , rn_lc,      &
+         &                 nn_etau , nn_htau  , rn_efr   , rn_eice  
       !!----------------------------------------------------------------------
       !
@@ -576,4 +624,9 @@
          WRITE(numout,*) '      mixing length type                          nn_mxl    = ', nn_mxl
          WRITE(numout,*) '         surface mixing length = F(stress) or not    ln_mxl0   = ', ln_mxl0
+         IF( ln_mxl0 ) THEN
+            WRITE(numout,*) '      type of scaling under sea-ice               nn_mxlice = ', nn_mxlice
+            IF( nn_mxlice == 1 ) &
+            WRITE(numout,*) '      ice thickness when scaling under sea-ice    rn_mxlice = ', rn_mxlice
+         ENDIF         
          WRITE(numout,*) '         surface  mixing length minimum value        rn_mxl0   = ', rn_mxl0
          WRITE(numout,*) '      top/bottom friction forcing flag            ln_drg    = ', ln_drg
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/nemogcm.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/nemogcm.F90	(revision 13121)
@@ -232,9 +232,10 @@
          IF( ngrdstop > 0 ) THEN
             WRITE(ctmp9,'(i2)') ngrdstop
-            WRITE(ctmp2,*) '      ==>>>   Error detected in Agrif grid '//TRIM(ctmp9)
-            WRITE(ctmp3,*) '      ==>>>   look for error messages in '//TRIM(ctmp9)//'_ocean_output* files'
-            CALL ctl_stop( ctmp1, ctmp2, ctmp3 )
+            WRITE(ctmp2,*) '           E R R O R detected in Agrif grid '//TRIM(ctmp9)
+            WRITE(ctmp3,*) '           Look for "E R R O R" messages in all existing '//TRIM(ctmp9)//'_ocean_output* files'
+            CALL ctl_stop( ' ', ctmp1, ' ', ctmp2, ' ', ctmp3 )
          ELSE
-            CALL ctl_stop( ctmp1 )
+            WRITE(ctmp2,*) '           Look for "E R R O R" messages in all existing ocean_output* files'
+            CALL ctl_stop( ' ', ctmp1, ' ', ctmp2 )
          ENDIF
       ENDIF
@@ -249,5 +250,5 @@
 #else
       IF    ( lk_oasis ) THEN   ;   CALL cpl_finalize   ! end coupling and mpp communications with OASIS
-      ELSEIF( lk_mpp   ) THEN   ;   CALL mppstop      ! end mpp communications
+      ELSEIF( lk_mpp   ) THEN   ;   CALL mppstop        ! end mpp communications
       ENDIF
 #endif
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/stpctl.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/stpctl.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OCE/stpctl.F90	(revision 13121)
@@ -130,5 +130,5 @@
       zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     ! minus salinity max
       zmax(4) = MAXVAL(  ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     !       salinity max
-      IF( ll_colruns ) THEN     ! following variables are used only in the netcdf file
+      IF( ll_colruns .OR. jpnij == 1 ) THEN     ! following variables are used only in the netcdf file
          zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  ! minus temperature max
          zmax(6) = MAXVAL(  ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  !       temperature max
@@ -220,12 +220,16 @@
          !
          IF( ll_colruns .or. jpnij == 1 ) THEN   ! all processes synchronized -> use lwp to print in opened ocean.output files
-            IF(lwp)   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
+            IF(lwp) THEN   ;   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
+            ELSE           ;   nstop = MAX(1, nstop)   ! make sure nstop > 0 (automatically done when calling ctl_stop)
+            ENDIF
          ELSE                                    ! only mpi subdomains with errors are here -> STOP now
             CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
          ENDIF
          !
-         IF( nstop == 0 )   nstop = 1 
-         ngrdstop = Agrif_Fixed()
-         !
+      ENDIF
+      !
+      IF( nstop > 0 ) THEN                                                  ! an error was detected and we did not abort yet...
+         ngrdstop = Agrif_Fixed()                                           ! store which grid got this error
+         IF( .NOT. ll_colruns .AND. jpnij > 1 )   CALL ctl_stop( 'STOP' )   ! we must abort here to avoid MPI deadlock
       ENDIF
       !
@@ -260,5 +264,5 @@
       !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF
       cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum
-      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij-1,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9)
+      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9)
       cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1
                                    WRITE(clmax, cl4) kmax-1
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OFF/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OFF/nemogcm.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/OFF/nemogcm.F90	(revision 13121)
@@ -147,5 +147,6 @@
       IF( nstop /= 0 .AND. lwp ) THEN                 ! error print
          WRITE(ctmp1,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found'
-         CALL ctl_stop( ctmp1 )
+         WRITE(ctmp2,*) '           Look for "E R R O R" messages in all existing ocean_output* files'
+         CALL ctl_stop( ' ', ctmp1, ' ', ctmp2 )
       ENDIF
       !
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/SAS/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/SAS/nemogcm.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/SAS/nemogcm.F90	(revision 13121)
@@ -162,9 +162,10 @@
          IF( ngrdstop > 0 ) THEN
             WRITE(ctmp9,'(i2)') ngrdstop
-            WRITE(ctmp2,*) '      ==>>>   Error detected in Agrif grid '//TRIM(ctmp9)
-            WRITE(ctmp3,*) '      ==>>>   look for error messages in '//TRIM(ctmp9)//'_ocean_output* files'
-            CALL ctl_stop( ctmp1, ctmp2, ctmp3 )
+            WRITE(ctmp2,*) '           E R R O R detected in Agrif grid '//TRIM(ctmp9)
+            WRITE(ctmp3,*) '           Look for "E R R O R" messages in all existing '//TRIM(ctmp9)//'_ocean_output* files'
+            CALL ctl_stop( ' ', ctmp1, ' ', ctmp2, ' ', ctmp3 )
          ELSE
-            CALL ctl_stop( ctmp1 )
+            WRITE(ctmp2,*) '           Look for "E R R O R" messages in all existing ocean_output* files'
+            CALL ctl_stop( ' ', ctmp1, ' ', ctmp2 )
          ENDIF
       ENDIF
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/SAS/stpctl.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/SAS/stpctl.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/SAS/stpctl.F90	(revision 13121)
@@ -180,12 +180,16 @@
          !
          IF( ll_colruns .or. jpnij == 1 ) THEN   ! all processes synchronized -> use lwp to print in opened ocean.output files
-            IF(lwp)   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
+            IF(lwp) THEN   ;   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
+            ELSE           ;   nstop = MAX(1, nstop)   ! make sure nstop > 0 (automatically done when calling ctl_stop)
+            ENDIF
          ELSE                                    ! only mpi subdomains with errors are here -> STOP now
             CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
          ENDIF
          !
-         IF( nstop == 0 )   nstop = 1 
-         ngrdstop = Agrif_Fixed()
-         !
+      ENDIF
+      !
+      IF( nstop > 0 ) THEN                                                  ! an error was detected and we did not abort yet...
+         ngrdstop = Agrif_Fixed()                                           ! store which grid got this error
+         IF( .NOT. ll_colruns .AND. jpnij > 1 )   CALL ctl_stop( 'STOP' )   ! we must abort here to avoid MPI deadlock
       ENDIF
       !
@@ -220,5 +224,5 @@
       !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF
       cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum
-      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij-1,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9)
+      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9)
       cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1
                                    WRITE(clmax, cl4) kmax-1
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/TOP/PISCES/P4Z/p4zsms.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/TOP/PISCES/P4Z/p4zsms.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/src/TOP/PISCES/P4Z/p4zsms.F90	(revision 13121)
@@ -206,5 +206,5 @@
       IF( l_trdtrc ) THEN
          DO jn = jp_pcs0, jp_pcs1
-           ztrdt(:,:,:,jn) = ( tr(:,:,:,jn,Kbb) - ztrdt(:,:,:,jn) ) * rfact2r 
+           ztrdt(:,:,:,jn) = ( tr(:,:,:,jn,Kbb) - ztrdt(:,:,:,jn) ) * rfactr 
            CALL trd_trc( tr(:,:,:,jn,Krhs), jn, jptra_sms, kt, Kmm )   ! save trends
          END DO
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/CANAL/MY_SRC/stpctl.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/CANAL/MY_SRC/stpctl.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/CANAL/MY_SRC/stpctl.F90	(revision 13121)
@@ -130,5 +130,5 @@
       zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     ! minus salinity max
       zmax(4) = MAXVAL(  ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     !       salinity max
-      IF( ll_colruns ) THEN     ! following variables are used only in the netcdf file
+      IF( ll_colruns .OR. jpnij == 1 ) THEN     ! following variables are used only in the netcdf file
          zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  ! minus temperature max
          zmax(6) = MAXVAL(  ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  !       temperature max
@@ -220,12 +220,16 @@
          !
          IF( ll_colruns .or. jpnij == 1 ) THEN   ! all processes synchronized -> use lwp to print in opened ocean.output files
-            IF(lwp)   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
+            IF(lwp) THEN   ;   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
+            ELSE           ;   nstop = MAX(1, nstop)   ! make sure nstop > 0 (automatically done when calling ctl_stop)
+            ENDIF
          ELSE                                    ! only mpi subdomains with errors are here -> STOP now
             CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
          ENDIF
          !
-         IF( nstop == 0 )   nstop = 1 
-         ngrdstop = Agrif_Fixed()
-         !
+      ENDIF
+      !
+      IF( nstop > 0 ) THEN                                                  ! an error was detected and we did not abort yet...
+         ngrdstop = Agrif_Fixed()                                           ! store which grid got this error
+         IF( .NOT. ll_colruns .AND. jpnij > 1 )   CALL ctl_stop( 'STOP' )   ! we must abort here to avoid MPI deadlock
       ENDIF
       !
@@ -260,5 +264,5 @@
       !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF
       cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum
-      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij-1,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9)
+      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9)
       cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1
                                    WRITE(clmax, cl4) kmax-1
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/file_def_nemo-oce.xml
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/file_def_nemo-oce.xml	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/file_def_nemo-oce.xml	(revision 13121)
@@ -28,6 +28,10 @@
       <field field_ref="empmr"        name="empmr" />
       <!-- -->
-      <field field_ref="taum"         name="taum"     />
-      <field field_ref="wspd"         name="windsp"   />
+      <field field_ref="taum"         name="taum"   />
+      <field field_ref="wspd"         name="windsp" />
+      <!-- -->
+      <field field_ref="Cd_oce"       name="Cd_oce" />
+      <field field_ref="Ce_oce"       name="Ce_oce" />
+      <field field_ref="Ch_oce"       name="Ch_oce" />
     </file>
 
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/launch_sasf.sh
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/launch_sasf.sh	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/launch_sasf.sh	(revision 13121)
@@ -33,5 +33,5 @@
 
 
-if [ ! -f ${NEMO_EXE} ]; then echo " Mhhh, no compiled nemo.exe found into ${NEMO_DIR}/tests/STATION_ASF/BLD/bin !"; exit; fi
+if [ ! -f ${NEMO_EXE} ]; then echo " Mhhh, no compiled 'nemo.exe' found into `dirname ${NEMO_EXE}` !"; exit; fi
 
 echo
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_coare3p6-noskin_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_coare3p6-noskin_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_coare3p6-noskin_cfg	(revision 13121)
@@ -29,8 +29,10 @@
    cn_exp      =  'STATION_ASF-COARE3p6-noskin'  !  experience name
    nn_it000    =    1   !  first time step
-   nn_itend    =    26280   !  last  time step (std 5840)
-   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
    nn_time0    =       0   !  initial time of day in hhmm
-   nn_leapy    =       0   !  Leap year calendar (1) or not (0)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
    ln_rstart   = .false.   !  start from rest (F) or from a restart file (T)
       ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T)
@@ -45,6 +47,10 @@
    nn_istate   =       0   !  output the initial state (1) or not (0)
    ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
-   nn_stock    =    26280   ! 1year @ dt=3600 s / frequency of creation of a restart file (modulo referenced to 1)
-   nn_write    =    26280   ! 1year @ dt=3600 s / frequency of write in the output file   (modulo referenced to nn_it000)
+   !!
+!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+   !!
    ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
    ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_coare3p6_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_coare3p6_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_coare3p6_cfg	(revision 13121)
@@ -29,8 +29,10 @@
    cn_exp      =  'STATION_ASF-COARE3p6'  !  experience name
    nn_it000    =    1   !  first time step
-   nn_itend    =    26280   !  last  time step (std 5840)
-   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
    nn_time0    =       0   !  initial time of day in hhmm
-   nn_leapy    =       0   !  Leap year calendar (1) or not (0)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
    ln_rstart   = .false.   !  start from rest (F) or from a restart file (T)
       ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T)
@@ -45,6 +47,10 @@
    nn_istate   =       0   !  output the initial state (1) or not (0)
    ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
-   nn_stock    =    26280   ! 1year @ dt=3600 s / frequency of creation of a restart file (modulo referenced to 1)
-   nn_write    =    26280   ! 1year @ dt=3600 s / frequency of write in the output file   (modulo referenced to nn_it000)
+   !!
+!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+   !!
    ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
    ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard
@@ -134,5 +140,5 @@
       ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true.
    !
-   cn_dir      = './'      !  root directory for the bulk data location
+   cn_dir = './'  !  root directory for the bulk data location
    !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
    !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
@@ -163,5 +169,5 @@
       ln_read_frq = .false.   !  specify whether we must read frq or not
 
-   cn_dir      = './'      !  root directory for the ocean data location
+   cn_dir      = './'     !  root directory for the ocean data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
    !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
@@ -215,5 +221,5 @@
 &nameos        !   ocean Equation Of Seawater                           (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_eos80    = .true.         !  = Use EOS80
+   ln_eos80    = .true.          !  = Use EOS80
 /
 !!======================================================================
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_ecmwf-noskin_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_ecmwf-noskin_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_ecmwf-noskin_cfg	(revision 13121)
@@ -29,8 +29,10 @@
    cn_exp      =  'STATION_ASF-ECMWF-noskin'  !  experience name
    nn_it000    =    1   !  first time step
-   nn_itend    =    26280   !  last  time step (std 5840)
-   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
    nn_time0    =       0   !  initial time of day in hhmm
-   nn_leapy    =       0   !  Leap year calendar (1) or not (0)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
    ln_rstart   = .false.   !  start from rest (F) or from a restart file (T)
       ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T)
@@ -45,6 +47,10 @@
    nn_istate   =       0   !  output the initial state (1) or not (0)
    ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
-   nn_stock    =    26280   ! 1year @ dt=3600 s / frequency of creation of a restart file (modulo referenced to 1)
-   nn_write    =    26280   ! 1year @ dt=3600 s / frequency of write in the output file   (modulo referenced to nn_it000)
+   !!
+!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+   !!
    ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
    ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_ecmwf_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_ecmwf_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_ecmwf_cfg	(revision 13121)
@@ -29,8 +29,10 @@
    cn_exp      =  'STATION_ASF-ECMWF'  !  experience name
    nn_it000    =    1   !  first time step
-   nn_itend    =    26280   !  last  time step (std 5840)
-   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
    nn_time0    =       0   !  initial time of day in hhmm
-   nn_leapy    =       0   !  Leap year calendar (1) or not (0)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
    ln_rstart   = .false.   !  start from rest (F) or from a restart file (T)
       ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T)
@@ -45,6 +47,10 @@
    nn_istate   =       0   !  output the initial state (1) or not (0)
    ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
-   nn_stock    =    26280   ! 1year @ dt=3600 s / frequency of creation of a restart file (modulo referenced to 1)
-   nn_write    =    26280   ! 1year @ dt=3600 s / frequency of write in the output file   (modulo referenced to nn_it000)
+   !!
+!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+   !!
    ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
    ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard
@@ -134,5 +140,5 @@
       ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true.
    !
-   cn_dir      = './'      !  root directory for the bulk data location
+   cn_dir = './'  !  root directory for the bulk data location
    !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
    !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
@@ -163,5 +169,5 @@
       ln_read_frq = .false.   !  specify whether we must read frq or not
 
-   cn_dir      = './'      !  root directory for the ocean data location
+   cn_dir      = './'     !  root directory for the ocean data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
    !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
@@ -215,5 +221,5 @@
 &nameos        !   ocean Equation Of Seawater                           (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_eos80    = .true.         !  = Use EOS80
+   ln_eos80    = .true.          !  = Use EOS80
 /
 !!======================================================================
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_ncar_cfg
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_ncar_cfg	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/EXPREF/namelist_ncar_cfg	(revision 13121)
@@ -29,8 +29,10 @@
    cn_exp      =  'STATION_ASF-NCAR'  !  experience name
    nn_it000    =    1   !  first time step
-   nn_itend    =    26280   !  last  time step (std 5840)
-   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s
+   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
    nn_time0    =       0   !  initial time of day in hhmm
-   nn_leapy    =       0   !  Leap year calendar (1) or not (0)
+   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
    ln_rstart   = .false.   !  start from rest (F) or from a restart file (T)
       ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T)
@@ -45,6 +47,10 @@
    nn_istate   =       0   !  output the initial state (1) or not (0)
    ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
-   nn_stock    =    26280   ! 1year @ dt=3600 s / frequency of creation of a restart file (modulo referenced to 1)
-   nn_write    =    26280   ! 1year @ dt=3600 s / frequency of write in the output file   (modulo referenced to nn_it000)
+   !!
+!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1)
+   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000)
+   !!
    ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
    ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard
@@ -134,5 +140,5 @@
       ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true.
    !
-   cn_dir      = './'      !  root directory for the bulk data location
+   cn_dir = './'  !  root directory for the bulk data location
    !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
    !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask !
@@ -163,5 +169,5 @@
       ln_read_frq = .false.   !  specify whether we must read frq or not
 
-   cn_dir      = './'      !  root directory for the ocean data location
+   cn_dir      = './'     !  root directory for the ocean data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
    !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
@@ -215,5 +221,5 @@
 &nameos        !   ocean Equation Of Seawater                           (default: NO selection)
 !-----------------------------------------------------------------------
-   ln_eos80    = .true.         !  = Use EOS80
+   ln_eos80    = .true.          !  = Use EOS80
 /
 !!======================================================================
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/MY_SRC/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/MY_SRC/nemogcm.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/MY_SRC/nemogcm.F90	(revision 13121)
@@ -100,5 +100,6 @@
       IF( nstop /= 0 .AND. lwp ) THEN        ! error print
          WRITE(ctmp1,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found'
-         CALL ctl_stop( ctmp1 )
+         WRITE(ctmp2,*) '           Look for "E R R O R" messages in all existing ocean_output* files'
+         CALL ctl_stop( ' ', ctmp1, ' ', ctmp2 )
       ENDIF
       !
Index: /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/MY_SRC/stpctl.F90
===================================================================
--- /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/MY_SRC/stpctl.F90	(revision 13120)
+++ /NEMO/branches/2020/dev_r12953_ENHANCE-10_acc_fix_traqsr/tests/STATION_ASF/MY_SRC/stpctl.F90	(revision 13121)
@@ -179,12 +179,16 @@
          !
          IF( ll_colruns .or. jpnij == 1 ) THEN   ! all processes synchronized -> use lwp to print in opened ocean.output files
-            IF(lwp)   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
+            IF(lwp) THEN   ;   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
+            ELSE           ;   nstop = MAX(1, nstop)   ! make sure nstop > 0 (automatically done when calling ctl_stop)
+            ENDIF
          ELSE                                    ! only mpi subdomains with errors are here -> STOP now
             CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 )
          ENDIF
          !
-         IF( nstop == 0 )   nstop = 1 
-         ngrdstop = Agrif_Fixed()
-         !
+      ENDIF
+      !
+      IF( nstop > 0 ) THEN                                                  ! an error was detected and we did not abort yet...
+         ngrdstop = Agrif_Fixed()                                           ! store which grid got this error
+         IF( .NOT. ll_colruns .AND. jpnij > 1 )   CALL ctl_stop( 'STOP' )   ! we must abort here to avoid MPI deadlock
       ENDIF
       !
@@ -219,5 +223,5 @@
       !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF
       cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum
-      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij-1,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9)
+      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9)
       cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1
                                    WRITE(clmax, cl4) kmax-1
