Index: NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/abl.F90
===================================================================
--- NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/abl.F90	(revision 12592)
+++ NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/abl.F90	(revision 12749)
@@ -39,8 +39,4 @@
    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)       ::   msk_abl
    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)       ::   rest_eq
-   
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:)     ::    cft_abl
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:  )     ::   taux_abl
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:  )     ::   tauy_abl  
    !
    INTEGER , PUBLIC :: nt_n, nt_a       !: now / after indices (equal 1 or 2)
@@ -68,9 +64,6 @@
          &      mxld_abl(1:jpi,1:jpj,1:jpka            ), &         
          &      mxlm_abl(1:jpi,1:jpj,1:jpka            ), & 
-         &      cft_abl (1:jpi,1:jpj,1:jpka            ), & 
          &      fft_abl (1:jpi,1:jpj                   ), &
          &      pblh    (1:jpi,1:jpj                   ), &         
-         &      taux_abl(1:jpi,1:jpj                   ), &   
-         &      tauy_abl(1:jpi,1:jpj                   ), &   		 
          &      msk_abl (1:jpi,1:jpj                   ), &
          &      rest_eq (1:jpi,1:jpj                   ), &         
Index: NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/ablmod.F90
===================================================================
--- NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/ablmod.F90	(revision 12592)
+++ NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/ablmod.F90	(revision 12749)
@@ -38,8 +38,8 @@
 
 !===================================================================================================
