FE-Project
Loading...
Searching...
No Matches
scale_atm_dyn_dgm_nonhydro3d_etot_hevi_numflux Module Reference

module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / HEVI / Numflux More...

Functions/Subroutines

subroutine, public atm_dyn_dgm_nonhydro3d_etot_hevi_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)
subroutine, public atm_dyn_dgm_nonhydro3d_etot_hevi_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)

Detailed Description

module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / HEVI / Numflux

Description
HEVE DGM scheme for Atmospheric dynamical process.
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ atm_dyn_dgm_nonhydro3d_etot_hevi_numflux_get_generalvc()

subroutine, public scale_atm_dyn_dgm_nonhydro3d_etot_hevi_numflux::atm_dyn_dgm_nonhydro3d_etot_hevi_numflux_get_generalvc ( real(rp), dimension(elem%nfptot,lmesh%ne,prgvar_num), intent(out) del_flux,
real(rp), dimension(elem%nfptot,lmesh%ne,2), intent(out) del_flux_hyd,
real(rp), dimension(elem%np*lmesh%nea), intent(in) ddens_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) momx_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) momy_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) momz_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) etot_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) dpres_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) dens_hyd,
real(rp), dimension(elem%np*lmesh%nea), intent(in) pres_hyd,
real(rp), dimension (elem%np*lmesh%nea), intent(in) rtot,
real(rp), dimension(elem%np*lmesh%nea), intent(in) cvtot,
real(rp), dimension(elem%np*lmesh%nea), intent(in) cptot,
real(rp), dimension(elem%np*lmesh%nea), intent(in) gsqrt,
real(rp), dimension(elem%np*lmesh%nea), intent(in) g13,
real(rp), dimension(elem%np*lmesh%nea), intent(in) g23,
real(rp), dimension(elem%np*lmesh%ne), intent(in) zlev,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(in) nx,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(in) ny,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(in) nz,
integer, dimension(elem%nfptot,lmesh%ne), intent(in) vmapm,
integer, dimension(elem%nfptot,lmesh%ne), intent(in) vmapp,
class(localmesh3d), intent(in) lmesh,
class(elementbase3d), intent(in) elem,
class(localmesh2d), intent(in) lmesh2d,
class(elementbase2d), intent(in) elem2d )

