Index: NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_algo_coare3p0.F90
===================================================================
--- NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_algo_coare3p0.F90	(revision 13159)
+++ NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_algo_coare3p0.F90	(revision 13197)
@@ -395,15 +395,15 @@
       !
       DO_2D_11_11
-         !
-         zw = pwnd(ji,jj)   ! wind speed
-         !
-         ! Charnock's constant, increases with the wind :
-         zgt10 = 0.5 + SIGN(0.5_wp,(zw - 10))  ! If zw<10. --> 0, else --> 1
-         zgt18 = 0.5 + SIGN(0.5_wp,(zw - 18.)) ! If zw<18. --> 0, else --> 1
-         !
-         alfa_charn_3p0(ji,jj) =  (1. - zgt10)*0.011    &    ! wind is lower than 10 m/s
-            &     + zgt10*((1. - zgt18)*(0.011 + (0.018 - 0.011) &
-            &      *(zw - 10.)/(18. - 10.)) + zgt18*( 0.018 ) )    ! Hare et al. (1999)
-         !
+      !
+      zw = pwnd(ji,jj)   ! wind speed
+      !
+      ! Charnock's constant, increases with the wind :
+      zgt10 = 0.5 + SIGN(0.5_wp,(zw - 10))  ! If zw<10. --> 0, else --> 1
+      zgt18 = 0.5 + SIGN(0.5_wp,(zw - 18.)) ! If zw<18. --> 0, else --> 1
+      !
+      alfa_charn_3p0(ji,jj) =  (1. - zgt10)*0.011    &    ! wind is lower than 10 m/s
+         &     + zgt10*((1. - zgt18)*(0.011 + (0.018 - 0.011) &
+         &      *(zw - 10.)/(18. - 10.)) + zgt18*( 0.018 ) )    ! Hare et al. (1999)
+      !
       END_2D
       !
@@ -431,26 +431,26 @@
       !
       DO_2D_11_11
-         !
-         zta = pzeta(ji,jj)
-         !
-         zphi_m = ABS(1. - 15.*zta)**.25    !!Kansas unstable
-         !
-         zpsi_k = 2.*LOG((1. + zphi_m)/2.) + LOG((1. + zphi_m*zphi_m)/2.)   &
-            & - 2.*ATAN(zphi_m) + 0.5*rpi
-         !
-         zphi_c = ABS(1. - 10.15*zta)**.3333                   !!Convective
-         !
-         zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
-            &     - 1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
-         !
-         zf = zta*zta
-         zf = zf/(1. + zf)
-         zc = MIN(50._wp, 0.35_wp*zta)
-         zstab = 0.5 + SIGN(0.5_wp, zta)
-         !
-         psi_m_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) & ! (zta < 0)
-            &                -   zstab     * ( 1. + 1.*zta     &                ! (zta > 0)
-            &                         + 0.6667*(zta - 14.28)/EXP(zc) + 8.525 )   !     "
-         !
+      !
+      zta = pzeta(ji,jj)
+      !
+      zphi_m = ABS(1. - 15.*zta)**.25    !!Kansas unstable
+      !
+      zpsi_k = 2.*LOG((1. + zphi_m)/2.) + LOG((1. + zphi_m*zphi_m)/2.)   &
+         & - 2.*ATAN(zphi_m) + 0.5*rpi
+      !
+      zphi_c = ABS(1. - 10.15*zta)**.3333                   !!Convective
+      !
+      zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+         &     - 1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+      !
+      zf = zta*zta
+      zf = zf/(1. + zf)
+      zc = MIN(50._wp, 0.35_wp*zta)
+      zstab = 0.5 + SIGN(0.5_wp, zta)
+      !
+      psi_m_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) & ! (zta < 0)
+         &                -   zstab     * ( 1. + 1.*zta     &                ! (zta > 0)
+         &                         + 0.6667*(zta - 14.28)/EXP(zc) + 8.525 )   !     "
+      !
       END_2D
       !
@@ -482,25 +482,25 @@
       !
       DO_2D_11_11
