Index: LMDZ6/trunk/libf/phylmdiso/pbl_surface_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmdiso/pbl_surface_mod.F90	(revision 3949)
+++ LMDZ6/trunk/libf/phylmdiso/pbl_surface_mod.F90	(revision 3962)
@@ -1,4 +1,4 @@
 !
-! $Id: pbl_surface_mod.F90 3906 2021-05-19 10:35:18Z jyg $
+! $Id: pbl_surface_mod.F90 3956 2021-07-06 07:16:14Z jyg $
 !
 MODULE pbl_surface_mod
@@ -805,5 +805,4 @@
     REAL, DIMENSION(klon, klev)        :: zxfluxu_x, zxfluxv_x, zxfluxu_w, zxfluxv_w
     REAL                               :: zx_qs_surf, zcor_surf, zdelta_surf
-    REAL, DIMENSION(klon)              :: ytsurf_th, yqsatsurf
 !jyg<
     REAL, DIMENSION(klon)              :: ybeta
@@ -969,5 +968,4 @@
     REAL, PARAMETER                    :: facteur=2./sqrt(3.14)
     REAL, PARAMETER                    :: inertia=2000.
-    REAL, DIMENSION(klon)              :: ytsurf_th_x,ytsurf_th_w,yqsatsurf_x,yqsatsurf_w
     REAL, DIMENSION(klon)              :: ydtsurf_th
     REAL                               :: zdelta_surf_x,zdelta_surf_w,zx_qs_surf_x,zx_qs_surf_w
@@ -1051,5 +1049,18 @@
 !!jyg      iflag_split = mod(iflag_pbl_split,2)
 !!jyg      iflag_split = mod(iflag_pbl_split,10)
+!
+! Flags controlling the splitting of the turbulent boundary layer:
+!   iflag_split_ref = 0  ==> no splitting
+!                   = 1  ==> splitting without coupling with surface temperature
+!                   = 2  ==> splitting with coupling with surface temperature over land
+!                   = 3  ==> splitting over ocean; no splitting over land
+!   iflag_split: actual flag controlling the splitting.
+!   iflag_split = iflag_split_ref outside the sub-surface loop
+!               = iflag_split_ref if iflag_split_ref = 0, 1, or 2
+!               = 0 over land  if iflga_split_ref = 3
+!               = 1 over ocean if iflga_split_ref = 3
+
       iflag_split_ref = mod(iflag_pbl_split,10)
+      iflag_split = iflag_split_ref
 
 #ifdef ISO      
@@ -1243,5 +1254,4 @@
 !!! jyg le 10/02/2012
     rh2m_x(:) = 0. ; qsat2m_x(:) = 0. ; rh2m_w(:) = 0. ; qsat2m_w(:) = 0.
-!!!
 
 ! 2b) Initialization of all local variables that will be compressed later
@@ -1813,4 +1823,5 @@
 !****************************************************************************************
 
+
 !!! jyg le 07/02/2012
        IF (iflag_split .eq.0) THEN
@@ -2195,5 +2206,6 @@
                          AcoefU_x, AcoefU_w, AcoefV_x, AcoefV_w, &
                          BcoefH_x, BcoefH_w, BcoefQ_x, BcoefQ_w, &
-                         BcoefU_x, BcoefU_w, BcoefV_x, BcoefV_w  &
+                         BcoefU_x, BcoefU_w, BcoefV_x, BcoefV_w, &
+                         Kech_h_x, Kech_h_w, Kech_h  &
                          )
          CALL wx_pbl_prelim_beta(knon, dtime, ywake_s, ybeta,  &
@@ -2798,8 +2810,6 @@
          print*,'Chx,Chw,Ch', ycdragh_x(j), ycdragh_w(j), ycdragh(j)
          print*,'Khx,Khw,Kh', Kech_h_x(j), Kech_h_w(j), Kech_h(j)
-!         print*,'tsurf_x,tsurf_w,tsurf,t1', ytsurf_th_x(j), ytsurf_th_w(j), ytsurf_th(j), yt(j,1)
-         print*,'tsurf_x,t1x,tsurf_w,t1w,tsurf,t1,t1_ancien', &
- &               ytsurf_th_x(j), yt_x(j,1), ytsurf_th_w(j), yt_w(j,1), ytsurf_th(j), yt(j,1),t(j,1)
-         print*,'qsatsurf,qsatsurf_x,qsatsurf_w', yqsatsurf(j), yqsatsurf_x(j), yqsatsurf_w(j)
+         print*,'t1x, t1w, t1, t1_ancien', &
+ &               yt_x(j,1), yt_w(j,1),  yt(j,1), t(j,1)
          print*,'delta_coef,delta_flux,delta_tsurf,tau', delta_coef(j), y_delta_flux_t1(j), y_delta_tsurf(j), tau_eq(j) 
         ENDDO
@@ -2808,6 +2818,6 @@
          print*,'fluxT_x, fluxT_w, y_flux_t1, fluxQ_x, fluxQ_w, yfluxlat, wakes' &
  &             , y_flux_t1_x(j), y_flux_t1_w(j), y_flux_t1(j), y_flux_q1_x(j)*RLVTT, y_flux_q1_w(j)*RLVTT, yfluxlat(j), ywake_s(j)
-         print*,'beta,ytsurf_new,yqsatsurf', ybeta(j), ytsurf_new(j), yqsatsurf(j)
-         print*,'inertia,facteur,cstar', inertia, facteur,wake_cstar(j)
+         print*,'beta, ytsurf_new ', ybeta(j), ytsurf_new(j)
+         print*,'inertia, facteur, cstar', inertia, facteur,wake_cstar(j)
         ENDDO
        ENDIF  ! (prt_level >=10)
@@ -3727,4 +3737,9 @@
 !****************************************************************************************
     ENDDO loop_nbsrf
+!
+!----------------------------------------------------------------------------------------
+!   Reset iflag_split 
+!
+   iflag_split=iflag_split_ref
 
 #ifdef ISO