Definition at line 67 of file scale_atm_dyn_dgm_nonhydro3d_etot_hevi_numflux.F90.

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) :: VelhP(elem%NfpTot), VelhM(elem%NfpTot)
107 real(RP) :: dpresP(elem%NfpTot), dpresM(elem%NfpTot)
108 real(RP) :: GsqrtDensM(elem%NfpTot), GsqrtDensP(elem%NfpTot)
109 real(RP) :: GsqrtEnthalpyM(elem%NfpTot), GsqrtEnthalpyP(elem%NfpTot)
110 real(RP) :: GsqrtDDENS_P(elem%NfpTot), GsqrtDDENS_M(elem%NfpTot)
111 real(RP) :: GsqrtMOMX_P(elem%NfpTot), GsqrtMOMX_M(elem%NfpTot)
112 real(RP) :: GsqrtMOMY_P(elem%NfpTot), GsqrtMOMY_M(elem%NfpTot)
113 real(RP) :: GsqrtMOMZ_P(elem%NfpTot), GsqrtMOMZ_M(elem%NfpTot)
114 real(RP) :: GsqrtETOT_P(elem%NfpTot), GsqrtETOT_M(elem%NfpTot)
115 real(RP) :: Phyd_P(elem%NfpTot), Phyd_M(elem%NfpTot)
116 real(RP) :: Gsqrt_P(elem%NfpTot), Gsqrt_M(elem%NfpTot)
117 real(RP) :: GsqrtV_P(elem%NfpTot), GsqrtV_M(elem%NfpTot)
118 real(RP) :: G13_M(elem%NfpTot), G13_P(elem%NfpTot)
119 real(RP) :: G23_M(elem%NfpTot), G23_P(elem%NfpTot)
120 real(RP) :: swV(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, VelhM, VelhP, &
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 swV )
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 swv(:) = 1.0_rp - nz(:,ke)**2
170
171 gsqrtdensm(:) = gsqrtddens_m(:) + gsqrt_m(:) * dens_hyd(im)
172 gsqrtdensp(:) = gsqrtddens_p(:) + gsqrt_p(:) * dens_hyd(ip)
173
174 velhm(:) = ( gsqrtmomx_m(:) * nx(:,ke) + gsqrtmomy_m(:) * ny(:,ke) ) / gsqrtdensm(:)
175 velhp(:) = ( gsqrtmomx_p(:) * nx(:,ke) + gsqrtmomy_p(:) * ny(:,ke) ) / gsqrtdensp(:)
176
177 velm(:) = velhm(:) + ( &
178 gsqrtmomz_m(:) / gsqrtv_m(:) + g13_m(:) * gsqrtmomx_m(:) + g23_m(:) * gsqrtmomy_m(:) ) / gsqrtdensm(:) * nz(:,ke)
179 velp(:) = velhp(:) + ( &
180 gsqrtmomz_p(:) / gsqrtv_p(:) + g13_p(:) * gsqrtmomx_p(:) + g23_p(:) * gsqrtmomy_p(:) ) / gsqrtdensp(:) * nz(:,ke)
181
182
183 ! dpresM(:) = ( CPtot(iM) / CVtot(iM) - 1.0_RP ) &
184 ! * ( GsqrtETOT_M(:) - GsqrtDensM(:) * Grav * zlev(iM) &
185 ! - 0.5_RP * ( GsqrtMOMX_M(:)**2 + GsqrtMOMY_M(:)**2 + GsqrtMOMZ_M(:)**2 ) / GsqrtDENSM(:) ) / Gsqrt_M(:) &
186 ! - Phyd_M(:)
187 ! dpresP(:) = ( CPtot(iP) / CVtot(iP) - 1.0_RP ) &
188 ! * ( GsqrtETOT_P(:) - GsqrtDensP(:) * Grav * zlev(iM) &
189 ! - 0.5_RP * ( GsqrtMOMX_P(:)**2 + GsqrtMOMY_P(:)**2 + GsqrtMOMZ_P(:)**2 ) / GsqrtDENSP(:) ) / Gsqrt_P(:) &
190 ! - Phyd_P(:)
191 dpresm(:) = dpres_(im)
192 dpresp(:) = dpres_(ip)
193
194 gsqrtenthalpym(:) = gsqrtetot_m(:) + gsqrt_m(:) * ( phyd_m(:) + dpresm(:) )
195 gsqrtenthalpyp(:) = gsqrtetot_p(:) + gsqrt_p(:) * ( phyd_p(:) + dpresp(:) )
196
197 alpha(:) = swv(:) * max( sqrt( gamm * ( phyd_m(:) + dpresm(:) ) * gsqrt_m(:) / gsqrtdensm(:) ) + abs(velm(:)), &
198 sqrt( gamm * ( phyd_p(:) + dpresp(:) ) * gsqrt_p(:) / gsqrtdensp(:) ) + abs(velp(:)) )
199
200 del_flux(:,ke,dens_vid) = 0.5_rp * ( &
201 ( gsqrtdensp(:) * velhp(:) - gsqrtdensm(:) * velhm(:) ) &
202 - alpha(:) * ( gsqrtddens_p(:) - gsqrtddens_m(:) ) )
203
204 del_flux(:,ke,momx_vid ) = 0.5_rp * ( &
205 ( gsqrtmomx_p(:) * velp(:) - gsqrtmomx_m(:) * velm(:) ) &
206 + ( gsqrt_p(:) * ( nx(:,ke) + g13_p(:) * nz(:,ke)) * dpresp(:) &
207 - gsqrt_m(:) * ( nx(:,ke) + g13_m(:) * nz(:,ke)) * dpresm(:) ) &
208 - alpha(:) * ( gsqrtmomx_p(:) - gsqrtmomx_m(:) ) )
209
210 del_flux(:,ke,momy_vid ) = 0.5_rp * ( &
211 ( gsqrtmomy_p(:) * velp(:) - gsqrtmomy_m(:) * velm(:) ) &
212 + ( gsqrt_p(:) * ( ny(:,ke) + g23_p(:) * nz(:,ke)) * dpresp(:) &
213 - gsqrt_m(:) * ( ny(:,ke) + g23_m(:) * nz(:,ke)) * dpresm(:) ) &
214 - alpha(:) * ( gsqrtmomy_p(:) - gsqrtmomy_m(:) ) )
215
216 del_flux(:,ke,momz_vid ) = 0.5_rp * ( &
217 ( gsqrtmomz_p(:) * velp(:) - gsqrtmomz_m(:) * velm(:) ) &
218 - alpha(:) * ( gsqrtmomz_p(:) - gsqrtmomz_m(:) ) )
219
220 del_flux(:,ke,etot_vid) = 0.5_rp * ( &
221 ( gsqrtenthalpyp(:) * velhp(:) - gsqrtenthalpym(:) * velhm(:) ) &
222 - alpha(:) * ( gsqrtetot_p(:) - gsqrtetot_m(:) ) )
223
224 del_flux_hyd(:,ke,1) = 0.5_rp * ( &
225 gsqrtv_p(:) * ( nx(:,ke) + g13_p(:) * nz(:,ke) ) * phyd_p(:) &
226 - gsqrtv_m(:) * ( nx(:,ke) + g13_m(:) * nz(:,ke) ) * phyd_m(:) )
227
228 del_flux_hyd(:,ke,2) = 0.5_rp * ( &
229 gsqrtv_p(:) * ( ny(:,ke) + g23_p(:) * nz(:,ke) ) * phyd_p(:) &
230 - gsqrtv_m(:) * ( ny(:,ke) + g23_m(:) * nz(:,ke) ) * phyd_m(:) )
231 end do
232
233 return