-   SUBROUTINE abl_stp( kt, psst, pssu, pssv, pssq, &                            ! in
+   SUBROUTINE abl_stp( kt, psst, pssu, pssv, pssq,            &     ! in
               &            pu_dta, pv_dta, pt_dta, pq_dta,    &
               &            pslp_dta, pgu_dta, pgv_dta,        &
-              &            pcd_du, psen, pevp,                &                            ! in/out
+              &            pcd_du, psen, pevp,                &     ! in/out
               &            pwndm, ptaui, ptauj, ptaum         &
 #if defined key_si3
@@ -112,5 +112,5 @@
       REAL(wp)            ::   zztmp, zcff, ztemp, zhumi, zcff1, zztmp1, zztmp2
       REAL(wp)            ::   zcff2, zfcor, zmsk, zsig, zcffu, zcffv, zzice,zzoce
-      LOGICAL             ::   SemiImp_Cor = .FALSE.
+      LOGICAL             ::   SemiImp_Cor = .TRUE.
       !
       !!---------------------------------------------------------------------
@@ -135,5 +135,5 @@
          ustar2(ji,jj) = zzoce
 #endif
-         zrough(ji,jj) = ght_abl(2) * EXP( - vkarmn / SQRT(Cdn_oce(ji,jj)) ) !<-- recover the value of z0 from Cdn_oce
+         zrough(ji,jj) = ght_abl(2) * EXP( - vkarmn / SQRT( MAX( Cdn_oce(ji,jj), 1.e-4 ) ) ) !<-- recover the value of z0 from Cdn_oce
       END_2D
       !
@@ -162,10 +162,10 @@
          DO ji = 1, jpi   ! vector opt.
             ! Neumann at the bottom
-            z_elem_a( ji, 2 ) = 0._wp
-            z_elem_c( ji, 2    ) = - rDt_abl * Avt_abl( ji, jj, 2   ) / e3w_abl( 2   )
+            z_elem_a( ji,    2 ) = 0._wp
+            z_elem_c( ji,    2 ) = - rDt_abl * Avt_abl( ji, jj,    2 ) / e3w_abl(    2 )
             ! Homogeneous Neumann at the top
             z_elem_a( ji, jpka ) = - rDt_abl * Avt_abl( ji, jj, jpka ) / e3w_abl( jpka )
             z_elem_c( ji, jpka ) = 0._wp
-            z_elem_b( ji, jpka ) = e3t_abl( jpka ) - z_elem_a( ji,     jpka )
+            z_elem_b( ji, jpka ) = e3t_abl( jpka ) - z_elem_a( ji, jpka )
          END DO
 
@@ -173,7 +173,7 @@
 
             DO jk = 3, jpkam1
-               DO ji = 2, jpim1
-               !DO ji = 1,jpi  !!GS: to be checked
-                  tq_abl  ( ji, jj, jk, nt_a, jtra ) = e3t_abl(jk) * tq_abl  ( ji, jj, jk, nt_n, jtra )   ! initialize right-hand-side
+               !DO ji = 2, jpim1
+               DO ji = 1,jpi  !!GS: to be checked if needed
+                  tq_abl( ji, jj, jk, nt_a, jtra ) = e3t_abl(jk) * tq_abl( ji, jj, jk, nt_n, jtra )   ! initialize right-hand-side
                END DO
             END DO
@@ -187,6 +187,6 @@
                   zztmp2 = zztmp2 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * psen_ice(ji,jj) * ptm_su(ji,jj)
 #endif
-                  z_elem_b( ji,     2                ) = e3t_abl( 2    ) - z_elem_c( ji, 2                    ) + rDt_abl * zztmp1
-                  tq_abl  ( ji, jj, 2   , nt_a, jtra ) = e3t_abl( 2    ) * tq_abl  ( ji, jj, 2   , nt_n, jtra ) + rDt_abl * zztmp2
+                  z_elem_b( ji,        2             ) = e3t_abl(    2 ) - z_elem_c( ji,        2             ) + rDt_abl * zztmp1
+                  tq_abl  ( ji, jj,    2, nt_a, jtra ) = e3t_abl(    2 ) * tq_abl  ( ji, jj,    2, nt_n, jtra ) + rDt_abl * zztmp2
                   tq_abl  ( ji, jj, jpka, nt_a, jtra ) = e3t_abl( jpka ) * tq_abl  ( ji, jj, jpka, nt_n, jtra )
                END DO
@@ -199,6 +199,6 @@
                   zztmp2 = zztmp2 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * pevp_ice(ji, jj) * pssq_ice(ji, jj)
 #endif
-                  z_elem_b( ji,     2                ) = e3t_abl( 2    ) - z_elem_c( ji, 2                    ) + rDt_abl * zztmp1
-                  tq_abl  ( ji, jj, 2   , nt_a, jtra ) = e3t_abl( 2    ) * tq_abl  ( ji, jj,    2, nt_n, jtra ) + rDt_abl * zztmp2
+                  z_elem_b( ji,     2                ) = e3t_abl(    2 ) - z_elem_c( ji,        2             ) + rDt_abl * zztmp1
+                  tq_abl  ( ji, jj, 2   , nt_a, jtra ) = e3t_abl(    2 ) * tq_abl  ( ji, jj,    2, nt_n, jtra ) + rDt_abl * zztmp2
                   tq_abl  ( ji, jj, jpka, nt_a, jtra ) = e3t_abl( jpka ) * tq_abl  ( ji, jj, jpka, nt_n, jtra )
                END DO
@@ -208,15 +208,15 @@
             !! ----------------------------------------------------------
             DO ji = 1,jpi
-               zcff                       =  1._wp / z_elem_b( ji, 2 )
-               zCF   (ji,   2           ) = - zcff * z_elem_c( ji, 2 )
-               tq_abl(ji,jj,2,nt_a,jtra) =    zcff * tq_abl(ji,jj,2,nt_a,jtra)
+               zcff                            =  1._wp / z_elem_b( ji, 2 )
+               zCF   ( ji,     2             ) = - zcff * z_elem_c( ji, 2 )
+               tq_abl( ji, jj, 2, nt_a, jtra ) =   zcff * tq_abl( ji, jj, 2, nt_a, jtra )
             END DO
 
             DO jk = 3, jpka
                DO ji = 1,jpi
-                  zcff = 1._wp / ( z_elem_b( ji, jk ) + z_elem_a( ji, jk ) * zCF   (ji, jk-1 ) )
+                  zcff = 1._wp / ( z_elem_b( ji, jk ) + z_elem_a( ji, jk ) * zCF( ji, jk-1 ) )
                   zCF(ji,jk) = - zcff * z_elem_c( ji, jk )
                   tq_abl(ji,jj,jk,nt_a,jtra) = zcff * ( tq_abl(ji,jj,jk  ,nt_a,jtra)   &
-                  &                - z_elem_a(ji, jk) * tq_abl(ji,jj,jk-1,nt_a,jtra) )
+                     &           - z_elem_a(ji, jk) *   tq_abl(ji,jj,jk-1,nt_a,jtra) )
                END DO
             END DO
@@ -240,91 +240,89 @@
       IF( SemiImp_Cor ) THEN
 
-      !-------------
-      DO jk = 2, jpka    ! outer loop
-      !-------------
-         !
-         ! Advance u_abl & v_abl to time n+1
-         DO_2D_11_11
-            zcff = ( fft_abl(ji,jj) * rDt_abl )*( fft_abl(ji,jj) * rDt_abl )  ! (f dt)**2
-
-            u_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *(  &
-               &        (1._wp-gamma_Cor*(1._wp-gamma_Cor)*zcff)*u_abl( ji, jj, jk, nt_n )    &
-               &                 +  rDt_abl * fft_abl(ji, jj) * v_abl ( ji , jj  , jk, nt_n ) )  &
-               &                               / (1._wp + gamma_Cor*gamma_Cor*zcff)
-
-            v_abl( ji, jj, jk, nt_a ) =  e3t_abl(jk) *(  &
-               &        (1._wp-gamma_Cor*(1._wp-gamma_Cor)*zcff)*v_abl( ji, jj, jk, nt_n )   &
-               &                 -  rDt_abl * fft_abl(ji, jj) * u_abl ( ji   , jj, jk, nt_n )  ) &
-               &                                / (1._wp + gamma_Cor*gamma_Cor*zcff)
-         END_2D
-         !
-      !-------------
-      END DO             ! end outer loop  !<-- u_abl and v_abl are properly updated on (1:jpi) x (1:jpj)
-      !-------------
-      !
-      !IF( ln_geos_winds ) THEN
-      !   DO jj = 1, jpj    ! outer loop
-      !      DO jk = 1, jpka
-      !         DO ji = 1, jpi
-      !            u_abl( ji, jj, jk, nt_a ) = u_abl( ji, jj, jk, nt_a )   &
-      !               &                      - rDt_abl * e3t_abl(jk) * fft_abl(ji  , jj) * pgv_dta(ji  ,jj  ,jk)
-      !            v_abl( ji, jj, jk, nt_a ) = v_abl( ji, jj, jk, nt_a )   &
-      !               &                      + rDt_abl * e3t_abl(jk) * fft_abl(ji, jj  ) * pgu_dta(ji  ,jj  ,jk)
-      !         END DO
-      !      END DO
-      !   END DO
-      !END IF
-
-      ELSE
-
-      !-------------
-      DO jk = 2, jpka    ! outer loop
-      !-------------
-         !
-         IF( MOD( kt, 2 ) == 0 ) then
-                 ! Advance u_abl & v_abl to time n+1
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zcff = fft_abl(ji,jj) * ( v_abl ( ji , jj  , jk, nt_n ) - pgv_dta(ji  ,jj  ,jk)  )
-               u_abl( ji, jj, jk, nt_a ) = u_abl( ji, jj, jk, nt_n ) + rDt_abl * zcff
-               zcff = fft_abl(ji,jj) * ( u_abl ( ji , jj  , jk, nt_a ) - pgu_dta(ji  ,jj  ,jk)  )
-               v_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *( v_abl( ji, jj, jk, nt_n ) - rDt_abl * zcff )
-               u_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *  u_abl( ji, jj, jk, nt_a )
-            END DO
-         END DO
-         !
-         ELSE
-         !
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zcff = fft_abl(ji,jj) * ( u_abl ( ji , jj  , jk, nt_n ) - pgu_dta(ji  ,jj  ,jk)  )
-               v_abl( ji, jj, jk, nt_a ) = v_abl( ji, jj, jk, nt_n ) - rDt_abl * zcff
-               zcff = fft_abl(ji,jj) * ( v_abl ( ji , jj  , jk, nt_a ) - pgv_dta(ji  ,jj  ,jk)  )
-               u_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *( u_abl( ji, jj, jk, nt_n ) + rDt_abl * zcff )
-               v_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *  v_abl( ji, jj, jk, nt_a )
-            END DO
-         END DO
-         !
-         ENDIF
-         !
-      !-------------
-      END DO             ! end outer loop  !<-- u_abl and v_abl are properly updated on (1:jpi) x (1:jpj)
-      !-------------
-
-      ENDIF
-
-      !-------------
-      !
-      IF( ln_hpgls_frc ) THEN
-         DO jj = 1, jpj    ! outer loop
-            DO jk = 1, jpka
-               DO ji = 1, jpi
-                  u_abl( ji, jj, jk, nt_a ) = u_abl( ji, jj, jk, nt_a ) - rDt_abl * e3t_abl(jk) * pgu_dta(ji,jj,jk)
-                  v_abl( ji, jj, jk, nt_a ) = v_abl( ji, jj, jk, nt_a ) - rDt_abl * e3t_abl(jk) * pgv_dta(ji,jj,jk)
+         !-------------
+         DO jk = 2, jpka    ! outer loop
+         !-------------
+            !
+            ! Advance u_abl & v_abl to time n+1
+            DO_2D_11_11
+               zcff = ( fft_abl(ji,jj) * rDt_abl )*( fft_abl(ji,jj) * rDt_abl )  ! (f dt)**2
+
+               u_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *(                                          &
+                  &        (1._wp-gamma_Cor*(1._wp-gamma_Cor)*zcff) * u_abl( ji, jj, jk, nt_n )    &
+                  &                     + rDt_abl * fft_abl(ji, jj) * v_abl( ji, jj, jk, nt_n ) )  &
+                  &                               / (1._wp + gamma_Cor*gamma_Cor*zcff)
+   
+               v_abl( ji, jj, jk, nt_a ) =  e3t_abl(jk) *(                                         &
+                  &        (1._wp-gamma_Cor*(1._wp-gamma_Cor)*zcff) * v_abl( ji, jj, jk, nt_n )    &
+                  &                     - rDt_abl * fft_abl(ji, jj) * u_abl( ji, jj, jk, nt_n ) )  &
+                  &                               / (1._wp + gamma_Cor*gamma_Cor*zcff)
+            END_2D
+            !
+         !-------------
+         END DO             ! end outer loop  !<-- u_abl and v_abl are properly updated on (1:jpi) x (1:jpj)
+         !-------------
+         !
+         IF( ln_geos_winds ) THEN
+            DO jj = 1, jpj    ! outer loop
+               DO jk = 1, jpka
+                  DO ji = 1, jpi
+                     u_abl( ji, jj, jk, nt_a ) = u_abl( ji, jj, jk, nt_a )   &
+                        &                      - rDt_abl * e3t_abl(jk) * fft_abl(ji  , jj) * pgv_dta(ji  ,jj  ,jk)
+                     v_abl( ji, jj, jk, nt_a ) = v_abl( ji, jj, jk, nt_a )   &
+                        &                      + rDt_abl * e3t_abl(jk) * fft_abl(ji, jj  ) * pgu_dta(ji  ,jj  ,jk)
+                  END DO
+               END DO
+            END DO
+         END IF
+         !
+         IF( ln_hpgls_frc ) THEN
+            DO jj = 1, jpj    ! outer loop
+               DO jk = 1, jpka
+                  DO ji = 1, jpi
+                     u_abl( ji, jj, jk, nt_a ) = u_abl( ji, jj, jk, nt_a ) - rDt_abl * e3t_abl(jk) * pgu_dta(ji,jj,jk)
+                     v_abl( ji, jj, jk, nt_a ) = v_abl( ji, jj, jk, nt_a ) - rDt_abl * e3t_abl(jk) * pgv_dta(ji,jj,jk)
+                  ENDDO
                ENDDO
             ENDDO
-         ENDDO
-      END IF
-
+         END IF
+
+      ELSE ! SemiImp_Cor = .FALSE.
+
+         IF( ln_geos_winds ) THEN
+
+            !-------------
+            DO jk = 2, jpka    ! outer loop
+            !-------------
+               !
+               IF( MOD( kt, 2 ) == 0 ) then
+                  ! Advance u_abl & v_abl to time n+1
+                  DO jj = 1, jpj
+                     DO ji = 1, jpi
+                        zcff = fft_abl(ji,jj) * ( v_abl ( ji , jj  , jk, nt_n ) - pgv_dta(ji  ,jj  ,jk)  )
+                        u_abl( ji, jj, jk, nt_a ) =                u_abl( ji, jj, jk, nt_n ) + rDt_abl * zcff
+                        zcff = fft_abl(ji,jj) * ( u_abl ( ji , jj  , jk, nt_a ) - pgu_dta(ji  ,jj  ,jk)  )
+                        v_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *( v_abl( ji, jj, jk, nt_n ) - rDt_abl * zcff )
+                        u_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *  u_abl( ji, jj, jk, nt_a )
+                     END DO
+                  END DO
+               ELSE
+                  DO jj = 1, jpj
+                     DO ji = 1, jpi
+                        zcff = fft_abl(ji,jj) * ( u_abl ( ji , jj  , jk, nt_n ) - pgu_dta(ji  ,jj  ,jk)  )
+                        v_abl( ji, jj, jk, nt_a ) =                v_abl( ji, jj, jk, nt_n ) - rDt_abl * zcff
+                        zcff = fft_abl(ji,jj) * ( v_abl ( ji , jj  , jk, nt_a ) - pgv_dta(ji  ,jj  ,jk)  )
+                        u_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *( u_abl( ji, jj, jk, nt_n ) + rDt_abl * zcff )
+                        v_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *  v_abl( ji, jj, jk, nt_a )
+                     END DO
+                  END DO
+               END IF
+               !
+            !-------------
+            END DO             ! end outer loop  !<-- u_abl and v_abl are properly updated on (1:jpi) x (1:jpj)
+            !-------------
+
+         ENDIF ! ln_geos_winds
+
+      ENDIF ! SemiImp_Cor
       !                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       !                            !  4 *** Advance u,v to time n+1
@@ -338,7 +336,7 @@
          DO jk = 3, jpkam1
             DO ji = 1, jpi
-               z_elem_a( ji,     jk ) = - rDt_abl * Avm_abl( ji, jj, jk-1 ) / e3w_abl( jk-1 )  ! lower-diagonal
-               z_elem_c( ji,     jk ) = - rDt_abl * Avm_abl( ji, jj, jk   ) / e3w_abl( jk   )  ! upper-diagonal
-               z_elem_b( ji,     jk ) = e3t_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk )                             !       diagonal
+               z_elem_a( ji, jk ) = - rDt_abl * Avm_abl( ji, jj, jk-1 ) / e3w_abl( jk-1 )  ! lower-diagonal
+               z_elem_c( ji, jk ) = - rDt_abl * Avm_abl( ji, jj, jk   ) / e3w_abl( jk   )  ! upper-diagonal
+               z_elem_b( ji, jk ) = e3t_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk )  !       diagonal
             END DO
          END DO
