PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_sbl_depth.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
2!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
3!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4!MNH_LIC for details. version 1.
6IMPLICIT NONE
7CONTAINS
8! ######spl
9 SUBROUTINE sbl_depth(D,TURBN,CSTURB,PZZ,PFLXU,PFLXV,PWTHV,PLMO,PSBL_DEPTH)
10 USE yomhook , ONLY : lhook, dr_hook, jphook
11! #################################################################
12!
13!
14!!**** *SBL_DEPTH* - computes SBL depth
15!!
16!! PURPOSE
17!! -------
18!
19!!** METHOD
20!! ------
21!!
22!! SBL is defined as the layer where momentum flux is equal to XSBL_FRAC of its surface value
23!!
24!! EXTERNAL
25!! --------
26!!
27!! IMPLICIT ARGUMENTS
28!! ------------------
29!!
30!!
31!! REFERENCE
32!! ---------
33!!
34!! AUTHOR
35!! ------
36!! V. Masson * Meteo-France *
37!!
38!! MODIFICATIONS
39!! -------------
40!! Original nov. 2005
41!! 26/02/2020 T.Nagel Correction of SBL depth computation in neutral stratification
42!! --------------------------------------------------------------------------
43!
44!* 0. DECLARATIONS
45! ------------
46!
47USE modd_cturb, ONLY: csturb_t
49USE modd_parameters, ONLY : xundef
50USE modd_turb_n, ONLY: turb_t
51!
53!
54IMPLICIT NONE
55!
56!
57!* 0.1 declarations of arguments
58!
59TYPE(dimphyex_t), INTENT(IN) :: D
60TYPE(csturb_t), INTENT(IN) :: CSTURB
61TYPE(turb_t), INTENT(IN) :: TURBN
62REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PZZ ! altitude of flux levels
63REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFLXU ! u'w'
64REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFLXV ! v'w'
65REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PWTHV ! buoyancy flux
66REAL, DIMENSION(D%NIJT), INTENT(IN) :: PLMO ! Monin-Obukhov length
67REAL, DIMENSION(MERGE(D%NIJT,0,TURBN%LRMC01)), INTENT(INOUT) :: PSBL_DEPTH! boundary layer height
68!
69!-------------------------------------------------------------------------------
70!
71! 0.2 declaration of local variables
72!
73!
74INTEGER :: JLOOP,JIJ,JK ! loop counter
75INTEGER :: IKB,IKE,IIJB,IIJE,IKT ! index value for the Beginning
76REAL, DIMENSION(D%NIJT) :: ZQ0 ! surface buoyancy flux
77REAL, DIMENSION(D%NIJT) :: ZWU ! surface friction u'w'
78REAL, DIMENSION(D%NIJT) :: ZWV ! surface friction v'w'
79REAL, DIMENSION(D%NIJT) :: ZUSTAR2 ! surface friction
80REAL, DIMENSION(D%NIJT) :: ZSBL_DYN ! SBL wih dynamical criteria
81REAL, DIMENSION(D%NIJT,D%NKT) :: ZWIND
82 ! intermediate wind for SBL calculation
83REAL, DIMENSION(D%NIJT) :: ZSBL_THER! SBL wih thermal criteria
84REAL, DIMENSION(D%NIJT) :: ZA ! ponderation coefficient
85!----------------------------------------------------------------------------
86!
87!* initialisations
88!
89!
90REAL(KIND=jphook) :: zhook_handle
91IF (lhook) CALL dr_hook('SBL_DEPTH',0,zhook_handle)
92!
93ikb=d%NKTB
94ike=d%NKTE
95iije=d%NIJE
96iijb=d%NIJB
97ikt=d%NKT
98!
99!$mnh_expand_array(JIJ=IIJB:IIJE)
100zwu(iijb:iije) = pflxu(iijb:iije,ikb)
101zwv(iijb:iije) = pflxv(iijb:iije,ikb)
102zq0(iijb:iije) = pwthv(iijb:iije,ikb)
103!
104zustar2(iijb:iije) = sqrt(zwu(iijb:iije)**2+zwv(iijb:iije)**2)
105!
106!$mnh_end_expand_array(JIJ=IIJB:IIJE)
107!----------------------------------------------------------------------------
108!
109!* BL and SBL diagnosed with friction criteria
110!
111!$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
112zwind(iijb:iije,1:ikt)=sqrt(pflxu(iijb:iije,1:ikt)**2+pflxv(iijb:iije,1:ikt)**2)
113!$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
114CALL bl_depth_diag(d,d%NKT,zustar2,pzz(:,ikb),zwind,pzz,csturb%XFTOP_O_FSURF,zsbl_dyn)
115!$mnh_expand_array(JIJ=IIJB:IIJE)
116zsbl_dyn(iijb:iije) = csturb%XSBL_O_BL * zsbl_dyn(iijb:iije)
117!$mnh_end_expand_array(JIJ=IIJB:IIJE)
118!
119!----------------------------------------------------------------------------
120!
121!* BL and SBL diagnosed with buoyancy flux criteria
122!
123CALL bl_depth_diag(d,d%NKT,zq0,pzz(:,ikb),pwthv,pzz,csturb%XFTOP_O_FSURF,zsbl_ther)
124!$mnh_expand_array(JIJ=IIJB:IIJE)
125zsbl_ther(iijb:iije)= csturb%XSBL_O_BL * zsbl_ther(iijb:iije)
126!$mnh_end_expand_array(JIJ=IIJB:IIJE)
127!
128!----------------------------------------------------------------------------
129!
130!* SBL depth
131!
132psbl_depth(:) = 0.
133!$mnh_expand_where(JIJ=IIJB:IIJE)
134WHERE (zsbl_ther(iijb:iije)> 0. .AND. zsbl_dyn(iijb:iije)> 0.)
135 psbl_depth(iijb:iije) = min(zsbl_ther(iijb:iije),zsbl_dyn(iijb:iije))
136END WHERE
137!$mnh_end_expand_where(JIJ=IIJB:IIJE)
138!
139!$mnh_expand_where(JIJ=IIJB:IIJE)
140WHERE (zsbl_ther(iijb:iije)> 0. .AND. zsbl_dyn(iijb:iije)==0.)
141 psbl_depth(iijb:iije) = zsbl_ther(iijb:iije)
142END WHERE
143!$mnh_end_expand_where(JIJ=IIJB:IIJE)
144!
145!$mnh_expand_where(JIJ=IIJB:IIJE)
146WHERE (zsbl_ther(iijb:iije)==0. .AND. zsbl_dyn(iijb:iije)> 0.)
147 psbl_depth(iijb:iije) = zsbl_dyn(iijb:iije)
148END WHERE
149!$mnh_end_expand_where(JIJ=IIJB:IIJE)
150!
151DO jloop=1,5
152 !$mnh_expand_where(JIJ=IIJB:IIJE)
153 WHERE (plmo(iijb:iije)/=xundef .AND. abs(plmo(iijb:iije))>=0.01 )
154 za(iijb:iije) = tanh(2.*psbl_depth(iijb:iije)/plmo(iijb:iije))**2
155 psbl_depth(iijb:iije) = 0.2 * psbl_depth(iijb:iije) + 0.8 * ((1.-za(iijb:iije)) &
156 * zsbl_dyn(iijb:iije) + za(iijb:iije) * zsbl_ther(iijb:iije) )
157 END WHERE
158 !$mnh_end_expand_where(JIJ=IIJB:IIJE)
159END DO
160!$mnh_expand_where(JIJ=IIJB:IIJE)
161WHERE (abs(plmo(iijb:iije))<=0.01 )
162 psbl_depth(iijb:iije) = zsbl_ther(iijb:iije)
163END WHERE
164!$mnh_end_expand_where(JIJ=IIJB:IIJE)
165!$mnh_expand_where(JIJ=IIJB:IIJE)
166WHERE (plmo(iijb:iije)==xundef)
167 psbl_depth(iijb:iije) = zsbl_dyn(iijb:iije)
168END WHERE
169!$mnh_end_expand_where(JIJ=IIJB:IIJE)
170!
171!----------------------------------------------------------------------------
172IF (lhook) CALL dr_hook('SBL_DEPTH',1,zhook_handle)
173END SUBROUTINE sbl_depth
174END MODULE mode_sbl_depth
real, parameter xundef
subroutine sbl_depth(d, turbn, csturb, pzz, pflxu, pflxv, pwthv, plmo, psbl_depth)