Referenced by scale_atm_dyn_dgm_nonhydro3d_etot_hevi::atm_dyn_dgm_nonhydro3d_etot_hevi_cal_tend().

◆ atm_dyn_dgm_nonhydro3d_etot_hevi_numflux_get_generalhvc()

subroutine, public scale_atm_dyn_dgm_nonhydro3d_etot_hevi_numflux::atm_dyn_dgm_nonhydro3d_etot_hevi_numflux_get_generalhvc ( real(rp), dimension(elem%nfptot,lmesh%ne,prgvar_num), intent(out) del_flux,
real(rp), dimension(elem%nfptot,lmesh%ne,2), intent(out) del_flux_hyd,
real(rp), dimension(elem%np*lmesh%nea), intent(in) ddens_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) momx_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) momy_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) momz_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) etot_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) dpres_,
real(rp), dimension(elem%np*lmesh%nea), intent(in) dens_hyd,
real(rp), dimension(elem%np*lmesh%nea), intent(in) pres_hyd,
real(rp), dimension (elem%np*lmesh%nea), intent(in) rtot,
real(rp), dimension(elem%np*lmesh%nea), intent(in) cvtot,
real(rp), dimension(elem%np*lmesh%nea), intent(in) cptot,
real(rp), dimension(elem%np*lmesh%nea), intent(in) gsqrt,
real(rp), dimension(elem2d%np,lmesh2d%ne), intent(in) g11,
real(rp), dimension(elem2d%np,lmesh2d%ne), intent(in) g12,
real(rp), dimension(elem2d%np,lmesh2d%ne), intent(in) g22,
real(rp), dimension(elem2d%np,lmesh2d%ne), intent(in) g_11,
real(rp), dimension(elem2d%np,lmesh2d%ne), intent(in) g_12,
real(rp), dimension(elem2d%np,lmesh2d%ne), intent(in) g_22,
real(rp), dimension(elem2d%np,lmesh2d%ne), intent(in) gsqrth,
real(rp), dimension(elem%np*lmesh%nea), intent(in) g13,
real(rp), dimension(elem%np*lmesh%nea), intent(in) g23,
real(rp), dimension(elem%np*lmesh%ne), intent(in) zlev,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(in) nx,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(in) ny,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(in) nz,
integer, dimension(elem%nfptot,lmesh%ne), intent(in) vmapm,
integer, dimension(elem%nfptot,lmesh%ne), intent(in) vmapp,
integer, dimension(elem%nfptot), intent(in) im2dto3d,
class(localmesh3d), intent(in) lmesh,
class(elementbase3d), intent(in) elem,
class(localmesh2d), intent(in) lmesh2d,
class(elementbase2d), intent(in) elem2d )

Definition at line 238 of file scale_atm_dyn_dgm_nonhydro3d_etot_hevi_numflux.F90.

