Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
!MNH_LIC Copyright 1994-2020 CNRS, Meteo-France and Universite Paul Sabatier
!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
!MNH_LIC for details. version 1.
!-----------------------------------------------------------------
MODULE MODE_TURB_HOR_TKE
IMPLICIT NONE
CONTAINS
SUBROUTINE TURB_HOR_TKE(KSPLT, &
PDXX, PDYY, PDZZ,PDZX,PDZY, &
PINV_PDXX, PINV_PDYY, PINV_PDZZ, PMZM_PRHODJ, &
PK, PRHODJ, PTKEM, &
PTRH )
! ################################################################
!
!
!!**** *TURB_HOR_TKE* computes the horizontal turbulant transports of Tke
!!
!! PURPOSE
!! -------
!!** METHOD
!! ------
!!
!!
!!
!! EXTERNAL
!! --------
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!!
!!
!! REFERENCE
!! ---------
!!
!! AUTHOR
!! ------
!! Joan Cuxart * INM and Meteo-France *
!!
!! MODIFICATIONS
!! -------------
!! Original Aug 29, 1994
!! Mar 07 2001 (V. Masson and J. Stein) new routine
!! Nov 06, 2002 (V. Masson) LES budgets
!! --------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
USE MODD_CONF
USE MODD_CST
USE MODD_CTURB
USE MODD_PARAMETERS
USE MODD_LES
!
!
USE MODI_SHUMAN
USE MODI_GRADIENT_M
USE MODI_LES_MEAN_SUBGRID
!
USE MODI_SECOND_MNH
!
IMPLICIT NONE
!
!
!* 0.1 declaration of arguments
!
!
INTEGER, INTENT(IN) :: KSPLT ! current split index
!
REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX, PDYY, PDZZ, PDZX, PDZY
! Metric coefficients
REAL, DIMENSION(:,:,:), INTENT(IN) :: PK ! Turbulent diffusion doef.
! PK = PLM * SQRT(PTKEM)
REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDXX ! 1./PDXX
REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDYY ! 1./PDYY
REAL, DIMENSION(:,:,:), INTENT(IN) :: PINV_PDZZ ! 1./PDZZ
REAL, DIMENSION(:,:,:), INTENT(IN) :: PMZM_PRHODJ ! MZM(PRHODJ)
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! density * grid volume
!
!
REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! TKE at time t- dt
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PTRH ! horizontal transport of Tke
!
!
!
!* 0.2 declaration of local variables
!
INTEGER :: IKB, IKU
!
REAL, DIMENSION(SIZE(PDZZ,1),SIZE(PDZZ,2),1+JPVEXT:3+JPVEXT) :: ZCOEFF
! coefficients for the uncentred gradient
! computation near the ground
!
REAL, DIMENSION(SIZE(PTKEM,1),SIZE(PTKEM,2),SIZE(PTKEM,3)):: ZFLX
!
REAL :: ZTIME1, ZTIME2
! ---------------------------------------------------------------------------
!
!* 1. PRELIMINARY COMPUTATIONS
! ------------------------
!
IKB = 1.+JPVEXT
IKU = SIZE(PTKEM,3)
!
! compute the coefficients for the uncentred gradient computation near the
! ground
!
ZCOEFF(:,:,IKB+2)= - PDZZ(:,:,IKB+1) / &
( (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) * PDZZ(:,:,IKB+2) )
ZCOEFF(:,:,IKB+1)= (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) / &
( PDZZ(:,:,IKB+1) * PDZZ(:,:,IKB+2) )
ZCOEFF(:,:,IKB)= - (PDZZ(:,:,IKB+2)+2.*PDZZ(:,:,IKB+1)) / &
( (PDZZ(:,:,IKB+2)+PDZZ(:,:,IKB+1)) * PDZZ(:,:,IKB+1) )
!
!--------------------------------------------------------------------
!
!* 2. horizontal transport of Tke u'e
! -------------------------------
!
!
ZFLX = -XCET * MXM(PK) * GX_M_U(1,IKU,1,PTKEM,PDXX,PDZZ,PDZX) ! < u'e >
!
! special case near the ground ( uncentred gradient )
!
ZFLX(:,:,IKB) = ZCOEFF(:,:,IKB+2)*PTKEM(:,:,IKB+2) &
+ ZCOEFF(:,:,IKB+1)*PTKEM(:,:,IKB+1) &
+ ZCOEFF(:,:,IKB )*PTKEM(:,:,IKB )
!
ZFLX(:,:,IKB:IKB) = &
- XCET * MXM( PK(:,:,IKB:IKB) ) * ( &
DXM ( PTKEM(:,:,IKB:IKB) ) * PINV_PDXX(:,:,IKB:IKB) &
-MXM ( ZFLX (:,:,IKB:IKB) ) * PINV_PDXX(:,:,IKB:IKB) &
* 0.5 * ( PDZX(:,:,IKB+1:IKB+1) + PDZX(:,:,IKB:IKB) ) )
!
! extrapolate the fluxes to obtain < u'e > = 0 at the ground
!
ZFLX(:,:,IKB-1) = - ZFLX(:,:,IKB)
!
! let the same flux at IKU-1 and IKU level
!
ZFLX(:,:,IKU) = ZFLX(:,:,IKU-1)
!
IF (.NOT. LFLAT) THEN
PTRH =-( DXF( MXM(PRHODJ) * ZFLX * PINV_PDXX)&
- DZF( PMZM_PRHODJ * MXF( PDZX * MZM(ZFLX*PINV_PDXX)) * PINV_PDZZ)&
) /PRHODJ
ELSE
PTRH =-( DXF( MXM(PRHODJ) * ZFLX * PINV_PDXX)&
) /PRHODJ
END IF
!
IF (LLES_CALL .AND. KSPLT==1) THEN
CALL SECOND_MNH(ZTIME1)
CALL LES_MEAN_SUBGRID( MXF(ZFLX), X_LES_SUBGRID_UTke )
CALL SECOND_MNH(ZTIME2)
XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1
END IF
!
!
!--------------------------------------------------------------------
!
!* 3. horizontal transport of Tke v'e
! -------------------------------
!
IF (.NOT. L2D) THEN
ZFLX =-XCET * MYM(PK) * GY_M_V(1,IKU,1,PTKEM,PDYY,PDZZ,PDZY) ! < v'e >
!
! special case near the ground ( uncentred gradient )
!
ZFLX(:,:,IKB) = ZCOEFF(:,:,IKB+2)*PTKEM(:,:,IKB+2) &
+ ZCOEFF(:,:,IKB+1)*PTKEM(:,:,IKB+1) &
+ ZCOEFF(:,:,IKB )*PTKEM(:,:,IKB )
!
ZFLX(:,:,IKB:IKB) = &
- XCET * MYM( PK(:,:,IKB:IKB) ) * ( &
DYM ( PTKEM(:,:,IKB:IKB) ) * PINV_PDYY(:,:,IKB:IKB) &
- MYM ( ZFLX (:,:,IKB:IKB) ) * PINV_PDYY(:,:,IKB:IKB) &
* 0.5 * ( PDZY(:,:,IKB+1:IKB+1) + PDZY(:,:,IKB:IKB) ) )
!
! extrapolate the fluxes to obtain < v'e > = 0 at the ground
!
ZFLX(:,:,IKB-1) = - ZFLX(:,:,IKB)
!
! let the same flux at IKU-1 and IKU level
!
ZFLX(:,:,IKU) = ZFLX(:,:,IKU-1)
!
! complete the explicit turbulent transport
!
IF (.NOT. LFLAT) THEN
PTRH = PTRH - ( DYF( MYM(PRHODJ) * ZFLX * PINV_PDYY ) &
- DZF( PMZM_PRHODJ * MYF( PDZY * MZM(ZFLX*PINV_PDYY) ) * PINV_PDZZ ) &
) /PRHODJ
ELSE
PTRH = PTRH - ( DYF( MYM(PRHODJ) * ZFLX * PINV_PDYY ) &
) /PRHODJ
END IF
!
IF (LLES_CALL .AND. KSPLT==1) THEN
CALL SECOND_MNH(ZTIME1)
CALL LES_MEAN_SUBGRID( MYF(ZFLX), X_LES_SUBGRID_VTke )
CALL SECOND_MNH(ZTIME2)
XTIME_LES = XTIME_LES + ZTIME2 - ZTIME1
END IF
!
END IF
!
!----------------------------------------------------------------------------
!
END SUBROUTINE TURB_HOR_TKE
END MODULE MODE_TURB_HOR_TKE