@@ -346,6 +344,6 @@
          DO ji = 2, jpi   ! boundary conditions   (Avm_abl and pcd_du must be available at ji=jpi)
             !++ Surface boundary condition
-            z_elem_a( ji,     2    ) = 0._wp
-            z_elem_c( ji,     2    ) = - rDt_abl * Avm_abl( ji, jj, 2   ) / e3w_abl( 2   )
+            z_elem_a( ji, 2 ) = 0._wp
+            z_elem_c( ji, 2 ) = - rDt_abl * Avm_abl( ji, jj, 2 ) / e3w_abl( 2 )
             !
             zztmp1  = pcd_du(ji, jj)
@@ -359,11 +357,12 @@
             u_abl( ji, jj,    2, nt_a ) =      u_abl( ji, jj,    2, nt_a ) + rDt_abl * zztmp2
 
-            IF( ln_topbc_neumann ) THEN
-               !++ Top Neumann B.C.
-               z_elem_a( ji,     jpka ) = - rDt_abl * Avm_abl( ji, jj, jpka ) / e3w_abl( jpka )
-               z_elem_c( ji,     jpka ) = 0._wp
-               z_elem_b( ji,     jpka ) = e3t_abl( jpka ) - z_elem_a( ji,     jpka )
-               !u_abl   ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * u_abl   ( ji, jj, jpka, nt_a )
-            ELSE
+            ! idealized test cases only
+            !IF( ln_topbc_neumann ) THEN
+            !   !++ Top Neumann B.C.
+            !   z_elem_a( ji,     jpka ) = - rDt_abl * Avm_abl( ji, jj, jpka ) / e3w_abl( jpka )
+            !   z_elem_c( ji,     jpka ) = 0._wp
+            !   z_elem_b( ji,     jpka ) = e3t_abl( jpka ) - z_elem_a( ji,     jpka )
+            !   !u_abl   ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * u_abl   ( ji, jj, jpka, nt_a )
+            !ELSE
                !++ Top Dirichlet B.C.
                z_elem_a( ji,     jpka )       = 0._wp