244
245 implicit none
246
247 class(LocalMesh3D), intent(in) :: lmesh
248 class(ElementBase3D), intent(in) :: elem
249 class(LocalMesh2D), intent(in) :: lmesh2D
250 class(ElementBase2D), intent(in) :: elem2D
251 real(RP), intent(out) :: del_flux(elem%NfpTot,lmesh%Ne,PRGVAR_NUM)
252 real(RP), intent(out) :: del_flux_hyd(elem%NfpTot,lmesh%Ne,2)
253 real(RP), intent(in) :: DDENS_(elem%Np*lmesh%NeA)
254 real(RP), intent(in) :: MOMX_(elem%Np*lmesh%NeA)
255 real(RP), intent(in) :: MOMY_(elem%Np*lmesh%NeA)
256 real(RP), intent(in) :: MOMZ_(elem%Np*lmesh%NeA)
257 real(RP), intent(in) :: ETOT_(elem%Np*lmesh%NeA)
258 real(RP), intent(in) :: DPRES_(elem%Np*lmesh%NeA)
259 real(RP), intent(in) :: DENS_hyd(elem%Np*lmesh%NeA)
260 real(RP), intent(in) :: PRES_hyd(elem%Np*lmesh%NeA)
261 real(RP), intent(in) :: Rtot (elem%Np*lmesh%NeA)
262 real(RP), intent(in) :: CVtot(elem%Np*lmesh%NeA)
263 real(RP), intent(in) :: CPtot(elem%Np*lmesh%NeA)
264 real(RP), intent(in) :: Gsqrt(elem%Np*lmesh%NeA)
265 real(RP), intent(in) :: G11(elem2D%Np,lmesh2D%Ne)
266 real(RP), intent(in) :: G12(elem2D%Np,lmesh2D%Ne)
267 real(RP), intent(in) :: G22(elem2D%Np,lmesh2D%Ne)
268 real(RP), intent(in) :: G_11(elem2D%Np,lmesh2D%Ne)
269 real(RP), intent(in) :: G_12(elem2D%Np,lmesh2D%Ne)
270 real(RP), intent(in) :: G_22(elem2D%Np,lmesh2D%Ne)
271 real(RP), intent(in) :: GsqrtH(elem2D%Np,lmesh2D%Ne)
272 real(RP), intent(in) :: G13(elem%Np*lmesh%NeA)
273 real(RP), intent(in) :: G23(elem%Np*lmesh%NeA)
274 real(RP), intent(in) :: zlev(elem%Np*lmesh%Ne)
275 real(RP), intent(in) :: nx(elem%NfpTot,lmesh%Ne)
276 real(RP), intent(in) :: ny(elem%NfpTot,lmesh%Ne)
277 real(RP), intent(in) :: nz(elem%NfpTot,lmesh%Ne)
278 integer, intent(in) :: vmapM(elem%NfpTot,lmesh%Ne)
279 integer, intent(in) :: vmapP(elem%NfpTot,lmesh%Ne)
280 integer, intent(in) :: iM2Dto3D(elem%NfpTot)
281
282 integer :: ke, iP(elem%NfpTot), iM(elem%NfpTot)
283 integer :: ke2D
284 real(RP) :: VelP(elem%NfpTot), VelM(elem%NfpTot), alpha(elem%NfpTot)
285 real(RP) :: VelhP(elem%NfpTot), VelhM(elem%NfpTot)
286 real(RP) :: dpresP(elem%NfpTot), dpresM(elem%NfpTot)
287 real(RP) :: GsqrtDensM(elem%NfpTot), GsqrtDensP(elem%NfpTot)
288 real(RP) :: GsqrtEnthalpyM(elem%NfpTot), GsqrtEnthalpyP(elem%NfpTot)
289 real(RP) :: GsqrtDDENS_P(elem%NfpTot), GsqrtDDENS_M(elem%NfpTot)
290 real(RP) :: GsqrtMOMX_P(elem%NfpTot), GsqrtMOMX_M(elem%NfpTot)
291 real(RP) :: GsqrtMOMY_P(elem%NfpTot), GsqrtMOMY_M(elem%NfpTot)
292 real(RP) :: GsqrtMOMZ_P(elem%NfpTot), GsqrtMOMZ_M(elem%NfpTot)
293 real(RP) :: GsqrtETOT_P(elem%NfpTot), GsqrtETOT_M(elem%NfpTot)
294 real(RP) :: Phyd_P(elem%NfpTot), Phyd_M(elem%NfpTot)
295 real(RP) :: Gsqrt_P(elem%NfpTot), Gsqrt_M(elem%NfpTot)
296 real(RP) :: GsqrtV_P(elem%NfpTot), GsqrtV_M(elem%NfpTot)
297 real(RP) :: G13_M(elem%NfpTot), G13_P(elem%NfpTot)
298 real(RP) :: G23_M(elem%NfpTot), G23_P(elem%NfpTot)
299 real(RP) :: G1n_M(elem%NfpTot), G2n_M(elem%NfpTot)
300 real(RP) :: Gnn_M(elem%NfpTot), Gnn_P(elem%NfpTot)
301 real(RP) :: Gxz_M(elem%NfpTot), Gxz_P(elem%NfpTot)
302 real(RP) :: Gyz_M(elem%NfpTot), Gyz_P(elem%NfpTot)
303 real(RP) :: swV(elem%NfpTot)
304
305 real(RP) :: Gsqrt_u1M(elem%NfpTot), Gsqrt_u2M(elem%NfpTot)
306 real(RP) :: Gsqrt_u1P(elem%NfpTot), Gsqrt_u2P(elem%NfpTot)
307
308 real(RP) :: gamm, rgamm
309 real(RP) :: rP0
310 real(RP) :: RovP0, P0ovR
311
312 !------------------------------------------------------------------------
313
314 gamm = cpdry / cvdry
315 rgamm = cvdry / cpdry
316 rp0 = 1.0_rp / pres00
317 rovp0 = rdry * rp0
318 p0ovr = pres00 / rdry
319
320 !$omp parallel do private( &
321 !$omp ke, iM, iP, ke2d, &
322 !$omp alpha, VelM, VelP, VelhM, VelhP, &
323 !$omp dpresM, dpresP, GsqrtDensM, GsqrtDensP, &
324 !$omp GsqrtMOMX_M, GsqrtMOMX_P, GsqrtMOMY_M, GsqrtMOMY_P, GsqrtMOMZ_M, GsqrtMOMZ_P, &
325 !$omp GsqrtDDENS_M, GsqrtDDENS_P, GsqrtETOT_M, GsqrtETOT_P, &
326 !$omp GsqrtEnthalpyM, GsqrtEnthalpyP, &
327 !$omp Gsqrt_u1M, Gsqrt_u2M, Gsqrt_u1P, Gsqrt_u2P, &
328 !$omp Phyd_M, Phyd_P, &
329 !$omp Gsqrt_P, Gsqrt_M, GsqrtV_P, GsqrtV_M, G13_P, G13_M, G23_P, G23_M, &
330 !$omp Gxz_P, Gxz_M, Gyz_P, Gyz_M, G1n_M, G2n_M, Gnn_P, Gnn_M, swV )
331 do ke=lmesh%NeS, lmesh%NeE
332 im(:) = vmapm(:,ke); ip(:) = vmapp(:,ke)
333 ke2d = lmesh%EMap3Dto2D(ke)
334
335 gsqrt_m(:) = gsqrt(im)
336 gsqrt_p(:) = gsqrt(ip)
337 gsqrtv_m(:) = gsqrt_m(:) / gsqrth(im2dto3d(:),ke2d)
338 gsqrtv_p(:) = gsqrt_p(:) / gsqrth(im2dto3d(:),ke2d)
339
340 g13_m(:) = g13(im)
341 g13_p(:) = g13(ip)
342 g23_m(:) = g23(im)
343 g23_p(:) = g23(ip)
344
345 gsqrtddens_m(:) = gsqrt_m(:) * ddens_(im)
346 gsqrtddens_p(:) = gsqrt_p(:) * ddens_(ip)
347 gsqrtmomx_m(:) = gsqrt_m(:) * momx_(im)
348 gsqrtmomx_p(:) = gsqrt_p(:) * momx_(ip)
349 gsqrtmomy_m(:) = gsqrt_m(:) * momy_(im)
350 gsqrtmomy_p(:) = gsqrt_p(:) * momy_(ip)
351 gsqrtmomz_m(:) = gsqrt_m(:) * momz_(im)
352 gsqrtmomz_p(:) = gsqrt_p(:) * momz_(ip)
353 gsqrtetot_m(:) = gsqrt_m(:) * etot_(im)
354 gsqrtetot_p(:) = gsqrt_p(:) * etot_(ip)
355 phyd_m(:) = pres_hyd(im)
356 phyd_p(:) = pres_hyd(ip)
357 swv(:) = 1.0_rp - nz(:,ke)**2
358
359 gxz_m(:) = g11(im2dto3d(:),ke2d) * g13_m(:) + g12(im2dto3d(:),ke2d) * g23_m(:)
360 gxz_p(:) = g11(im2dto3d(:),ke2d) * g13_p(:) + g12(im2dto3d(:),ke2d) * g23_p(:)
361
362 gyz_m(:) = g12(im2dto3d(:),ke2d) * g13_m(:) + g22(im2dto3d(:),ke2d) * g23_m(:)
363 gyz_p(:) = g12(im2dto3d(:),ke2d) * g13_p(:) + g22(im2dto3d(:),ke2d) * g23_p(:)
364
365 g1n_m(:) = g11(im2dto3d(:),ke2d) * nx(:,ke) + g12(im2dto3d(:),ke2d) * ny(:,ke)
366 g2n_m(:) = g12(im2dto3d(:),ke2d) * nx(:,ke) + g22(im2dto3d(:),ke2d) * ny(:,ke)
367
368 gnn_m(:) = g11(im2dto3d(:),ke2d) * abs( nx(:,ke) ) + g22(im2dto3d(:),ke2d) * abs( ny(:,ke) ) &
369 + ( 1.0_rp / gsqrtv_m(:)**2 + g13_m(:) * gxz_m(:) + g23_m(:) * gyz_m(:) ) * abs( nz(:,ke) )
370 gnn_p(:) = g11(im2dto3d(:),ke2d) * abs( nx(:,ke) ) + g22(im2dto3d(:),ke2d) * abs( ny(:,ke) ) &
371 + ( 1.0_rp / gsqrtv_p(:)**2 + g13_p(:) * gxz_p(:) + g23_p(:) * gyz_p(:) ) * abs( nz(:,ke) )
372
373 gsqrtdensm(:) = gsqrtddens_m(:) + gsqrt_m(:) * dens_hyd(im)
374 gsqrtdensp(:) = gsqrtddens_p(:) + gsqrt_p(:) * dens_hyd(ip)
375
376 velhm(:) = ( gsqrtmomx_m(:) * nx(:,ke) + gsqrtmomy_m(:) * ny(:,ke) ) / gsqrtdensm(:)
377 velhp(:) = ( gsqrtmomx_p(:) * nx(:,ke) + gsqrtmomy_p(:) * ny(:,ke) ) / gsqrtdensp(:)
378
379 velm(:) = velhm(:) + ( &
380 gsqrtmomz_m(:) / gsqrtv_m(:) + g13_m(:) * gsqrtmomx_m(:) + g23_m(:) * gsqrtmomy_m(:) ) / gsqrtdensm(:) * nz(:,ke)
381 velp(:) = velhp(:) + ( &
382 gsqrtmomz_p(:) / gsqrtv_p(:) + g13_p(:) * gsqrtmomx_p(:) + g23_p(:) * gsqrtmomy_p(:) ) / gsqrtdensp(:) * nz(:,ke)
383
384 gsqrt_u1m(:) = ( g_11(im2dto3d(:),ke2d) * gsqrtmomx_m(:) + g_12(im2dto3d(:),ke2d) * gsqrtmomy_m(:) )
385 gsqrt_u2m(:) = ( g_12(im2dto3d(:),ke2d) * gsqrtmomx_m(:) + g_22(im2dto3d(:),ke2d) * gsqrtmomy_m(:) )
386 gsqrt_u1p(:) = ( g_11(im2dto3d(:),ke2d) * gsqrtmomx_p(:) + g_12(im2dto3d(:),ke2d) * gsqrtmomy_p(:) )
387 gsqrt_u2p(:) = ( g_12(im2dto3d(:),ke2d) * gsqrtmomx_p(:) + g_22(im2dto3d(:),ke2d) * gsqrtmomy_p(:) )
388
389 ! dpresM(:) = ( CPtot(iM) / CVtot(iM) - 1.0_RP ) &
390 ! * ( GsqrtETOT_M(:) - GsqrtDensM(:) * Grav * zlev(iM) &
391 ! - 0.5_RP * ( GsqrtMOMX_M(:) * Gsqrt_u1M(:) + GsqrtMOMY_M(:) * Gsqrt_u2M(:) + GsqrtMOMZ_M(:)**2 ) / GsqrtDENSM(:) ) / Gsqrt_M(:) &
392 ! - Phyd_M(:)
393 ! dpresP(:) = ( CPtot(iP) / CVtot(iP) - 1.0_RP ) &
394 ! * ( GsqrtETOT_P(:) - GsqrtDensP(:) * Grav * zlev(iM) &
395 ! - 0.5_RP * ( GsqrtMOMX_P(:) * Gsqrt_u1P(:) + GsqrtMOMY_P(:) * Gsqrt_u2P(:) + GsqrtMOMZ_P(:)**2 ) / GsqrtDENSP(:) ) / Gsqrt_P(:) &
396 ! - Phyd_P(:)
397 dpresm(:) = dpres_(im)
398 dpresp(:) = dpres_(ip)
399
400 gsqrtenthalpym(:) = gsqrtetot_m(:) + gsqrt_m(:) * ( phyd_m(:) + dpresm(:) )
401 gsqrtenthalpyp(:) = gsqrtetot_p(:) + gsqrt_p(:) * ( phyd_p(:) + dpresp(:) )
402
403 alpha(:) = swv(:) * max( sqrt( gnn_m(:) * gamm * ( phyd_m(:) + dpresm(:) ) * gsqrt_m(:) / gsqrtdensm(:) ) + abs(velm(:)), &
404 sqrt( gnn_p(:) * gamm * ( phyd_p(:) + dpresp(:) ) * gsqrt_p(:) / gsqrtdensp(:) ) + abs(velp(:)) )
405
406 del_flux(:,ke,dens_vid) = 0.5_rp * ( &
407 ( gsqrtdensp(:) * velhp(:) - gsqrtdensm(:) * velhm(:) ) &
408 - alpha(:) * ( gsqrtddens_p(:) - gsqrtddens_m(:) ) )
409
410 del_flux(:,ke,momx_vid ) = 0.5_rp * ( &
411 ( gsqrtmomx_p(:) * velp(:) - gsqrtmomx_m(:) * velm(:) ) &
412 + ( gsqrt_p(:) * ( g1n_m(:) + gxz_p(:) * nz(:,ke)) * dpresp(:) &
413 - gsqrt_m(:) * ( g1n_m(:) + gxz_m(:) * nz(:,ke)) * dpresm(:) ) &
414 - alpha(:) * ( gsqrtmomx_p(:) - gsqrtmomx_m(:) ) )
415
416 del_flux(:,ke,momy_vid ) = 0.5_rp * ( &
417 ( gsqrtmomy_p(:) * velp(:) - gsqrtmomy_m(:) * velm(:) ) &
418 + ( gsqrt_p(:) * ( g2n_m(:) + gyz_p(:) * nz(:,ke) ) * dpresp(:) &
419 - gsqrt_m(:) * ( g2n_m(:) + gyz_m(:) * nz(:,ke) ) * dpresm(:) ) &
420 - alpha(:) * ( gsqrtmomy_p(:) - gsqrtmomy_m(:) ) )
421
422 del_flux(:,ke,momz_vid ) = 0.5_rp * ( &
423 ( gsqrtmomz_p(:) * velp(:) - gsqrtmomz_m(:) * velm(:) ) &
424 - alpha(:) * ( gsqrtmomz_p(:) - gsqrtmomz_m(:) ) )
425
426 del_flux(:,ke,etot_vid) = 0.5_rp * ( &
427 ( gsqrtenthalpyp(:) * velhp(:) - gsqrtenthalpym(:) * velhm(:) ) &
428 - alpha(:) * ( gsqrtetot_p(:) - gsqrtetot_m(:) ) )
429
430 del_flux_hyd(:,ke,1) = 0.5_rp * ( &
431 gsqrtv_p(:) * ( nx(:,ke) + g13_p(:) * nz(:,ke) ) * phyd_p(:) &
432 - gsqrtv_m(:) * ( nx(:,ke) + g13_m(:) * nz(:,ke) ) * phyd_m(:) )
433
434 del_flux_hyd(:,ke,2) = 0.5_rp * ( &
435 gsqrtv_p(:) * ( ny(:,ke) + g23_p(:) * nz(:,ke) ) * phyd_p(:) &
436 - gsqrtv_m(:) * ( ny(:,ke) + g23_m(:) * nz(:,ke) ) * phyd_m(:) )
437 end do
438
439 return

Referenced by scale_atm_dyn_dgm_globalnonhydro3d_etot_hevi::atm_dyn_dgm_globalnonhydro3d_etot_hevi_cal_tend().