-         !
-         zta = pzeta(ji,jj)
-         !
-         zphi_h = (ABS(1. - 15.*zta))**.5  !! Kansas unstable   (zphi_h = zphi_m**2 when unstable, zphi_m when stable)
-         !
-         zpsi_k = 2.*LOG((1. + zphi_h)/2.)
-         !
-         zphi_c = (ABS(1. - 34.15*zta))**.3333   !! Convective
-         !
-         zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
-            &    -1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
-         !
-         zf = zta*zta
-         zf = zf/(1. + zf)
-         zc = MIN(50._wp,0.35_wp*zta)
-         zstab = 0.5 + SIGN(0.5_wp, zta)
-         !
-         psi_h_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) &
-            &                -   zstab     * ( (ABS(1. + 2.*zta/3.))**1.5     &
-            &                           + .6667*(zta - 14.28)/EXP(zc) + 8.525 )
-         !
+      !
+      zta = pzeta(ji,jj)
+      !
+      zphi_h = (ABS(1. - 15.*zta))**.5  !! Kansas unstable   (zphi_h = zphi_m**2 when unstable, zphi_m when stable)
+      !
+      zpsi_k = 2.*LOG((1. + zphi_h)/2.)
+      !
+      zphi_c = (ABS(1. - 34.15*zta))**.3333   !! Convective
+      !
+      zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+         &    -1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+      !
+      zf = zta*zta
+      zf = zf/(1. + zf)
+      zc = MIN(50._wp,0.35_wp*zta)
+      zstab = 0.5 + SIGN(0.5_wp, zta)
+      !
+      psi_h_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) &
+         &                -   zstab     * ( (ABS(1. + 2.*zta/3.))**1.5     &
+         &                           + .6667*(zta - 14.28)/EXP(zc) + 8.525 )
+      !
       END_2D
       !
Index: NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_algo_coare3p6.F90
===================================================================
--- NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_algo_coare3p6.F90	(revision 13159)
+++ NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_algo_coare3p6.F90	(revision 13197)
@@ -431,26 +431,26 @@
       !
       DO_2D_11_11
-         !
-         zta = pzeta(ji,jj)
-         !
-         zphi_m = ABS(1. - 15.*zta)**.25    !!Kansas unstable
-         !
-         zpsi_k = 2.*LOG((1. + zphi_m)/2.) + LOG((1. + zphi_m*zphi_m)/2.)   &
-            & - 2.*ATAN(zphi_m) + 0.5*rpi
-         !
-         zphi_c = ABS(1. - 10.15*zta)**.3333                   !!Convective
-         !
-         zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
-            &     - 1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
-         !
-         zf = zta*zta
-         zf = zf/(1. + zf)
-         zc = MIN(50._wp, 0.35_wp*zta)
-         zstab = 0.5 + SIGN(0.5_wp, zta)
-         !
-         psi_m_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) & ! (zta < 0)
-            &                -   zstab     * ( 1. + 1.*zta     &                ! (zta > 0)
-            &                         + 0.6667*(zta - 14.28)/EXP(zc) + 8.525 )   !     "
-         !
+      !
+      zta = pzeta(ji,jj)
+      !
+      zphi_m = ABS(1. - 15.*zta)**.25    !!Kansas unstable
+      !
+      zpsi_k = 2.*LOG((1. + zphi_m)/2.) + LOG((1. + zphi_m*zphi_m)/2.)   &
+         & - 2.*ATAN(zphi_m) + 0.5*rpi
+      !
+      zphi_c = ABS(1. - 10.15*zta)**.3333                   !!Convective
+      !
+      zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+         &     - 1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+      !
+      zf = zta*zta
+      zf = zf/(1. + zf)
+      zc = MIN(50._wp, 0.35_wp*zta)
+      zstab = 0.5 + SIGN(0.5_wp, zta)
+      !
+      psi_m_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) & ! (zta < 0)
+         &                -   zstab     * ( 1. + 1.*zta     &                ! (zta > 0)
+         &                         + 0.6667*(zta - 14.28)/EXP(zc) + 8.525 )   !     "
+      !
       END_2D
       !
@@ -482,25 +482,25 @@
       !
       DO_2D_11_11