@@ -371,5 +370,5 @@
                z_elem_b( ji,     jpka )       = e3t_abl( jpka )
                u_abl   ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * pu_dta(ji,jj,jk)
-            ENDIF
+            !ENDIF
 
          END DO
@@ -377,5 +376,6 @@
          !! Matrix inversion
          !! ----------------------------------------------------------
-         DO ji = 2, jpi
+         !DO ji = 2, jpi
+         DO ji = 1, jpi  !!GS: TBI
             zcff                 =   1._wp / z_elem_b( ji, 2 )
             zCF   (ji,   2     ) =  - zcff * z_elem_c( ji, 2 )
@@ -410,7 +410,7 @@
          DO jk = 3, jpkam1
             DO ji = 1, jpi
-               z_elem_a( ji,     jk ) = -rDt_abl * Avm_abl( ji, jj, jk-1 ) / e3w_abl( jk-1 )   ! lower-diagonal
-               z_elem_c( ji,     jk ) = -rDt_abl * Avm_abl( ji, jj, jk   ) / e3w_abl( jk   )   ! upper-diagonal
-               z_elem_b( ji,     jk ) = e3t_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk )                              !       diagonal
+               z_elem_a( ji, jk ) = -rDt_abl * Avm_abl( ji, jj, jk-1 ) / e3w_abl( jk-1 )   ! lower-diagonal
+               z_elem_c( ji, jk ) = -rDt_abl * Avm_abl( ji, jj, jk   ) / e3w_abl( jk   )   ! upper-diagonal
+               z_elem_b( ji, jk ) = e3t_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk )                              !       diagonal
             END DO
          END DO
@@ -418,6 +418,6 @@
          DO ji = 1, jpi   ! boundary conditions (Avm_abl and pcd_du must be available at jj=jpj)
             !++ Surface boundary condition
-            z_elem_a( ji,     2    ) = 0._wp
-            z_elem_c( ji,     2    ) = - rDt_abl * Avm_abl( ji, jj, 2   ) / e3w_abl( 2   )
+            z_elem_a( ji, 2 ) = 0._wp
+            z_elem_c( ji, 2 ) = - rDt_abl * Avm_abl( ji, jj, 2 ) / e3w_abl( 2 )
             !
             zztmp1 = pcd_du(ji, jj)
@@ -431,11 +431,12 @@
             v_abl( ji, jj,    2, nt_a ) =         v_abl( ji, jj, 2, nt_a ) + rDt_abl * zztmp2
 
-            IF( ln_topbc_neumann ) THEN
-               !++ Top Neumann B.C.
-               z_elem_a( ji,     jpka ) = - rDt_abl * Avm_abl( ji, jj, jpka ) / e3w_abl( jpka )
-               z_elem_c( ji,     jpka ) = 0._wp
-               z_elem_b( ji,     jpka ) = e3t_abl( jpka ) - z_elem_a( ji,     jpka )
-               !v_abl   ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * v_abl   ( ji, jj, jpka, nt_a )
-            ELSE
+            ! idealized test cases only
+            !IF( ln_topbc_neumann ) THEN
+            !   !++ Top Neumann B.C.
+            !   z_elem_a( ji,     jpka ) = - rDt_abl * Avm_abl( ji, jj, jpka ) / e3w_abl( jpka )
+            !   z_elem_c( ji,     jpka ) = 0._wp
+            !   z_elem_b( ji,     jpka ) = e3t_abl( jpka ) - z_elem_a( ji,     jpka )
+            !   !v_abl   ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * v_abl   ( ji, jj, jpka, nt_a )
+            !ELSE
                !++ Top Dirichlet B.C.
                z_elem_a( ji,     jpka )       = 0._wp
@@ -443,5 +444,5 @@
                z_elem_b( ji,     jpka )       = e3t_abl( jpka )
                v_abl   ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * pv_dta(ji,jj,jk)
-            ENDIF
+            !ENDIF
 
          END DO
@@ -528,9 +529,10 @@
       !                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       !
-      CALL lbc_lnk_multi( 'ablmod',  u_abl(:,:,:,nt_a      ), 'T', -1.,  v_abl(:,:,:,nt_a)      , 'T', -1., kfillmode = jpfillnothing )
+      CALL lbc_lnk_multi( 'ablmod',  u_abl(:,:,:,nt_a      ), 'T', -1.,  v_abl(:,:,:,nt_a)      , 'T', -1.                            )
       CALL lbc_lnk_multi( 'ablmod', tq_abl(:,:,:,nt_a,jp_ta), 'T',  1., tq_abl(:,:,:,nt_a,jp_qa), 'T',  1., kfillmode = jpfillnothing )   ! ++++ this should not be needed...
       !
 #if defined key_iomput
-      ! first ABL level
+      ! 2D & first ABL level
+      IF ( iom_use("pblh"   ) ) CALL iom_put (    "pblh",    pblh(:,:             ) )
       IF ( iom_use("uz1_abl") ) CALL iom_put ( "uz1_abl",   u_abl(:,:,2,nt_a      ) )
       IF ( iom_use("vz1_abl") ) CALL iom_put ( "vz1_abl",   v_abl(:,:,2,nt_a      ) )
