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

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

Functions/Subroutines

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)
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)

Detailed Description

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

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

Function/Subroutine Documentation

◆ atm_dyn_dgm_nonhydro3d_etot_heve_numflux_get_generalvc()

subroutine, public scale_atm_dyn_dgm_nonhydro3d_etot_heve_numflux::atm_dyn_dgm_nonhydro3d_etot_heve_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_heve_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) :: 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

Referenced by scale_atm_dyn_dgm_nonhydro3d_etot_heve::atm_dyn_dgm_nonhydro3d_etot_heve_cal_tend().

◆ atm_dyn_dgm_nonhydro3d_etot_heve_numflux_get_generalhvc()

subroutine, public scale_atm_dyn_dgm_nonhydro3d_etot_heve_numflux::atm_dyn_dgm_nonhydro3d_etot_heve_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 245 of file scale_atm_dyn_dgm_nonhydro3d_etot_heve_numflux.F90.

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

Referenced by scale_atm_dyn_dgm_globalnonhydro3d_etot_heve::atm_dyn_dgm_globalnonhydro3d_etot_heve_cal_tend().