PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
turb.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!-----------------------------------------------------------------
6 SUBROUTINE turb(CST,CSTURB,BUCONF,TURBN,NEBN,D,TLES, &
7 & KRR,KRRL,KRRI,HLBCX,HLBCY,KGRADIENTSLEO, &
8 & KGRADIENTSGOG,KHALO, &
9 & KSPLIT, OCLOUDMODIFLM, KSV,KSV_LGBEG,KSV_LGEND, &
10 & KSV_LIMA_NR, KSV_LIMA_NS, KSV_LIMA_NG, KSV_LIMA_NH, &
11 & O2D,ONOMIXLG,OFLAT,OCOUPLES,OBLOWSNOW,OIBM,OFLYER, &
12 & OCOMPUTE_SRC, PRSNOW, &
13 & OOCEAN,ODEEPOC,ODIAG_IN_RUN, &
14 & HTURBLEN_CL,HCLOUD,HELEC, &
15 & PTSTEP,TPFILE, &
16 & PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, &
17 & PDIRCOSXW,PDIRCOSYW,PDIRCOSZW,PCOSSLOPE,PSINSLOPE, &
18 & PRHODJ,PTHVREF,PHGRADLEO,PHGRADGOG,PZS, &
19 & PSFTH,PSFRV,PSFSV,PSFU,PSFV, &
20 & PSEA_UCU,PSEA_VCU, &
21 & PPABST,PUT,PVT,PWT,PTKET,PSVT,PSRCT, &
22 & PLENGTHM,PLENGTHH,MFMOIST, &
23 & PBL_DEPTH,PSBL_DEPTH, &
24 & PCEI,PCEI_MIN,PCEI_MAX,PCOEF_AMPL_SAT, &
25 & PTHLT,PRT, &
26 & PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS,PRTKES, &
27 & PSIGS, &
28 & PFLXZTHVMF, PFLXZUMF, PFLXZVMF, &
29 & PWTH,PWRC,PWSV,PDP,PTP,PTDIFF,PTDISS, &
30 & TBUDGETS, KBUDGETS, &
31 & PEDR,PLEM,PRTKEMS,PDPMF,PTPMF, &
32 & PDRUS_TURB,PDRVS_TURB, &
33 & PDRTHLS_TURB,PDRRTS_TURB,PDRSVS_TURB,PTURB_SPP, &
34 & PTR,PDISS, PIBM_LS, PIBM_XMUT, &
35 & PCURRENT_TKE_DISS, PSSTFL, PSSTFL_C, PSSRFL_C, &
36 & PSSUFL_C, PSSVFL_C,PSSUFL,PSSVFL )
37
38!$ACDC singlecolumn --nocreate-interface
39
40! #################################################################
41!
42!
43!!**** *TURB* - computes the turbulent source terms for the prognostic
44!! variables.
45!!
46!! PURPOSE
47!! -------
48!!**** The purpose of this routine is to compute the source terms in
49!! the evolution equations due to the turbulent mixing.
50!! The source term is computed as the divergence of the turbulent fluxes.
51!! The cartesian fluxes are obtained by a one and a half order closure, based
52!! on a prognostic equation for the Turbulence Kinetic Energy( TKE ). The
53!! system is closed by prescribing a turbulent mixing length. Different
54!! choices are available for this length.
55!
56!!** METHOD
57!! ------
58!!
59!! The dimensionality of the turbulence parameterization can be chosen by
60!! means of the parameter TURBN%CTURBDIM:
61!! * TURBN%CTURBDIM='1DIM' the parameterization is 1D but can be used in
62!! 3D , 2D or 1D simulations. Only the sources associated to the vertical
63!! turbulent fluxes are taken into account.
64!! * TURBN%CTURBDIM='3DIM' the parameterization is fully 2D or 3D depending
65!! on the model dimensionality. Of course, it does not make any sense to
66!! activate this option with a 1D model.
67!!
68!! The following steps are made:
69!! 1- Preliminary computations.
70!! 2- The metric coefficients are recovered from the grid knowledge.
71!! 3- The mixing length is computed according to its choice:
72!! * TURBN%CTURBLEN='BL89' the Bougeault and Lacarrere algorithm is used.
73!! The mixing length is given by the vertical displacement from its
74!! original level of an air particule having an initial internal
75!! energy equal to its TKE and stopped by the buoyancy forces.
76!! The discrete formulation is second order accurate.
77!! * TURBN%CTURBLEN='DELT' the mixing length is given by the mesh size
78!! depending on the model dimensionality, this length is limited
79!! with the ground distance.
80!! * TURBN%CTURBLEN='DEAR' the mixing length is given by the mesh size
81!! depending on the model dimensionality, this length is limited
82!! with the ground distance and also by the Deardorff mixing length
83!! pertinent in the stable cases.
84!! * TURBN%CTURBLEN='KEPS' the mixing length is deduced from the TKE
85!! dissipation, which becomes a prognostic variable of the model (
86!! Duynkerke formulation).
87!! 3'- The cloud mixing length is computed according to HTURBLEN_CLOUD
88!! and emphasized following the CEI index
89!! 4- The conservative variables are computed along with Lv/Cp.
90!! 5- The turbulent Prandtl numbers are computed from the resolved fields
91!! and TKE
92!! 6- The sources associated to the vertical turbulent fluxes are computed
93!! with a temporal scheme allowing a degree of implicitness given by
94!! TURBN%XIMPL, varying from TURBN%XIMPL=0. ( purely explicit scheme) to TURBN%XIMPL=1.
95!! ( purely implicit scheme)
96!! The sources associated to the horizontal fluxes are computed with a
97!! purely explicit temporal scheme. These sources are only computed when
98!! the turbulence parameterization is 2D or 3D( TURBN%CTURBDIM='3DIM' ).
99!! 7- The sources for TKE are computed, along with the dissipation of TKE
100!! if TURBN%CTURBLEN='KEPS'.
101!! 8- Some turbulence-related quantities are stored in the synchronous file.
102!! 9- The non-conservative variables are retrieved.
103!!
104!!
105!! The saving of the fields in the synchronous file is controlled by:
106!! * TURBN%LTURB_FLX => saves all the turbulent fluxes and correlations
107!! * TURBN%LTURB_DIAG=> saves the turbulent Prandtl and Schmidt numbers, the
108!! source terms of TKE and dissipation of TKE
109!!
110!! EXTERNAL
111!! --------
112!! SUBROUTINE PRANDTL : computes the turbulent Prandtl number
113!! SUBROUTINE TURB_VER : computes the sources from the vertical fluxes
114!! SUBROUTINE TURB_HOR : computes the sources from the horizontal fluxes
115!! SUBROUTINE TKE_EPS_SOURCES : computes the sources for TKE and its
116!! dissipation
117!! SUBROUTINE BUDGET : computes and stores the budgets
118!!
119!! IMPLICIT ARGUMENTS
120!! ------------------
121!!
122!! MODD_PARAMETERS : JPVEXT_TURB number of marginal vertical points
123!!
124!! MODD_CST : contains physical constants
125!! CST%XG gravity constant
126!! CST%XRD Gas constant for dry air
127!! CST%XRV Gas constant for vapor
128!!
129!! MODD_CTURB : contains turbulence scheme constants
130!! XCMFS,XCED to compute the dissipation mixing length
131!! XTKEMIN minimum values for the TKE
132!! CST%XLINI,CST%XLINF to compute Bougeault-Lacarrere mixing
133!! length
134!! Module MODD_BUDGET:
135!! NBUMOD
136!! CBUTYPE
137!! LBU_RU
138!! LBU_RV
139!! LBU_RW
140!! LBU_RTH
141!! LBU_RSV1
142!! LBU_RRV
143!! LBU_RRC
144!! LBU_RRR
145!! LBU_RRI
146!! LBU_RRS
147!! LBU_RRG
148!! LBU_RRH
149!!
150!! REFERENCE
151!! ---------
152!! Book 2 of documentation (routine TURB)
153!! Book 1 of documentation (Chapter: Turbulence)
154!!
155!! AUTHOR
156!! ------
157!! Joan Cuxart * INM and Meteo-France *
158!!
159!! MODIFICATIONS
160!! -------------
161!! Original 05/10/94
162!! Modifications: Feb 14, 1995 (J.Cuxart and J.Stein)
163!! Doctorization and Optimization
164!! Modifications: March 21, 1995 (J.M. Carriere)
165!! Introduction of cloud water
166!! Modifications: June 1, 1995 (J.Cuxart )
167!! take min(Kz,delta)
168!! Modifications: June 1, 1995 (J.Stein J.Cuxart)
169!! remove unnecessary arrays and change Prandtl
170!! and Schmidt numbers localizations
171!! Modifications: July 20, 1995 (J.Stein) remove MODI_ground_ocean +
172!! TZDTCUR + MODD_TIME because they are not used
173!! change RW in RNP for the outputs
174!! Modifications: August 21, 1995 (Ph. Bougeault)
175!! take min(K(z-zsol),delta)
176!! Modifications: Sept 14, 1995 (Ph Bougeault, J. Cuxart)
177!! second order BL89 mixing length computations + add Deardorff length
178!! in the Delta case for stable cases
179!! Modifications: Sept 19, 1995 (J. Stein, J. Cuxart)
180!! define a DEAR case for the mixing length, add MODI_BUDGET and change
181!! some BUDGET calls, add LES tools
182!! Modifications: Oct 16, 1995 (J. Stein) change the budget calls
183!! Modifications: Feb 28, 1996 (J. Stein) optimization +
184!! remove min(K(z-zsol),delta)+
185!! bug in the tangential fluxes
186!! Modifications: Oct 16, 1996 (J. Stein) change the subgrid condensation
187!! scheme + temporal discretization
188!! Modifications: Dec 19, 1996 (J.-P. Pinty) update the budget calls
189!! Jun 22, 1997 (J. Stein) use the absolute pressure and
190!! change the Deardorf length at the surface
191!! Modifications: Apr 27, 1997 (V. Masson) BL89 mix. length computed in
192!! a separate routine
193!! Oct 13, 1999 (J. Stein) switch for the tgt fluxes
194!! Jun 24, 1999 (P Jabouille) Add routine UPDATE_ROTATE_WIND
195!! Feb 15, 2001 (J. Stein) remove tgt fluxes
196!! Mar 8, 2001 (V. Masson) forces the same behaviour near the surface
197!! for all mixing lengths
198!! Nov 06, 2002 (V. Masson) LES budgets
199!! Nov, 2002 (V. Masson) implement modifications of
200!! mixing and dissipative lengths
201!! near the surface (according
202!! Redelsperger et al 2001)
203!! Apr, 2003 (V. Masson) bug in Blackadar length
204!! bug in LES in 1DIM case
205!! Feb 20, 2003 (J.-P. Pinty) Add reversible ice processes
206!! May,26 2004 (P Jabouille) coef for computing dissipative heating
207!! Sept 2004 (M.Tomasini) Cloud Mixing length modification
208!! following the instability
209!! criterium CEI calculated in modeln
210!! May 2006 Remove KEPS
211!! Sept.2006 (I.Sandu): Modification of the stability criterion for
212!! DEAR (theta_v -> theta_l)
213!! Oct 2007 (J.Pergaud) Add MF contribution for vert. turb. transport
214!! Oct.2009 (C.Lac) Introduction of different PTSTEP according to the
215!! advection schemes
216!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after
217!! change of YCOMMENT
218!! 06/2011 (J.escobar ) Bypass Bug with ifort11/12 on HLBCX,HLBC
219!! 2012-02 Y. Seity, add possibility to run with reversed
220!! vertical levels
221!! 10/2012 (J. Colin) Correct bug in DearDoff for dry simulations
222!! 10/2012 J.Escobar Bypass PGI bug , redefine some allocatable array inplace of automatic
223!! 2014-11 Y. Seity, add output terms for TKE DDHs budgets
224!! July 2015 (Wim de Rooy) modifications to run with RACMO
225!! turbulence (TURBN%LHARAT=TRUE)
226!! 04/2016 (C.Lac) correction of negativity for KHKO
227! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O
228! Q. Rodier 01/2018: introduction of RM17
229! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine
230! Wim de Rooy 06/2019: update statistical cloud scheme
231! P. Wautelet 02/2020: use the new data structures and subroutines for budgets
232! B. Vie 03/2020: LIMA negativity checks after turbulence, advection and microphysics budgets
233! P. Wautelet 11/06/2020: bugfix: correct PRSVS array indices
234! P. Wautelet + Benoit Vié 06/2020: improve removal of negative scalar variables + adapt the corresponding budgets
235! P. Wautelet 30/06/2020: move removal of negative scalar variables to Sources_neg_correct
236! R. Honnert/V. Masson 02/2021: new mixing length in the grey zone
237! J.L. Redelsperger 03/2021: add Ocean LES case
238! C. Barthe 08/02/2022: add helec in arguments of Sources_neg_correct
239! A. Marcel Jan 2025: EDMF contribution to dynamic TKE production
240! --------------------------------------------------------------------------
241!
242!* 0. DECLARATIONS
243! ------------
244!
245USE yomhook , ONLY: lhook, dr_hook, jphook
246!
250USE modd_cst, ONLY: cst_t
251USE modd_cturb, ONLY: csturb_t
252USE modd_dimphyex, ONLY: dimphyex_t
255USE modd_les, ONLY: tles_t
259USE modd_neb_n, ONLY: neb_t
260!
261USE mode_bl89, ONLY: bl89
265USE mode_dear, ONLY: dear
266USE mode_delt, ONLY: delt
269USE mode_rmc01, ONLY: rmc01
271USE mode_sbl_phy, ONLY: lmo
273USE mode_tm06, ONLY: tm06
276USE mode_turb_ver, ONLY: turb_ver
277USE mode_update_lm, ONLY: update_lm
278USE mode_msg, ONLY: print_msg
279!
281USE modi_second_mnh, ONLY: second_mnh
282!
283! These macro are handled by pft_tool.py --craybyPassDOCONCURRENT applied on Cray Rules
284#ifdef MNH_COMPILER_CCE
285!$mnh_undef(LOOP)
286!$mnh_undef(OPENACC)
287#endif
288!
289IMPLICIT NONE
290!
291!
292!* 0.1 declarations of arguments
293!
294!
295!
296TYPE(dimphyex_t), INTENT(IN) :: D ! PHYEX variables dimensions structure
297TYPE(cst_t), INTENT(IN) :: CST ! modd_cst general constant structure
298TYPE(csturb_t), INTENT(IN) :: CSTURB ! modd_csturb turb constant structure
299TYPE(tbudgetconf_t), INTENT(IN) :: BUCONF ! budget structure
300TYPE(turb_t), INTENT(IN) :: TURBN ! modn_turbn (turb namelist) structure
301TYPE(neb_t), INTENT(IN) :: NEBN ! modd_nebn structure
302TYPE(tles_t), INTENT(INOUT) :: TLES ! modd_les structure
303INTEGER, INTENT(IN) :: KGRADIENTSLEO ! Number of stored horizontal gradients for Moeng scheme
304INTEGER, INTENT(IN) :: KGRADIENTSGOG ! Number of stored horizontal gradients for Goger scheme
305INTEGER, INTENT(IN) :: KRR ! number of moist var.
306INTEGER, INTENT(IN) :: KRRL ! number of liquid water var.
307INTEGER, INTENT(IN) :: KRRI ! number of ice water var.
308INTEGER, INTENT(IN) :: KSV, KSV_LGBEG, KSV_LGEND ! number of scalar variables
309INTEGER, INTENT(IN) :: KSV_LIMA_NR,KSV_LIMA_NS,KSV_LIMA_NG,KSV_LIMA_NH
310CHARACTER(LEN=4),DIMENSION(2),INTENT(IN):: HLBCX, HLBCY ! X- and Y-direc LBC
311INTEGER, INTENT(IN) :: KSPLIT ! number of time-splitting
312LOGICAL, INTENT(IN) :: OCLOUDMODIFLM ! cloud mixing length modifications
313INTEGER, INTENT(IN) :: KHALO ! Size of the halo for parallel distribution
314LOGICAL, INTENT(IN) :: OCOMPUTE_SRC ! flag to define dimensions of SIGS and SRCT variables
315LOGICAL, INTENT(IN) :: OOCEAN ! switch for Ocean model version
316LOGICAL, INTENT(IN) :: ODEEPOC ! activates sfc forcing for ideal ocean deep conv
317LOGICAL, INTENT(IN) :: OFLYER ! MesoNH flyer diagnostic
318LOGICAL, INTENT(IN) :: OFLAT ! Logical for zero ororography
319LOGICAL, INTENT(IN) :: OCOUPLES ! switch to activate atmos-ocean LES version
320LOGICAL, INTENT(IN) :: OBLOWSNOW ! switch to activate pronostic blowing snow
321LOGICAL, INTENT(IN) :: ODIAG_IN_RUN ! switch to activate online diagnostics (mesonh)
322LOGICAL, INTENT(IN) :: OIBM ! switch to modity mixing length near building with IBM
323CHARACTER(LEN=4), INTENT(IN) :: HTURBLEN_CL ! kind of cloud mixing length
324CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Kind of microphysical scheme
325CHARACTER (LEN=4), INTENT(IN) :: HELEC ! Kind of cloud electricity scheme
326REAL, INTENT(IN) :: PRSNOW ! Ratio for diffusion coeff. scalar (blowing snow)
327REAL, INTENT(IN) :: PTSTEP ! timestep
328TYPE(tfiledata), INTENT(INOUT) :: TPFILE ! Output file
329!
330REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDXX,PDYY,PDZZ,PDZX,PDZY
331 ! metric coefficients
332REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PZZ ! physical distance
333! between 2 succesive grid points along the K direction
334REAL, DIMENSION(D%NIJT), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW, PDIRCOSZW
335! Director Cosinus along x, y and z directions at surface w-point
336REAL, DIMENSION(D%NIJT), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle
337 ! between i and the slope vector
338REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSINSLOPE ! sinus of the angle
339 ! between i and the slope vector
340REAL, DIMENSION(D%NIJT), INTENT(IN) :: PZS ! orography (for LEONARD terms)
341REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODJ ! dry density * Grid size
342REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: MFMOIST ! moist mass flux dual scheme
343REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTHVREF ! Virtual Potential
344 ! Temperature of the reference state
345REAL, DIMENSION(MERGE(D%NIJT,0,TURBN%LLEONARD),MERGE(D%NKT,0,TURBN%LLEONARD), & MERGE(KGRADIENTSLEO,0,TURBN%LLEONARD)), INTENT(IN) :: PHGRADLEO ! horizontal gradients in Moeng
346REAL, DIMENSION(MERGE(D%NIJT,0,TURBN%LGOGER),MERGE(D%NKT,0,TURBN%LGOGER), & MERGE(KGRADIENTSGOG,0,TURBN%LGOGER)), INTENT(IN) :: PHGRADGOG ! horizontal gradients in Goger
347!
348REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSFTH,PSFRV, &
349! normal surface fluxes of theta and Rv
350 psfu,psfv
351! normal surface fluxes of (u,v) parallel to the orography
352REAL, DIMENSION(D%NIJT,KSV), INTENT(IN) :: PSFSV
353! normal surface fluxes of Scalar var.
354!
355REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSEA_UCU,PSEA_VCU !Sea surface currents
356!
357! prognostic variables at t- deltat
358REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPABST ! Pressure at time t
359REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PUT,PVT,PWT ! wind components
360REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTKET ! TKE
361REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(IN) :: PSVT ! passive scal. var.
362REAL, DIMENSION(MERGE(D%NIJT,0,OCOMPUTE_SRC),& MERGE(D%NKT,0,OCOMPUTE_SRC)), INTENT(IN) :: PSRCT ! Second-order flux
363 ! s'rc'/2Sigma_s2 at time t-1 multiplied by Lambda_3
364REAL, DIMENSION(MERGE(D%NIJT,0,TURBN%CTOM=='TM06')),INTENT(INOUT) :: PBL_DEPTH ! BL height for TOMS
365REAL, DIMENSION(MERGE(D%NIJT,0,TURBN%LRMC01)) ,INTENT(INOUT) :: PSBL_DEPTH ! SBL depth for RMC01
366!
367! variables for cloud mixing length
368REAL, DIMENSION(MERGE(D%NIJT,0,OCLOUDMODIFLM),& MERGE(D%NKT,0,OCLOUDMODIFLM)),INTENT(IN) :: PCEI
369 ! Cloud Entrainment instability
370 ! index to emphasize localy
371 ! turbulent fluxes
372REAL, INTENT(IN) :: PCEI_MIN ! minimum threshold for the instability index CEI
373REAL, INTENT(IN) :: PCEI_MAX ! maximum threshold for the instability index CEI
374REAL, INTENT(IN) :: PCOEF_AMPL_SAT ! saturation of the amplification coefficient
375!
376! thermodynamical variables which are transformed in conservative var.
377REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PTHLT ! conservative pot. temp.
378REAL, DIMENSION(D%NIJT,D%NKT,KRR), INTENT(INOUT) :: PRT ! water var. where
379 ! PRT(:,:,:,1) is the conservative mixing ratio
380!
381! sources of momentum, conservative potential temperature, Turb. Kin. Energy,
382! TKE dissipation
383REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRUS,PRVS,PRWS,PRTHLS,PRTKES
384! Source terms for all water kinds, PRRS(:,:,:,1) is used for the conservative
385! mixing ratio
386REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN),OPTIONAL :: PRTKEMS
387REAL, DIMENSION(D%NIJT,D%NKT,KRR), INTENT(INOUT) :: PRRS
388! Source terms for all passive scalar variables
389REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(INOUT) :: PRSVS
390! Sigma_s at time t+1 : square root of the variance of the deviation to the
391! saturation
392REAL, DIMENSION(MERGE(D%NIJT,0,OCOMPUTE_SRC),& MERGE(D%NKT,0,OCOMPUTE_SRC)), INTENT(OUT) :: PSIGS
393REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT),OPTIONAL :: PDRUS_TURB ! evolution of rhoJ*U by turbulence only
394REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT),OPTIONAL :: PDRVS_TURB ! evolution of rhoJ*V by turbulence only
395REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT),OPTIONAL :: PDRTHLS_TURB ! evolution of rhoJ*thl by turbulence only
396REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT),OPTIONAL :: PDRRTS_TURB ! evolution of rhoJ*rt by turbulence only
397REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(OUT),OPTIONAL :: PDRSVS_TURB ! evolution of rhoJ*Sv by turbulence only
398REAL, DIMENSION(D%NIJT,D%NKT,NTURB_S), INTENT(IN),OPTIONAL :: PTURB_SPP
399REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFLXZTHVMF
400! MF contribution for vert. turb. transport
401! used in the buoy. prod. of TKE
402REAL, DIMENSION(MERGE(D%NIJT,0,OFLYER),MERGE(D%NKT,0,OFLYER)), INTENT(OUT) :: PWTH ! heat flux
403REAL, DIMENSION(MERGE(D%NIJT,0,OFLYER),MERGE(D%NKT,0,OFLYER)), INTENT(OUT) :: PWRC ! cloud water flux
404REAL, DIMENSION(MERGE(D%NIJT,0,OFLYER),MERGE(D%NKT,0,OFLYER),MERGE(KSV,0,OFLYER)),INTENT(OUT) :: PWSV ! scalar flux
405REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFLXZUMF ! MF contribution for vert. turb. transport (dyn prod)
406REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PFLXZVMF ! MF contribution for vert. turb. transport (dyn prod)
407REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PTP ! Thermal TKE production MassFlux + turb
408REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT),OPTIONAL :: PTPMF ! Thermal TKE production MassFlux Only
409REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PDP ! Dynamic TKE production MassFlux + turb
410REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT),OPTIONAL :: PDPMF ! Dynamic TKE production MassFlux Only
411REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PTDIFF ! Diffusion TKE term
412REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PTDISS ! Dissipation TKE term
413!
414TYPE(tbudgetdata_ptr), DIMENSION(KBUDGETS), INTENT(INOUT) :: TBUDGETS
415INTEGER, INTENT(IN) :: KBUDGETS
416!
417LOGICAL, INTENT(IN) :: ONOMIXLG ! to use turbulence for lagrangian variables (modd_conf)
418LOGICAL, INTENT(IN) :: O2D ! Logical for 2D model version (modd_conf)
419!
420! length scale from vdfexcu
421REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLENGTHM, PLENGTHH
422!
423REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT), OPTIONAL :: PEDR ! EDR
424REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT), OPTIONAL :: PLEM ! Mixing length
425REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT), OPTIONAL :: PTR ! Transport prod. of TKE
426REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT), OPTIONAL :: PDISS ! Dissipation of TKE
427REAL, DIMENSION(MERGE(D%NIJT,0,ODIAG_IN_RUN),MERGE(D%NKT,0,ODIAG_IN_RUN)), INTENT(INOUT), OPTIONAL :: PCURRENT_TKE_DISS
428REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSTFL ! Time evol Flux of T at sea surface (LOCEAN)
429REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSTFL_C ! O-A interface flux for theta(LOCEAN and LCOUPLES)
430REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSRFL_C ! O-A interface flux for vapor (LOCEAN and LCOUPLES)
431REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSUFL_C ! Time evol Flux of U at sea surface (LOCEAN)
432REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSVFL_C !
433REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSUFL
434REAL, DIMENSION(MERGE(D%NIJT,0,OCOUPLES)), INTENT(IN),OPTIONAL :: PSSVFL !
435!
436REAL, DIMENSION(MERGE(D%NIJT,0,OIBM),MERGE(D%NKT,0,OIBM)), INTENT(OUT), OPTIONAL :: PIBM_XMUT ! IBM turbulent viscosity
437REAL, DIMENSION(MERGE(D%NIJT,0,OIBM),MERGE(D%NKT,0,OIBM)), INTENT(IN), OPTIONAL :: PIBM_LS ! IBM Level-set function
438!
439!
440!-------------------------------------------------------------------------------
441!
442! 0.2 declaration of local variables
443!
444REAL, DIMENSION(D%NIJT,D%NKT) :: &
445 ZCP, & ! Cp at t-1
446 ZEXN, & ! EXN at t-1
447 ZT, & ! T at t-1
448 ZLOCPEXNM, & ! Lv/Cp/EXNREF at t-1
449 ZLM,ZLMW, & ! Turbulent mixing length (+ work array)
450 ZLEPS, & ! Dissipative length
451 ZTRH, & !
452 ZATHETA,ZAMOIST, & ! coefficients for s = f (Thetal,Rnp)
453 ZCOEF_DISS, & ! 1/(Cph*Exner) for dissipative heating
454 ZFRAC_ICE, & ! ri fraction of rc+ri
455 ZMWTH,ZMWR,ZMTH2,ZMR2,ZMTHR,& ! 3rd order moments
456 ZFWTH,ZFWR,ZFTH2,ZFR2,ZFTHR,& ! opposite of verticale derivate of 3rd order moments
457 ZTHLM,ZRTKEMS, & ! initial potential temp; TKE advective source
458 ZSHEAR, ZDUDZ, ZDVDZ, & ! horizontal-wind vertical gradient
459 ZLVOCPEXNM,ZLSOCPEXNM, & ! Lv/Cp/EXNREF and Ls/Cp/EXNREF at t-1
460 ZATHETA_ICE,ZAMOIST_ICE, & ! coefficients for s = f (Thetal,Rnp)
461 ZWORK1,ZWORK2, & ! working array syntax
462 ZTEMP_BUD
463!
464!
465REAL, DIMENSION(D%NIJT,D%NKT,KRR) :: ZRM ! initial mixing ratio
466REAL, DIMENSION(D%NIJT) :: ZTAU11M,ZTAU12M, &
467 ZTAU22M,ZTAU33M, &
468 ! tangential surface fluxes in the axes following the orography
469 zuslope,zvslope, &
470 ! wind components at the first mass level parallel
471 ! to the orography
472 zcdueff, &
473 ! - Cd*||u|| where ||u|| is the module of the wind tangential to
474 ! orography (ZUSLOPE,ZVSLOPE) at the surface.
475 zustar, zlmo, &
476 zrvm, zsfrv,zwork2d
477 ! friction velocity, Monin Obuhkov length, work arrays for vapor
478!
479 ! Virtual Potential Temp. used
480 ! in the Deardorff mixing length computation
481!
482!with LIMA, do not change rain, snow, graupel and hail concentrations (mixing ratio is not changed)
483REAL, DIMENSION(D%NIJT,D%NKT,KSV) :: ZRSVS
484!
485REAL :: ZEXPL ! 1-TURBN%XIMPL deg of expl.
486REAL :: ZRVORD ! RV/RD
487!
488INTEGER :: IIJB,IIJE,IKB,IKE ! index value for the
489! Beginning and the End of the physical domain for the mass points
490INTEGER :: IKT,IKA,IKU ! array size in k direction
491INTEGER :: IKL
492INTEGER :: IKTB,IKTE ! start, end of k loops in physical domain
493INTEGER :: JRR,JK,JSV ! loop counters
494INTEGER :: JIJ ! loop counters
495REAL :: ZL0 ! Max. Mixing Length in Blakadar formula
496REAL :: ZALPHA ! work coefficient :
497 ! - proportionnality constant between Dz/2 and
498! ! BL89 mixing length near the surface
499!
500REAL :: ZTIME1, ZTIME2
501LOGICAL :: GOCEAN !Intermediate variable used to work around a Cray compiler bug (CCE 13.0.0)
502LOGICAL :: GTURBLEN_BL89_TURBLEN_RM17_TURBLEN_HM21_ORMC01
503TYPE(tfieldmetadata) :: TZFIELD
504!
505REAL, DIMENSION(D%NIJT,D%NKT,MERGE(KSV+KRR,KSV,TURBN%LTURB_PRECIP)) :: ZWORKT, ZWORKS
506REAL, DIMENSION(D%NIJT, MERGE(KSV+KRR,KSV,TURBN%LTURB_PRECIP)) :: ZWORKSFSV
507REAL, DIMENSION(MERGE(D%NIJT,0,OFLYER),MERGE(D%NKT,0,OFLYER),MERGE(KSV,0,OFLYER)) :: ZWORKWSV
508REAL, DIMENSION(D%NIJT,D%NKT,NTURB_S) :: ZTURB_SPP
509INTEGER :: ISV
510!
511!* 1.PRELIMINARIES
512! -------------
513!
514!* 1.1 Set the internal domains, ZEXPL
515!
516!
517REAL(KIND=jphook) :: zhook_handle
518IF (lhook) CALL dr_hook('TURB',0,zhook_handle)
519!
520IF (turbn%LHARAT .AND. turbn%CTURBDIM /= '1DIM') THEN
521 CALL print_msg(nverb_fatal, 'GEN', 'TURB', 'TURBN%LHARATU only implemented for option TURBN%CTURBDIM=1DIM!')
522ENDIF
523IF (turbn%LHARAT .AND. tles%LLES_CALL) THEN
524 CALL print_msg(nverb_fatal, 'GEN', 'TURB', 'TURBN%LHARATU not implemented for option LLES_CALL')
525ENDIF
526!
527ikt=d%NKT
528iktb=d%NKTB
529ikte=d%NKTE
530ikb=d%NKB
531ike=d%NKE
532ika=d%NKA
533iku=d%NKU
534ikl=d%NKL
535iije=d%NIJE
536iijb=d%NIJB
537!
538zexpl = 1.- turbn%XIMPL
539zrvord= cst%XRV / cst%XRD
540!
541gocean = oocean
542gturblen_bl89_turblen_rm17_turblen_hm21_ormc01 = &
543turbn%CTURBLEN=='BL89' .OR. turbn%CTURBLEN=='RM17' .OR. turbn%CTURBLEN=='HM21' .OR. turbn%LRMC01
544!Copy data into ZTHLM and ZRM only if needed
545IF (gturblen_bl89_turblen_rm17_turblen_hm21_ormc01) THEN
546!$acc kernels present_cr(ZTHLM,ZRM)
547 zthlm(iijb:iije,1:ikt) = pthlt(iijb:iije,1:ikt)
548 zrm(iijb:iije,1:ikt,:) = prt(iijb:iije,1:ikt,:)
549!$acc end kernels
550END IF
551!
552!Save LIMA scalar variables sources
553zrsvs(iijb:iije,1:ikt,1:ksv)=prsvs(iijb:iije,1:ikt,1:ksv)
554!
555isv=ksv
556IF (turbn%LTURB_PRECIP) isv=ksv+krr
557zworkt(:,:,1:ksv)=psvt(:,:,:)
558zworks(:,:,1:ksv)=prsvs(:,:,:)
559IF (turbn%LTURB_PRECIP) zworkt(:,:,ksv+1:ksv+krr)=prt(:,:,:)
560IF (turbn%LTURB_PRECIP) zworks(:,:,ksv+1:ksv+krr)=prrs(:,:,:)
561zworksfsv(:,:)=0.
562zworkwsv(:,:,:)=0.
563zworksfsv(:,1:ksv)=psfsv(:,:)
564!
565!----------------------------------------------------------------------------
566!
567!* 2. COMPUTE CONSERVATIVE VARIABLES AND RELATED QUANTITIES
568! -----------------------------------------------------
569!
570!* 2.1 Cph at t
571!
572!$acc kernels present_cr(ZCOEF_DISS,ZTHLM,ZRM,zcp)
573!$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
574zcp(iijb:iije,1:ikt)=cst%XCPD
575!
576IF (krr > 0) zcp(iijb:iije,1:ikt) = zcp(iijb:iije,1:ikt) + cst%XCPV * prt(iijb:iije,1:ikt,1)
577!$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
578! PGI20.5 BUG or reproductibility problem , with pointer this loop on JRR parallelize whitout reduction
579!$acc loop seq
580DO jrr = 2,1+krrl ! loop on the liquid components
581 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT,OPENACC='gang')
582 zcp(iijb:iije,1:ikt) = zcp(iijb:iije,1:ikt) + cst%XCL * prt(iijb:iije,1:ikt,jrr)
583 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
584END DO
585!
586!$acc loop seq
587DO jrr = 2+krrl,1+krrl+krri ! loop on the solid components
588 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT,OPENACC='gang')
589 zcp(iijb:iije,1:ikt) = zcp(iijb:iije,1:ikt) + cst%XCI * prt(iijb:iije,1:ikt,jrr)
590 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
591END DO
592!
593!* 2.2 Exner function at t
594!
595IF (gocean) THEN
596 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
597 zexn(iijb:iije,1:ikt) = 1.
598 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
599ELSE
600 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
601 zexn(iijb:iije,1:ikt) = (ppabst(iijb:iije,1:ikt)/cst%XP00) ** (cst%XRD/cst%XCPD)
602 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
603END IF
604!
605!* 2.3 dissipative heating coeff a t
606!
607!$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
608zcoef_diss(iijb:iije,1:ikt) = 1/(zcp(iijb:iije,1:ikt) * zexn(iijb:iije,1:ikt))
609zfrac_ice(iijb:iije,1:ikt) = 0.0
610zatheta(iijb:iije,1:ikt) = 0.0
611zamoist(iijb:iije,1:ikt) = 0.0
612!$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
613!$acc end kernels
614!
615IF (krrl >=1) THEN
616 !
617 !* 2.4 Temperature at t
618 !
619 !$acc kernels present_cr(ZT)
620 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
621 zt(iijb:iije,1:ikt) = pthlt(iijb:iije,1:ikt) * zexn(iijb:iije,1:ikt)
622 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
623 !$acc end kernels
624 !
625 !* 2.5 Lv/Cph/Exn
626 !
627 IF ( krri >= 1 ) THEN
628 IF (nebn%LSTATNW) THEN
629 !wc call new functions depending on statnew
630 CALL compute_function_thermo_new_stat(d, cst, cst%XALPW,cst%XBETAW,cst%XGAMW,cst%XLVTT,cst%XCL,zt,zexn,zcp, &
631 zlvocpexnm,zamoist,zatheta, ppabst)
632 CALL compute_function_thermo_new_stat(d, cst, cst%XALPI,cst%XBETAI,cst%XGAMI,cst%XLSTT,cst%XCI,zt,zexn,zcp, &
633 zlsocpexnm,zamoist_ice,zatheta_ice, ppabst)
634 ELSE
635 CALL compute_function_thermo(d,cst,cst%XALPW,cst%XBETAW,cst%XGAMW,cst%XLVTT,cst%XCL,zt,zexn,zcp, &
636 zlvocpexnm,zamoist,zatheta,prt,ppabst,krr)
637 CALL compute_function_thermo(d,cst,cst%XALPI,cst%XBETAI,cst%XGAMI,cst%XLSTT,cst%XCI,zt,zexn,zcp, &
638 zlsocpexnm,zamoist_ice,zatheta_ice,prt,ppabst,krr)
639 ENDIF
640 !
641!$acc kernels present_cr( zamoist, zatheta, zlocpexnm, zlvocpexnm, zlsocpexnm, zamoist_ice, zatheta_ice )
642 !$mnh_expand_where(JIJ=IIJB:IIJE,JK=1:IKT)
643 WHERE(prt(iijb:iije,1:ikt,2)+prt(iijb:iije,1:ikt,4)>0.0)
644 zfrac_ice(iijb:iije,1:ikt) = prt(iijb:iije,1:ikt,4) / ( prt(iijb:iije,1:ikt,2) &
645 +prt(iijb:iije,1:ikt,4) )
646 END WHERE
647 !$mnh_end_expand_where(JIJ=IIJB:IIJE,JK=1:IKT)
648 !
649 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
650 zlocpexnm(iijb:iije,1:ikt) = (1.0-zfrac_ice(iijb:iije,1:ikt))*zlvocpexnm(iijb:iije,1:ikt) &
651 +zfrac_ice(iijb:iije,1:ikt) *zlsocpexnm(iijb:iije,1:ikt)
652 zamoist(iijb:iije,1:ikt) = (1.0-zfrac_ice(iijb:iije,1:ikt))*zamoist(iijb:iije,1:ikt) &
653 +zfrac_ice(iijb:iije,1:ikt) *zamoist_ice(iijb:iije,1:ikt)
654 zatheta(iijb:iije,1:ikt) = (1.0-zfrac_ice(iijb:iije,1:ikt))*zatheta(iijb:iije,1:ikt) &
655 +zfrac_ice(iijb:iije,1:ikt) *zatheta_ice(iijb:iije,1:ikt)
656 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
657!$acc end kernels
658 ELSE
659 !wc call new stat functions or not
660 IF (nebn%LSTATNW) THEN
661 CALL compute_function_thermo_new_stat(d,cst,cst%XALPW,cst%XBETAW,cst%XGAMW,cst%XLVTT,cst%XCL,zt,zexn,zcp, &
662 zlocpexnm,zamoist,zatheta,ppabst)
663 ELSE
664 CALL compute_function_thermo(d,cst,cst%XALPW,cst%XBETAW,cst%XGAMW,cst%XLVTT,cst%XCL,zt,zexn,zcp, &
665 zlocpexnm,zamoist,zatheta,prt,ppabst,krr)
666 ENDIF
667 END IF
668 !
669 !
670 IF ( tpfile%LOPENED .AND. turbn%LTURB_DIAG ) THEN
671!$acc update self(ZAMOIST,ZATHETA)
672 tzfield = tfieldmetadata( &
673 cmnhname = 'ATHETA', &
674 cstdname = '', &
675 clongname = 'ATHETA', &
676 cunits = 'm', &
677 cdir = 'XY', &
678 ccomment = 'X_Y_Z_ATHETA', &
679 ngrid = 1, &
680 ntype = typereal, &
681 ndims = 3, &
682 ltimedep = .true. )
683 CALL io_field_write_phy(d,tpfile,tzfield,zatheta)
684 !
685 tzfield = tfieldmetadata( &
686 cmnhname = 'AMOIST', &
687 cstdname = '', &
688 clongname = 'AMOIST', &
689 cunits = 'm', &
690 cdir = 'XY', &
691 ccomment = 'X_Y_Z_AMOIST', &
692 ngrid = 1, &
693 ntype = typereal, &
694 ndims = 3, &
695 ltimedep = .true. )
696 CALL io_field_write_phy(d,tpfile,tzfield,zamoist)
697 END IF
698 !
699ELSE
700!$acc kernels present_cr( zlocpexnm )
701 zlocpexnm(iijb:iije,1:ikt)=0.
702!$acc end kernels
703END IF ! loop end on KRRL >= 1
704!
705! computes conservative variables
706!
707!$acc update device(PRRS,PRTHLS)
708IF ( krrl >= 1 ) THEN
709!$acc kernels present_cr( zlocpexnm )
710 IF ( krri >= 1 ) THEN
711 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
712 ! Rnp at t
713 prt(iijb:iije,1:ikt,1) = prt(iijb:iije,1:ikt,1) + prt(iijb:iije,1:ikt,2) &
714 + prt(iijb:iije,1:ikt,4)
715 prrs(iijb:iije,1:ikt,1) = prrs(iijb:iije,1:ikt,1) + prrs(iijb:iije,1:ikt,2) &
716 + prrs(iijb:iije,1:ikt,4)
717 ! Theta_l at t
718 pthlt(iijb:iije,1:ikt) = pthlt(iijb:iije,1:ikt) - zlvocpexnm(iijb:iije,1:ikt) &
719 * prt(iijb:iije,1:ikt,2) &
720 - zlsocpexnm(iijb:iije,1:ikt) * prt(iijb:iije,1:ikt,4)
721 prthls(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) - zlvocpexnm(iijb:iije,1:ikt) &
722 * prrs(iijb:iije,1:ikt,2) &
723 - zlsocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt,4)
724 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
725 ELSE
726 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
727 ! Rnp at t
728 prt(iijb:iije,1:ikt,1) = prt(iijb:iije,1:ikt,1) + prt(iijb:iije,1:ikt,2)
729 prrs(iijb:iije,1:ikt,1) = prrs(iijb:iije,1:ikt,1) + prrs(iijb:iije,1:ikt,2)
730 ! Theta_l at t
731 pthlt(iijb:iije,1:ikt) = pthlt(iijb:iije,1:ikt) - zlocpexnm(iijb:iije,1:ikt) &
732 * prt(iijb:iije,1:ikt,2)
733 prthls(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) - zlocpexnm(iijb:iije,1:ikt) &
734 * prrs(iijb:iije,1:ikt,2)
735 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
736 END IF
737!$acc end kernels
738END IF
739!
740!* stores value of conservative variables & wind before turbulence tendency (AROME diag)
741IF(PRESENT(pdrus_turb)) THEN
742 pdrus_turb(:,:) = prus(:,:)
743 pdrvs_turb(:,:) = prvs(:,:)
744 pdrthls_turb(:,:) = prthls(:,:)
745 pdrrts_turb(:,:) = prrs(:,:,1)
746 pdrsvs_turb(:,:,:) = prsvs(:,:,:)
747END IF
748!
749IF(PRESENT(pturb_spp)) THEN
750 zturb_spp(:,:,:) = pturb_spp(:,:,:)
751ELSE
752 zturb_spp(:,:,nctp) = turbn%XCTP
753 zturb_spp(:,:,nctv) = turbn%XCTV
754 zturb_spp(:,:,ncht1) = turbn%XCHT1
755 zturb_spp(:,:,ncht2) = turbn%XCHT2
756 zturb_spp(:,:,ncshf) = turbn%XCSHF
757 zturb_spp(:,:,nchf) = turbn%XCHF
758 zturb_spp(:,:,ncpr3) = csturb%XCPR3
759 zturb_spp(:,:,ncpr4) = csturb%XCPR4
760 zturb_spp(:,:,ncpr5) = csturb%XCPR5
761 zturb_spp(:,:,ncep) = csturb%XCEP
762 zturb_spp(:,:,ncmfs) = csturb%XCMFS
763 zturb_spp(:,:,nced) = turbn%XCED
764 zturb_spp(:,:,nbl89exp) = turbn%XBL89EXP
765 zturb_spp(:,:,nusrbl89) = turbn%XUSRBL89
766END IF
767!
768!----------------------------------------------------------------------------
769!
770!* 3. MIXING LENGTH : SELECTION AND COMPUTATION
771! -----------------------------------------
772!
773!
774IF (.NOT. turbn%LHARAT) THEN
775
776SELECT CASE (turbn%CTURBLEN)
777 !
778 !* 3.1 BL89 mixing length
779 ! ------------------
780
781 CASE ('BL89')
782!$acc kernels present_cr(ZSHEAR)
783 zshear(:,:)=0.
784!$acc end kernels
785 CALL bl89(d,cst,csturb,turbn,pzz,pdzz,pthvref,zthlm,krr,zrm,ptket,zshear,zlm,gocean,zturb_spp)
786 !
787 !* 3.2 RM17 mixing length
788 ! ------------------
789 CASE ('RM17')
790 zwork1=gz_u_uw(put,pdzz)
791 zwork2=mzf(zwork1)
792 zdudz=mxf(zwork2)
793 !
794 zwork1=gz_v_vw(pvt,pdzz)
795 zwork2=mzf(zwork1)
796 zdvdz=myf(zwork2)
797 !
798 !$acc kernels
799 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
800 zshear(iijb:iije,1:ikt) = sqrt(zdudz(iijb:iije,1:ikt)*zdudz(iijb:iije,1:ikt) &
801 + zdvdz(iijb:iije,1:ikt)*zdvdz(iijb:iije,1:ikt))
802 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
803 !$acc end kernels
804 CALL bl89(d,cst,csturb,turbn,pzz,pdzz,pthvref,zthlm,krr,zrm,ptket,zshear,zlm,gocean,zturb_spp)
805 !
806 !* 3.3 Grey-zone combined RM17 & Deardorff mixing lengths
807 ! --------------------------------------------------
808
809 CASE ('HM21')
810 zwork1=gz_u_uw(put,pdzz)
811 zwork2=mzf(zwork1)
812 zdudz=mxf(zwork2)
813 !
814 zwork1=gz_v_vw(pvt,pdzz)
815 zwork2=mzf(zwork1)
816 zdvdz=myf(zwork2)
817 !
818 !$acc kernels present_cr( ZSHEAR, ZDUDZ, ZDVDZ)
819 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
820 zshear(iijb:iije,1:ikt) = sqrt(zdudz(iijb:iije,1:ikt)*zdudz(iijb:iije,1:ikt) &
821 + zdvdz(iijb:iije,1:ikt)*zdvdz(iijb:iije,1:ikt))
822 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
823 !$acc end kernels
824 CALL bl89(d,cst,csturb,turbn,pzz,pdzz,pthvref,zthlm,krr,zrm,ptket,zshear,zlm,gocean,zturb_spp)
825
826 CALL delt(d, turbn, o2d, .false., gocean, pzz, pdyy, pdxx, pdircoszw, zlmw)
827 ! The minimum mixing length is chosen between Horizontal grid mesh (not taking into account the vertical grid mesh) and RM17.
828 ! For large horizontal grid meshes, this is equal to RM17
829 ! For LES grid meshes, this is equivalent to Deardorff : the base mixing lentgh is the horizontal grid mesh,
830 !and it is limited by a stability-based length (RM17), as was done in Deardorff length (but taking into account shear as well)
831 ! For grid meshes in the grey zone, then this is the smaller of the two.
832 !
833 !$acc kernels present_cr(ZLM, ZLMW)
834 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
835 zlm(iijb:iije,1:ikt) = min(zlm(iijb:iije,1:ikt),turbn%XCADAP*zlmw(iijb:iije,1:ikt))
836 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
837 !$acc end kernels
838 !
839 !* 3.4 Delta mixing length
840 ! -------------------
841 !
842 CASE ('DELT')
843 CALL delt(d, turbn, o2d, .true., gocean, pzz, pdyy, pdxx, pdircoszw, zlm)
844 !
845 !* 3.5 Deardorff mixing length
846 ! -----------------------
847 !
848 CASE ('DEAR')
849 CALL dear(d, cst, turbn, krr, krri, o2d, ocompute_src, gocean, &
850 & zlm, prt, pdzz, pzz, ptket, pthvref, &
851 & pthlt, zlocpexnm, psrct, zamoist, pdircoszw, &
852 & pdxx, pdyy, zatheta)
853 !
854 !* 3.6 Blackadar mixing length
855 ! -----------------------
856 !
857 CASE ('BLKR')
858 !$acc kernels
859 zl0 = 100.
860 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
861 zlm(iijb:iije,1:ikt) = zl0
862 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
863
864 zalpha=0.5**(-1.5)
865 !$acc end kernels
866 !
867 !$acc kernels
868 DO jk=iktb,ikte
869 !$mnh_expand_array(JIJ=IIJB:IIJE)
870 zlm(iijb:iije,jk) = ( 0.5*(pzz(iijb:iije,jk)+pzz(iijb:iije,jk+ikl)) - &
871 & pzz(iijb:iije,ika+jpvext_turb*ikl) ) * pdircoszw(iijb:iije)
872 zlm(iijb:iije,jk) = zalpha * zlm(iijb:iije,jk) * zl0 / ( zl0 + zalpha*zlm(iijb:iije,jk) )
873 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
874 END DO
875 !$acc end kernels
876 !
877 !$acc kernels
878 !$mnh_expand_array(JIJ=IIJB:IIJE)
879 zlm(iijb:iije,iktb-1) = zlm(iijb:iije,iktb)
880 zlm(iijb:iije,ikte+1) = zlm(iijb:iije,ikte)
881 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
882 !$acc end kernels
883 !
884END SELECT
885!
886!* 3.5 Mixing length modification for cloud
887! -----------------------
888IF (ocloudmodiflm) CALL cloud_modif_lm(d, cst, csturb, turbn, tpfile, tzfield, krr, krri, &
889 & ocloudmodiflm, gocean, ocompute_src, o2d, hturblen_cl, &
890 & pdzz, pdxx, pdyy, pzz, &
891 & prt, ptket, pthlt, zthlm, zrm, pthvref, &
892 & zlocpexnm, psrct, pcoef_ampl_sat, zamoist, zatheta, pdircoszw, &
893 & pcei, pcei_min, pcei_max, zlm, zturb_spp)
894ENDIF ! end LHARRAT
895
896!
897!* 3.6 Dissipative length
898! ------------------
899
900IF (turbn%LHARAT) THEN
901 !$acc kernels
902 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
903 zleps(iijb:iije,1:ikt)=plengthm(iijb:iije,1:ikt)*(3.75**2.)
904 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
905 !$acc end kernels
906ELSE
907 !$acc kernels
908 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
909 zleps(iijb:iije,1:ikt)=zlm(iijb:iije,1:ikt)
910 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
911 !$acc end kernels
912ENDIF
913!
914!* 3.7 Correction in the Surface Boundary Layer (Redelsperger 2001)
915! ----------------------------------------
916!
917!$acc kernels
918!$mnh_expand_array(JIJ=IIJB:IIJE)
919zlmo(iijb:iije)=xundef
920!$mnh_end_expand_array(JIJ=IIJB:IIJE)
921!$acc end kernels
922IF (turbn%LRMC01) THEN
923!$acc kernels
924 !$mnh_expand_array(JIJ=IIJB:IIJE)
925 zustar(iijb:iije)=(psfu(iijb:iije)**2+psfv(iijb:iije)**2)**(0.25)
926 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
927!$acc end kernels
928 IF (krr>0) THEN
929 CALL lmo(d,cst,zustar,zthlm(:,ikb),zrm(:,ikb,1),psfth,psfrv,zlmo)
930 ELSE
931 !$acc kernels
932 zrvm(:)=0.
933 zsfrv(:)=0.
934 !$acc end kernels
935 CALL lmo(d,cst,zustar,zthlm(:,ikb),zrvm,psfth,zsfrv,zlmo)
936 END IF
937 CALL rmc01(d,cst,csturb,turbn,pzz,pdxx,pdyy,pdzz,pdircoszw,psbl_depth,zlmo,zturb_spp,zlm,zleps)
938END IF
939!
940!RMC01 is only applied on RM17 in HM21
941IF (turbn%CTURBLEN=='HM21') THEN
942!$acc kernels
943 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
944 zleps(iijb:iije,1:ikt) = min(zleps(iijb:iije,1:ikt),zlmw(iijb:iije,1:ikt)*turbn%XCADAP)
945 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
946!$acc end kernels
947END IF
948!
949!* 3.8 Mixing length in external points (used if TURBN%CTURBDIM="3DIM")
950! ----------------------------------------------------------
951!
952IF (turbn%CTURBDIM=="3DIM") THEN
953 CALL update_lm(d,hlbcx,hlbcy,zlm,zleps)
954END IF
955!
956!* 3.9 Mixing length correction if immersed walls
957! ------------------------------------------
958!
959IF (oibm) THEN
960 CALL ibm_mixinglength(d,zlm,zleps,pibm_xmut,pibm_ls,ptket)
961ENDIF
962!----------------------------------------------------------------------------
963!
964!* 4. GO INTO THE AXES FOLLOWING THE SURFACE
965! --------------------------------------
966!
967!
968!* 4.1 rotate the wind at time t
969!
970!
971!
972IF (turbn%LROTATE_WIND) THEN
973 CALL rotate_wind(d,put,pvt,pwt, &
974 pdircosxw, pdircosyw, pdircoszw, &
975 pcosslope,psinslope, &
976 pdxx,pdyy,pdzz, &
977 zuslope,zvslope )
978 !
979 CALL update_rotate_wind(d,zuslope,zvslope,hlbcx,hlbcy)
980ELSE
981!$acc kernels present_cr(ZUSLOPE,ZVSLOPE)
982 zuslope(iijb:iije)=put(iijb:iije,ika)
983 zvslope(iijb:iije)=pvt(iijb:iije,ika)
984!$acc end kernels
985END IF
986IF (gocean) THEN
987!$acc kernels present_cr(ZUSLOPE,ZVSLOPE)
988 zuslope(iijb:iije)=put(iijb:iije,iku-1)
989 zvslope(iijb:iije)=pvt(iijb:iije,iku-1)
990!$acc end kernels
991END IF
992!
993! relative wind over ocean
994!$mnh_expand_array(JIJ=IIJB:IIJE)
995zuslope(iijb:iije)=zuslope(iijb:iije)-psea_ucu(iijb:iije)
996zvslope(iijb:iije)=zvslope(iijb:iije)-psea_vcu(iijb:iije)
997!$mnh_end_expand_array(JIJ=IIJB:IIJE)
998
999!
1000!* 4.2 compute the proportionality coefficient between wind and stress
1001!
1002!$acc kernels
1003!$mnh_expand_array(JIJ=IIJB:IIJE)
1004zcdueff(iijb:iije) =-sqrt( (psfu(iijb:iije)**2 + psfv(iijb:iije)**2) / &
1005 (cst%XMNH_TINY + zuslope(iijb:iije)**2 + zvslope(iijb:iije)**2 ) )
1006!$mnh_end_expand_array(JIJ=IIJB:IIJE)
1007!$acc end kernels
1008!
1009!* 4.6 compute the surface tangential fluxes
1010!
1011!$acc kernels present_cr(ZTAU22M,ZTAU33M)
1012IF (gocean) THEN
1013 ztau11m(iijb:iije)=0.
1014ELSE
1015 !$mnh_expand_array(JIJ=IIJB:IIJE)
1016 ztau11m(iijb:iije) =2./3.*( (1.+ (pzz(iijb:iije,ikb+ikl)-pzz(iijb:iije,ikb)) &
1017 /(pdzz(iijb:iije,ikb+ikl)+pdzz(iijb:iije,ikb)) &
1018 ) *ptket(iijb:iije,ikb) &
1019 -0.5 *ptket(iijb:iije,ikb+ikl) &
1020 )
1021 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
1022END IF
1023ztau12m(iijb:iije) =0.0
1024ztau22m(iijb:iije) =ztau11m(iijb:iije)
1025ztau33m(iijb:iije) =ztau11m(iijb:iije)
1026!
1027!* 4.7 third order terms in temperature and water fluxes and correlations
1028! ------------------------------------------------------------------
1029!
1030!
1031zmwth(:,:) = 0. ! w'2th'
1032zmwr(:,:) = 0. ! w'2r'
1033zmth2(:,:) = 0. ! w'th'2
1034zmr2(:,:) = 0. ! w'r'2
1035zmthr(:,:) = 0. ! w'th'r'
1036!$acc end kernels
1037!
1038IF (turbn%CTOM=='TM06') THEN
1039 CALL tm06(d,turbn,cst,pthvref,pbl_depth,pzz,psfth,zmwth,zmth2)
1040 !
1041 zwork1=gz_m_w(zmwth,pdzz) ! -d(w'2th' )/dz
1042 zwork2=gz_w_m(zmth2,pdzz) ! -d(w'th'2 )/dz
1043 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1044 zfwth(iijb:iije,1:ikt) = -zwork1(iijb:iije,1:ikt)
1045 zfth2(iijb:iije,1:ikt) = -zwork2(iijb:iije,1:ikt)
1046 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1047 !
1048 zfwth(:,ikte:) = 0.
1049 zfwth(:,:iktb) = 0.
1050 zfwr(:,:) = 0.
1051 zfth2(:,ikte:) = 0.
1052 zfth2(:,:iktb) = 0.
1053 zfr2(:,:) = 0.
1054 zfthr(:,:) = 0.
1055ELSE
1056!$acc kernels present_cr(ZFWTH,ZFWR,ZFTH2,ZFR2,ZFTHR)
1057 zfwth(:,:) = 0.
1058 zfwr(:,:) = 0.
1059 zfth2(:,:) = 0.
1060 zfr2(:,:) = 0.
1061 zfthr(:,:) = 0.
1062!$acc end kernels
1063ENDIF
1064!
1065!----------------------------------------------------------------------------
1066!
1067!* 5. TURBULENT SOURCES
1068! -----------------
1069!
1070IF( buconf%LBUDGET_U ) CALL tbudgets(nbudget_u )%PTR%INIT_PHY(d, 'VTURB', prus )
1071IF( buconf%LBUDGET_V ) CALL tbudgets(nbudget_v )%PTR%INIT_PHY(d, 'VTURB', prvs )
1072IF( buconf%LBUDGET_W ) CALL tbudgets(nbudget_w )%PTR%INIT_PHY(d, 'VTURB', prws )
1073
1074IF( buconf%LBUDGET_TH ) THEN
1075 IF( krri >= 1 .AND. krrl >= 1 ) THEN
1076 !$acc kernels present_cr(ZTEMP_BUD)
1077 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1078 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlvocpexnm(iijb:iije,1:ikt) * &
1079 & prrs(iijb:iije,1:ikt, 2) + zlsocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt, 4)
1080 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1081 !$acc end kernels
1082 CALL tbudgets(nbudget_th)%PTR%INIT_PHY(d, 'VTURB', ztemp_bud )
1083 ELSE IF( krrl >= 1 ) THEN
1084 !$acc kernels present_cr(ZTEMP_BUD, ZLOCPEXNM)
1085 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1086 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt, 2)
1087 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1088 !$acc end kernels
1089 CALL tbudgets(nbudget_th)%PTR%INIT_PHY(d, 'VTURB', ztemp_bud )
1090 ELSE
1091 CALL tbudgets(nbudget_th)%PTR%INIT_PHY(d, 'VTURB', prthls )
1092 END IF
1093END IF
1094
1095IF( buconf%LBUDGET_RV ) THEN
1096 IF( krri >= 1 .AND. krrl >= 1 ) THEN
1097 !$acc kernels present_cr(ZTEMP_BUD)
1098 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1099 ztemp_bud(iijb:iije,1:ikt) = prrs(iijb:iije,1:ikt, 1) - prrs(iijb:iije,1:ikt, 2) - prrs(iijb:iije,1:ikt, 4)
1100 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1101 !$acc end kernels
1102 CALL tbudgets(nbudget_rv)%PTR%INIT_PHY(d, 'VTURB', ztemp_bud )
1103 ELSE IF( krrl >= 1 ) THEN
1104 !$acc kernels present_cr(ZTEMP_BUD)
1105 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1106 ztemp_bud(iijb:iije,1:ikt) = prrs(iijb:iije,1:ikt, 1) - prrs(iijb:iije,1:ikt, 2)
1107 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1108 !$acc end kernels
1109 CALL tbudgets(nbudget_rv)%PTR%INIT_PHY(d, 'VTURB', ztemp_bud )
1110 ELSE
1111 CALL tbudgets(nbudget_rv)%PTR%INIT_PHY(d, 'VTURB', prrs(:,:, 1) )
1112 END IF
1113END IF
1114
1115IF( buconf%LBUDGET_RC ) CALL tbudgets(nbudget_rc)%PTR%INIT_PHY(d, 'VTURB', prrs(:,:, 2) )
1116IF( buconf%LBUDGET_RI ) CALL tbudgets(nbudget_ri)%PTR%INIT_PHY(d, 'VTURB', prrs(:,:, 4) )
1117
1118IF( buconf%LBUDGET_SV ) THEN
1119 DO jsv = 1, ksv
1120 CALL tbudgets(nbudget_sv1 - 1 + jsv)%PTR%INIT_PHY(d, 'VTURB', zworks(:,:, jsv) )
1121 END DO
1122END IF
1123!$acc update device(PRHODJ)
1124!$acc update_crm device(PRUS,PRVS,PRWS,PRSVS)
1125CALL turb_ver(d,cst,csturb,turbn,nebn,tles, &
1126 krr,krrl,krri,kgradientsleo, &
1127 gocean, odeepoc, ocompute_src, &
1128 isv,ksv_lgbeg,ksv_lgend, &
1129 zexpl, o2d, onomixlg, oflat, &
1130 ocouples,oblowsnow,oflyer, prsnow, &
1131 ptstep,tpfile, &
1132 pdxx,pdyy,pdzz,pdzx,pdzy,pdircoszw,pzz, &
1133 pcosslope,psinslope, &
1134 prhodj,pthvref,psfu,psfv, &
1135 psfth,psfrv,zworksfsv,psfth,psfrv,zworksfsv, &
1136 zcdueff,ztau11m,ztau12m,ztau33m, &
1137 psea_ucu,psea_vcu, &
1138 put,pvt,pwt,zuslope,zvslope,pthlt,prt,zworkt, &
1139 ptket,zlm,plengthm,plengthh,zleps,mfmoist, &
1140 zlocpexnm,zatheta,zamoist,psrct,zfrac_ice, &
1141 zfwth,zfwr,zfth2,zfr2,zfthr,pbl_depth, &
1142 psbl_depth,zlmo,phgradleo,pzs, &
1143 prus,prvs,prws,prthls,prrs,zworks, &
1144 pdp,ptp,psigs,pwth,pwrc,zworkwsv, &
1145 psstfl, psstfl_c, pssrfl_c,pssufl_c,pssvfl_c, &
1146 pssufl,pssvfl,zturb_spp )
1147!$acc update_crm self(PWTH,PWRC,PWSV)
1148
1149IF (turbn%LTURB_PRECIP) THEN
1150 IF( buconf%LBUDGET_RR ) CALL tbudgets(nbudget_rr)%PTR%INIT_PHY(d, 'VTURB', prrs(:,:, 3) )
1151 IF( buconf%LBUDGET_RS ) CALL tbudgets(nbudget_rs)%PTR%INIT_PHY(d, 'VTURB', prrs(:,:, 5) )
1152 IF( buconf%LBUDGET_RG ) CALL tbudgets(nbudget_rg)%PTR%INIT_PHY(d, 'VTURB', prrs(:,:, 6) )
1153 IF( buconf%LBUDGET_RH .AND. krr ==7) CALL tbudgets(nbudget_rh)%PTR%INIT_PHY(d, 'VTURB', prrs(:,:, 7) )
1154 IF (krr.GE.3) prrs(iijb:iije,1:ikt,3)=zworks(iijb:iije,1:ikt,ksv+3)
1155 IF (krr.GE.5) prrs(iijb:iije,1:ikt,5)=zworks(iijb:iije,1:ikt,ksv+5)
1156 IF (krr.GE.6) prrs(iijb:iije,1:ikt,6)=zworks(iijb:iije,1:ikt,ksv+6)
1157 IF (krr.GE.7) prrs(iijb:iije,1:ikt,7)=zworks(iijb:iije,1:ikt,ksv+7)
1158 IF( buconf%LBUDGET_RR ) CALL tbudgets(nbudget_rr)%PTR%END_PHY(d, 'VTURB', prrs(:,:, 3) )
1159 IF( buconf%LBUDGET_RS ) CALL tbudgets(nbudget_rs)%PTR%END_PHY(d, 'VTURB', prrs(:,:, 5) )
1160 IF( buconf%LBUDGET_RG ) CALL tbudgets(nbudget_rg)%PTR%END_PHY(d, 'VTURB', prrs(:,:, 6) )
1161 IF( buconf%LBUDGET_RH .AND. krr ==7) CALL tbudgets(nbudget_rh)%PTR%END_PHY(d, 'VTURB', prrs(:,:, 7) )
1162END IF
1163
1164IF( buconf%LBUDGET_U ) CALL tbudgets(nbudget_u)%PTR%END_PHY(d, 'VTURB', prus )
1165IF( buconf%LBUDGET_V ) CALL tbudgets(nbudget_v)%PTR%END_PHY(d, 'VTURB', prvs )
1166IF( buconf%LBUDGET_W ) CALL tbudgets(nbudget_w)%PTR%END_PHY(d, 'VTURB', prws )
1167
1168IF( buconf%LBUDGET_TH ) THEN
1169 IF( krri >= 1 .AND. krrl >= 1 ) THEN
1170 !$acc kernels present_cr(ZTEMP_BUD)
1171 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1172 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlvocpexnm(iijb:iije,1:ikt) * &
1173 & prrs(iijb:iije,1:ikt, 2) + zlsocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt, 4)
1174 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1175 !$acc end kernels
1176 CALL tbudgets(nbudget_th)%PTR%END_PHY(d, 'VTURB', ztemp_bud )
1177 ELSE IF( krrl >= 1 ) THEN
1178 !$acc kernels present_cr(ZTEMP_BUD, ZLOCPEXNM)
1179 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1180 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt, 2)
1181 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1182 !$acc end kernels
1183 CALL tbudgets(nbudget_th)%PTR%END_PHY(d, 'VTURB', ztemp_bud )
1184 ELSE
1185 CALL tbudgets(nbudget_th)%PTR%END_PHY(d, 'VTURB', prthls )
1186 END IF
1187END IF
1188
1189IF( buconf%LBUDGET_RV ) THEN
1190 IF( krri >= 1 .AND. krrl >= 1 ) THEN
1191 !$acc kernels present_cr(ZTEMP_BUD)
1192 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1193 ztemp_bud(iijb:iije,1:ikt) = prrs(iijb:iije,1:ikt, 1) - prrs(iijb:iije,1:ikt, 2) - prrs(iijb:iije,1:ikt, 4)
1194 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1195 !$acc end kernels
1196 CALL tbudgets(nbudget_rv)%PTR%END_PHY(d, 'VTURB', ztemp_bud )
1197 ELSE IF( krrl >= 1 ) THEN
1198 !$acc kernels present_cr(ZTEMP_BUD)
1199 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1200 ztemp_bud(iijb:iije,1:ikt) = prrs(iijb:iije,1:ikt, 1) - prrs(iijb:iije,1:ikt, 2)
1201 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1202 !$acc end kernels
1203 CALL tbudgets(nbudget_rv)%PTR%END_PHY(d, 'VTURB', ztemp_bud)
1204 ELSE
1205 CALL tbudgets(nbudget_rv)%PTR%END_PHY(d, 'VTURB', prrs(:,:, 1) )
1206 END IF
1207END IF
1208
1209IF( buconf%LBUDGET_RC ) CALL tbudgets(nbudget_rc)%PTR%END_PHY(d, 'VTURB', prrs(:,:, 2) )
1210IF( buconf%LBUDGET_RI ) CALL tbudgets(nbudget_ri)%PTR%END_PHY(d, 'VTURB', prrs(:,:, 4) )
1211
1212IF( buconf%LBUDGET_SV ) THEN
1213 DO jsv = 1, ksv
1214 CALL tbudgets(nbudget_sv1 - 1 + jsv)%PTR%END_PHY(d, 'VTURB', zworks(:,:, jsv) )
1215 END DO
1216END IF
1217!
1218IF( turbn%CTURBDIM == '3DIM' ) THEN
1219 IF( buconf%LBUDGET_U ) CALL tbudgets(nbudget_u)%PTR%INIT_PHY(d, 'HTURB', prus )
1220 IF( buconf%LBUDGET_V ) CALL tbudgets(nbudget_v)%PTR%INIT_PHY(d, 'HTURB', prvs )
1221 IF( buconf%LBUDGET_W ) CALL tbudgets(nbudget_w)%PTR%INIT_PHY(d, 'HTURB', prws )
1222
1223 IF(buconf%LBUDGET_TH) THEN
1224 IF( krri >= 1 .AND. krrl >= 1 ) THEN
1225 !$acc kernels present_cr(ZTEMP_BUD)
1226 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1227 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlvocpexnm(iijb:iije,1:ikt) * &
1228 & prrs(iijb:iije,1:ikt, 2) + zlsocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt, 4)
1229 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1230 !$acc end kernels
1231 CALL tbudgets(nbudget_th)%PTR%INIT_PHY(d, 'HTURB', ztemp_bud )
1232 ELSE IF( krrl >= 1 ) THEN
1233 !$acc kernels present_cr(ZTEMP_BUD)
1234 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1235 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt, 2)
1236 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1237 !$acc end kernels
1238 CALL tbudgets(nbudget_th)%PTR%INIT_PHY(d, 'HTURB', ztemp_bud )
1239 ELSE
1240 CALL tbudgets(nbudget_th)%PTR%INIT_PHY(d, 'HTURB', prthls )
1241 END IF
1242 END IF
1243
1244 IF( buconf%LBUDGET_RV ) THEN
1245 IF( krri >= 1 .AND. krrl >= 1 ) THEN
1246 !$acc kernels present_cr(ZTEMP_BUD)
1247 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1248 ztemp_bud(iijb:iije,1:ikt) = prrs(iijb:iije,1:ikt, 1) - prrs(iijb:iije,1:ikt, 2) - prrs(iijb:iije,1:ikt, 4)
1249 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1250 !$acc end kernels
1251 CALL tbudgets(nbudget_rv)%PTR%INIT_PHY(d, 'HTURB', ztemp_bud )
1252 ELSE IF( krrl >= 1 ) THEN
1253 !$acc kernels present_cr(ZTEMP_BUD)
1254 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1255 ztemp_bud(iijb:iije,1:ikt) = prrs(iijb:iije,1:ikt, 1) - prrs(iijb:iije,1:ikt, 2)
1256 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1257 !$acc end kernels
1258 CALL tbudgets(nbudget_rv)%PTR%INIT_PHY(d, 'HTURB', ztemp_bud )
1259 ELSE
1260 CALL tbudgets(nbudget_rv)%PTR%INIT_PHY(d, 'HTURB', prrs(:,:, 1) )
1261 END IF
1262 END IF
1263
1264 IF( buconf%LBUDGET_RC ) CALL tbudgets(nbudget_rc)%PTR%INIT_PHY(d, 'HTURB', prrs(:,:, 2) )
1265 IF( buconf%LBUDGET_RI ) CALL tbudgets(nbudget_ri)%PTR%INIT_PHY(d, 'HTURB', prrs(:,:, 4) )
1266
1267 IF( buconf%LBUDGET_SV ) THEN
1268 DO jsv = 1, ksv
1269 CALL tbudgets(nbudget_sv1 - 1 + jsv)%PTR%INIT_PHY(d, 'HTURB', zworks(:,:, jsv) )
1270 END DO
1271 END IF
1272 CALL turb_hor_splt(d,cst,csturb, turbn, nebn, tles, &
1273 ksplit, krr, krrl, krri, isv,ksv_lgbeg,ksv_lgend, &
1274 ptstep,hlbcx,hlbcy, oflat,o2d, onomixlg, &
1275 gocean,ocompute_src,oblowsnow,prsnow, &
1276 tpfile, khalo, &
1277 pdxx,pdyy,pdzz,pdzx,pdzy,pzz, &
1278 pdircosxw,pdircosyw,pdircoszw, &
1279 pcosslope,psinslope, &
1280 prhodj,pthvref, &
1281 psfth,psfrv,zworksfsv, &
1282 zcdueff,ztau11m,ztau12m,ztau22m,ztau33m, &
1283 put,pvt,pwt,zuslope,zvslope,pthlt,prt,zworkt, &
1284 ptket,zlm,zleps, &
1285 zlocpexnm,zatheta,zamoist,psrct,zfrac_ice, &
1286 zturb_spp,pdp,ptp,psigs, &
1287 ztrh, &
1288 prus,prvs,prws,prthls,prrs,zworks )
1289 !
1290 IF (turbn%LTURB_PRECIP) THEN
1291 IF( buconf%LBUDGET_RR ) CALL tbudgets(nbudget_rr)%PTR%INIT_PHY(d, 'HTURB', prrs(:,:, 3) )
1292 IF( buconf%LBUDGET_RS ) CALL tbudgets(nbudget_rs)%PTR%INIT_PHY(d, 'HTURB', prrs(:,:, 5) )
1293 IF( buconf%LBUDGET_RG ) CALL tbudgets(nbudget_rg)%PTR%INIT_PHY(d, 'HTURB', prrs(:,:, 6) )
1294 IF( buconf%LBUDGET_RH .AND. krr==7) CALL tbudgets(nbudget_rh)%PTR%INIT_PHY(d, 'HTURB', prrs(:,:, 7) )
1295 IF (krr.GE.3) prrs(iijb:iije,1:ikt,3)=zworks(iijb:iije,1:ikt,ksv+3)
1296 IF (krr.GE.5) prrs(iijb:iije,1:ikt,5)=zworks(iijb:iije,1:ikt,ksv+5)
1297 IF (krr.GE.6) prrs(iijb:iije,1:ikt,6)=zworks(iijb:iije,1:ikt,ksv+6)
1298 IF (krr.GE.7) prrs(iijb:iije,1:ikt,7)=zworks(iijb:iije,1:ikt,ksv+7)
1299 IF( buconf%LBUDGET_RR ) CALL tbudgets(nbudget_rr)%PTR%END_PHY(d, 'HTURB', prrs(:,:, 3) )
1300 IF( buconf%LBUDGET_RS ) CALL tbudgets(nbudget_rs)%PTR%END_PHY(d, 'HTURB', prrs(:,:, 5) )
1301 IF( buconf%LBUDGET_RG ) CALL tbudgets(nbudget_rg)%PTR%END_PHY(d, 'HTURB', prrs(:,:, 6) )
1302 IF( buconf%LBUDGET_RH .AND. krr==7) CALL tbudgets(nbudget_rh)%PTR%END_PHY(d, 'HTURB', prrs(:,:, 7) )
1303 END IF
1304 !
1305 IF( buconf%LBUDGET_U ) CALL tbudgets(nbudget_u)%PTR%END_PHY(d, 'HTURB', prus )
1306 IF( buconf%LBUDGET_V ) CALL tbudgets(nbudget_v)%PTR%END_PHY(d, 'HTURB', prvs )
1307 IF( buconf%LBUDGET_W ) CALL tbudgets(nbudget_w)%PTR%END_PHY(d, 'HTURB', prws )
1308
1309 IF( buconf%LBUDGET_TH ) THEN
1310 IF( krri >= 1 .AND. krrl >= 1 ) THEN
1311 !$acc kernels present_cr(ZTEMP_BUD)
1312 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1313 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlvocpexnm(iijb:iije,1:ikt) * &
1314 & prrs(iijb:iije,1:ikt, 2) + zlsocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt, 4)
1315 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1316 !$acc end kernels
1317 CALL tbudgets(nbudget_th)%PTR%END_PHY(d, 'HTURB', ztemp_bud )
1318 ELSE IF( krrl >= 1 ) THEN
1319 !$acc kernels present_cr(ZTEMP_BUD)
1320 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1321 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt, 2)
1322 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1323 !$acc end kernels
1324 CALL tbudgets(nbudget_th)%PTR%END_PHY(d, 'HTURB', ztemp_bud )
1325 ELSE
1326 CALL tbudgets(nbudget_th)%PTR%END_PHY(d, 'HTURB', prthls )
1327 END IF
1328 END IF
1329
1330 IF( buconf%LBUDGET_RV ) THEN
1331 IF( krri >= 1 .AND. krrl >= 1 ) THEN
1332 !$acc kernels present_cr(ZTEMP_BUD)
1333 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1334 ztemp_bud(iijb:iije,1:ikt) = prrs(iijb:iije,1:ikt, 1) - prrs(iijb:iije,1:ikt, 2) - prrs(iijb:iije,1:ikt, 4)
1335 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1336 !$acc end kernels
1337 CALL tbudgets(nbudget_rv)%PTR%END_PHY(d, 'HTURB', ztemp_bud )
1338 ELSE IF( krrl >= 1 ) THEN
1339 !$acc kernels present_cr(ZTEMP_BUD)
1340 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1341 ztemp_bud(iijb:iije,1:ikt) = prrs(iijb:iije,1:ikt, 1) - prrs(iijb:iije,1:ikt, 2)
1342 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1343 !$acc end kernels
1344 CALL tbudgets(nbudget_rv)%PTR%END_PHY(d, 'HTURB', ztemp_bud )
1345 ELSE
1346 CALL tbudgets(nbudget_rv)%PTR%END_PHY(d, 'HTURB', prrs(:,:, 1) )
1347 END IF
1348 END IF
1349
1350 IF( buconf%LBUDGET_RC ) CALL tbudgets(nbudget_rc)%PTR%END_PHY(d, 'HTURB', prrs(:,:, 2) )
1351 IF( buconf%LBUDGET_RI ) CALL tbudgets(nbudget_ri)%PTR%END_PHY(d, 'HTURB', prrs(:,:, 4) )
1352
1353 IF( buconf%LBUDGET_SV ) THEN
1354 DO jsv = 1, ksv
1355 CALL tbudgets(nbudget_sv1 - 1 + jsv)%PTR%END_PHY(d, 'HTURB', zworks(:,:, jsv) )
1356 END DO
1357 END IF
1358END IF
1359!$acc update_crm self(PSIGS,PRUS,PRVS,PRWS,PRSVS)
1360!----------------------------------------------------------------------------
1361!
1362!* 6. EVOLUTION OF THE TKE AND ITS DISSIPATION
1363! ----------------------------------------
1364!
1365! 6.1 Contribution of mass-flux in the TKE buoyancy and dynamical production if
1366! cloud computation is not statistical
1367IF(turbn%LTHERMMF) THEN
1368 zwork1=mzf(pflxzthvmf)
1369!$acc kernels present_crm(PTP)
1370 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1371 ptp(iijb:iije,1:ikt) = ptp(iijb:iije,1:ikt) &
1372 + cst%XG / pthvref(iijb:iije,1:ikt) * zwork1(iijb:iije,1:ikt)
1373 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1374!$acc end kernels
1375 IF(PRESENT(ptpmf)) THEN
1376!$acc kernels present_crm(PTPMF)
1377 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1378 ptpmf(iijb:iije,1:ikt)=cst%XG / pthvref(iijb:iije,1:ikt) * zwork1(iijb:iije,1:ikt)
1379 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1380!$acc end kernels
1381 ENDIF
1382ELSEIF(PRESENT(ptpmf)) THEN
1383!$acc kernels
1384 ptpmf(iijb:iije,1:ikt)=0.
1385!$acc end kernels
1386ENDIF
1387
1388IF(turbn%LDYNMF) THEN
1389 zwork1=gz_u_uw(put,pdzz)
1390 zwork2=mxf(zwork1)
1391!$acc kernels
1392 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1393 zwork1(iijb:iije,1:ikt)=zwork2(iijb:iije,1:ikt)*pflxzumf(iijb:iije,1:ikt)
1394 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1395!$acc end kernels
1396 zwork2=mzf(zwork1)
1397!$acc kernels
1398 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1399 pdp(iijb:iije,1:ikt)=pdp(iijb:iije,1:ikt)-zwork2(iijb:iije,1:ikt)
1400 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1401!$acc end kernels
1402 IF(PRESENT(pdpmf)) THEN
1403!$acc kernels
1404 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1405 pdpmf(iijb:iije,1:ikt)=-zwork2(iijb:iije,1:ikt)
1406 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1407!$acc end kernels
1408 ENDIF
1409!
1410 zwork1=gz_v_vw(pvt,pdzz)
1411 zwork2=mxf(zwork1)
1412!$acc kernels
1413 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1414 zwork1(iijb:iije,1:ikt)=zwork2(iijb:iije,1:ikt)*pflxzvmf(iijb:iije,1:ikt)
1415 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1416!$acc end kernels
1417 zwork2=mzf(zwork1)
1418!$acc kernels
1419 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1420 pdp(iijb:iije,1:ikt)=pdp(iijb:iije,1:ikt)-zwork2(iijb:iije,1:ikt)
1421 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1422!$acc end kernels
1423 IF(PRESENT(pdpmf)) THEN
1424!$acc kernels
1425 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1426 pdpmf(iijb:iije,1:ikt)=pdpmf(iijb:iije,1:ikt)-zwork2(iijb:iije,1:ikt)
1427 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1428!$acc end kernels
1429 ENDIF
1430ELSEIF(PRESENT(pdpmf)) THEN
1431!$acc kernels
1432 pdpmf(iijb:iije,1:ikt)=0.
1433!$acc end kernels
1434ENDIF
1435
1436! 6.2 Horizontal gradients as in Göger et al. (2016)
1437
1438IF (turbn%LGOGER) THEN
1439 ! Add horizontal terms from Göger et al. (2018)
1440 ! Increase the Dyn. Prod.
1441!$acc kernels
1442 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1443 !* Computation of the horizontal mixing length
1444 !* Add horizontal terms
1445 ! DUDX=PHGRADGOG(IIJB:IIJE,1:IKT,1)
1446 ! DUDY=PHGRADGOG(IIJB:IIJE,1:IKT,2)
1447 ! DVDX=PHGRADGOG(IIJB:IIJE,1:IKT,3)
1448 ! DVDY=PHGRADGOG(IIJB:IIJE,1:IKT,4)
1449 pdp(iijb:iije,1:ikt)=pdp(iijb:iije,1:ikt)+turbn%XSMAG**2*pdxx(iijb:iije,1:ikt)*pdyy(iijb:iije,1:ikt)* &
1450 &(phgradgog(iijb:iije,1:ikt,1)*phgradgog(iijb:iije,1:ikt,1) &
1451 &+phgradgog(iijb:iije,1:ikt,4)*phgradgog(iijb:iije,1:ikt,4) &
1452 &+0.5*(phgradgog(iijb:iije,1:ikt,2)+phgradgog(iijb:iije,1:ikt,3)) &
1453 &*(phgradgog(iijb:iije,1:ikt,2)+phgradgog(iijb:iije,1:ikt,3)))**(3./2.)
1454 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1455!$acc end kernels
1456ENDIF
1457
1458! 6.3 TKE evolution equation
1459
1460IF (.NOT. turbn%LHARAT) THEN
1461!
1462IF (buconf%LBUDGET_TH) THEN
1463 IF ( krri >= 1 .AND. krrl >= 1 ) THEN
1464 !$acc kernels present_cr(ZTEMP_BUD)
1465 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1466 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt)+ zlvocpexnm(iijb:iije,1:ikt) * &
1467 & prrs(iijb:iije,1:ikt,2) + zlsocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt,4)
1468 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1469 !$acc end kernels
1470 CALL tbudgets(nbudget_th)%PTR%INIT_PHY(d, 'DISSH', ztemp_bud )
1471 ELSE IF ( krrl >= 1 ) THEN
1472 !$acc kernels present_cr(ZTEMP_BUD)
1473 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1474 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt,2)
1475 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1476 !$acc end kernels
1477 CALL tbudgets(nbudget_th)%PTR%INIT_PHY(d, 'DISSH', ztemp_bud )
1478 ELSE
1479 CALL tbudgets(nbudget_th)%PTR%INIT_PHY(d, 'DISSH', prthls )
1480 END IF
1481END IF
1482!
1483IF(PRESENT(prtkems)) THEN
1484!$acc kernels
1485 zrtkems(:,:)=prtkems(:,:)
1486!$acc end kernels
1487ELSE
1488!$acc kernels
1489 zrtkems(:,:)=0.
1490!$acc end kernels
1491END IF
1492!
1493!$acc update_crm device(PRTKES)
1494CALL tke_eps_sources(d,cst,csturb,buconf,turbn,tles, &
1495 & ptket,zlm,zleps,pdp,ztrh, &
1496 & prhodj,pdzz,pdxx,pdyy,pdzx,pdzy,pzz, &
1497 & ptstep,zexpl, &
1498 & tpfile,odiag_in_run,gocean, &
1499 & psfu,psfv, &
1500 & ptp,prtkes,prthls,zcoef_diss,ptdiff,ptdiss,zrtkems,&
1501 & tbudgets,kbudgets, pedr=pedr, ptr=ptr,pdiss=pdiss, &
1502 & pcurrent_tke_diss=pcurrent_tke_diss, &
1503 & pturb_spp=zturb_spp )
1504 !
1505!$acc update_crm self(PTR,PDISS)
1506!
1507!$acc update_crm self(PRTKES)
1508IF (buconf%LBUDGET_TH) THEN
1509 IF ( krri >= 1 .AND. krrl >= 1 ) THEN
1510 !$acc kernels present_cr(ZTEMP_BUD)
1511 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1512 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt)+ zlvocpexnm(iijb:iije,1:ikt) * &
1513 & prrs(iijb:iije,1:ikt,2) + zlsocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt,4)
1514 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1515 !$acc end kernels
1516 CALL tbudgets(nbudget_th)%PTR%END_PHY(d, 'DISSH', ztemp_bud )
1517 ELSE IF ( krrl >= 1 ) THEN
1518 !$acc kernels present_cr(ZTEMP_BUD)
1519 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1520 ztemp_bud(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt,2)
1521 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1522 !$acc end kernels
1523 CALL tbudgets(nbudget_th)%PTR%END_PHY(d, 'DISSH', ztemp_bud )
1524 ELSE
1525 CALL tbudgets(nbudget_th)%PTR%END_PHY(d, 'DISSH', prthls )
1526 END IF
1527END IF
1528!
1529ENDIF
1530!
1531!----------------------------------------------------------------------------
1532!
1533!* 7. STORES SOME INFORMATIONS RELATED TO THE TURBULENCE SCHEME
1534! ---------------------------------------------------------
1535!
1536!$acc update_crm self(PLEM)
1537IF ( turbn%LTURB_DIAG .AND. tpfile%LOPENED ) THEN
1538 !
1539 ! stores the mixing length
1540 !
1541 tzfield = tfieldmetadata( &
1542 cmnhname = 'LM', &
1543 cstdname = '', &
1544 clongname = 'LM', &
1545 cunits = 'm', &
1546 cdir = 'XY', &
1547 ccomment = 'Mixing length', &
1548 ngrid = 1, &
1549 ntype = typereal, &
1550 ndims = 3, &
1551 ltimedep = .true. )
1552 CALL io_field_write_phy(d,tpfile,tzfield,zlm)
1553 !
1554 IF (krr /= 0) THEN
1555 !
1556 ! stores the conservative potential temperature
1557 !
1558 tzfield = tfieldmetadata( &
1559 cmnhname = 'THLM', &
1560 cstdname = '', &
1561 clongname = 'THLM', &
1562 cunits = 'K', &
1563 cdir = 'XY', &
1564 ccomment = 'Conservative potential temperature', &
1565 ngrid = 1, &
1566 ntype = typereal, &
1567 ndims = 3, &
1568 ltimedep = .true. )
1569!$acc update self(PTHLT)
1570 CALL io_field_write_phy(d,tpfile,tzfield,pthlt)
1571 !
1572 ! stores the conservative mixing ratio
1573 !
1574 tzfield = tfieldmetadata( &
1575 cmnhname = 'RNPM', &
1576 cstdname = '', &
1577 clongname = 'RNPM', &
1578 cunits = 'kg kg-1', &
1579 cdir = 'XY', &
1580 ccomment = 'Conservative mixing ratio',&
1581 ngrid = 1, &
1582 ntype = typereal, &
1583 ndims = 3, &
1584 ltimedep = .true. )
1585!$acc update self(PRT)
1586 CALL io_field_write_phy(d,tpfile,tzfield,prt(:,:,1))
1587 END IF
1588END IF
1589!
1590prsvs(:,:,:) = zworks(:,:,1:ksv)
1591IF (oflyer) pwsv(:,:,:)=zworkwsv(:,:,1:ksv)
1592!* stores value of conservative variables & wind before turbulence tendency (AROME only)
1593IF(PRESENT(pdrus_turb)) THEN
1594 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1595 pdrus_turb(iijb:iije,1:ikt) = prus(iijb:iije,1:ikt) - pdrus_turb(iijb:iije,1:ikt)
1596 pdrvs_turb(iijb:iije,1:ikt) = prvs(iijb:iije,1:ikt) - pdrvs_turb(iijb:iije,1:ikt)
1597 pdrthls_turb(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) - pdrthls_turb(iijb:iije,1:ikt)
1598 pdrrts_turb(iijb:iije,1:ikt) = prrs(iijb:iije,1:ikt,1) - pdrrts_turb(iijb:iije,1:ikt)
1599 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1600 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT,JSV=1:KSV)
1601 pdrsvs_turb(iijb:iije,1:ikt,:) = prsvs(iijb:iije,1:ikt,:) - pdrsvs_turb(iijb:iije,1:ikt,:)
1602 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT,JSV=1:KSV)
1603END IF
1604!----------------------------------------------------------------------------
1605!
1606!* 8. RETRIEVE NON-CONSERVATIVE VARIABLES
1607! -----------------------------------
1608!
1609IF ( krrl >= 1 ) THEN
1610 IF ( krri >= 1 ) THEN
1611!$acc kernels present_cr(PRT,PRRS,PTHLT,PRTHLS)
1612 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1613 prt(iijb:iije,1:ikt,1) = prt(iijb:iije,1:ikt,1) - prt(iijb:iije,1:ikt,2) &
1614 - prt(iijb:iije,1:ikt,4)
1615 prrs(iijb:iije,1:ikt,1) = prrs(iijb:iije,1:ikt,1) - prrs(iijb:iije,1:ikt,2) &
1616 - prrs(iijb:iije,1:ikt,4)
1617 pthlt(iijb:iije,1:ikt) = pthlt(iijb:iije,1:ikt) + zlvocpexnm(iijb:iije,1:ikt) &
1618 * prt(iijb:iije,1:ikt,2) &
1619 + zlsocpexnm(iijb:iije,1:ikt) * prt(iijb:iije,1:ikt,4)
1620 prthls(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlvocpexnm(iijb:iije,1:ikt) &
1621 * prrs(iijb:iije,1:ikt,2) &
1622 + zlsocpexnm(iijb:iije,1:ikt) * prrs(iijb:iije,1:ikt,4)
1623 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1624!$acc end kernels
1625!$acc update self(PRT(:,:,1))
1626 !
1627 ELSE
1628!$acc kernels present_cr(PRT,PRRS,PTHLT,PRTHLS, zlocpexnm )
1629 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1630 prt(iijb:iije,1:ikt,1) = prt(iijb:iije,1:ikt,1) - prt(iijb:iije,1:ikt,2)
1631 prrs(iijb:iije,1:ikt,1) = prrs(iijb:iije,1:ikt,1) - prrs(iijb:iije,1:ikt,2)
1632 pthlt(iijb:iije,1:ikt) = pthlt(iijb:iije,1:ikt) + zlocpexnm(iijb:iije,1:ikt) &
1633 * prt(iijb:iije,1:ikt,2)
1634 prthls(iijb:iije,1:ikt) = prthls(iijb:iije,1:ikt) + zlocpexnm(iijb:iije,1:ikt) &
1635 * prrs(iijb:iije,1:ikt,2)
1636 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1637!$acc end kernels
1638!$acc update self(PRT(:,:,1))
1639 END IF
1640END if!
1641!
1642!
1643! Remove non-physical negative values (unnecessary in a perfect world) + corresponding budgets
1644CALL sources_neg_correct_phy(d,ksv,hcloud,helec,'NETUR',krr,ptstep,ppabst,pthlt,prt,prthls,prrs,prsvs)
1645!$acc update self( PTHLT ) !PTHLT not modified in Sources_neg_correct
1646!$acc update self( PRTHLS, PRRS )
1647!----------------------------------------------------------------------------
1648!
1649!* 9. LES averaged surface fluxes
1650! ---------------------------
1651!
1652IF (tles%LLES_CALL) THEN
1653 CALL second_mnh(ztime1)
1654 !$acc data copy(TLES%X_LES_Q0,TLES%X_LES_E0,TLES%X_LES_SV0,TLES%X_LES_UW0,TLES%X_LES_VW0,TLES%X_LES_USTAR)
1655 CALL les_mean_subgrid_phy(d,tles,psfth,tles%X_LES_Q0)
1656 CALL les_mean_subgrid_phy(d,tles,psfrv,tles%X_LES_E0)
1657 DO jsv=1,ksv
1658 CALL les_mean_subgrid_phy(d,tles,psfsv(:,jsv),tles%X_LES_SV0(:,jsv))
1659 END DO
1660 CALL les_mean_subgrid_phy(d,tles,psfu,tles%X_LES_UW0)
1661 CALL les_mean_subgrid_phy(d,tles,psfv,tles%X_LES_VW0)
1662 !
1663 !$acc kernels present_cr(ZWORK2D)
1664 !$mnh_expand_array(JIJ=IIJB:IIJE)
1665 zwork2d(iijb:iije) = (psfu(iijb:iije)*psfu(iijb:iije)+psfv(iijb:iije)*psfv(iijb:iije))**0.25
1666 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
1667 !$acc end kernels
1668 CALL les_mean_subgrid_phy(d,tles,zwork2d,tles%X_LES_USTAR)
1669!$acc end data
1670!----------------------------------------------------------------------------
1671!
1672!* 10. LES for 3rd order moments
1673! -------------------------
1674!
1675!$acc data copy(TLES%X_LES_SUBGRID_W2Thl,TLES%X_LES_SUBGRID_WThl2)
1676 CALL les_mean_subgrid_phy(d,tles,zmwth,tles%X_LES_SUBGRID_W2Thl)
1677 CALL les_mean_subgrid_phy(d,tles,zmth2,tles%X_LES_SUBGRID_WThl2)
1678!$acc end data
1679 IF (krr>0) THEN
1680!$acc data copy(TLES%X_LES_SUBGRID_W2Rt,TLES%X_LES_SUBGRID_WThlRt,TLES%X_LES_SUBGRID_WRt2)
1681 CALL les_mean_subgrid_phy(d,tles,zmwr,tles%X_LES_SUBGRID_W2Rt)
1682 CALL les_mean_subgrid_phy(d,tles,zmthr,tles%X_LES_SUBGRID_WThlRt)
1683 CALL les_mean_subgrid_phy(d,tles,zmr2,tles%X_LES_SUBGRID_WRt2)
1684!$acc end data
1685 END IF
1686 !
1687 !----------------------------------------------------------------------------
1688 !
1689 !* 11. LES quantities depending on <w'2> in "1DIM" mode
1690 ! ------------------------------------------------
1691 !
1692 IF (turbn%CTURBDIM=="1DIM") THEN
1693!$acc data copy(TLES%X_LES_SUBGRID_U2,TLES%X_LES_SUBGRID_V2,TLES%X_LES_SUBGRID_W2,TLES%X_LES_RES_ddz_Thl_SBG_W2)
1694 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1695 zwork1(iijb:iije,1:ikt) = 2./3.*ptket(iijb:iije,1:ikt)
1696 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1697 CALL les_mean_subgrid_phy(d,tles,zwork1,tles%X_LES_SUBGRID_U2)
1698 tles%X_LES_SUBGRID_V2(:,:,:) = tles%X_LES_SUBGRID_U2(:,:,:)
1699 tles%X_LES_SUBGRID_W2(:,:,:) = tles%X_LES_SUBGRID_U2(:,:,:)
1700 !
1701 zwork1=gz_m_w(pthlt,pdzz)
1702 zwork2=mzf(zwork1)
1703 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1704 zwork2(iijb:iije,1:ikt) = 2./3.*ptket(iijb:iije,1:ikt) *zwork2(iijb:iije,1:ikt)
1705 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1706 CALL les_mean_subgrid_phy(d,tles,zwork2,tles%X_LES_RES_ddz_Thl_SBG_W2)
1707!$acc end data
1708 !
1709 IF (krr>=1) THEN
1710!$acc data copy(TLES%X_LES_RES_ddz_Rt_SBG_W2)
1711 zwork1=gz_m_w(prt(:,:,1),pdzz)
1712 zwork2=mzf(zwork1)
1713 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1714 zwork2(iijb:iije,1:ikt) = 2./3.*ptket(iijb:iije,1:ikt) *zwork2(iijb:iije,1:ikt)
1715 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1716 CALL les_mean_subgrid_phy(d,tles,zwork2,tles%X_LES_RES_ddz_Rt_SBG_W2)
1717!$acc end data
1718 END IF
1719!$acc data copy(TLES%X_LES_RES_ddz_Sv_SBG_W2(:,:,:,1:KSV))
1720 DO jsv=1,ksv
1721 zwork1=gz_m_w(psvt(:,:,jsv),pdzz)
1722 zwork2=mzf(zwork1)
1723 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1724 zwork2(iijb:iije,1:ikt) = 2./3.*ptket(iijb:iije,1:ikt) *zwork2(iijb:iije,1:ikt)
1725 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
1726 CALL les_mean_subgrid_phy(d,tles,zwork2, tles%X_LES_RES_ddz_Sv_SBG_W2(:,:,:,jsv))
1727 END DO
1728!$acc end data
1729 END IF
1730 !
1731 !----------------------------------------------------------------------------
1732 !
1733 !* 12. LES mixing end dissipative lengths, presso-correlations
1734 ! -------------------------------------------------------
1735 !
1736!$acc data copy(TLES%X_LES_SUBGRID_LMix,TLES%X_LES_SUBGRID_LDiss,TLES%X_LES_SUBGRID_WP)
1737 CALL les_mean_subgrid_phy(d,tles,zlm,tles%X_LES_SUBGRID_LMix)
1738 CALL les_mean_subgrid_phy(d,tles,zleps,tles%X_LES_SUBGRID_LDiss)
1739 !
1740 !* presso-correlations for subgrid Tke are equal to zero.
1741 !
1742!$acc kernels present_cr(ZLEPS)
1743 zleps(:,:) = 0. !ZLEPS is used as a work array (not used anymore)
1744!$acc end kernels
1745 CALL les_mean_subgrid_phy(d,tles,zleps,tles%X_LES_SUBGRID_WP)
1746!$acc end data
1747 !
1748 CALL second_mnh(ztime2)
1749 tles%XTIME_LES = tles%XTIME_LES + ztime2 - ztime1
1750END IF
1751!
1752IF(PRESENT(plem)) THEN
1753 !$acc kernels
1754 plem(iijb:iije,iktb:ikte) = zlm(iijb:iije,iktb:ikte)
1755 !$acc end kernels
1756END IF
1757!----------------------------------------------------------------------------
1758!
1759IF (lhook) CALL dr_hook('TURB',1,zhook_handle)
1760CONTAINS
1761include "shugrad.h"
1762END SUBROUTINE turb
1763
integer, parameter nbudget_rv
integer, parameter nbudget_rh
integer, parameter nbudget_th
integer, parameter nbudget_rs
integer, parameter nbudget_ri
integer, parameter nbudget_rc
integer, parameter nbudget_v
integer, parameter nbudget_sv1
integer, parameter nbudget_rr
integer, parameter nbudget_w
integer, parameter nbudget_rg
integer, parameter nbudget_u
integer, parameter typereal
Definition modd_field.F90:9
integer, parameter nverb_fatal
Definition modd_io.F90:6
integer, parameter jpvext_turb
real, parameter xundef
integer, parameter nusrbl89
integer, parameter nctp
integer, parameter ncpr5
integer, parameter nbl89exp
integer, parameter ncpr3
integer, parameter nchf
integer, parameter ncht1
integer, parameter nced
integer, parameter nturb_s
integer, parameter ncht2
integer, parameter ncep
integer, parameter ncmfs
integer, parameter ncpr4
integer, parameter ncshf
integer, parameter nctv
subroutine bl89(d, cst, csturb, turbn, pzz, pdzz, pthvref, pthlm, krr, prm, ptkem, pshear, plm, oocean, pturb_spp)
Definition mode_bl89.F90:13
subroutine cloud_modif_lm(d, cst, csturb, turbn, tpfile, tzfield, krr, krri, ocloudmodiflm, oocean, ocompute_src, o2d, hturblen_cl, pdzz, pdxx, pdyy, pzz, prt, ptket, pthlt, pthlm, prm, pthvref, plocpexnm, psrct, pcoef_ampl_sat, pamoist, patheta, pdircoszw, pcei, pcei_min, pcei_max, plm, pturb_spp)
subroutine compute_function_thermo_new_stat(d, cst, palp, pbeta, pgam, pltt, pc, pt, pexn, pcp, plocpexn, pamoist, patheta, ppabst)
subroutine compute_function_thermo(d, cst, palp, pbeta, pgam, pltt, pc, pt, pexn, pcp, plocpexn, pamoist, patheta, prt, ppabst, krr)
subroutine dear(d, cst, turbn, krr, krri, o2d, ocompute_src, oocean, plm, prt, pdzz, pzz, ptket, pthvref, pthlt, plocpexnm, psrct, pamoist, pdircoszw, pdxx, pdyy, patheta)
Definition mode_dear.F90:16
subroutine delt(d, turbn, o2d, odz, oocean, pzz, pdyy, pdxx, pdircoszw, plm)
Definition mode_delt.F90:13
subroutine ibm_mixinglength(d, plm, pleps, pmu, phi, ptke)
subroutine rmc01(d, cst, csturb, turbn, pzz, pdxx, pdyy, pdzz, pdircoszw, psbl_depth, plmo, pturb_spp, plk, pleps)
Definition mode_rmc01.F90:9
subroutine rotate_wind(d, pu, pv, pw, pdircosxw, pdircosyw, pdircoszw, pcosslope, psinslope, pdxx, pdyy, pdzz, puslope, pvslope)
subroutine update_rotate_wind(d, puslope, pvslope, hlbcx, hlbcy)
subroutine lmo(d, cst, pustar, ptheta, prv, psfth, psfrv, plmo)
subroutine sources_neg_correct_phy(d, ksv, hcloud, helec, hbudname, krr, ptstep, ppabst, ptht, prt, prths, prrs, prsvs, prhodj)
subroutine tke_eps_sources(d, cst, csturb, buconf, turbn, tles, ptkem, plm, pleps, pdp, ptrh, prhodj, pdzz, pdxx, pdyy, pdzx, pdzy, pzz, ptstep, pexpl, tpfile, odiag_in_run, oocean, psfum, psfvm, ptp, prtkes, prthls, pcoef_diss, ptdiff, ptdiss, prtkems, tbudgets, kbudgets, pedr, ptr, pdiss, pcurrent_tke_diss, pturb_spp)
subroutine tm06(d, turbn, cst, pthvref, pbl_depth, pzz, psfth, pmwth, pmth2)
Definition mode_tm06.F90:9
subroutine turb_hor_splt(d, cst, csturb, turbn, nebn, tles, ksplit, krr, krrl, krri, ksv, ksv_lgbeg, ksv_lgend, ptstep, hlbcx, hlbcy, oflat, o2d, onomixlg, oocean, ocompute_src, oblowsnow, prsnow, tpfile, khalo, pdxx, pdyy, pdzz, pdzx, pdzy, pzz, pdircosxw, pdircosyw, pdircoszw, pcosslope, psinslope, prhodj, pthvref, psfthm, psfrm, psfsvm, pcdueff, ptau11m, ptau12m, ptau22m, ptau33m, pum, pvm, pwm, puslopem, pvslopem, pthlm, prm, psvm, ptkem, plm, pleps, plocpexnm, patheta, pamoist, psrcm, pfrac_ice, pturb_spp, pdp, ptp, psigs, ptrh, prus, prvs, prws, prthls, prrs, prsvs)
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 update_lm(d, hlbcx, hlbcy, plm, pleps)
subroutine second_mnh(xt)
Definition second_mnh.F90:2
real function, dimension(size(pin, 1), size(pin, 2)) mzf(pin)
Definition shugrad.h:142
real function, dimension(size(pa, 1), size(pa, 2)) gz_v_vw(pa, pdzz)
Definition shugrad.h:579
real function, dimension(size(pin, 1), size(pin, 2)) myf(pin)
Definition shugrad.h:80
real function, dimension(size(pa, 1), size(pa, 2)) gz_w_m(pa, pdzz)
Definition shugrad.h:598
real function, dimension(size(pin, 1), size(pin, 2)) mxf(pin)
Definition shugrad.h:18
real function, dimension(size(pa, 1), size(pa, 2)) gz_u_uw(pa, pdzz)
Definition shugrad.h:508
real function, dimension(size(py, 1), size(py, 2)) gz_m_w(py, pdzz)
Definition shugrad.h:437
subroutine turb(cst, csturb, buconf, turbn, nebn, d, tles, krr, krrl, krri, hlbcx, hlbcy, kgradientsleo, kgradientsgog, khalo, ksplit, ocloudmodiflm, ksv, ksv_lgbeg, ksv_lgend, ksv_lima_nr, ksv_lima_ns, ksv_lima_ng, ksv_lima_nh, o2d, onomixlg, oflat, ocouples, oblowsnow, oibm, oflyer, ocompute_src, prsnow, oocean, odeepoc, odiag_in_run, hturblen_cl, hcloud, helec, ptstep, tpfile, pdxx, pdyy, pdzz, pdzx, pdzy, pzz, pdircosxw, pdircosyw, pdircoszw, pcosslope, psinslope, prhodj, pthvref, phgradleo, phgradgog, pzs, psfth, psfrv, psfsv, psfu, psfv, psea_ucu, psea_vcu, ppabst, put, pvt, pwt, ptket, psvt, psrct, plengthm, plengthh, mfmoist, pbl_depth, psbl_depth, pcei, pcei_min, pcei_max, pcoef_ampl_sat, pthlt, prt, prus, prvs, prws, prthls, prrs, prsvs, prtkes, psigs, pflxzthvmf, pflxzumf, pflxzvmf, pwth, pwrc, pwsv, pdp, ptp, ptdiff, ptdiss, tbudgets, kbudgets, pedr, plem, prtkems, pdpmf, ptpmf, pdrus_turb, pdrvs_turb, pdrthls_turb, pdrrts_turb, pdrsvs_turb, pturb_spp, ptr, pdiss, pibm_ls, pibm_xmut, pcurrent_tke_diss, psstfl, psstfl_c, pssrfl_c, pssufl_c, pssvfl_c, pssufl, pssvfl)
Definition turb.F90:37