@@ -541,15 +543,24 @@
       IF ( iom_use("tz1_dta") ) CALL iom_put ( "tz1_dta",  pt_dta(:,:,2           ) )
       IF ( iom_use("qz1_dta") ) CALL iom_put ( "qz1_dta",  pq_dta(:,:,2           ) )
-      ! all ABL levels
-      IF ( iom_use("u_abl"  ) ) CALL iom_put ( "u_abl"  ,   u_abl(:,:,2:jpka,nt_a      ) )
-      IF ( iom_use("v_abl"  ) ) CALL iom_put ( "v_abl"  ,   v_abl(:,:,2:jpka,nt_a      ) )
-      IF ( iom_use("t_abl"  ) ) CALL iom_put ( "t_abl"  ,  tq_abl(:,:,2:jpka,nt_a,jp_ta) )
-      IF ( iom_use("q_abl"  ) ) CALL iom_put ( "q_abl"  ,  tq_abl(:,:,2:jpka,nt_a,jp_qa) )
-      IF ( iom_use("tke_abl") ) CALL iom_put ( "tke_abl", tke_abl(:,:,2:jpka,nt_a      ) )
-      IF ( iom_use("avm_abl") ) CALL iom_put ( "avm_abl", avm_abl(:,:,2:jpka           ) )
-      IF ( iom_use("avt_abl") ) CALL iom_put ( "avt_abl", avm_abl(:,:,2:jpka           ) )
-      IF ( iom_use("mxl_abl") ) CALL iom_put ( "mxl_abl", mxlm_abl(:,:,2:jpka          ) )
-      IF ( iom_use("pblh"   ) ) CALL iom_put (  "pblh"  ,    pblh(:,:                  ) )
-      ! debug (to be removed)
+      ! debug 2D
+      IF( ln_geos_winds ) THEN
+         IF ( iom_use("uz1_geo") ) CALL iom_put ( "uz1_geo", pgu_dta(:,:,2) )
+         IF ( iom_use("vz1_geo") ) CALL iom_put ( "vz1_geo", pgv_dta(:,:,2) )
+      END IF
+      IF( ln_hpgls_frc ) THEN
+         IF ( iom_use("uz1_geo") ) CALL iom_put ( "uz1_geo",  pgu_dta(:,:,2)/MAX(fft_abl(:,:),2.5e-5_wp) )
+         IF ( iom_use("vz1_geo") ) CALL iom_put ( "vz1_geo", -pgv_dta(:,:,2)/MAX(fft_abl(:,:),2.5e-5_wp) )
+      END IF
+      ! 3D (all ABL levels)
+      IF ( iom_use("u_abl"   ) ) CALL iom_put ( "u_abl"   ,    u_abl(:,:,2:jpka,nt_a      ) )
+      IF ( iom_use("v_abl"   ) ) CALL iom_put ( "v_abl"   ,    v_abl(:,:,2:jpka,nt_a      ) )
+      IF ( iom_use("t_abl"   ) ) CALL iom_put ( "t_abl"   ,   tq_abl(:,:,2:jpka,nt_a,jp_ta) )
+      IF ( iom_use("q_abl"   ) ) CALL iom_put ( "q_abl"   ,   tq_abl(:,:,2:jpka,nt_a,jp_qa) )
+      IF ( iom_use("tke_abl" ) ) CALL iom_put ( "tke_abl" ,  tke_abl(:,:,2:jpka,nt_a      ) )
+      IF ( iom_use("avm_abl" ) ) CALL iom_put ( "avm_abl" ,  avm_abl(:,:,2:jpka           ) )
+      IF ( iom_use("avt_abl" ) ) CALL iom_put ( "avt_abl" ,  avt_abl(:,:,2:jpka           ) )
+      IF ( iom_use("mxlm_abl") ) CALL iom_put ( "mxlm_abl", mxlm_abl(:,:,2:jpka           ) )
+      IF ( iom_use("mxld_abl") ) CALL iom_put ( "mxld_abl", mxld_abl(:,:,2:jpka           ) )
+      ! debug 3D
       IF ( iom_use("u_dta") ) CALL iom_put ( "u_dta",  pu_dta(:,:,2:jpka) )
       IF ( iom_use("v_dta") ) CALL iom_put ( "v_dta",  pv_dta(:,:,2:jpka) )
@@ -557,10 +568,10 @@
       IF ( iom_use("q_dta") ) CALL iom_put ( "q_dta",  pq_dta(:,:,2:jpka) )
       IF( ln_geos_winds ) THEN
-         IF ( iom_use("uz1_geo") ) CALL iom_put ( "uz1_geo", pgu_dta(:,:,2           ) )
-         IF ( iom_use("vz1_geo") ) CALL iom_put ( "vz1_geo", pgv_dta(:,:,2           ) )
+         IF ( iom_use("u_geo") ) CALL iom_put ( "u_geo", pgu_dta(:,:,2:jpka) )
+         IF ( iom_use("v_geo") ) CALL iom_put ( "v_geo", pgv_dta(:,:,2:jpka) )
       END IF
       IF( ln_hpgls_frc ) THEN
-         IF ( iom_use("uz1_geo") ) CALL iom_put ( "uz1_geo",  pgu_dta(:,:,2)/MAX(fft_abl(:,:),2.5e-5_wp)   )
-         IF ( iom_use("vz1_geo") ) CALL iom_put ( "vz1_geo", -pgv_dta(:,:,2)/MAX(fft_abl(:,:),2.5e-5_wp)   )
+         IF ( iom_use("u_geo") ) CALL iom_put ( "u_geo",  pgu_dta(:,:,2:jpka)/MAX( RESHAPE( fft_abl(:,:), (/jpi,jpj,jpka-1/), fft_abl(:,:)), 2.5e-5_wp) )
+         IF ( iom_use("v_geo") ) CALL iom_put ( "v_geo", -pgv_dta(:,:,2:jpka)/MAX( RESHAPE( fft_abl(:,:), (/jpi,jpj,jpka-1/), fft_abl(:,:)), 2.5e-5_wp) )
       END IF
 #endif
@@ -570,6 +581,6 @@
       !
       DO_2D_11_11
-         ztemp          = tq_abl  ( ji, jj, 2, nt_a, jp_ta )
-         zhumi          = tq_abl  ( ji, jj, 2, nt_a, jp_qa )
+         ztemp          =  tq_abl( ji, jj, 2, nt_a, jp_ta )
+         zhumi          =  tq_abl( ji, jj, 2, nt_a, jp_qa )
          zcff           = rho_air( ztemp, zhumi, pslp_dta( ji, jj ) )
          psen( ji, jj ) =    - cp_air(zhumi) * zcff * psen(ji,jj) * ( psst(ji,jj) + rt0 - ztemp )   !GS: negative sign to respect aerobulk convention