-         !
-         zta = pzeta(ji,jj)
-         !
-         zphi_h = (ABS(1. - 15.*zta))**.5  !! Kansas unstable   (zphi_h = zphi_m**2 when unstable, zphi_m when stable)
-         !
-         zpsi_k = 2.*LOG((1. + zphi_h)/2.)
-         !
-         zphi_c = (ABS(1. - 34.15*zta))**.3333   !! Convective
-         !
-         zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
-            &    -1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
-         !
-         zf = zta*zta
-         zf = zf/(1. + zf)
-         zc = MIN(50._wp,0.35_wp*zta)
-         zstab = 0.5 + SIGN(0.5_wp, zta)
-         !
-         psi_h_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) &
-            &                -   zstab     * ( (ABS(1. + 2.*zta/3.))**1.5     &
-            &                           + .6667*(zta - 14.28)/EXP(zc) + 8.525 )
-         !
+      !
+      zta = pzeta(ji,jj)
+      !
+      zphi_h = (ABS(1. - 15.*zta))**.5  !! Kansas unstable   (zphi_h = zphi_m**2 when unstable, zphi_m when stable)
+      !
+      zpsi_k = 2.*LOG((1. + zphi_h)/2.)
+      !
+      zphi_c = (ABS(1. - 34.15*zta))**.3333   !! Convective
+      !
+      zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+         &    -1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+      !
+      zf = zta*zta
+      zf = zf/(1. + zf)
+      zc = MIN(50._wp,0.35_wp*zta)
+      zstab = 0.5 + SIGN(0.5_wp, zta)
+      !
+      psi_h_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) &
+         &                -   zstab     * ( (ABS(1. + 2.*zta/3.))**1.5     &
+         &                           + .6667*(zta - 14.28)/EXP(zc) + 8.525 )
+      !
       END_2D
       !
Index: NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_algo_ecmwf.F90
===================================================================
--- NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_algo_ecmwf.F90	(revision 13159)
+++ NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_algo_ecmwf.F90	(revision 13197)
@@ -411,26 +411,26 @@
       !!----------------------------------------------------------------------------------
       DO_2D_11_11
-         !
-         zzeta = MIN( pzeta(ji,jj) , 5._wp ) !! Very stable conditions (L positif and big!):
-         !
-         ! Unstable (Paulson 1970):
-         !   eq.3.20, Chap.3, p.33, IFS doc - Cy31r1
-         zx = SQRT(ABS(1._wp - 16._wp*zzeta))
-         ztmp = 1._wp + SQRT(zx)
-         ztmp = ztmp*ztmp
-         psi_unst = LOG( 0.125_wp*ztmp*(1._wp + zx) )   &
-            &       -2._wp*ATAN( SQRT(zx) ) + 0.5_wp*rpi
-         !
-         ! Unstable:
-         ! eq.3.22, Chap.3, p.33, IFS doc - Cy31r1
-         psi_stab = -2._wp/3._wp*(zzeta - 5._wp/0.35_wp)*EXP(-0.35_wp*zzeta) &
-            &       - zzeta - 2._wp/3._wp*5._wp/0.35_wp
-         !
-         ! Combining:
-         stab = 0.5_wp + SIGN(0.5_wp, zzeta) ! zzeta > 0 => stab = 1
-         !
-         psi_m_ecmwf(ji,jj) = (1._wp - stab) * psi_unst & ! (zzeta < 0) Unstable
-            &                +      stab  * psi_stab      ! (zzeta > 0) Stable
-         !
+      !
+      zzeta = MIN( pzeta(ji,jj) , 5._wp ) !! Very stable conditions (L positif and big!):
+      !
+      ! Unstable (Paulson 1970):
+      !   eq.3.20, Chap.3, p.33, IFS doc - Cy31r1
+      zx = SQRT(ABS(1._wp - 16._wp*zzeta))
+      ztmp = 1._wp + SQRT(zx)
+      ztmp = ztmp*ztmp
+      psi_unst = LOG( 0.125_wp*ztmp*(1._wp + zx) )   &
+         &       -2._wp*ATAN( SQRT(zx) ) + 0.5_wp*rpi
+      !
+      ! Unstable:
+      ! eq.3.22, Chap.3, p.33, IFS doc - Cy31r1
+      psi_stab = -2._wp/3._wp*(zzeta - 5._wp/0.35_wp)*EXP(-0.35_wp*zzeta) &
+         &       - zzeta - 2._wp/3._wp*5._wp/0.35_wp
+      !
+      ! Combining:
+      stab = 0.5_wp + SIGN(0.5_wp, zzeta) ! zzeta > 0 => stab = 1
+      !
+      psi_m_ecmwf(ji,jj) = (1._wp - stab) * psi_unst & ! (zzeta < 0) Unstable
+         &                +      stab  * psi_stab      ! (zzeta > 0) Stable
+      !
       END_2D
    END FUNCTION psi_m_ecmwf
