FE-Project
Loading...
Searching...
No Matches
scale_atm_dyn_dgm_nonhydro3d_etot_heve_numflux.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / Numflux
3!!
4!! @par Description
5!! HEVE DGM scheme for Atmospheric dynamical process.
6!!
7!! @author Yuta Kawai, Team SCALE
8!<
9!-------------------------------------------------------------------------------
10#include "scaleFElib.h"
12 !-----------------------------------------------------------------------------
13 !
14 !++ Used modules
15 !
16 use scale_precision
17 use scale_io
18 use scale_prc
19 use scale_prof
20 use scale_const, only: &
21 grav => const_grav, &
22 rdry => const_rdry, &
23 cpdry => const_cpdry, &
24 cvdry => const_cvdry, &
25 pres00 => const_pre00
26
28 use scale_element_base, only: &
36
38 dens_vid => prgvar_ddens_id, etot_vid => prgvar_etot_id, &
39 momx_vid => prgvar_momx_id, momy_vid => prgvar_momy_id, &
40 momz_vid => prgvar_momz_id, &
42
43 !-----------------------------------------------------------------------------
44 implicit none
45 private
46 !-----------------------------------------------------------------------------
47 !
48 !++ Public procedures
49 !
52
53 !-----------------------------------------------------------------------------
54 !
55 !++ Public parameters & variables
56 !
57
58 !-----------------------------------------------------------------------------
59 !
60 !++ Private procedures & variables
61 !
62 !-------------------
63
64contains
65
66!OCL SERIAL
68 del_flux, del_flux_hyd, & ! (out)
69 ddens_, momx_, momy_, momz_, etot_, dpres_, dens_hyd, pres_hyd, & ! (in)
70 rtot, cvtot, cptot, & ! (in)
71 gsqrt, g13, g23, zlev, nx, ny, nz, & ! (in)
72 vmapm, vmapp, lmesh, elem, lmesh2d, elem2d ) ! (in)
73
74 implicit none
75
76 class(localmesh3d), intent(in) :: lmesh
77 class(elementbase3d), intent(in) :: elem
78 class(localmesh2d), intent(in) :: lmesh2d
79 class(elementbase2d), intent(in) :: elem2d
80 real(rp), intent(out) :: del_flux(elem%nfptot,lmesh%ne,prgvar_num)
81 real(rp), intent(out) :: del_flux_hyd(elem%nfptot,lmesh%ne,2)
82 real(rp), intent(in) :: ddens_(elem%np*lmesh%nea)
83 real(rp), intent(in) :: momx_(elem%np*lmesh%nea)
84 real(rp), intent(in) :: momy_(elem%np*lmesh%nea)
85 real(rp), intent(in) :: momz_(elem%np*lmesh%nea)
86 real(rp), intent(in) :: etot_(elem%np*lmesh%nea)
87 real(rp), intent(in) :: dpres_(elem%np*lmesh%nea)
88 real(rp), intent(in) :: dens_hyd(elem%np*lmesh%nea)
89 real(rp), intent(in) :: pres_hyd(elem%np*lmesh%nea)
90 real(rp), intent(in) :: rtot (elem%np*lmesh%nea)
91 real(rp), intent(in) :: cvtot(elem%np*lmesh%nea)
92 real(rp), intent(in) :: cptot(elem%np*lmesh%nea)
93 real(rp), intent(in) :: gsqrt(elem%np*lmesh%nea)
94 real(rp), intent(in) :: g13(elem%np*lmesh%nea)
95 real(rp), intent(in) :: g23(elem%np*lmesh%nea)
96 real(rp), intent(in) :: zlev(elem%np*lmesh%ne)
97 real(rp), intent(in) :: nx(elem%nfptot,lmesh%ne)
98 real(rp), intent(in) :: ny(elem%nfptot,lmesh%ne)
99 real(rp), intent(in) :: nz(elem%nfptot,lmesh%ne)
100 integer, intent(in) :: vmapm(elem%nfptot,lmesh%ne)
101 integer, intent(in) :: vmapp(elem%nfptot,lmesh%ne)
102
103 integer :: ke, i, ip(elem%nfptot), im(elem%nfptot)
104 integer :: ke2d
105 real(rp) :: velp(elem%nfptot), velm(elem%nfptot), alpha(elem%nfptot)
106 real(rp) :: dpresp(elem%nfptot), dpresm(elem%nfptot)
107 real(rp) :: gsqrtdensm(elem%nfptot), gsqrtdensp(elem%nfptot)
108 real(rp) :: gsqrtenthalpym(elem%nfptot), gsqrtenthalpyp(elem%nfptot)
109 real(rp) :: gsqrtddens_p(elem%nfptot), gsqrtddens_m(elem%nfptot)
110 real(rp) :: gsqrtmomx_p(elem%nfptot), gsqrtmomx_m(elem%nfptot)
111 real(rp) :: gsqrtmomy_p(elem%nfptot), gsqrtmomy_m(elem%nfptot)
112 real(rp) :: gsqrtmomz_p(elem%nfptot), gsqrtmomz_m(elem%nfptot)
113 real(rp) :: gsqrtetot_p(elem%nfptot), gsqrtetot_m(elem%nfptot)
114 real(rp) :: phyd_p(elem%nfptot), phyd_m(elem%nfptot)
115 real(rp) :: gsqrt_p(elem%nfptot), gsqrt_m(elem%nfptot)
116 real(rp) :: gsqrtv_p(elem%nfptot), gsqrtv_m(elem%nfptot)
117 real(rp) :: g13_m(elem%nfptot), g13_p(elem%nfptot)
118 real(rp) :: g23_m(elem%nfptot), g23_p(elem%nfptot)
119
120 real(rp) :: gnn_m(elem%nfptot), gnn_p(elem%nfptot)
121
122 real(rp) :: gamm, rgamm
123 real(rp) :: rp0
124 real(rp) :: rovp0, p0ovr
125 !------------------------------------------------------------------------
126
127 gamm = cpdry / cvdry
128 rgamm = cvdry / cpdry
129 rp0 = 1.0_rp / pres00
130 rovp0 = rdry * rp0
131 p0ovr = pres00 / rdry
132
133 !$omp parallel do private( &
134 !$omp ke, iM, iP, ke2D, &
135 !$omp alpha, VelM, VelP, &
136 !$omp dpresM, dpresP, GsqrtDensM, GsqrtDensP, &
137 !$omp GsqrtMOMX_M, GsqrtMOMX_P, GsqrtMOMY_M, GsqrtMOMY_P, GsqrtMOMZ_M, GsqrtMOMZ_P, &
138 !$omp GsqrtDDENS_M, GsqrtDDENS_P, GsqrtETOT_M, GsqrtETOT_P, &
139 !$omp GsqrtEnthalpyM, GsqrtEnthalpyP, &
140 !$omp Phyd_M, Phyd_P, &
141 !$omp Gsqrt_P, Gsqrt_M, GsqrtV_P, GsqrtV_M, G13_P, G13_M, G23_P, G23_M, &
142 !$omp Gnn_P, Gnn_M )
143 do ke=lmesh%NeS, lmesh%NeE
144 im(:) = vmapm(:,ke); ip(:) = vmapp(:,ke)
145 ke2d = lmesh%EMap3Dto2D(ke)
146
147 gsqrt_m(:) = gsqrt(im)
148 gsqrt_p(:) = gsqrt(ip)
149 gsqrtv_m(:) = gsqrt_m(:)
150 gsqrtv_p(:) = gsqrt_p(:)
151
152 g13_m(:) = g13(im)
153 g13_p(:) = g13(ip)
154 g23_m(:) = g23(im)
155 g23_p(:) = g23(ip)
156
157 gsqrtddens_m(:) = gsqrt_m(:) * ddens_(im)
158 gsqrtddens_p(:) = gsqrt_p(:) * ddens_(ip)
159 gsqrtmomx_m(:) = gsqrt_m(:) * momx_(im)
160 gsqrtmomx_p(:) = gsqrt_p(:) * momx_(ip)
161 gsqrtmomy_m(:) = gsqrt_m(:) * momy_(im)
162 gsqrtmomy_p(:) = gsqrt_p(:) * momy_(ip)
163 gsqrtmomz_m(:) = gsqrt_m(:) * momz_(im)
164 gsqrtmomz_p(:) = gsqrt_p(:) * momz_(ip)
165 gsqrtetot_m(:) = gsqrt_m(:) * etot_(im)
166 gsqrtetot_p(:) = gsqrt_p(:) * etot_(ip)
167 phyd_m(:) = pres_hyd(im)
168 phyd_p(:) = pres_hyd(ip)
169
170 gnn_m(:) = abs( nx(:,ke) ) + abs( ny(:,ke) ) &
171 + ( 1.0_rp / gsqrtv_m(:)**2 + g13_m(:)**2 + g23_m(:)**2 ) * abs( nz(:,ke) )
172 gnn_p(:) = abs( nx(:,ke) ) + abs( ny(:,ke) ) &
173 + ( 1.0_rp / gsqrtv_p(:)**2 + g13_p(:)**2 + g23_p(:)**2 ) * abs( nz(:,ke) )
174
175 gsqrtdensm(:) = gsqrtddens_m(:) + gsqrt_m(:) * dens_hyd(im)
176 gsqrtdensp(:) = gsqrtddens_p(:) + gsqrt_p(:) * dens_hyd(ip)
177
178 velm(:) = ( gsqrtmomx_m(:) * nx(:,ke) + gsqrtmomy_m(:) * ny(:,ke) &
179 + ( ( gsqrtmomz_m(:) / gsqrtv_m(:) &
180 + g13_m(:) * gsqrtmomx_m(:) + g23_m(:) * gsqrtmomy_m(:) ) * nz(:,ke) ) &
181 ) / gsqrtdensm(:)
182 velp(:) = ( gsqrtmomx_p(:) * nx(:,ke) + gsqrtmomy_p(:) * ny(:,ke) &
183 + ( ( gsqrtmomz_p(:) / gsqrtv_p(:) &
184 + g13_p(:) * gsqrtmomx_p(:) + g23_p(:) * gsqrtmomy_p(:) ) * nz(:,ke) ) &
185 ) / gsqrtdensp(:)
186
187 ! dpresM(:) = ( CPtot(iM) / CVtot(iM) - 1.0_RP ) &
188 ! * ( GsqrtETOT_M(:) - GsqrtDensM(:) * Grav * zlev(iM) &
189 ! - 0.5_RP * ( GsqrtMOMX_M(:)**2 + GsqrtMOMY_M(:)**2 + GsqrtMOMZ_M(:)**2 ) / GsqrtDENSM(:) ) / Gsqrt_M(:) &
190 ! - Phyd_M(:)
191 ! dpresP(:) = ( CPtot(iP) / CVtot(iP) - 1.0_RP ) &
192 ! * ( GsqrtETOT_P(:) - GsqrtDensP(:) * Grav * zlev(iM) &
193 ! - 0.5_RP * ( GsqrtMOMX_P(:)**2 + GsqrtMOMY_P(:)**2 + GsqrtMOMZ_P(:)**2 ) / GsqrtDENSP(:) ) / Gsqrt_P(:) &
194 ! - Phyd_P(:)
195 dpresm(:) = dpres_(im)
196 dpresp(:) = dpres_(ip)
197
198 gsqrtenthalpym(:) = gsqrtetot_m(:) + gsqrt_m(:) * ( phyd_m(:) + dpresm(:) )
199 gsqrtenthalpyp(:) = gsqrtetot_p(:) + gsqrt_p(:) * ( phyd_p(:) + dpresp(:) )
200
201 alpha(:) = max( sqrt( gnn_m(:) * gamm * ( phyd_m(:) + dpresm(:) ) * gsqrt_m(:) / gsqrtdensm(:) ) + abs(velm(:)), &
202 sqrt( gnn_p(:) * gamm * ( phyd_p(:) + dpresp(:) ) * gsqrt_p(:) / gsqrtdensp(:) ) + abs(velp(:)) )
203
204 del_flux(:,ke,dens_vid) = 0.5_rp * ( &
205 ( gsqrtdensp(:) * velp(:) - gsqrtdensm(:) * velm(:) ) &
206 - alpha(:) * ( gsqrtddens_p(:) - gsqrtddens_m(:) ) )
207
208 del_flux(:,ke,momx_vid ) = 0.5_rp * ( &
209 ( gsqrtmomx_p(:) * velp(:) - gsqrtmomx_m(:) * velm(:) ) &
210 + ( gsqrt_p(:) * ( nx(:,ke) + g13_p(:) * nz(:,ke)) * dpresp(:) &
211 - gsqrt_m(:) * ( nx(:,ke) + g13_m(:) * nz(:,ke)) * dpresm(:) ) &
212 - alpha(:) * ( gsqrtmomx_p(:) - gsqrtmomx_m(:) ) )
213
214 del_flux(:,ke,momy_vid ) = 0.5_rp * ( &
215 ( gsqrtmomy_p(:) * velp(:) - gsqrtmomy_m(:) * velm(:) ) &
216 + ( gsqrt_p(:) * ( ny(:,ke) + g23_p(:) * nz(:,ke)) * dpresp(:) &
217 - gsqrt_m(:) * ( ny(:,ke) + g23_m(:) * nz(:,ke)) * dpresm(:) ) &
218 - alpha(:) * ( gsqrtmomy_p(:) - gsqrtmomy_m(:) ) )
219
220 del_flux(:,ke,momz_vid ) = 0.5_rp * ( &
221 ( gsqrtmomz_p(:) * velp(:) - gsqrtmomz_m(:) * velm(:) ) &
222 + ( gsqrt_p(:) * dpresp(:) / gsqrtv_p(:) &
223 - gsqrt_m(:) * dpresm(:) / gsqrtv_m(:) ) * nz(:,ke) &
224 - alpha(:) * ( gsqrtmomz_p(:) - gsqrtmomz_m(:) ) )
225
226 del_flux(:,ke,etot_vid) = 0.5_rp * ( &
227 ( gsqrtenthalpyp(:) * velp(:) - gsqrtenthalpym(:) * velm(:) ) &
228 - alpha(:) * ( gsqrtetot_p(:) - gsqrtetot_m(:) ) )
229
230
231 del_flux_hyd(:,ke,1) = 0.5_rp * ( &
232 gsqrtv_p(:) * ( nx(:,ke) + g13_p(:) * nz(:,ke) ) * phyd_p(:) &
233 - gsqrtv_m(:) * ( nx(:,ke) + g13_m(:) * nz(:,ke) ) * phyd_m(:) )
234
235 del_flux_hyd(:,ke,2) = 0.5_rp * ( &
236 gsqrtv_p(:) * ( ny(:,ke) + g23_p(:) * nz(:,ke) ) * phyd_p(:) &
237 - gsqrtv_m(:) * ( ny(:,ke) + g23_m(:) * nz(:,ke) ) * phyd_m(:) )
238 end do
239
240 return
242
243
244!OCL SERIAL
246 del_flux, del_flux_hyd, & ! (out)
247 ddens_, momx_, momy_, momz_, etot_, dpres_, dens_hyd, pres_hyd, & ! (in)
248 rtot, cvtot, cptot, & ! (in)
249 gsqrt, g11, g12, g22, g_11, g_12, g_22, gsqrth, g13, g23, zlev, & ! (in)
250 nx, ny, nz, vmapm, vmapp, im2dto3d, lmesh, elem, lmesh2d, elem2d ) ! (in)
251
252 implicit none
253
254 class(localmesh3d), intent(in) :: lmesh
255 class(elementbase3d), intent(in) :: elem
256 class(localmesh2d), intent(in) :: lmesh2d
257 class(elementbase2d), intent(in) :: elem2d
258 real(rp), intent(out) :: del_flux(elem%nfptot,lmesh%ne,prgvar_num)
259 real(rp), intent(out) :: del_flux_hyd(elem%nfptot,lmesh%ne,2)
260 real(rp), intent(in) :: ddens_(elem%np*lmesh%nea)
261 real(rp), intent(in) :: momx_(elem%np*lmesh%nea)
262 real(rp), intent(in) :: momy_(elem%np*lmesh%nea)
263 real(rp), intent(in) :: momz_(elem%np*lmesh%nea)
264 real(rp), intent(in) :: etot_(elem%np*lmesh%nea)
265 real(rp), intent(in) :: dpres_(elem%np*lmesh%nea)
266 real(rp), intent(in) :: dens_hyd(elem%np*lmesh%nea)
267 real(rp), intent(in) :: pres_hyd(elem%np*lmesh%nea)
268 real(rp), intent(in) :: rtot (elem%np*lmesh%nea)
269 real(rp), intent(in) :: cvtot(elem%np*lmesh%nea)
270 real(rp), intent(in) :: cptot(elem%np*lmesh%nea)
271 real(rp), intent(in) :: gsqrt(elem%np*lmesh%nea)
272 real(rp), intent(in) :: g11(elem2d%np,lmesh2d%ne)
273 real(rp), intent(in) :: g12(elem2d%np,lmesh2d%ne)
274 real(rp), intent(in) :: g22(elem2d%np,lmesh2d%ne)
275 real(rp), intent(in) :: g_11(elem2d%np,lmesh2d%ne)
276 real(rp), intent(in) :: g_12(elem2d%np,lmesh2d%ne)
277 real(rp), intent(in) :: g_22(elem2d%np,lmesh2d%ne)
278 real(rp), intent(in) :: gsqrth(elem2d%np,lmesh2d%ne)
279 real(rp), intent(in) :: g13(elem%np*lmesh%nea)
280 real(rp), intent(in) :: g23(elem%np*lmesh%nea)
281 real(rp), intent(in) :: zlev(elem%np*lmesh%ne)
282 real(rp), intent(in) :: nx(elem%nfptot,lmesh%ne)
283 real(rp), intent(in) :: ny(elem%nfptot,lmesh%ne)
284 real(rp), intent(in) :: nz(elem%nfptot,lmesh%ne)
285 integer, intent(in) :: vmapm(elem%nfptot,lmesh%ne)
286 integer, intent(in) :: vmapp(elem%nfptot,lmesh%ne)
287 integer, intent(in) :: im2dto3d(elem%nfptot)
288
289 integer :: ke, ip(elem%nfptot), im(elem%nfptot)
290 integer :: ke2d
291 real(rp) :: velp(elem%nfptot), velm(elem%nfptot), alpha(elem%nfptot)
292 real(rp) :: dpresp(elem%nfptot), dpresm(elem%nfptot)
293 real(rp) :: gsqrtdensm(elem%nfptot), gsqrtdensp(elem%nfptot)
294 real(rp) :: gsqrtenthalpym(elem%nfptot), gsqrtenthalpyp(elem%nfptot)
295 real(rp) :: gsqrtddens_p(elem%nfptot), gsqrtddens_m(elem%nfptot)
296 real(rp) :: gsqrtmomx_p(elem%nfptot), gsqrtmomx_m(elem%nfptot)
297 real(rp) :: gsqrtmomy_p(elem%nfptot), gsqrtmomy_m(elem%nfptot)
298 real(rp) :: gsqrtmomz_p(elem%nfptot), gsqrtmomz_m(elem%nfptot)
299 real(rp) :: gsqrtetot_p(elem%nfptot), gsqrtetot_m(elem%nfptot)
300 real(rp) :: phyd_p(elem%nfptot), phyd_m(elem%nfptot)
301 real(rp) :: gsqrt_p(elem%nfptot), gsqrt_m(elem%nfptot)
302 real(rp) :: gsqrtv_p(elem%nfptot), gsqrtv_m(elem%nfptot)
303 real(rp) :: g13_m(elem%nfptot), g13_p(elem%nfptot)
304 real(rp) :: g23_m(elem%nfptot), g23_p(elem%nfptot)
305 real(rp) :: g1n_m(elem%nfptot), g2n_m(elem%nfptot)
306 real(rp) :: gnn_m(elem%nfptot), gnn_p(elem%nfptot)
307 real(rp) :: gxz_m(elem%nfptot), gxz_p(elem%nfptot)
308 real(rp) :: gyz_m(elem%nfptot), gyz_p(elem%nfptot)
309 real(rp) :: gsqrt_u1m(elem%nfptot), gsqrt_u2m(elem%nfptot)
310 real(rp) :: gsqrt_u1p(elem%nfptot), gsqrt_u2p(elem%nfptot)
311
312 real(rp) :: gamm, rgamm
313 real(rp) :: rp0
314 real(rp) :: rovp0, p0ovr
315
316 !------------------------------------------------------------------------
317
318 gamm = cpdry / cvdry
319 rgamm = cvdry / cpdry
320 rp0 = 1.0_rp / pres00
321 rovp0 = rdry * rp0
322 p0ovr = pres00 / rdry
323
324 !$omp parallel do private( &
325 !$omp ke, iM, iP, ke2d, &
326 !$omp alpha, VelM, VelP, &
327 !$omp dpresM, dpresP, GsqrtDensM, GsqrtDensP, &
328 !$omp GsqrtMOMX_M, GsqrtMOMX_P, GsqrtMOMY_M, GsqrtMOMY_P, GsqrtMOMZ_M, GsqrtMOMZ_P, &
329 !$omp GsqrtDDENS_M, GsqrtDDENS_P, GsqrtETOT_M, GsqrtETOT_P, &
330 !$omp GsqrtEnthalpyM, GsqrtEnthalpyP, &
331 !$omp Gsqrt_u1M, Gsqrt_u2M, Gsqrt_u1P, Gsqrt_u2P, &
332 !$omp Phyd_M, Phyd_P, &
333 !$omp Gsqrt_P, Gsqrt_M, GsqrtV_P, GsqrtV_M, G13_P, G13_M, G23_P, G23_M, &
334 !$omp Gxz_P, Gxz_M, Gyz_P, Gyz_M, G1n_M, G2n_M, Gnn_P, Gnn_M )
335 do ke=lmesh%NeS, lmesh%NeE
336 im(:) = vmapm(:,ke); ip(:) = vmapp(:,ke)
337 ke2d = lmesh%EMap3Dto2D(ke)
338
339 gsqrt_m(:) = gsqrt(im)
340 gsqrt_p(:) = gsqrt(ip)
341 gsqrtv_m(:) = gsqrt_m(:) / gsqrth(im2dto3d(:),ke2d)
342 gsqrtv_p(:) = gsqrt_p(:) / gsqrth(im2dto3d(:),ke2d)
343
344 g13_m(:) = g13(im)
345 g13_p(:) = g13(ip)
346 g23_m(:) = g23(im)
347 g23_p(:) = g23(ip)
348
349 gsqrtddens_m(:) = gsqrt_m(:) * ddens_(im)
350 gsqrtddens_p(:) = gsqrt_p(:) * ddens_(ip)
351 gsqrtmomx_m(:) = gsqrt_m(:) * momx_(im)
352 gsqrtmomx_p(:) = gsqrt_p(:) * momx_(ip)
353 gsqrtmomy_m(:) = gsqrt_m(:) * momy_(im)
354 gsqrtmomy_p(:) = gsqrt_p(:) * momy_(ip)
355 gsqrtmomz_m(:) = gsqrt_m(:) * momz_(im)
356 gsqrtmomz_p(:) = gsqrt_p(:) * momz_(ip)
357 gsqrtetot_m(:) = gsqrt_m(:) * etot_(im)
358 gsqrtetot_p(:) = gsqrt_p(:) * etot_(ip)
359 phyd_m(:) = pres_hyd(im)
360 phyd_p(:) = pres_hyd(ip)
361
362 gxz_m(:) = g11(im2dto3d(:),ke2d) * g13_m(:) + g12(im2dto3d(:),ke2d) * g23_m(:)
363 gxz_p(:) = g11(im2dto3d(:),ke2d) * g13_p(:) + g12(im2dto3d(:),ke2d) * g23_p(:)
364
365 gyz_m(:) = g12(im2dto3d(:),ke2d) * g13_m(:) + g22(im2dto3d(:),ke2d) * g23_m(:)
366 gyz_p(:) = g12(im2dto3d(:),ke2d) * g13_p(:) + g22(im2dto3d(:),ke2d) * g23_p(:)
367
368 g1n_m(:) = g11(im2dto3d(:),ke2d) * nx(:,ke) + g12(im2dto3d(:),ke2d) * ny(:,ke)
369 g2n_m(:) = g12(im2dto3d(:),ke2d) * nx(:,ke) + g22(im2dto3d(:),ke2d) * ny(:,ke)
370
371 gnn_m(:) = g11(im2dto3d(:),ke2d) * abs( nx(:,ke) ) + g22(im2dto3d(:),ke2d) * abs( ny(:,ke) ) &
372 + ( 1.0_rp / gsqrtv_m(:)**2 + g13_m(:) * gxz_m(:) + g23_m(:) * gyz_m(:) ) * abs( nz(:,ke) )
373 gnn_p(:) = g11(im2dto3d(:),ke2d) * abs( nx(:,ke) ) + g22(im2dto3d(:),ke2d) * abs( ny(:,ke) ) &
374 + ( 1.0_rp / gsqrtv_p(:)**2 + g13_p(:) * gxz_p(:) + g23_p(:) * gyz_p(:) ) * abs( nz(:,ke) )
375
376 gsqrtdensm(:) = gsqrtddens_m(:) + gsqrt_m(:) * dens_hyd(im)
377 gsqrtdensp(:) = gsqrtddens_p(:) + gsqrt_p(:) * dens_hyd(ip)
378
379 velm(:) = ( gsqrtmomx_m(:) * nx(:,ke) + gsqrtmomy_m(:) * ny(:,ke) &
380 + ( ( gsqrtmomz_m(:) / gsqrtv_m(:) &
381 + g13_m(:) * gsqrtmomx_m(:) + g23_m(:) * gsqrtmomy_m(:) ) * nz(:,ke) ) &
382 ) / gsqrtdensm(:)
383 velp(:) = ( gsqrtmomx_p(:) * nx(:,ke) + gsqrtmomy_p(:) * ny(:,ke) &
384 + ( ( gsqrtmomz_p(:) / gsqrtv_p(:) &
385 + g13_p(:) * gsqrtmomx_p(:) + g23_p(:) * gsqrtmomy_p(:) ) * nz(:,ke) ) &
386 ) / gsqrtdensp(:)
387
388 gsqrt_u1m(:) = ( g_11(im2dto3d(:),ke2d) * gsqrtmomx_m(:) + g_12(im2dto3d(:),ke2d) * gsqrtmomy_m(:) )
389 gsqrt_u2m(:) = ( g_12(im2dto3d(:),ke2d) * gsqrtmomx_m(:) + g_22(im2dto3d(:),ke2d) * gsqrtmomy_m(:) )
390 gsqrt_u1p(:) = ( g_11(im2dto3d(:),ke2d) * gsqrtmomx_p(:) + g_12(im2dto3d(:),ke2d) * gsqrtmomy_p(:) )
391 gsqrt_u2p(:) = ( g_12(im2dto3d(:),ke2d) * gsqrtmomx_p(:) + g_22(im2dto3d(:),ke2d) * gsqrtmomy_p(:) )
392
393 ! dpresM(:) = ( CPtot(iM) / CVtot(iM) - 1.0_RP ) &
394 ! * ( GsqrtETOT_M(:) - GsqrtDensM(:) * Grav * zlev(iM) &
395 ! - 0.5_RP * ( GsqrtMOMX_M(:) * Gsqrt_u1M(:) + GsqrtMOMY_M(:) * Gsqrt_u2M(:) + GsqrtMOMZ_M(:)**2 ) / GsqrtDENSM(:) ) / Gsqrt_M(:) &
396 ! - Phyd_M(:)
397 ! dpresP(:) = ( CPtot(iP) / CVtot(iP) - 1.0_RP ) &
398 ! * ( GsqrtETOT_P(:) - GsqrtDensP(:) * Grav * zlev(iM) &
399 ! - 0.5_RP * ( GsqrtMOMX_P(:) * Gsqrt_u1P(:) + GsqrtMOMY_P(:) * Gsqrt_u2P(:) + GsqrtMOMZ_P(:)**2 ) / GsqrtDENSP(:) ) / Gsqrt_P(:) &
400 ! - Phyd_P(:)
401 dpresm(:) = dpres_(im)
402 dpresp(:) = dpres_(ip)
403
404 gsqrtenthalpym(:) = gsqrtetot_m(:) + gsqrt_m(:) * ( phyd_m(:) + dpresm(:) )
405 gsqrtenthalpyp(:) = gsqrtetot_p(:) + gsqrt_p(:) * ( phyd_p(:) + dpresp(:) )
406
407 alpha(:) = max( sqrt( gnn_m(:) * gamm * ( phyd_m(:) + dpresm(:) ) * gsqrt_m(:) / gsqrtdensm(:) ) + abs(velm(:)), &
408 sqrt( gnn_p(:) * gamm * ( phyd_p(:) + dpresp(:) ) * gsqrt_p(:) / gsqrtdensp(:) ) + abs(velp(:)) )
409
410 del_flux(:,ke,dens_vid) = 0.5_rp * ( &
411 ( gsqrtdensp(:) * velp(:) - gsqrtdensm(:) * velm(:) ) &
412 - alpha(:) * ( gsqrtddens_p(:) - gsqrtddens_m(:) ) )
413
414 del_flux(:,ke,momx_vid ) = 0.5_rp * ( &
415 ( gsqrtmomx_p(:) * velp(:) - gsqrtmomx_m(:) * velm(:) ) &
416 + ( gsqrt_p(:) * ( g1n_m(:) + gxz_p(:) * nz(:,ke)) * dpresp(:) &
417 - gsqrt_m(:) * ( g1n_m(:) + gxz_m(:) * nz(:,ke)) * dpresm(:) ) &
418 - alpha(:) * ( gsqrtmomx_p(:) - gsqrtmomx_m(:) ) )
419
420 del_flux(:,ke,momy_vid ) = 0.5_rp * ( &
421 ( gsqrtmomy_p(:) * velp(:) - gsqrtmomy_m(:) * velm(:) ) &
422 + ( gsqrt_p(:) * ( g2n_m(:) + gyz_p(:) * nz(:,ke) ) * dpresp(:) &
423 - gsqrt_m(:) * ( g2n_m(:) + gyz_m(:) * nz(:,ke) ) * dpresm(:) ) &
424 - alpha(:) * ( gsqrtmomy_p(:) - gsqrtmomy_m(:) ) )
425
426 del_flux(:,ke,momz_vid ) = 0.5_rp * ( &
427 ( gsqrtmomz_p(:) * velp(:) - gsqrtmomz_m(:) * velm(:) ) &
428 + ( gsqrt_p(:) * dpresp(:) / gsqrtv_p(:) &
429 - gsqrt_m(:) * dpresm(:) / gsqrtv_m(:) ) * nz(:,ke) &
430 - alpha(:) * ( gsqrtmomz_p(:) - gsqrtmomz_m(:) ) )
431
432 del_flux(:,ke,etot_vid) = 0.5_rp * ( &
433 ( gsqrtenthalpyp(:) * velp(:) - gsqrtenthalpym(:) * velm(:) ) &
434 - alpha(:) * ( gsqrtetot_p(:) - gsqrtetot_m(:) ) )
435
436 del_flux_hyd(:,ke,1) = 0.5_rp * ( &
437 gsqrtv_p(:) * ( nx(:,ke) + g13_p(:) * nz(:,ke) ) * phyd_p(:) &
438 - gsqrtv_m(:) * ( nx(:,ke) + g13_m(:) * nz(:,ke) ) * phyd_m(:) )
439
440 del_flux_hyd(:,ke,2) = 0.5_rp * ( &
441 gsqrtv_p(:) * ( ny(:,ke) + g23_p(:) * nz(:,ke) ) * phyd_p(:) &
442 - gsqrtv_m(:) * ( ny(:,ke) + g23_m(:) * nz(:,ke) ) * phyd_m(:) )
443 end do
444
445 return
447
module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / Common
module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / Numflux
subroutine, public atm_dyn_dgm_nonhydro3d_etot_heve_numflux_get_generalhvc(del_flux, del_flux_hyd, ddens_, momx_, momy_, momz_, etot_, dpres_, dens_hyd, pres_hyd, rtot, cvtot, cptot, gsqrt, g11, g12, g22, g_11, g_12, g_22, gsqrth, g13, g23, zlev, nx, ny, nz, vmapm, vmapp, im2dto3d, lmesh, elem, lmesh2d, elem2d)
subroutine, public atm_dyn_dgm_nonhydro3d_etot_heve_numflux_get_generalvc(del_flux, del_flux_hyd, ddens_, momx_, momy_, momz_, etot_, dpres_, dens_hyd, pres_hyd, rtot, cvtot, cptot, gsqrt, g13, g23, zlev, nx, ny, nz, vmapm, vmapp, lmesh, elem, lmesh2d, elem2d)
module FElib / Element / Base
module FElib / Element / hexahedron
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Mesh / Base 3D
module FElib / Data / base
Module common / sparsemat.
Derived type representing a 2D reference element.
Derived type representing a 3D reference element.
Derived type representing a hexahedral element.
Derived type representing a local mesh for 2D domain.
Derived type to manage a local 3D computational domain.
Derived type representing a field with 3D local mesh.
Derived type to manage a computational mesh (base type for 3D domain)
Derived type representing a field with 3D mesh.