@@ -587,13 +598,12 @@
       ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked)
       DO_2D_11_11
-         zcff            = SQRT(  zwnd_i(ji,jj) * zwnd_i(ji,jj)   &
-            &                   + zwnd_j(ji,jj) * zwnd_j(ji,jj)   )  ! * msk_abl(ji,jj)
-         zztmp           = rhoa(ji,jj) * pcd_du(ji,jj)
-         pwndm (ji,jj)   =         zcff
-         ptaum (ji,jj)   = zztmp * zcff
-         zwnd_i(ji,jj)   = zztmp * zwnd_i(ji,jj)
-         zwnd_j(ji,jj)   = zztmp * zwnd_j(ji,jj)
-         taux_abl(ji,jj) = rhoa(ji,jj) * pcd_du(ji,jj) * zwnd_i(ji,jj)
-         tauy_abl(ji,jj) = rhoa(ji,jj) * pcd_du(ji,jj) * zwnd_j(ji,jj)
+         zcff          = SQRT(  zwnd_i(ji,jj) * zwnd_i(ji,jj)   &
+            &                 + zwnd_j(ji,jj) * zwnd_j(ji,jj) )   ! * msk_abl(ji,jj)
+         zztmp         = rhoa(ji,jj) * pcd_du(ji,jj)
+
+         pwndm (ji,jj) =         zcff
+         ptaum (ji,jj) = zztmp * zcff
+         zwnd_i(ji,jj) = zztmp * zwnd_i(ji,jj)
+         zwnd_j(ji,jj) = zztmp * zwnd_j(ji,jj)
       END_2D
       ! ... utau, vtau at U- and V_points, resp.
@@ -620,23 +630,23 @@
 
 #if defined key_si3
-         ! ------------------------------------------------------------ !
-         !    Wind stress relative to the moving ice ( U10m - U_ice )   !
-         ! ------------------------------------------------------------ !
-         DO_2D_00_00
-
-            zztmp1 = 0.5_wp * ( u_abl(ji+1,jj  ,2,nt_a) + u_abl(ji,jj,2,nt_a) )
-            zztmp2 = 0.5_wp * ( v_abl(ji  ,jj+1,2,nt_a) + v_abl(ji,jj,2,nt_a) )
-
-            ptaui_ice(ji,jj) = 0.5_wp * (  rhoa(ji+1,jj) * pCd_du_ice(ji+1,jj)             &
-               &                      +    rhoa(ji  ,jj) * pCd_du_ice(ji  ,jj)  )          &
-               &         * ( zztmp1 - rn_vfac * pssu_ice(ji,jj) )
-            ptauj_ice(ji,jj) = 0.5_wp * (  rhoa(ji,jj+1) * pCd_du_ice(ji,jj+1)             &
-               &                      +    rhoa(ji,jj  ) * pCd_du_ice(ji,jj  )  )          &
-               &         * ( zztmp2 - rn_vfac * pssv_ice(ji,jj) )
-         END_2D
-         CALL lbc_lnk_multi( 'ablmod', ptaui_ice, 'U', -1., ptauj_ice, 'V', -1. )
-         !
-         IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab2d_1=ptaui_ice  , clinfo1=' abl_stp: putaui : '   &
-            &                                , tab2d_2=ptauj_ice  , clinfo2='          pvtaui : ' )
+      ! ------------------------------------------------------------ !
+      !    Wind stress relative to the moving ice ( U10m - U_ice )   !
+      ! ------------------------------------------------------------ !
+      DO_2D_00_00
+
+         zztmp1 = 0.5_wp * ( u_abl(ji+1,jj  ,2,nt_a) + u_abl(ji,jj,2,nt_a) )
+         zztmp2 = 0.5_wp * ( v_abl(ji  ,jj+1,2,nt_a) + v_abl(ji,jj,2,nt_a) )
+
+         ptaui_ice(ji,jj) = 0.5_wp * (  rhoa(ji+1,jj) * pCd_du_ice(ji+1,jj)             &
+            &                      +    rhoa(ji  ,jj) * pCd_du_ice(ji  ,jj)  )          &
+            &         * ( zztmp1 - rn_vfac * pssu_ice(ji,jj) )
+         ptauj_ice(ji,jj) = 0.5_wp * (  rhoa(ji,jj+1) * pCd_du_ice(ji,jj+1)             &
+            &                      +    rhoa(ji,jj  ) * pCd_du_ice(ji,jj  )  )          &
+            &         * ( zztmp2 - rn_vfac * pssv_ice(ji,jj) )
+      END_2D
+      CALL lbc_lnk_multi( 'ablmod', ptaui_ice, 'U', -1., ptauj_ice, 'V', -1. )
+      !
+      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab2d_1=ptaui_ice  , clinfo1=' abl_stp: putaui : '   &
+         &                                , tab2d_2=ptauj_ice  , clinfo2='          pvtaui : ' )
 #endif
       !                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -688,5 +698,5 @@
       REAL(wp)                                ::   zcff, zcff2, ztken, zesrf, zetop, ziRic, ztv
       REAL(wp)                                ::   zdU , zdV , zcff1, zshear, zbuoy, zsig, zustar2
-      REAL(wp)                                ::   zdU2, zdV2, zbuoy1, zbuoy2
+      REAL(wp)                                ::   zdU2, zdV2, zbuoy1, zbuoy2    ! zbuoy for BL89
       REAL(wp)                                ::   zwndi, zwndj
       REAL(wp), DIMENSION(1:jpi,      1:jpka) ::   zsh2
@@ -733,20 +743,20 @@
          ! Terms for the tridiagonal problem
          DO jk = 2, jpkam1