@@ -456,23 +456,23 @@
       !
       DO_2D_11_11
-         !
-         zzeta = MIN(pzeta(ji,jj) , 5._wp)   ! Very stable conditions (L positif and big!):
-         !
-         zx  = ABS(1._wp - 16._wp*zzeta)**.25        ! this is actually (1/phi_m)**2  !!!
-         !                                     ! eq.3.19, Chap.3, p.33, IFS doc - Cy31r1
-         ! Unstable (Paulson 1970) :
-         psi_unst = 2._wp*LOG(0.5_wp*(1._wp + zx*zx))   ! eq.3.20, Chap.3, p.33, IFS doc - Cy31r1
-         !
-         ! Stable:
-         psi_stab = -2._wp/3._wp*(zzeta - 5._wp/0.35_wp)*EXP(-0.35_wp*zzeta) & ! eq.3.22, Chap.3, p.33, IFS doc - Cy31r1
-            &       - ABS(1._wp + 2._wp/3._wp*zzeta)**1.5_wp - 2._wp/3._wp*5._wp/0.35_wp + 1._wp
-         ! LB: added ABS() to avoid NaN values when unstable, which contaminates the unstable solution...
-         !
-         stab = 0.5_wp + SIGN(0.5_wp, zzeta) ! zzeta > 0 => stab = 1
-         !
-         !
-         psi_h_ecmwf(ji,jj) = (1._wp - stab) * psi_unst &   ! (zzeta < 0) Unstable
-            &                +    stab    * psi_stab        ! (zzeta > 0) Stable
-         !
+      !
+      zzeta = MIN(pzeta(ji,jj) , 5._wp)   ! Very stable conditions (L positif and big!):
+      !
+      zx  = ABS(1._wp - 16._wp*zzeta)**.25        ! this is actually (1/phi_m)**2  !!!
+      !                                     ! eq.3.19, Chap.3, p.33, IFS doc - Cy31r1
+      ! Unstable (Paulson 1970) :
+      psi_unst = 2._wp*LOG(0.5_wp*(1._wp + zx*zx))   ! eq.3.20, Chap.3, p.33, IFS doc - Cy31r1
+      !
+      ! Stable:
+      psi_stab = -2._wp/3._wp*(zzeta - 5._wp/0.35_wp)*EXP(-0.35_wp*zzeta) & ! eq.3.22, Chap.3, p.33, IFS doc - Cy31r1
+         &       - ABS(1._wp + 2._wp/3._wp*zzeta)**1.5_wp - 2._wp/3._wp*5._wp/0.35_wp + 1._wp
+      ! LB: added ABS() to avoid NaN values when unstable, which contaminates the unstable solution...
+      !
+      stab = 0.5_wp + SIGN(0.5_wp, zzeta) ! zzeta > 0 => stab = 1
+      !
+      !
+      psi_h_ecmwf(ji,jj) = (1._wp - stab) * psi_unst &   ! (zzeta < 0) Unstable
+         &                +    stab    * psi_stab        ! (zzeta > 0) Stable
+      !
       END_2D
    END FUNCTION psi_h_ecmwf
Index: NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_phy.F90
===================================================================
--- NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_phy.F90	(revision 13159)
+++ NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/SBC/sbcblk_phy.F90	(revision 13197)
@@ -524,5 +524,5 @@
             &                    pwnd(ji,jj), pUb(ji,jj), pslp(ji,jj),                &
             &                    pTau(ji,jj), zQsen, zQlat )
-
+         
          zTs2  = pTs(ji,jj)*pTs(ji,jj)
          zQlw  = emiss_w*(prlw(ji,jj) - stefan*zTs2*zTs2) ! Net longwave flux
