PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_turb_ver_sv_flux.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!-----------------------------------------------------------------
7
8!$ACDC singlecolumn --dummy
9
10IMPLICIT NONE
11CONTAINS
12SUBROUTINE turb_ver_sv_flux(D,CST,CSTURB,TURBN,TLES,ONOMIXLG, &
13 KSV,KSV_LGBEG,KSV_LGEND, &
14 OBLOWSNOW,OFLYER, &
15 PEXPL,PTSTEP,TPFILE,PRSNOW, &
16 PDZZ,PDIRCOSZW, &
17 PRHODJ,PWM, &
18 PSFSVM,PSFSVP, &
19 PSVM, &
20 PTKEM,PLM,MFMOIST,PPSI_SV, &
21 PTURB_SPP,PRSVS,PWSV )
22!
23!
24!
25!!**** *TURB_VER_SV_FLUX* -compute the source terms due to the vertical turbulent
26!! fluxes.
27!!
28!! PURPOSE
29!! -------
30! The purpose of this routine is to compute the vertical turbulent
31! fluxes of the evolutive variables and give back the source
32! terms to the main program. In the case of large horizontal meshes,
33! the divergence of these vertical turbulent fluxes represent the whole
34! effect of the turbulence but when the three-dimensionnal version of
35! the turbulence scheme is activated (CTURBDIM="3DIM"), these divergences
36! are completed in the next routine TURB_HOR.
37! An arbitrary degree of implicitness has been implemented for the
38! temporal treatment of these diffusion terms.
39! The vertical boundary conditions are as follows:
40! * at the bottom, the surface fluxes are prescribed at the same
41! as the other turbulent fluxes
42! * at the top, the turbulent fluxes are set to 0.
43! It should be noted that the condensation has been implicitely included
44! in this turbulence scheme by using conservative variables and computing
45! the subgrid variance of a statistical variable s indicating the presence
46! or not of condensation in a given mesh.
47!
48!!** METHOD
49!! ------
50!! 1D type calculations are made;
51!! The vertical turbulent fluxes are computed in an off-centered
52!! implicit scheme (a Crank-Nicholson type with coefficients different
53!! than 0.5), which allows to vary the degree of implicitness of the
54!! formulation.
55!! The different prognostic variables are treated one by one.
56!! The contributions of each turbulent fluxes are cumulated into the
57!! tendency PRvarS, and into the dynamic and thermal production of
58!! TKE if necessary.
59!!
60!! In section 2 and 3, the thermodynamical fields are considered.
61!! Only the turbulent fluxes of the conservative variables
62!! (Thetal and Rnp stored in PRx(:,:,:,1)) are computed.
63!! Note that the turbulent fluxes at the vertical
64!! boundaries are given either by the soil scheme for the surface one
65!! ( at the same instant as the others fluxes) and equal to 0 at the
66!! top of the model. The thermal production is computed by vertically
67!! averaging the turbulent flux and multiply this flux at the mass point by
68!! a function ETHETA or EMOIST, which preform the transformation from the
69!! conservative variables to the virtual potential temperature.
70!!
71!! In section 4, the variance of the statistical variable
72!! s indicating presence or not of condensation, is determined in function
73!! of the turbulent moments of the conservative variables and its
74!! squarred root is stored in PSIGS. This information will be completed in
75!! the horizontal turbulence if the turbulence dimensionality is not
76!! equal to "1DIM".
77!!
78!! In section 5, the x component of the stress tensor is computed.
79!! The surface flux <u'w'> is computed from the value of the surface
80!! fluxes computed in axes linked to the orography ( i", j" , k"):
81!! i" is parallel to the surface and in the direction of the maximum
82!! slope
83!! j" is also parallel to the surface and in the normal direction of
84!! the maximum slope
85!! k" is the normal to the surface
86!! In order to prevent numerical instability, the implicit scheme has
87!! been extended to the surface flux regarding to its dependence in
88!! function of U. The dependence in function of the other components
89!! introduced by the different rotations is only explicit.
90!! The turbulent fluxes are used to compute the dynamic production of
91!! TKE. For the last TKE level ( located at PDZZ(:,:,IKB)/2 from the
92!! ground), an harmonic extrapolation from the dynamic production at
93!! PDZZ(:,:,IKB) is used to avoid an evaluation of the gradient of U
94!! in the surface layer.
95!!
96!! In section 6, the same steps are repeated but for the y direction
97!! and in section 7, a diagnostic computation of the W variance is
98!! performed.
99!!
100!! In section 8, the turbulent fluxes for the scalar variables are
101!! computed by the same way as the conservative thermodynamical variables
102!!
103!!
104!! EXTERNAL
105!! --------
106!! GX_U_M, GY_V_M, GZ_W_M : cartesian gradient operators
107!! GX_U_UW,GY_V_VW (X,Y,Z) represent the direction of the gradient
108!! _(M,U,...)_ represent the localization of the
109!! field to be derivated
110!! _(M,UW,...) represent the localization of the
111!! field derivated
112!!
113!!
114!! MXM,MXF,MYM,MYF,MZM,MZF
115!! : Shuman functions (mean operators)
116!! DXF,DYF,DZF,DZM
117!! : Shuman functions (difference operators)
118!!
119!! SUBROUTINE TRIDIAG : to compute the split implicit evolution
120!! of a variable located at a mass point
121!!
122!! SUBROUTINE TRIDIAG_WIND: to compute the split implicit evolution
123!! of a variable located at a wind point
124!!
125!! FUNCTIONs ETHETA and EMOIST :
126!! allows to compute:
127!! - the coefficients for the turbulent correlation between
128!! any variable and the virtual potential temperature, of its
129!! correlations with the conservative potential temperature and
130!! the humidity conservative variable:
131!! ------- ------- -------
132!! A' Thv' = ETHETA A' Thl' + EMOIST A' Rnp'
133!!
134!!
135!! IMPLICIT ARGUMENTS
136!! ------------------
137!! Module MODD_CST : contains physical constants
138!!
139!! CST%XG : gravity constant
140!!
141!! Module MODD_CTURB: contains the set of constants for
142!! the turbulence scheme
143!!
144!! CSTURB%XCMFS,XCMFB : cts for the momentum flux
145!! CSTURB%XCSHF : ct for the sensible heat flux
146!! CSTURB%XCHF : ct for the moisture flux
147!! CSTURB%XCTV,CSTURB%XCHV : cts for the T and moisture variances
148!!
149!! Module MODD_PARAMETERS
150!!
151!! JPVEXT_TURB : number of vertical external points
152!! JPHEXT : number of horizontal external points
153!!
154!!
155!! REFERENCE
156!! ---------
157!! Book 1 of documentation (Chapter: Turbulence)
158!!
159!! AUTHOR
160!! ------
161!! Joan Cuxart * INM and Meteo-France *
162!!
163!! MODIFICATIONS
164!! -------------
165!! Original August 19, 1994
166!! Modifications: February 14, 1995 (J.Cuxart and J.Stein)
167!! Doctorization and Optimization
168!! Modifications: March 21, 1995 (J.M. Carriere)
169!! Introduction of cloud water
170!! Modifications: June 14, 1995 (J.Cuxart and J. Stein)
171!! Phi3 and Psi3 at w-point + bug in the all
172!! or nothing condens.
173!! Modifications: Sept 15, 1995 (J.Cuxart and J. Stein)
174!! Change the DP computation at the ground
175!! Modifications: October 10, 1995 (J.Cuxart and J. Stein)
176!! Psi for scal var and LES tools
177!! Modifications: November 10, 1995 (J. Stein)
178!! change the surface relations
179!! Modifications: February 20, 1995 (J. Stein) optimization
180!! Modifications: May 21, 1996 (J. Stein)
181!! bug in the vertical flux of the V wind
182!! component for explicit computation
183!! Modifications: May 21, 1996 (N. wood)
184!! modify the computation of the vertical
185!! part or the surface tangential flux
186!! Modifications: May 21, 1996 (P. Jabouille)
187!! same modification in the Y direction
188!!
189!! Modifications: Sept 17, 1996 (J. Stein) change the moist case by using
190!! Pi instead of Piref + use Atheta and Amoist
191!!
192!! Modifications: Nov 24, 1997 (V. Masson) removes the DO loops
193!! Modifications: Mar 31, 1998 (V. Masson) splits the routine TURB_VER_SV_FLUX
194!! Modifications: Dec 01, 2000 (V. Masson) conservation of scalar emission
195!! from surface in 1DIM case
196!! when slopes are present
197!! Jun 20, 2001 (J Stein) case of lagragian variables
198!! Nov 06, 2002 (V. Masson) LES budgets
199!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after
200!! change of YCOMMENT
201!! Feb 2012(Y. Seity) add possibility to run with reversed
202!! vertical levels
203!! Modifications: July 2015 (Wim de Rooy) TURBN%LHARAT switch
204!! Feb 2017(M. Leriche) add initialisation of ZSOURCE
205!! to avoid unknwon values outside physical domain
206!! and avoid negative values in sv tendencies
207!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O
208! Wim de Rooy 06/2019: with energycascade, 50MF nog longer necessary
209! P. Wautelet 30/11/2022: compute PWSV only when needed
210! P. Wautelet 01/06/2023: fix for PWSV
211!!--------------------------------------------------------------------------
212!
213!* 0. DECLARATIONS
214! ------------
215!
216USE yomhook, ONLY: lhook, dr_hook, jphook
217!
218USE modd_cst, ONLY: cst_t
219USE modd_cturb, ONLY: csturb_t
220USE modd_dimphyex, ONLY: dimphyex_t
222USE modd_io, ONLY: tfiledata
223USE modd_les, ONLY: tles_t
225USE modd_turb_n, ONLY: turb_t, nchf, nturb_s
226!
228USE mode_tridiag, ONLY: tridiag
229!
231USE modi_second_mnh, ONLY: second_mnh
232!
233#ifdef MNH_COMPILER_CCE
234!$mnh_undef(LOOP)
235!$mnh_undef(OPENACC)
236#endif
237!
238IMPLICIT NONE
239!
240!* 0.1 declarations of arguments
241!
242!
243TYPE(dimphyex_t), INTENT(IN) :: D
244TYPE(cst_t), INTENT(IN) :: CST
245TYPE(csturb_t), INTENT(IN) :: CSTURB
246TYPE(turb_t), INTENT(IN) :: TURBN
247TYPE(tles_t), INTENT(INOUT):: TLES ! modd_les structure
248INTEGER, INTENT(IN) :: KSV, &
249 KSV_LGBEG, KSV_LGEND ! number of scalar variables
250LOGICAL, INTENT(IN) :: ONOMIXLG ! to use turbulence for lagrangian variables (modd_conf)
251LOGICAL, INTENT(IN) :: OBLOWSNOW ! switch to activate pronostic blowing snow
252LOGICAL, INTENT(IN) :: OFLYER ! MesoNH flyer diagnostic
253REAL, INTENT(IN) :: PRSNOW ! Ratio for diffusion coeff. scalar (blowing snow)
254REAL, INTENT(IN) :: PEXPL ! Coef. for temporal disc.
255REAL, INTENT(IN) :: PTSTEP ! Double Time Step
256TYPE(tfiledata), INTENT(INOUT) :: TPFILE ! Output file
257!
258REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZZ
259 ! Metric coefficients
260REAL, DIMENSION(D%NIJT), INTENT(IN) :: PDIRCOSZW ! Director Cosinus of the
261 ! normal to the ground surface
262!
263REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODJ ! dry density * grid volum
264REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: MFMOIST ! moist mf dual scheme
265
266!
267REAL, DIMENSION(D%NIJT,KSV), INTENT(IN) :: PSFSVM ! t - deltat
268!
269REAL, DIMENSION(D%NIJT,KSV), INTENT(IN) :: PSFSVP ! t + deltat
270!
271REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(IN) :: PSVM ! scalar var. at t-Delta t
272!
273REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PWM ! vertical wind
274REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTKEM ! TKE at time t
275REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLM ! Turb. mixing length
276REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(IN) :: PPSI_SV ! Inv.Turb.Sch.for scalars
277REAL, DIMENSION(D%NIJT,D%NKT,NTURB_S), INTENT(IN) :: PTURB_SPP ! SPP for turbulence
278!
279REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(INOUT) :: PRSVS
280 ! cumulated sources for the prognostic variables
281REAL, DIMENSION(MERGE(D%NIJT,0,OFLYER),MERGE(D%NKT,0,OFLYER),MERGE(KSV,0,OFLYER)), INTENT(OUT) :: PWSV ! scalar flux
282!
283!* 0.2 declaration of local variables
284!
285!
286REAL, DIMENSION(D%NIJT,D%NKT) :: &
287 ZA, & ! under diagonal elements of the tri-diagonal matrix involved
288 ! in the temporal implicit scheme (also used to store coefficient
289 ! J in Section 5)
290 zres, & ! guess of the treated variable at t+ deltat when the turbu-
291 ! lence is the only source of evolution added to the ones
292 ! considered in ZSOURCE
293 zflxz, & ! vertical flux of the treated variable
294 zsource, & ! source of evolution for the treated variable
295 zkeff, & ! effectif diffusion coeff = LT * SQRT( TKE )
296 zwork1, & ! working var. for shuman operators (array syntax)
297 zmzmrhodj, &
298 zwkles ! working var. for LES calls
299REAL, DIMENSION(D%NIJT,D%NKT) :: ZCSV !constant (possibly perturbed) for the scalar flux
300INTEGER :: IKT ! array size in k direction
301INTEGER :: IIJB,IIJE,IKB,IKE,IKA ! index value for the mass points of the domain
302INTEGER :: IKTB,IKTE ! start, end of k loops in physical domain
303INTEGER :: IKL
304INTEGER :: JSV ! loop counters
305INTEGER :: JIJ,JK ! loop
306!
307REAL :: ZTIME1, ZTIME2
308
309REAL :: ZCSVP = 4.0 ! constant for scalar flux presso-correlation (RS81)
310!
311CHARACTER(LEN=NMNHNAMELGTMAX) :: YMNHNAME
312REAL(KIND=jphook) :: zhook_handle
313TYPE(tfieldmetadata) :: tzfield
314!----------------------------------------------------------------------------
315!
316!* 1. PRELIMINARIES
317! -------------
318!
319IF (lhook) CALL dr_hook('TURB_VER_SV_FLUX',0,zhook_handle)
320!
321ikt=d%NKT
322iktb=d%NKTB
323ikte=d%NKTE
324ikb=d%NKB
325ike=d%NKE
326ika=d%NKA
327ikl=d%NKL
328iije=d%NIJE
329iijb=d%NIJB
330!
331IF (turbn%LHARAT) THEN
332!$acc kernels
333 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
334 zkeff(iijb:iije,1:ikt) = plm(iijb:iije,1:ikt) * sqrt(ptkem(iijb:iije,1:ikt))
335 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
336!$acc end kernels
337ELSE
338!$acc kernels
339 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
340 zwork1(iijb:iije,1:ikt) = plm(iijb:iije,1:ikt)*sqrt(ptkem(iijb:iije,1:ikt))
341 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
342!$acc end kernels
343 zkeff=mzm(zwork1)
344ENDIF
345!
346IF(oblowsnow) THEN
347! See Vionnet (PhD, 2012) for a complete discussion around the value of the Schmidt number for blowing snow variables
348 zcsv(:,:)=pturb_spp(:,:,nchf)/prsnow
349ELSE
350 zcsv(:,:)=pturb_spp(:,:,nchf)
351ENDIF
352!----------------------------------------------------------------------------
353!
354!* 8. SOURCES OF PASSIVE SCALAR VARIABLES
355! -----------------------------------
356!
357zmzmrhodj=mzm(prhodj)
358DO jsv=1,ksv
359!
360 IF (onomixlg .AND. jsv >= ksv_lgbeg .AND. jsv<= ksv_lgend) cycle
361!
362! Preparation of the arguments for TRIDIAG
363 IF (turbn%LHARAT) THEN
364!$acc kernels
365 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
366 za(iijb:iije,1:ikt) = -ptstep * zkeff(iijb:iije,1:ikt) * zmzmrhodj(iijb:iije,1:ikt) &
367 / pdzz(iijb:iije,1:ikt)**2
368 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
369!$acc end kernels
370 ELSE
371!$acc kernels
372 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
373 za(iijb:iije,1:ikt) = -ptstep*zcsv(iijb:iije,1:ikt)*ppsi_sv(iijb:iije,1:ikt,jsv) * &
374 zkeff(iijb:iije,1:ikt) * zmzmrhodj(iijb:iije,1:ikt) / pdzz(iijb:iije,1:ikt)**2
375 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
376!$acc end kernels
377 ENDIF
378!$acc kernels
379 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
380 zsource(iijb:iije,1:ikt) = 0.
381 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
382!$acc end kernels
383!
384! Compute the sources for the JSVth scalar variable
385
386!* in 3DIM case, a part of the flux goes vertically, and another goes horizontally
387! (in presence of slopes)
388!* in 1DIM case, the part of energy released in horizontal flux
389! is taken into account in the vertical part
390 IF (turbn%CTURBDIM=='3DIM') THEN
391!$acc kernels
392 !$mnh_expand_array(JIJ=IIJB:IIJE)
393 zsource(iijb:iije,ikb) = (turbn%XIMPL*psfsvp(iijb:iije,jsv) + pexpl*psfsvm(iijb:iije,jsv)) / &
394 pdzz(iijb:iije,ikb) * pdircoszw(iijb:iije) &
395 * 0.5 * (1. + prhodj(iijb:iije,ika) / prhodj(iijb:iije,ikb))
396 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
397!$acc end kernels
398 ELSE
399!$acc kernels
400 !$mnh_expand_array(JIJ=IIJB:IIJE)
401 zsource(iijb:iije,ikb) = (turbn%XIMPL*psfsvp(iijb:iije,jsv) + pexpl*psfsvm(iijb:iije,jsv)) / &
402 pdzz(iijb:iije,ikb) / pdircoszw(iijb:iije) &
403 * 0.5 * (1. + prhodj(iijb:iije,ika) / prhodj(iijb:iije,ikb))
404 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
405!$acc end kernels
406 END IF
407!$acc kernels
408 zsource(iijb:iije,iktb+1:ikte-1) = 0.
409 zsource(iijb:iije,ike) = 0.
410!$acc end kernels
411!
412! Obtention of the split JSV scalar variable at t+ deltat
413 CALL tridiag(d,psvm(:,:,jsv),za,ptstep,pexpl,turbn%XIMPL,prhodj,zsource,zres)
414!
415! Compute the equivalent tendency for the JSV scalar variable
416!$acc kernels
417 !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
418 prsvs(iijb:iije,1:ikt,jsv)= prsvs(iijb:iije,1:ikt,jsv)+ &
419 prhodj(iijb:iije,1:ikt)*(zres(iijb:iije,1:ikt)-psvm(iijb:iije,1:ikt,jsv))/ptstep
420 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
421!$acc end kernels
422!
423 IF ( (turbn%LTURB_FLX .AND. tpfile%LOPENED) .OR. tles%LLES_CALL .OR. oflyer ) THEN
424 ! Diagnostic of the cartesian vertical flux
425 !
426 zflxz(iijb:iije,:) = -zcsv(iijb:iije,:) * ppsi_sv(iijb:iije,:,jsv) * mzm(plm(iijb:iije,:)*sqrt(ptkem(iijb:iije,:))) &
427 & / pdzz(iijb:iije,:) * &
428 dzm( turbn%XIMPL*zres(iijb:iije,:) + pexpl*psvm(iijb:iije,:,jsv) )
429 ! surface flux
430 !* in 3DIM case, a part of the flux goes vertically, and another goes horizontally
431 ! (in presence of slopes)
432 !* in 1DIM case, the part of energy released in horizontal flux
433 ! is taken into account in the vertical part
434 IF (turbn%CTURBDIM=='3DIM') THEN
435!$acc kernels
436 !$mnh_expand_array(JIJ=IIJB:IIJE)
437 zflxz(iijb:iije,ikb) = (turbn%XIMPL*psfsvp(iijb:iije,jsv) + pexpl*psfsvm(iijb:iije,jsv)) &
438 * pdircoszw(iijb:iije)
439 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
440!$acc end kernels
441 ELSE
442!$acc kernels
443 !$mnh_expand_array(JIJ=IIJB:IIJE)
444 zflxz(iijb:iije,ikb) = (turbn%XIMPL*psfsvp(iijb:iije,jsv) + pexpl*psfsvm(iijb:iije,jsv)) &
445 / pdircoszw(iijb:iije)
446 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
447!$acc end kernels
448 END IF
449 ! extrapolates the flux under the ground so that the vertical average with
450 ! the IKB flux gives the ground value
451 !
452!$acc kernels
453 !$mnh_expand_array(JIJ=IIJB:IIJE)
454 zflxz(iijb:iije,ika) = zflxz(iijb:iije,ikb)
455 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
456!$acc end kernels
457 IF ( oflyer ) THEN
458!$acc kernels
459 DO jk=iktb+1,ikte-1
460 !$mnh_expand_array(JIJ=IIJB:IIJE)
461 pwsv(iijb:iije,jk,jsv)=0.5*(zflxz(iijb:iije,jk)+zflxz(iijb:iije,jk+ikl))
462 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
463 END DO
464 !$mnh_expand_array(JIJ=IIJB:IIJE)
465 pwsv(iijb:iije,ikb,jsv)=0.5*(zflxz(iijb:iije,ikb)+zflxz(iijb:iije,ikb+ikl))
466 pwsv(iijb:iije,ike,jsv)=pwsv(iijb:iije,ike-ikl,jsv)
467 !$mnh_end_expand_array(JIJ=IIJB:IIJE)
468!$acc end kernels
469 END IF
470 END IF
471 !
472 IF (turbn%LTURB_FLX .AND. tpfile%LOPENED) THEN
473 ! stores the JSVth vertical flux
474 WRITE(ymnhname,'("WSV_FLX_",I3.3)') jsv
475 tzfield = tfieldmetadata( &
476 cmnhname = trim( ymnhname ), &
477 cstdname = '', &
478 clongname = trim( ymnhname ), &
479 cunits = 'SVUNIT m s-1', &
480 cdir = 'XY', &
481 ccomment = 'X_Y_Z_' // trim( ymnhname ), &
482 ngrid = 4, &
483 ntype = typereal, &
484 ndims = 3, &
485 ltimedep = .true. )
486 !
487!$acc update self(ZFLXZ)
488 CALL io_field_write_phy(d,tpfile,tzfield,zflxz)
489 END IF
490 !
491 ! Storage in the LES configuration
492 !
493 IF (tles%LLES_CALL) THEN
494 CALL second_mnh(ztime1)
495 zwkles = mzf(zflxz)
496 CALL les_mean_subgrid_phy(d, tles, zwkles, tles%X_LES_SUBGRID_WSv(:,:,:,jsv) )
497 zwkles = gz_w_m(pwm,pdzz)*mzf(zflxz)
498 CALL les_mean_subgrid_phy(d, tles, zwkles, tles%X_LES_RES_ddxa_W_SBG_UaSv(:,:,:,jsv) )
499 zwkles = mzf(gz_m_w(psvm(:,:,jsv),pdzz)*zflxz)
500 CALL les_mean_subgrid_phy(d, tles, zwkles, tles%X_LES_RES_ddxa_Sv_SBG_UaSv(:,:,:,jsv) )
501 zwkles = -zcsvp*sqrt(ptkem)/plm*mzf(zflxz)
502 CALL les_mean_subgrid_phy(d, tles, zwkles, tles%X_LES_SUBGRID_SvPz(:,:,:,jsv) )
503 zwkles = mzf(pwm*zflxz)
504 CALL les_mean_subgrid_phy(d, tles, zwkles, tles%X_LES_RES_W_SBG_WSv(:,:,:,jsv) )
505 CALL second_mnh(ztime2)
506 tles%XTIME_LES = tles%XTIME_LES + ztime2 - ztime1
507 END IF
508 !
509END DO ! end of scalar loop
510!
511!----------------------------------------------------------------------------
512!
513IF (lhook) CALL dr_hook('TURB_VER_SV_FLUX',1,zhook_handle)
514CONTAINS
515include "shugrad.h"
516END SUBROUTINE turb_ver_sv_flux
517END MODULE mode_turb_ver_sv_flux
integer, parameter typereal
Definition modd_field.F90:9
integer, parameter nmnhnamelgtmax
integer, parameter nchf
integer, parameter nturb_s
subroutine tridiag(d, pvarm, pa, ptstep, pexpl, pimpl, prhodj, psource, pvarp)
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 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_w_m(pa, pdzz)
Definition shugrad.h:598
real function, dimension(size(pin, 1), size(pin, 2)) mzm(pin)
Definition shugrad.h:2
real function, dimension(size(pin, 1), size(pin, 2)) dzm(pin)
Definition shugrad.h:298
real function, dimension(size(py, 1), size(py, 2)) gz_m_w(py, pdzz)
Definition shugrad.h:437