-            DO ji = 1,jpi
-               zshear       =                 zsh2( ji,     jk )   ! zsh2 is already multiplied by Avm_abl at this point
-               zsh2(ji,jk)  = zsh2( ji, jk ) / Avm_abl( ji, jj, jk )   ! reformulate zsh2 as a 'true' vertical shear for PBLH computation
-               zbuoy        = - Avt_abl( ji, jj, jk ) * zbn2( ji, jj, jk )
-
-               z_elem_a( ji,     jk )   = - 0.5_wp * rDt_abl * rn_Sch * ( Avm_abl( ji, jj, jk   )+Avm_abl( ji, jj, jk-1 ) ) / e3t_abl( jk   ) ! lower-diagonal
-               z_elem_c( ji,     jk )   = - 0.5_wp * rDt_abl * rn_Sch * ( Avm_abl( ji, jj, jk   )+Avm_abl( ji, jj, jk+1 ) ) / e3t_abl( jk+1 ) ! upper-diagonal
+            DO ji = 1, jpi
+               zshear      = zsh2( ji, jk )                           ! zsh2 is already multiplied by Avm_abl at this point
+               zsh2(ji,jk) = zsh2( ji, jk ) / Avm_abl( ji, jj, jk )   ! reformulate zsh2 as a 'true' vertical shear for PBLH computation
+               zbuoy       = - Avt_abl( ji, jj, jk ) * zbn2( ji, jj, jk )
+
+               z_elem_a( ji, jk ) = - 0.5_wp * rDt_abl * rn_Sch * ( Avm_abl( ji, jj, jk ) + Avm_abl( ji, jj, jk-1 ) ) / e3t_abl( jk   ) ! lower-diagonal
+               z_elem_c( ji, jk ) = - 0.5_wp * rDt_abl * rn_Sch * ( Avm_abl( ji, jj, jk ) + Avm_abl( ji, jj, jk+1 ) ) / e3t_abl( jk+1 ) ! upper-diagonal
                IF( (zbuoy + zshear) .gt. 0.) THEN    ! Patankar trick to avoid negative values of TKE
-                  z_elem_b( ji,     jk )   = e3w_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk )   &
-                     &                     + e3w_abl(jk) * rDt_abl * rn_Ceps * sqrt(tke_abl( ji, jj, jk, nt_n )) / mxld_abl(ji,jj,jk)      ! diagonal
-                  tke_abl( ji, jj, jk, nt_a ) = e3w_abl(jk) * ( tke_abl( ji, jj, jk, nt_n ) + rDt_abl * ( zbuoy + zshear ) )               ! right-hand-side
+                  z_elem_b( ji, jk ) = e3w_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk )   &
+                     &               + e3w_abl(jk) * rDt_abl * rn_Ceps * sqrt(tke_abl( ji, jj, jk, nt_n )) / mxld_abl(ji,jj,jk)    ! diagonal
+                  tke_abl( ji, jj, jk, nt_a ) = e3w_abl(jk) * ( tke_abl( ji, jj, jk, nt_n ) + rDt_abl * ( zbuoy + zshear ) )       ! right-hand-side
                ELSE
-                  z_elem_b( ji,     jk )   = e3w_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk )   &
-                     &                     + e3w_abl(jk) * rDt_abl * rn_Ceps * sqrt(tke_abl( ji, jj, jk, nt_n )) / mxld_abl(ji,jj,jk)   &  ! diagonal
-                     &                     - e3w_abl(jk) * rDt_abl * zbuoy
-                  tke_abl( ji, jj, jk, nt_a )  = e3w_abl(jk) * ( tke_abl( ji, jj, jk, nt_n ) + rDt_abl *  zshear )             ! right-hand-side
+                  z_elem_b( ji, jk ) = e3w_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk )   &
+                     &               + e3w_abl(jk) * rDt_abl * rn_Ceps * sqrt(tke_abl( ji, jj, jk, nt_n )) / mxld_abl(ji,jj,jk)   &  ! diagonal
+                     &               - e3w_abl(jk) * rDt_abl * zbuoy
+                  tke_abl( ji, jj, jk, nt_a ) = e3w_abl(jk) * ( tke_abl( ji, jj, jk, nt_n ) + rDt_abl *  zshear )                    ! right-hand-side
                END IF
             END DO
@@ -754,19 +764,28 @@
 
          DO ji = 1,jpi    ! vector opt.
-            zesrf   =  MAX( rn_esfc * ustar2(ji,jj), tke_min )
-            zetop   = tke_min
-
-            z_elem_a ( ji,        1 ) = 0._wp; z_elem_c ( ji,     1    ) = 0._wp; z_elem_b ( ji,     1    ) = 1._wp
-            z_elem_a ( ji,     jpka ) = - 0.5 * rDt_abl * rn_Sch * (Avm_abl(ji,jj, jpka-1 )+Avm_abl(ji,jj, jpka ))  / e3t_abl( jpka )
-            z_elem_c ( ji,     jpka ) = 0._wp
-            z_elem_b ( ji,     jpka ) = e3w_abl(jpka) - z_elem_a(ji, jpka )
-
-            tke_abl  ( ji, jj,    1 , nt_a ) = zesrf
-            tke_abl  ( ji, jj, jpka , nt_a ) = e3w_abl(jpka) * tke_abl( ji,jj, jpka, nt_n )
-
-            zbn2(ji,jj,   1) = zbn2( ji,jj,   2)
-            zsh2(ji,      1) = zsh2( ji,      2)
-            zbn2(ji,jj,jpka) = zbn2( ji,jj,jpkam1)
-            zsh2(ji,   jpka) = zsh2( ji  , jpkam1)
+            zesrf = MAX( rn_Esfc * ustar2(ji,jj), tke_min )
+            zetop = tke_min
+
+            z_elem_a ( ji,     1       ) = 0._wp
+            z_elem_c ( ji,     1       ) = 0._wp
+            z_elem_b ( ji,     1       ) = 1._wp
+            tke_abl  ( ji, jj, 1, nt_a ) = zesrf
+
+            !++ Top Neumann B.C.
+            !z_elem_a ( ji,     jpka       ) = - 0.5 * rDt_abl * rn_Sch * (Avm_abl(ji,jj, jpka-1 )+Avm_abl(ji,jj, jpka ))  / e3t_abl( jpka )
+            !z_elem_c ( ji,     jpka       ) = 0._wp
+            !z_elem_b ( ji,     jpka       ) = e3w_abl(jpka) - z_elem_a(ji, jpka )
+            !tke_abl  ( ji, jj, jpka, nt_a ) = e3w_abl(jpka) * tke_abl( ji,jj, jpka, nt_n )
+
+            !++ Top Dirichlet B.C.
+            z_elem_a ( ji,     jpka       ) = 0._wp
+            z_elem_c ( ji,     jpka       ) = 0._wp
+            z_elem_b ( ji,     jpka       ) = 1._wp
+            tke_abl  ( ji, jj, jpka, nt_a ) = zetop
+
+            zbn2 ( ji, jj,    1 ) = zbn2 ( ji, jj,      2 )
+            zsh2 ( ji,        1 ) = zsh2 ( ji,          2 )
+            zbn2 ( ji, jj, jpka ) = zbn2 ( ji, jj, jpkam1 )
+            zsh2 ( ji,     jpka ) = zsh2 ( ji    , jpkam1 )
          END DO
          !!
@@ -844,7 +863,7 @@
       ! Optional : could add pblh smoothing if pblh is noisy horizontally ...
       IF(ln_smth_pblh) THEN
