PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_turb_ver.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 1994-2025 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.
5!-----------------------------------------------------------------
7IMPLICIT NONE
8CONTAINS
9SUBROUTINE turb_ver(D,CST,CSTURB,TURBN,NEBN,TLES, &
10 KRR,KRRL,KRRI,KGRADIENTS, &
11 OOCEAN,ODEEPOC,OCOMPUTE_SRC, &
12 KSV,KSV_LGBEG,KSV_LGEND, &
13 PEXPL, O2D, ONOMIXLG, OFLAT, &
14 OCOUPLES,OBLOWSNOW,OFLYER,PRSNOW, &
15 PTSTEP, TPFILE, &
16 PDXX,PDYY,PDZZ,PDZX,PDZY,PDIRCOSZW,PZZ, &
17 PCOSSLOPE,PSINSLOPE, &
18 PRHODJ,PTHVREF,PSFUM,PSFVM, &
19 PSFTHM,PSFRM,PSFSVM,PSFTHP,PSFRP,PSFSVP, &
20 PCDUEFF,PTAU11M,PTAU12M,PTAU33M, &
21 PSEA_UCU,PSEA_VCU, &
22 PUM,PVM,PWM,PUSLOPEM,PVSLOPEM,PTHLM,PRM,PSVM, &
23 PTKEM,PLM,PLENGTHM,PLENGTHH,PLEPS,MFMOIST, &
24 PLOCPEXNM,PATHETA,PAMOIST,PSRCM,PFRAC_ICE, &
25 PFWTH,PFWR,PFTH2,PFR2,PFTHR,PBL_DEPTH, &
26 PSBL_DEPTH,PLMO,PHGRAD,PZS, &
27 PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS, &
28 PDP,PTP,PSIGS,PWTH,PWRC,PWSV, &
29 PSSTFL,PSSTFL_C,PSSRFL_C,PSSUFL_C,PSSVFL_C, &
30 PSSUFL,PSSVFL,PTURB_SPP )
31
32!$ACDC singlecolumn
33
34! ###############################################################
35!
36!
37!!**** *TURB_VER* -compute the source terms due to the vertical turbulent
38!! fluxes.
39!!
40!! PURPOSE
41!! -------
42! The purpose of this routine is to compute the vertical turbulent
43! fluxes of the evolutive variables and give back the source
44! terms to the main program. In the case of large horizontal meshes,
45! the divergence of these vertical turbulent fluxes represent the whole
46! effect of the turbulence but when the three-dimensionnal version of
47! the turbulence scheme is activated (CTURBDIM="3DIM"), these divergences
48! are completed in the next routine TURB_HOR.
49! An arbitrary degree of implicitness has been implemented for the
50! temporal treatment of these diffusion terms.
51! The vertical boundary conditions are as follows:
52! * at the bottom, the surface fluxes are prescribed at the same
53! as the other turbulent fluxes
54! * at the top, the turbulent fluxes are set to 0.
55! It should be noted that the condensation has been implicitely included
56! in this turbulence scheme by using conservative variables and computing
57! the subgrid variance of a statistical variable s indicating the presence
58! or not of condensation in a given mesh.
59!
60!!** METHOD
61!! ------
62!! 1D type calculations are made;
63!! The vertical turbulent fluxes are computed in an off-centered
64!! implicit scheme (a Crank-Nicholson type with coefficients different
65!! than 0.5), which allows to vary the degree of implicitness of the
66!! formulation.
67!! The different prognostic variables are treated one by one.
68!! The contributions of each turbulent fluxes are cumulated into the
69!! tendency PRvarS, and into the dynamic and thermal production of
70!! TKE if necessary.
71!!
72!! In section 2 and 3, the thermodynamical fields are considered.
73!! Only the turbulent fluxes of the conservative variables
74!! (Thetal and Rnp stored in PRx(:,:,:,1)) are computed.
75!! Note that the turbulent fluxes at the vertical
76!! boundaries are given either by the soil scheme for the surface one
77!! ( at the same instant as the others fluxes) and equal to 0 at the
78!! top of the model. The thermal production is computed by vertically
79!! averaging the turbulent flux and multiply this flux at the mass point by
80!! a function ETHETA or EMOIST, which preform the transformation from the
81!! conservative variables to the virtual potential temperature.
82!!
83!! In section 4, the variance of the statistical variable
84!! s indicating presence or not of condensation, is determined in function
85!! of the turbulent moments of the conservative variables and its
86!! squarred root is stored in PSIGS. This information will be completed in
87!! the horizontal turbulence if the turbulence dimensionality is not
88!! equal to "1DIM".
89!!
90!! In section 5, the x component of the stress tensor is computed.
91!! The surface flux <u'w'> is computed from the value of the surface
92!! fluxes computed in axes linked to the orography ( i", j" , k"):
93!! i" is parallel to the surface and in the direction of the maximum
94!! slope
95!! j" is also parallel to the surface and in the normal direction of
96!! the maximum slope
97!! k" is the normal to the surface
98!! In order to prevent numerical instability, the implicit scheme has
99!! been extended to the surface flux regarding to its dependence in
100!! function of U. The dependence in function of the other components
101!! introduced by the different rotations is only explicit.
102!! The turbulent fluxes are used to compute the dynamic production of
103!! TKE. For the last TKE level ( located at PDZZ(:,:,IKB)/2 from the
104!! ground), an harmonic extrapolation from the dynamic production at
105!! PDZZ(:,:,IKB) is used to avoid an evaluation of the gradient of U
106!! in the surface layer.
107!!
108!! In section 6, the same steps are repeated but for the y direction
109!! and in section 7, a diagnostic computation of the W variance is
110!! performed.
111!!
112!! In section 8, the turbulent fluxes for the scalar variables are
113!! computed by the same way as the conservative thermodynamical variables
114!!
115!!
116!! EXTERNAL
117!! --------
118!! GX_U_M, GY_V_M, GZ_W_M : cartesian gradient operators
119!! GX_U_UW,GY_V_VW (X,Y,Z) represent the direction of the gradient
120!! _(M,U,...)_ represent the localization of the
121!! field to be derivated
122!! _(M,UW,...) represent the localization of the
123!! field derivated
124!!
125!! SUBROUTINE TRIDIAG : to compute the split implicit evolution
126!! of a variable located at a mass point
127!!
128!! SUBROUTINE TRIDIAG_WIND: to compute the split implicit evolution
129!! of a variable located at a wind point
130!!
131!! FUNCTIONs ETHETA and EMOIST :
132!! allows to compute:
133!! - the coefficients for the turbulent correlation between
134!! any variable and the virtual potential temperature, of its
135!! correlations with the conservative potential temperature and
136!! the humidity conservative variable:
137!! ------- ------- -------
138!! A' Thv' = ETHETA A' Thl' + EMOIST A' Rnp'
139!!
140!!
141!! IMPLICIT ARGUMENTS
142!! ------------------
143!! Module MODD_CST : contains physical constants
144!!
145!! CST%XG : gravity constant
146!!
147!! Module MODD_CTURB: contains the set of constants for
148!! the turbulence scheme
149!!
150!! CSTURB%XCMFS,XCMFB : cts for the momentum flux
151!! CSTURB%XCSHF : ct for the sensible heat flux
152!! CSTURB%XCHF : ct for the moisture flux
153!! CSTURB%XCTV,CSTURB%XCHV : cts for the T and moisture variances
154!!
155!! Module MODD_PARAMETERS
156!!
157!! JPVEXT_TURB : number of vertical external points
158!!
159!!
160!! REFERENCE
161!! ---------
162!! Book 1 of documentation (Chapter: Turbulence)
163!!
164!! AUTHOR
165!! ------
166!! Joan Cuxart * INM and Meteo-France *
167!!
168!! MODIFICATIONS
169!! -------------
170!! Original August 19, 1994
171!! Modifications: February 14, 1995 (J.Cuxart and J.Stein)
172!! Doctorization and Optimization
173!! Modifications: March 21, 1995 (J.M. Carriere)
174!! Introduction of cloud water
175!! Modifications: June 14, 1995 (J.Cuxart and J. Stein)
176!! Phi3 and Psi3 at w-point + bug in the all
177!! or nothing condens.
178!! Modifications: Sept 15, 1995 (J.Cuxart and J. Stein)
179!! Change the DP computation at the ground
180!! Modifications: October 10, 1995 (J.Cuxart and J. Stein)
181!! Psi for scal var and LES tools
182!! Modifications: November 10, 1995 (J. Stein)
183!! change the surface relations
184!! Modifications: February 20, 1995 (J. Stein) optimization
185!! Modifications: May 21, 1996 (J. Stein)
186!! bug in the vertical flux of the V wind
187!! component for explicit computation
188!! Modifications: May 21, 1996 (N. wood)
189!! modify the computation of the vertical
190!! part or the surface tangential flux
191!! Modifications: May 21, 1996 (P. Jabouille)
192!! same modification in the Y direction
193!!
194!! Modifications: Sept 17, 1996 (J. Stein) change the moist case by using
195!! Pi instead of Piref + use Atheta and Amoist
196!!
197!! Modifications: Nov 24, 1997 (V. Masson) removes the DO loops
198!! Modifications: Mar 31, 1998 (V. Masson) splits the routine TURB_VER
199!! Nov 06, 2002 (V. Masson) LES budgets
200!! Feb 20, 2003 (JP Pinty) Add PFRAC_ICE
201!! July 2005 (S. Tomas, V. Masson)
202!! Add 3rd order moments and
203!! implicitation of PHI3, PSI3
204!! Oct.2009 (C.Lac) Introduction of different PTSTEP according to the
205!! advection schemes
206!! Feb. 2012 (Y. Seity) add possibility to run with
207!! reversed vertical levels
208!! 10/2012 (J.Escobar) Bypass PGI bug , redefine some allocatable array inplace of automatic
209!! 08/2014 (J.Escobar) Bypass PGI memory leak bug , replace IF statement with IF THEN ENDIF
210!! Modifications: July, 2015 (Wim de Rooy) switch for HARATU (Racmo turbulence scheme)
211!! 04/2016 (M.Moge) Use openACC directives to port the TURB part of Meso-NH on GPU
212!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O
213!! JL Redelsperger 03/2021 : add Ocean LES case
214!!--------------------------------------------------------------------------
215!
216!* 0. DECLARATIONS
217! ------------
218!
219USE yomhook, ONLY: lhook, dr_hook, jphook
220!
221USE modd_cst, ONLY: cst_t
222USE modd_cturb, ONLY: csturb_t
223USE modd_dimphyex, ONLY: dimphyex_t
225USE modd_io, ONLY: tfiledata
226USE modd_les, ONLY: tles_t
227USE modd_turb_n, ONLY: turb_t, nturb_s
228USE modd_neb_n, ONLY: neb_t
229!
231USE mode_prandtl, ONLY: psi_sv, psi3, phi3, prandtl
232USE mode_sbl_depth, ONLY: sbl_depth
238!
240USE modi_second_mnh, ONLY: second_mnh
241!
242IMPLICIT NONE
243!
244!* 0.1 declarations of arguments
245!
246TYPE(dimphyex_t), INTENT(IN) :: D
247TYPE(cst_t), INTENT(IN) :: CST
248TYPE(csturb_t), INTENT(IN) :: CSTURB
249TYPE(turb_t), INTENT(IN) :: TURBN
250TYPE(neb_t), INTENT(IN) :: NEBN
251TYPE(tles_t), INTENT(INOUT):: TLES ! modd_les structure
252INTEGER, INTENT(IN) :: KGRADIENTS ! Number of stored horizontal gradients
253INTEGER, INTENT(IN) :: KRR ! number of moist var.
254INTEGER, INTENT(IN) :: KRRL ! number of liquid water var.
255INTEGER, INTENT(IN) :: KRRI ! number of ice water var.
256INTEGER, INTENT(IN) :: KSV, KSV_LGBEG, KSV_LGEND ! number of scalar variables
257LOGICAL, INTENT(IN) :: OOCEAN ! switch for Ocean model version
258LOGICAL, INTENT(IN) :: ODEEPOC ! activates sfc forcing for ideal ocean deep conv
259LOGICAL, INTENT(IN) :: OFLYER ! MesoNH flyer diagnostic
260LOGICAL, INTENT(IN) :: OCOMPUTE_SRC ! flag to define dimensions of SIGS and SRCT variables
261LOGICAL, INTENT(IN) :: OFLAT ! Logical for zero ororography
262LOGICAL, INTENT(IN) :: OCOUPLES ! switch to activate atmos-ocean LES version
263LOGICAL, INTENT(IN) :: OBLOWSNOW ! switch to activate pronostic blowing snow
264REAL, INTENT(IN) :: PRSNOW ! Ratio for diffusion coeff. scalar (blowing snow)
265LOGICAL, INTENT(IN) :: ONOMIXLG ! to use turbulence for lagrangian variables
266LOGICAL, INTENT(IN) :: O2D ! Logical for 2D model version
267REAL, INTENT(IN) :: PEXPL ! Coef. for temporal disc.
268REAL, INTENT(IN) :: PTSTEP ! timestep
269TYPE(tfiledata), INTENT(INOUT) :: TPFILE ! Output file
270!
271REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY
272 ! Metric coefficients
273REAL, DIMENSION(D%NIJT), INTENT(IN) :: PDIRCOSZW ! Director Cosinus of the
274 ! normal to the ground surface
275REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PZZ ! altitudes at flux points
276REAL, DIMENSION(D%NIJT), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle
277 ! between i and the slope vector
278REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSINSLOPE ! sinus of the angle
279 ! between i and the slope vector
280!
281REAL, DIMENSION(D%NIJT), INTENT(IN) :: PZS ! orography (for LEONARD terms)
282REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODJ ! dry density * grid volum
283! MFMOIST used in case of TURBN%LHARATU
284REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: MFMOIST ! moist mass flux dual scheme
285
286REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTHVREF ! ref. state Virtual
287 ! Potential Temperature
288REAL, DIMENSION(MERGE(D%NIJT,0,TURBN%LLEONARD),MERGE(D%NKT,0,TURBN%LLEONARD), & MERGE(KGRADIENTS,0,TURBN%LLEONARD)), INTENT(IN) :: PHGRAD ! horizontal gradients in Moeng
289!
290REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSFUM,PSFVM ! surface fluxes
291REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSFTHM,PSFRM ! surface fluxes at time
292REAL, DIMENSION(D%NIJT,KSV), INTENT(IN) :: PSFSVM ! t - deltat
293!
294REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSFTHP,PSFRP ! surface fluxes at time
295REAL, DIMENSION(D%NIJT,KSV), INTENT(IN) :: PSFSVP ! t + deltat
296!
297REAL, DIMENSION(D%NIJT), INTENT(IN) :: PCDUEFF ! Cd * || u || at time t
298REAL, DIMENSION(D%NIJT), INTENT(IN) :: PTAU11M ! <uu> in the axes linked
299 ! to the maximum slope direction and the surface normal and the binormal
300 ! at time t - dt
301REAL, DIMENSION(D%NIJT), INTENT(IN) :: PTAU12M ! <uv> in the same axes
302REAL, DIMENSION(D%NIJT), INTENT(IN) :: PTAU33M ! <ww> in the same axes
303REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSEA_UCU ! ocean current along X
304REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSEA_VCU ! ocean current along Y
305!
306REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PUM,PVM,PWM,PTHLM
307 ! Wind and potential temperature at t-Delta t
308REAL, DIMENSION(D%NIJT,D%NKT,KRR), INTENT(IN) :: PRM ! Mixing ratios
309 ! at t-Delta t
310REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(IN) :: PSVM ! scalar var. at t-Delta t
311REAL, DIMENSION(D%NIJT), INTENT(IN) :: PUSLOPEM ! wind component along the
312 ! maximum slope direction
313REAL, DIMENSION(D%NIJT), INTENT(IN) :: PVSLOPEM ! wind component along the
314 ! direction normal to the maximum slope one
315!
316REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTKEM ! TKE at time t
317REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLM ! Turb. mixing length
318! PLENGTHM PLENGTHH used in case of TURBN%LHARATU
319REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLENGTHM ! Turb. mixing length momentum
320REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLENGTHH ! Turb. mixing length heat/moisture
321REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLEPS ! dissipative length
322REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLOCPEXNM ! Lv(T)/Cp/Exnref at time t-1
323REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PATHETA ! coefficients between
324REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PAMOIST ! s and Thetal and Rnp
325REAL, DIMENSION(MERGE(D%NIJT,0,OCOMPUTE_SRC),& MERGE(D%NKT,0,OCOMPUTE_SRC)), INTENT(IN) :: PSRCM ! normalized
326 ! 2nd-order flux s'r'c/2Sigma_s2 at t-1 multiplied by Lambda_3
327REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFRAC_ICE ! ri fraction of rc+ri
328REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFWTH ! d(w'2th' )/dz
329REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFWR ! d(w'2r' )/dz
330REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFTH2 ! d(w'th'2 )/dz
331REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFR2 ! d(w'r'2 )/dz
332REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFTHR ! d(w'th'r')/dz
333REAL, DIMENSION(MERGE(D%NIJT,0,TURBN%CTOM=='TM06')),INTENT(INOUT) :: PBL_DEPTH ! BL height for TOMS
334REAL, DIMENSION(MERGE(D%NIJT,0,TURBN%LRMC01)) ,INTENT(INOUT) :: PSBL_DEPTH ! SBL depth for RMC01
335REAL, DIMENSION(D%NIJT), INTENT(IN) :: PLMO ! Monin-Obukhov length
336!
337REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRUS, PRVS, PRWS, PRTHLS
338REAL, DIMENSION(D%NIJT,D%NKT,KRR), INTENT(INOUT) :: PRRS
339REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(INOUT) :: PRSVS
340 ! cumulated sources for the prognostic variables
341!
342REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PDP,PTP ! Dynamic and thermal
343 ! TKE production terms
344REAL, DIMENSION(MERGE(D%NIJT,0,OCOMPUTE_SRC),& MERGE(D%NKT,0,OCOMPUTE_SRC)), INTENT(OUT) :: PSIGS
345REAL, DIMENSION(MERGE(D%NIJT,0,OFLYER),MERGE(D%NKT,0,OFLYER)), INTENT(OUT) :: PWTH ! heat flux
346REAL, DIMENSION(MERGE(D%NIJT,0,OFLYER),MERGE(D%NKT,0,OFLYER)), INTENT(OUT) :: PWRC ! cloud water flux
347REAL, DIMENSION(MERGE(D%NIJT,0,OFLYER),MERGE(D%NKT,0,OFLYER),MERGE(KSV,0,OFLYER)),INTENT(OUT) :: PWSV ! scalar flux
348REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSTFL ! Time evol Flux of T at sea surface (LOCEAN)!
349REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSTFL_C ! O-A interface flux for theta(LOCEAN and LCOUPLES)
350REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSRFL_C ! O-A interface flux for vapor (LOCEAN and LCOUPLES)
351REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSUFL_C ! Time evol Flux of U at sea surface (LOCEAN)
352REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSVFL_C !
353REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSUFL
354REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSVFL !
355REAL, DIMENSION(D%NIJT,D%NKT,NTURB_S), INTENT(IN) :: PTURB_SPP
356!
357!* 0.2 declaration of local variables
358!
359REAL, DIMENSION(D%NIJT,D%NKT) :: &
360 ZBETA, & ! buoyancy coefficient
361 ZSQRT_TKE,& ! sqrt(e)
362 ZDTH_DZ, & ! d(th)/dz
363 ZDR_DZ, & ! d(rt)/dz
364 ZRED2TH3, & ! 3D Redeslperger number R*2_th
365 ZRED2R3, & ! 3D Redeslperger number R*2_r
366 ZRED2THR3,& ! 3D Redeslperger number R*2_thr
367 ZBLL_O_E, & ! beta * Lk * Leps / tke
368 ZETHETA, & ! Coefficient for theta in theta_v computation
369 ZEMOIST, & ! Coefficient for r in theta_v computation
370 ZREDTH1, & ! 1D Redelsperger number for Th
371 ZREDR1, & ! 1D Redelsperger number for r
372 ZPHI3, & ! phi3 Prandtl number
373 ZPSI3, & ! psi3 Prandtl number for vapor
374 ZD, & ! denominator in phi3 terms
375 ZWTHV, & ! buoyancy flux
376 ZWU, & ! (u'w')
377 ZWV, & ! (v'w')
378 ZTHLP, & ! guess of potential temperature due to vert. turbulent flux
379 ZRP ! guess of total water due to vert. turbulent flux
380!
381REAL, DIMENSION(D%NIJT,D%NKT,KSV) :: &
382 ZPSI_SV, & ! Prandtl number for scalars
383 ZREDS1, & ! 1D Redelsperger number R_sv
384 ZRED2THS, & ! 3D Redelsperger number R*2_thsv
385 ZRED2RS ! 3D Redelsperger number R*2_rsv
386REAL, DIMENSION(D%NIJT,D%NKT) :: ZLM
387!
388LOGICAL :: GUSERV ! flag to use water vapor
389INTEGER :: IKB,IKE,IIJE,IIJB,IKT ! index value for the Beginning
390 ! and the End of the physical domain for the mass points
391INTEGER :: JSV,JIJ,JK ! loop counter
392REAL :: ZTIME1
393REAL :: ZTIME2
394REAL(KIND=jphook) :: zhook_handle
395TYPE(tfieldmetadata) :: tzfield
396!----------------------------------------------------------------------------
397!----------------------------------------------------------------------------
398!
399!* 1. PRELIMINARIES
400! -------------
401!
402IF (lhook) CALL dr_hook('TURB_VER',0,zhook_handle)
403!
404ikb=d%NKTB
405ike=d%NKTE
406ikt=d%NKT
407iije=d%NIJE
408iijb=d%NIJB
409!
410!
411! 3D Redelsperger numbers
412!
413!
414CALL prandtl(d,cst,csturb,turbn, krr,ksv,krri,turbn%LTURB_FLX, &
415 turbn%CTURBDIM,oocean,turbn%LHARAT,o2d,ocompute_src,&
416 tpfile, oflat, &
417 pdxx,pdyy,pdzz,pdzx,pdzy, &
418 pthvref,plocpexnm,patheta,pamoist, &
419 plm,pleps,ptkem,pthlm,prm,psvm,psrcm, &
420 pturb_spp,zredth1, zredr1, &
421 zred2th3, zred2r3, zred2thr3, &
422 zreds1,zred2ths, zred2rs, &
423 zbll_o_e, &
424 zetheta, zemoist )
425!
426! Buoyancy coefficient
427!
428!$acc kernels
429IF (oocean) THEN
430 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
431 zbeta(iijb:iije,1:ikt) = cst%XG*cst%XALPHAOC
432 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
433ELSE
434 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
435 zbeta(iijb:iije,1:ikt) = cst%XG/pthvref(iijb:iije,1:ikt)
436 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
437END IF
438!
439! Square root of Tke
440!
441!$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
442zsqrt_tke(iijb:iije,1:ikt) = sqrt(ptkem(iijb:iije,1:ikt))
443!$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
444!$acc end kernels
445!
446! gradients of mean quantities at previous time-step
447!
448zdth_dz=gz_m_w(pthlm,pdzz)
449!$acc kernels
450zdr_dz(:,:) = 0.
451!$acc end kernels
452IF (krr>0) zdr_dz=gz_m_w(prm(:,:,1),pdzz)
453!
454!
455! Denominator factor in 3rd order terms
456!
457!$acc kernels
458IF (.NOT. turbn%LHARAT) THEN
459 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
460 zd(iijb:iije,1:ikt) = (1.+zredth1(iijb:iije,1:ikt)+zredr1(iijb:iije,1:ikt)) * &
461 &(1.+0.5*(zredth1(iijb:iije,1:ikt)+zredr1(iijb:iije,1:ikt)))
462 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
463ELSE
464 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
465 zd(iijb:iije,1:ikt) = 1.
466 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
467ENDIF
468!$acc end kernels
469!
470! Phi3 and Psi3 Prandtl numbers
471!
472guserv = krr/=0
473!
474CALL phi3(d,csturb,turbn,zredth1,zredr1,zred2th3,zred2r3,zred2thr3,turbn%CTURBDIM,guserv,zphi3)
475IF(krr/=0) THEN
476 CALL psi3(d,csturb,turbn,zredr1,zredth1,zred2r3,zred2th3,zred2thr3,turbn%CTURBDIM,guserv,zpsi3)
477ELSE
478 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
479 zpsi3(iijb:iije,1:ikt) = 1.
480 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
481END IF
482!
483! Prandtl numbers for scalars
484!
485CALL psi_sv(d,csturb,turbn,ksv,zredth1,zredr1,zreds1,zred2ths,zred2rs,zphi3,zpsi3,zpsi_sv,pturb_spp)
486!
487! LES diagnostics
488!
489IF (tles%LLES_CALL) THEN
490 CALL second_mnh(ztime1)
491 CALL les_mean_subgrid_phy(d,tles,zphi3,tles%X_LES_SUBGRID_PHI3)
492 IF(krr/=0) THEN
493 CALL les_mean_subgrid_phy(d,tles,zpsi3,tles%X_LES_SUBGRID_PSI3)
494 END IF
495 CALL second_mnh(ztime2)
496 tles%XTIME_LES = tles%XTIME_LES + ztime2 - ztime1
497END IF
498!----------------------------------------------------------------------------
499!
500!
501!* 2. SOURCES OF CONSERVATIVE POTENTIAL TEMPERATURE AND
502! PARTIAL THERMAL PRODUCTION
503! ---------------------------------------------------------------
504!
505!* 3. SOURCES OF CONSERVATIVE AND CLOUD MIXING RATIO AND
506! COMPLETE THERMAL PRODUCTION
507! ------------------------------------------------------
508!
509!* 4. TURBULENT CORRELATIONS : <w Rc>, <THl THl>, <THl Rnp>, <Rnp Rnp>
510! ----------------------------------------------------------------
511!
512!$acc kernels
513IF (turbn%LHARAT) THEN
514 zlm(:,:)=plengthh(:,:)
515ELSE
516 zlm(:,:)=plm(:,:)
517ENDIF
518!$acc end kernels
519!
520 CALL turb_ver_thermo_flux(d,cst,csturb,turbn,tles, &
521 krr,krrl,krri,ksv,kgradients, &
522 oocean,odeepoc,oflyer, &
523 ocouples,ocompute_src, &
524 pexpl,ptstep,tpfile, &
525 pdxx,pdyy,pdzz,pdzx,pdzy,pdircoszw,pzz, &
526 prhodj,pthvref,phgrad,pzs, &
527 psfthm,psfrm,psfthp,psfrp, &
528 pwm,pthlm,prm,psvm, &
529 ptkem,zlm,pleps, &
530 plocpexnm,patheta,pamoist,psrcm,pfrac_ice, &
531 zbeta, zsqrt_tke, zdth_dz, zdr_dz, zred2th3, &
532 zred2r3, zred2thr3, zbll_o_e, zetheta, &
533 zemoist, zredth1, zredr1, zphi3, zpsi3, zd, &
534 pfwth,pfwr,pfth2,pfr2,pfthr, &
535 mfmoist,pbl_depth,zwthv, &
536 prthls,prrs,zthlp,zrp,ptp,pwth,pwrc, &
537 psstfl, psstfl_c, pssrfl_c,pturb_spp )
538!
539 CALL turb_ver_thermo_corr(d,cst,csturb,turbn,nebn,tles, &
540 krr,krrl,krri,ksv, &
541 ocompute_src, &
542 ocouples, &
543 pexpl,tpfile, &
544 pdxx,pdyy,pdzz,pdzx,pdzy,pdircoszw, &
545 prhodj,pthvref, &
546 psfthm,psfrm,psfthp,psfrp, &
547 pwm,pthlm,prm,psvm, &
548 ptkem,zlm,pleps, &
549 plocpexnm,patheta,pamoist, &
550 zbeta, zsqrt_tke, zdth_dz, zdr_dz, zred2th3, &
551 zred2r3, zred2thr3, zbll_o_e, zetheta, &
552 zemoist, zredth1, zredr1, zphi3, zpsi3, zd, &
553 pfwth,pfwr,pfth2,pfr2,pfthr, &
554 zthlp,zrp,mfmoist,pturb_spp,psigs )
555!
556!----------------------------------------------------------------------------
557!
558!
559!
560!* 5. SOURCES OF U,W WIND COMPONENTS AND PARTIAL DYNAMIC PRODUCTION
561! -------------------------------------------------------------
562!
563!* 6. SOURCES OF V,W WIND COMPONENTS AND COMPLETE 1D DYNAMIC PRODUCTION
564! -----------------------------------------------------------------
565!
566!* 7. DIAGNOSTIC COMPUTATION OF THE 1D <W W> VARIANCE
567! -----------------------------------------------
568!
569!
570IF (turbn%LHARAT) zlm(:,:)=plengthm(:,:)
571!
572CALL turb_ver_dyn_flux(d,cst,csturb,turbn,tles,ksv,o2d,oflat, &
573 krr,oocean,ocouples, &
574 pexpl,ptstep,tpfile, &
575 pdxx,pdyy,pdzz,pdzx,pdzy,pdircoszw,pzz, &
576 pcosslope,psinslope, &
577 psea_ucu,psea_vcu, &
578 prhodj,psfum,psfvm, &
579 pcdueff,ptau11m,ptau12m,ptau33m, &
580 pthlm,prm,psvm,pum,pvm,pwm,puslopem,pvslopem, &
581 ptkem,zlm,mfmoist,zwu,zwv, &
582 prus,prvs,prws,pdp,ptp,pturb_spp, &
583 pssufl_c,pssvfl_c,pssufl,pssvfl )
584!
585!----------------------------------------------------------------------------
586!
587!
588!* 8. SOURCES OF PASSIVE SCALAR VARIABLES
589! -----------------------------------
590!
591IF (turbn%LHARAT) zlm(:,:)=plengthh(:,:)
592!
593IF (ksv>0) &
594CALL turb_ver_sv_flux(d,cst,csturb,turbn,tles,onomixlg, &
595 ksv,ksv_lgbeg,ksv_lgend, &
596 oblowsnow,oflyer, &
597 pexpl,ptstep,tpfile,prsnow, &
598 pdzz,pdircoszw, &
599 prhodj,pwm, &
600 psfsvm,psfsvp, &
601 psvm, &
602 ptkem,zlm,mfmoist,zpsi_sv, &
603 pturb_spp,prsvs,pwsv )
604!
605!
606IF (ksv>0 .AND. tles%LLES_CALL) &
607CALL turb_ver_sv_corr(d,cst,csturb,turbn,tles,krr,krrl,krri,oocean,&
608 pdzz,ksv,ksv_lgbeg,ksv_lgend,onomixlg, &
609 oblowsnow,ocompute_src,prsnow, &
610 pthlm,prm,pthvref, &
611 plocpexnm,patheta,pamoist,psrcm,zphi3,zpsi3, &
612 pwm,psvm, &
613 ptkem,zlm,pleps,zpsi_sv,pturb_spp )
614!
615!
616!----------------------------------------------------------------------------
617!
618!* 9. DIAGNOSTIC OF Surface Boundary Layer Depth
619! ------------------------------------------
620!
621IF (turbn%LRMC01) CALL sbl_depth(d,turbn,csturb,pzz,zwu,zwv,zwthv,plmo,psbl_depth)
622!
623!----------------------------------------------------------------------------
624!
625!
626!* 10. PRINTS
627! ------
628!
629!
630IF ( turbn%LTURB_FLX .AND. tpfile%LOPENED .AND. .NOT. turbn%LHARAT) THEN
631!
632! stores the Turbulent Prandtl number
633!
634 tzfield = tfieldmetadata( &
635 cmnhname = 'PHI3', &
636 cstdname = '', &
637 clongname = 'PHI3', &
638 cunits = '1', &
639 cdir = 'XY', &
640 ccomment = 'Turbulent Prandtl number', &
641 ngrid = 4, &
642 ntype = typereal, &
643 ndims = 3, &
644 ltimedep = .true. )
645 !$acc update self(ZPHI3)
646 CALL io_field_write_phy(d,tpfile,tzfield,zphi3)
647!
648! stores the Turbulent Schmidt number
649!
650 tzfield = tfieldmetadata( &
651 cmnhname = 'PSI3', &
652 cstdname = '', &
653 clongname = 'PSI3', &
654 cunits = '1', &
655 cdir = 'XY', &
656 ccomment = 'Turbulent Schmidt number', &
657 ngrid = 4, &
658 ntype = typereal, &
659 ndims = 3, &
660 ltimedep = .true. )
661 !$acc update self(ZPSI3)
662 CALL io_field_write_phy(d,tpfile,tzfield,zpsi3)
663!
664!
665! stores the Turbulent Schmidt number for the scalar variables
666!
667 tzfield = tfieldmetadata( &
668 cmnhname = 'generic for SV in turb_ver', & !Temporary name to ease identification
669 cstdname = '', &
670 cunits = '1', &
671 cdir = 'XY', &
672 ngrid = 4, &
673 ntype = typereal, &
674 ndims = 3, &
675 ltimedep = .true. )
676 !$acc update self(ZPSI_SV)
677 DO jsv=1,ksv
678 WRITE(tzfield%CMNHNAME, '("PSI_SV_",I3.3)') jsv
679 tzfield%CLONGNAME = trim(tzfield%CMNHNAME)
680 tzfield%CCOMMENT = 'X_Y_Z_'//trim(tzfield%CMNHNAME)
681 CALL io_field_write_phy(d,tpfile,tzfield,zpsi_sv(:,:,jsv))
682 END DO
683!
684END IF
685!
686!
687!----------------------------------------------------------------------------
688IF (lhook) CALL dr_hook('TURB_VER',1,zhook_handle)
689CONTAINS
690include "shugrad.h"
691END SUBROUTINE turb_ver
692END MODULE mode_turb_ver
693
integer, parameter typereal
Definition modd_field.F90:9
integer, parameter nturb_s
subroutine phi3(d, csturb, turbn, predth1, predr1, pred2th3, pred2r3, pred2thr3, hturbdim, ouserv, pphi3)
subroutine psi3(d, csturb, turbn, predr1, predth1, pred2r3, pred2th3, pred2thr3, hturbdim, ouserv, ppsi3)
subroutine psi_sv(d, csturb, turbn, ksv, predth1, predr1, preds1, pred2ths, pred2rs, pphi3, ppsi3, ppsi_sv, pturb_spp)
subroutine prandtl(d, cst, csturb, turbn, krr, ksv, krri, oturb_diag, hturbdim, oocean, oharat, o2d, ocompute_src, tpfile, oflat, pdxx, pdyy, pdzz, pdzx, pdzy, pthvref, plocpexnm, patheta, pamoist, plm, pleps, ptkem, pthlm, prm, psvm, psrcm, pturb_spp, predth1, predr1, pred2th3, pred2r3, pred2thr3, preds1, pred2ths3, pred2rs3, pbll_o_e, petheta, pemoist)
subroutine sbl_depth(d, turbn, csturb, pzz, pflxu, pflxv, pwthv, plmo, psbl_depth)
subroutine turb_ver_dyn_flux(d, cst, csturb, turbn, tles, ksv, o2d, oflat, krr, oocean, ocouples, pexpl, ptstep, tpfile, pdxx, pdyy, pdzz, pdzx, pdzy, pdircoszw, pzz, pcosslope, psinslope, psea_ucu, psea_vcu, prhodj, psfum, psfvm, pcdueff, ptau11m, ptau12m, ptau33m, pthlm, prm, psvm, pum, pvm, pwm, puslopem, pvslopem, ptkem, plm, mfmoist, pwu, pwv, prus, prvs, prws, pdp, ptp, pturb_spp, pssufl_c, pssvfl_c, pssufl, pssvfl)
subroutine turb_ver_sv_corr(d, cst, csturb, turbn, tles, krr, krrl, krri, oocean, pdzz, ksv, ksv_lgbeg, ksv_lgend, onomixlg, oblowsnow, ocompute_src, prsnow, pthlm, prm, pthvref, plocpexnm, patheta, pamoist, psrcm, pphi3, ppsi3, pwm, psvm, ptkem, plm, pleps, ppsi_sv, pturb_spp)
subroutine turb_ver_sv_flux(d, cst, csturb, turbn, tles, onomixlg, ksv, ksv_lgbeg, ksv_lgend, oblowsnow, oflyer, pexpl, ptstep, tpfile, prsnow, pdzz, pdircoszw, prhodj, pwm, psfsvm, psfsvp, psvm, ptkem, plm, mfmoist, ppsi_sv, pturb_spp, prsvs, pwsv)
subroutine turb_ver_thermo_corr(d, cst, csturb, turbn, nebn, tles, krr, krrl, krri, ksv, ocompute_src, ocouples, pexpl, tpfile, pdxx, pdyy, pdzz, pdzx, pdzy, pdircoszw, prhodj, pthvref, psfthm, psfrm, psfthp, psfrp, pwm, pthlm, prm, psvm, ptkem, plm, pleps, plocpexnm, patheta, pamoist, pbeta, psqrt_tke, pdth_dz, pdr_dz, pred2th3, pred2r3, pred2thr3, pbll_o_e, petheta, pemoist, predth1, predr1, pphi3, ppsi3, pd, pfwth, pfwr, pfth2, pfr2, pfthr, pthlp, prp, mfmoist, pturb_spp, psigs)
subroutine turb_ver_thermo_flux(d, cst, csturb, turbn, tles, krr, krrl, krri, ksv, kgradients, oocean, odeepoc, oflyer, ocouples, ocompute_src, pexpl, ptstep, tpfile, pdxx, pdyy, pdzz, pdzx, pdzy, pdircoszw, pzz, prhodj, pthvref, phgrad, pzs, psfthm, psfrm, psfthp, psfrp, pwm, pthlm, prm, psvm, ptkem, plm, pleps, plocpexnm, patheta, pamoist, psrcm, pfrac_ice, pbeta, psqrt_tke, pdth_dz, pdr_dz, pred2th3, pred2r3, pred2thr3, pbll_o_e, petheta, pemoist, predth1, predr1, pphi3, ppsi3, pd, pfwth, pfwr, pfth2, pfr2, pfthr, mfmoist, pbl_depth, pwthv, prthls, prrs, pthlp, prp, ptp, pwth, pwrc, psstfl, psstfl_c, pssrfl_c, pturb_spp)
subroutine turb_ver(d, cst, csturb, turbn, nebn, tles, krr, krrl, krri, kgradients, oocean, odeepoc, ocompute_src, ksv, ksv_lgbeg, ksv_lgend, pexpl, o2d, onomixlg, oflat, ocouples, oblowsnow, oflyer, prsnow, ptstep, tpfile, pdxx, pdyy, pdzz, pdzx, pdzy, pdircoszw, pzz, pcosslope, psinslope, prhodj, pthvref, psfum, psfvm, psfthm, psfrm, psfsvm, psfthp, psfrp, psfsvp, pcdueff, ptau11m, ptau12m, ptau33m, psea_ucu, psea_vcu, pum, pvm, pwm, puslopem, pvslopem, pthlm, prm, psvm, ptkem, plm, plengthm, plengthh, pleps, mfmoist, plocpexnm, patheta, pamoist, psrcm, pfrac_ice, pfwth, pfwr, pfth2, pfr2, pfthr, pbl_depth, psbl_depth, plmo, phgrad, pzs, prus, prvs, prws, prthls, prrs, prsvs, pdp, ptp, psigs, pwth, pwrc, pwsv, psstfl, psstfl_c, pssrfl_c, pssufl_c, pssvfl_c, pssufl, pssvfl, pturb_spp)
subroutine second_mnh(xt)
Definition second_mnh.F90:2
real function, dimension(size(py, 1), size(py, 2)) gz_m_w(py, pdzz)
Definition shugrad.h:437