diff --git a/src/MNH/lesn.f90 b/src/MNH/lesn.f90 index 86b86a3e6e3a0b572e2686f371365d227c0713fb..7f1de616e99774a64fa58d65f0eca19adb8811d6 100644 --- a/src/MNH/lesn.f90 +++ b/src/MNH/lesn.f90 @@ -3277,7 +3277,7 @@ ELSE IF (CBL_HEIGHT_DEF=='FRI') THEN +( XLES_SUBGRID_WV (:,NLES_CURRENT_TCOUNT,1) & +XLES_RESOLVED_WV(:,NLES_CURRENT_TCOUNT,1))**2 ) ZFRIC_SURF = XLES_USTAR(NLES_CURRENT_TCOUNT)**2 - CALL BL_DEPTH_DIAG(YLDIMPHYEX,ZFRIC_SURF, XLES_ZS, & + CALL BL_DEPTH_DIAG(YLDIMPHYEX,SIZE(ZFRIC_LES),ZFRIC_SURF, XLES_ZS, & ZFRIC_LES, XLES_Z, & XFTOP_O_FSURF,XLES_BL_HEIGHT(NLES_CURRENT_TCOUNT)) END IF diff --git a/src/PHYEX/turb/mode_bl_depth_diag.f90 b/src/PHYEX/turb/mode_bl_depth_diag.f90 index 2cae3a3fe2cf48cfd1f0a9a4d55c52b57abde3cf..daafb106e2d2ebc995bb4add8c7aef8d6a9738bd 100644 --- a/src/PHYEX/turb/mode_bl_depth_diag.f90 +++ b/src/PHYEX/turb/mode_bl_depth_diag.f90 @@ -12,7 +12,7 @@ END INTERFACE ! CONTAINS ! -SUBROUTINE BL_DEPTH_DIAG_3D(D,PSURF,PZS,PFLUX,PZZ,PFTOP_O_FSURF,BL_DEPTH_DIAG3D) +SUBROUTINE BL_DEPTH_DIAG_3D(D,KDIM, PSURF,PZS,PFLUX,PZZ,PFTOP_O_FSURF,BL_DEPTH_DIAG3D) USE YOMHOOK , ONLY : LHOOK, DR_HOOK, JPHOOK ! ! @@ -56,10 +56,11 @@ USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t IMPLICIT NONE ! TYPE(DIMPHYEX_t), INTENT(IN) :: D +INTEGER, INTENT(IN) :: KDIM ! Vertical dimensions (LES grid vs full grid) REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSURF ! surface flux REAL, DIMENSION(D%NIJT), INTENT(IN) :: PZS ! orography -REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFLUX ! flux -REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PZZ ! altitude of flux points +REAL, DIMENSION(D%NIJT,KDIM), INTENT(IN) :: PFLUX ! flux +REAL, DIMENSION(D%NIJT,KDIM), INTENT(IN) :: PZZ ! altitude of flux points REAL, INTENT(IN) :: PFTOP_O_FSURF! Flux at BL top / Surface flux REAL, DIMENSION(D%NIJT), INTENT(OUT) :: BL_DEPTH_DIAG3D ! @@ -106,7 +107,7 @@ BL_DEPTH_DIAG3D(:) = BL_DEPTH_DIAG3D(:) / (1. - PFTOP_O_FSURF) IF (LHOOK) CALL DR_HOOK('BL_DEPTH_DIAG_3D',1,ZHOOK_HANDLE) END SUBROUTINE BL_DEPTH_DIAG_3D ! -SUBROUTINE BL_DEPTH_DIAG_1D(D,PSURF,PZS,PFLUX,PZZ,PFTOP_O_FSURF,BL_DEPTH_DIAG1D) +SUBROUTINE BL_DEPTH_DIAG_1D(D,KDIM, PSURF,PZS,PFLUX,PZZ,PFTOP_O_FSURF,BL_DEPTH_DIAG1D) USE YOMHOOK , ONLY : LHOOK, DR_HOOK, JPHOOK ! USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t @@ -114,31 +115,37 @@ USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t IMPLICIT NONE ! TYPE(DIMPHYEX_t), INTENT(IN) :: D +INTEGER, INTENT(IN) :: KDIM ! Vertical dimensions (LES grid vs full grid) REAL, INTENT(IN) :: PSURF ! surface flux REAL, INTENT(IN) :: PZS ! orography -REAL, DIMENSION(D%NKT), INTENT(IN) :: PFLUX ! flux -REAL, DIMENSION(D%NKT), INTENT(IN) :: PZZ ! altitude of flux points +REAL, DIMENSION(KDIM), INTENT(IN) :: PFLUX ! flux +REAL, DIMENSION(KDIM), INTENT(IN) :: PZZ ! altitude of flux points REAL, INTENT(IN) :: PFTOP_O_FSURF! Flux at BL top / Surface flux REAL, INTENT(OUT) :: BL_DEPTH_DIAG1D +INTEGER :: JK ! loop counters +INTEGER :: IKB,IIJB,IIJE,IKL +REAL :: ZFLX ! flux at top of BL ! -REAL, DIMENSION(1,1) :: ZSURF -REAL, DIMENSION(1,1) :: ZZS -REAL, DIMENSION(1,1,D%NKT) :: ZFLUX -REAL, DIMENSION(1,1,D%NKT) :: ZZZ -REAL, DIMENSION(1,1) :: ZBL_DEPTH_DIAG -! -INTEGER :: IKT REAL(KIND=JPHOOK) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('BL_DEPTH_DIAG_1D',0,ZHOOK_HANDLE) -IKT=D%NKT -ZSURF = PSURF -ZZS = PZS -ZFLUX(1,1,:) = PFLUX(:) -ZZZ (1,1,:) = PZZ (:) ! -CALL BL_DEPTH_DIAG_3D(D,ZSURF,ZZS,ZFLUX,ZZZ,PFTOP_O_FSURF,ZBL_DEPTH_DIAG) +IKB=D%NKTB +IKL=D%NKL ! -BL_DEPTH_DIAG1D = ZBL_DEPTH_DIAG(1,1) +BL_DEPTH_DIAG1D = 0. +IF (PSURF/=0.) THEN + DO JK=IKB,KDIM-1,IKL + IF (PZZ(JK-IKL)>PZS) THEN + ZFLX = PSURF * PFTOP_O_FSURF + IF ( (PFLUX(JK)-ZFLX)*(PFLUX(JK-IKL)-ZFLX) <= 0. ) THEN + BL_DEPTH_DIAG1D = (PZZ (JK-IKL) - PZS) & + + (PZZ (JK) - PZZ (JK-IKL)) & + * (ZFLX - PFLUX(JK-IKL) ) & + / (PFLUX(JK) - PFLUX(JK-IKL) ) + END IF + END IF + END DO +END IF ! !------------------------------------------------------------------------------- ! diff --git a/src/PHYEX/turb/mode_sbl_depth.f90 b/src/PHYEX/turb/mode_sbl_depth.f90 index 8da65ac5643dc573d4e5706c1a4b76cbb8456464..948948c07295d73c570f98965799ee77928bea01 100644 --- a/src/PHYEX/turb/mode_sbl_depth.f90 +++ b/src/PHYEX/turb/mode_sbl_depth.f90 @@ -109,7 +109,7 @@ ZUSTAR2(:) = SQRT(ZWU(:)**2+ZWV(:)**2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ZWIND(:,:)=SQRT(PFLXU(:,:)**2+PFLXV(:,:)**2) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -CALL BL_DEPTH_DIAG(D,ZUSTAR2,PZZ(:,IKB),ZWIND,PZZ,CSTURB%XFTOP_O_FSURF,ZSBL_DYN) +CALL BL_DEPTH_DIAG(D,D%NKT,ZUSTAR2,PZZ(:,IKB),ZWIND,PZZ,CSTURB%XFTOP_O_FSURF,ZSBL_DYN) !$mnh_expand_array(JIJ=IIJB:IIJE) ZSBL_DYN(:) = CSTURB%XSBL_O_BL * ZSBL_DYN(:) !$mnh_end_expand_array(JIJ=IIJB:IIJE) @@ -118,7 +118,7 @@ ZSBL_DYN(:) = CSTURB%XSBL_O_BL * ZSBL_DYN(:) ! !* BL and SBL diagnosed with buoyancy flux criteria ! -CALL BL_DEPTH_DIAG(D,ZQ0,PZZ(:,IKB),PWTHV,PZZ,CSTURB%XFTOP_O_FSURF,ZSBL_THER) +CALL BL_DEPTH_DIAG(D,D%NKT,ZQ0,PZZ(:,IKB),PWTHV,PZZ,CSTURB%XFTOP_O_FSURF,ZSBL_THER) !$mnh_expand_array(JIJ=IIJB:IIJE) ZSBL_THER(:)= CSTURB%XSBL_O_BL * ZSBL_THER(:) !$mnh_end_expand_array(JIJ=IIJB:IIJE)