-         CALL lbc_lnk( 'ablmod', pblh, 'T', 1., kfillmode = jpfillnothing)
+         CALL lbc_lnk( 'ablmod', pblh, 'T', 1.) !, kfillmode = jpfillnothing)
          CALL smooth_pblh( pblh, msk_abl )
-         CALL lbc_lnk( 'ablmod', pblh, 'T', 1., kfillmode = jpfillnothing)
+         CALL lbc_lnk( 'ablmod', pblh, 'T', 1.) !, kfillmode = jpfillnothing)
       ENDIF
       !                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -860,10 +879,10 @@
             !
             DO ji = 1, jpi
-               mxld_abl ( ji, jj,    1 ) = mxl_min
-               mxld_abl ( ji, jj, jpka ) = mxl_min
-               mxlm_abl ( ji, jj,    1 ) = mxl_min
-               mxlm_abl ( ji, jj, jpka ) = mxl_min
-               zldw     ( ji,        1 ) = zrough(ji,jj) * rn_Lsfc
-               zlup     ( ji,     jpka ) = mxl_min
+               mxld_abl( ji, jj,    1 ) = mxl_min
+               mxld_abl( ji, jj, jpka ) = mxl_min
+               mxlm_abl( ji, jj,    1 ) = mxl_min
+               mxlm_abl( ji, jj, jpka ) = mxl_min
+               zldw    ( ji,        1 ) = zrough(ji,jj) * rn_Lsfc
+               zlup    ( ji,     jpka ) = mxl_min
             END DO
             !
@@ -898,8 +917,7 @@
             DO jk = 1, jpka
                DO ji = 1, jpi
+!                  zcff = 2.*SQRT(2.)*(  zldw( ji, jk )**(-2._wp/3._wp) + zlup( ji, jk )**(-2._wp/3._wp)  )**(-3._wp/2._wp)
                   zcff = SQRT( zldw( ji, jk ) * zlup( ji, jk ) )
-!                  zcff = 2.*SQRT(2.)*(  zldw( ji, jk )**(-2._wp/3._wp) + zlup( ji, jk )**(-2._wp/3._wp)  )**(-3._wp/2._wp)
                   mxlm_abl( ji, jj, jk ) = MAX( zcff, mxl_min )
-                  !mxld_abl( ji, jj, jk ) = MIN( zldw( ji, jk ),  zlup( ji, jk ) )
                   mxld_abl( ji, jj, jk ) = MAX( MIN( zldw( ji, jk ),  zlup( ji, jk ) ), mxl_min )
                END DO
@@ -971,5 +989,5 @@
 #   undef zlup
 #   undef zldw
-!         !
+         !
       CASE ( 2 )           ! Bougeault & Lacarrere 89 length-scale
          !
@@ -1007,6 +1025,6 @@
             DO jkup=jk+1,jpka-1
                DO ji = 1, jpi
-                  zbuoy1             = MAX( zbn2(ji,jj,jkup  ), rsmall )
-                  zbuoy2             = MAX( zbn2(ji,jj,jkup-1), rsmall )
+                  zbuoy1 = MAX( zbn2(ji,jj,jkup  ), rsmall )
+                  zbuoy2 = MAX( zbn2(ji,jj,jkup-1), rsmall )
                   zCF (ji,jkup) = zCF (ji,jkup-1) + 0.5_wp * e3t_abl(jkup) * &
                      &               ( zbuoy1*(ghw_abl(jkup  )-ghw_abl(jk)) &
@@ -1038,6 +1056,6 @@
             DO jkdwn=jk-1,1,-1
                DO ji = 1, jpi
-                  zbuoy1             = MAX( zbn2(ji,jj,jkdwn+1), rsmall )
-                  zbuoy2             = MAX( zbn2(ji,jj,jkdwn  ), rsmall )
+                  zbuoy1 = MAX( zbn2(ji,jj,jkdwn+1), rsmall )
+                  zbuoy2 = MAX( zbn2(ji,jj,jkdwn  ), rsmall )
                   zCF (ji,jkdwn) = zCF (ji,jkdwn+1) + 0.5_wp * e3t_abl(jkdwn+1)  &
                      &               * ( zbuoy1*(ghw_abl(jk)-ghw_abl(jkdwn+1)) &
@@ -1166,5 +1184,5 @@
                         &    (         zCF(ji,jkdwn+1) -         zCF(ji,jkdwn) )
                      zldw(ji,jk) = zcff
-                                         zldw(ji,jk) = ghw_abl(jk) - ghw_abl(jkdwn  )
+                     zldw(ji,jk) = ghw_abl(jk) - ghw_abl(jkdwn  )
                      ln_foundl(ji) = .true.
                   END IF
@@ -1186,5 +1204,4 @@
 #   undef zlup
 #   undef zldw
-         !
          !
          !
Index: NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/par_abl.F90
===================================================================
--- NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/par_abl.F90	(revision 12592)
+++ NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/par_abl.F90	(revision 12749)
@@ -28,5 +28,5 @@
    LOGICAL , PUBLIC            ::   ln_hpgls_frc   !: forcing of ABL winds by large-scale pressure gradient 
    LOGICAL , PUBLIC            ::   ln_smth_pblh   !: smoothing of atmospheric PBL height 
-   LOGICAL , PUBLIC            ::   ln_topbc_neumann = .FALSE.  !: smoothing of atmospheric PBL height    
+   !LOGICAL , PUBLIC            ::   ln_topbc_neumann = .FALSE.  !: idealised testcases only
 
    LOGICAL           , PUBLIC  ::   ln_rstart_abl    !: (de)activate abl restart
Index: NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/sbcabl.F90
===================================================================
--- NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/sbcabl.F90	(revision 12592)
+++ NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/ABL/sbcabl.F90	(revision 12749)
@@ -168,5 +168,5 @@
       rn_Esfc =  1._wp / SQRT(rn_cm*rn_ceps)
       rn_Lsfc = vkarmn * SQRT(SQRT(rn_cm*rn_ceps)) / rn_cm
-	  
+
       IF(lwp) THEN
          WRITE(numout,*)
@@ -175,5 +175,5 @@
          IF(nn_amxl==0) WRITE(numout,*) 'Deardorff 80 length-scale '
          IF(nn_amxl==1) WRITE(numout,*) 'Modified Deardorff 80 length-scale '
-         IF(nn_amxl==1) WRITE(numout,*) 'Bougeault and Lacarrere length-scale '		 
+         IF(nn_amxl==2) WRITE(numout,*) 'Bougeault and Lacarrere length-scale '		 
          IF(nn_amxl==3) WRITE(numout,*) 'Rodier et al. length-scale '	
          WRITE(numout,*) ' Minimum value of atmospheric TKE           = ',tke_min,' m^2 s^-2'
