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

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

Functions/Subroutines

subroutine, public atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_get_generalvc_gpu (del_flux, ddens_, momx_, momy_, momz_, drhot_, dpres, dens_hyd, pres_hyd, therm_hyd, rtot, cvtot, cptot, gsqrt, g13, g23, nx, ny, nz, vmapm, vmapp, lmesh, elem, lmesh2d, elem2d)
subroutine, public atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_get_generalhvc_gpu (del_flux, ddens_, momx_, momy_, momz_, drhot_, dpres, dens_hyd, pres_hyd, therm_hyd, rtot, cvtot, cptot, gsqrt, g11, g12, g22, gsqrth, gam, g13, g23, nx, ny, nz, vmapm, vmapp, im2dto3d, lmesh, elem, lmesh2d, elem2d)

Detailed Description

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

Description
An module for numerical fluxes for HEVE atmospheric dynamical process which runs on GPU.
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_get_generalvc_gpu()

subroutine, public scale_atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_gpu::atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_get_generalvc_gpu ( real(rp), dimension(elem%nfptot,prgvar_num,lmesh%ne), intent(out) del_flux,
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) drhot_,
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) therm_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%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 65 of file scale_atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_gpu.F90.

71
72 implicit none
73
74 class(LocalMesh3D), intent(in) :: lmesh
75 class(ElementBase3D), intent(in) :: elem
76 class(LocalMesh2D), intent(in) :: lmesh2D
77 class(ElementBase2D), intent(in) :: elem2D
78 real(RP), intent(out) :: del_flux(elem%NfpTot,PRGVAR_NUM,lmesh%Ne)
79 real(RP), intent(in) :: DDENS_(elem%Np*lmesh%NeA)
80 real(RP), intent(in) :: MOMX_(elem%Np*lmesh%NeA)
81 real(RP), intent(in) :: MOMY_(elem%Np*lmesh%NeA)
82 real(RP), intent(in) :: MOMZ_(elem%Np*lmesh%NeA)
83 real(RP), intent(in) :: DRHOT_(elem%Np*lmesh%NeA)
84 real(RP), intent(in) :: DPRES(elem%Np*lmesh%NeA)
85 real(RP), intent(in) :: DENS_hyd(elem%Np*lmesh%NeA)
86 real(RP), intent(in) :: PRES_hyd(elem%Np*lmesh%NeA)
87 real(RP), intent(in) :: THERM_hyd(elem%Np*lmesh%NeA)
88 real(RP), intent(in) :: Rtot (elem%Np*lmesh%NeA)
89 real(RP), intent(in) :: CVtot(elem%Np*lmesh%NeA)
90 real(RP), intent(in) :: CPtot(elem%Np*lmesh%NeA)
91 real(RP), intent(in) :: Gsqrt(elem%Np*lmesh%NeA)
92 real(RP), intent(in) :: G13(elem%Np*lmesh%NeA)
93 real(RP), intent(in) :: G23(elem%Np*lmesh%NeA)
94 real(RP), intent(in) :: nx(elem%NfpTot,lmesh%Ne)
95 real(RP), intent(in) :: ny(elem%NfpTot,lmesh%Ne)
96 real(RP), intent(in) :: nz(elem%NfpTot,lmesh%Ne)
97 integer, intent(in) :: vmapM(elem%NfpTot,lmesh%Ne)
98 integer, intent(in) :: vmapP(elem%NfpTot,lmesh%Ne)
99
100 integer :: ke, fp, i, iP, iM
101 integer :: ke2D
102 real(RP) :: Vel_M, Vel_P, alpha
103 real(RP) :: DPRES_M, DPRES_P
104 real(RP) :: GsqrtDens_M, GsqrtDens_P
105 real(RP) :: GsqrtRhot_M, GsqrtRhot_P
106 real(RP) :: GsqrtDDENS_M, GsqrtDDENS_P
107 real(RP) :: GsqrtMOMX_M, GsqrtMOMX_P
108 real(RP) :: GsqrtMOMY_M, GsqrtMOMY_P
109 real(RP) :: GsqrtMOMZ_M, GsqrtMOMZ_P
110 real(RP) :: GsqrtDRHOT_M, GsqrtDRHOT_P
111 real(RP) :: Gsqrt_M, Gsqrt_P
112 real(RP) :: GsqrtV_M, GsqrtV_P
113 real(RP) :: RGsqrtV_M, RGsqrtV_P
114 real(RP) :: G13_M, G13_P
115 real(RP) :: G23_M, G23_P
116 real(RP) :: Gnn_M, Gnn_P
117
118 real(RP) :: gamm, rgamm
119 real(RP) :: rP0
120 real(RP) :: RovP0, P0ovR
121
122 real(RP) :: tmp1
123 real(RP) :: del_flux_tmp_momz, del_flux_tmp_momx, del_flux_tmp_momy
124 real(RP) :: GsqrtDPres_M, GsqrtDPres_P
125 real(RP) :: nx_, ny_, nz_, fscale_
126
127 integer :: NeS, NeE, NfpTot
128 !------------------------------------------------------------------------
129
130 gamm = cpdry / cvdry
131 rgamm = cvdry / cpdry
132 rp0 = 1.0_rp / pres00
133 rovp0 = rdry * rp0
134 p0ovr = pres00 / rdry
135
136 nes = lmesh%NeS; nee = lmesh%NeE
137 nfptot = elem%NfpTot
138
139 !$acc parallel present( DDENS_,MOMX_,MOMY_,MOMZ_,DRHOT_,DPRES, &
140 !$acc DENS_hyd,PRES_hyd,THERM_hyd, &
141 !$acc Gsqrt,G13,G23,nx,ny,nz,vmapM,vmapP, &
142 !$acc del_flux, lmesh, elem )
143 !$acc loop gang
144 do ke=nes, nee
145 !$acc loop vector
146 do fp=1, nfptot
147
148 im = vmapm(fp,ke); ip = vmapp(fp,ke)
149 ke2d = lmesh%EMap3Dto2D(ke)
150
151 nx_ = nx(fp,ke); ny_ = ny(fp,ke); nz_ = nz(fp,ke)
152
153 !-
154 gsqrt_m = gsqrt(im)
155 gsqrt_p = gsqrt(ip)
156 gsqrtv_m = gsqrt_m
157 gsqrtv_p = gsqrt_p
158
159 rgsqrtv_m = 1.0_rp / gsqrtv_m
160 rgsqrtv_p = 1.0_rp / gsqrtv_p
161
162 g13_m = g13(im)
163 g13_p = g13(ip)
164 g23_m = g23(im)
165 g23_p = g23(ip)
166
167 gsqrtddens_m = gsqrt_m * ddens_(im)
168 gsqrtddens_p = gsqrt_p * ddens_(ip)
169 gsqrtmomx_m = gsqrt_m * momx_(im)
170 gsqrtmomx_p = gsqrt_p * momx_(ip)
171 gsqrtmomy_m = gsqrt_m * momy_(im)
172 gsqrtmomy_p = gsqrt_p * momy_(ip)
173 gsqrtmomz_m = gsqrt_m * momz_(im)
174 gsqrtmomz_p = gsqrt_p * momz_(ip)
175 gsqrtdrhot_m = gsqrt_m * drhot_(im)
176 gsqrtdrhot_p = gsqrt_p * drhot_(ip)
177
178 dpres_m = dpres(im)
179 dpres_p = dpres(ip)
180
181 gsqrtdens_p = gsqrtddens_p + gsqrt_p * dens_hyd(ip)
182 gsqrtdens_m = gsqrtddens_m + gsqrt_m * dens_hyd(im)
183
184 gsqrtrhot_p = gsqrt_p * therm_hyd(ip) + gsqrtdrhot_p
185 gsqrtrhot_m = gsqrt_m * therm_hyd(im) + gsqrtdrhot_m
186
187 vel_m = ( gsqrtmomx_m * nx_ + gsqrtmomy_m * ny_ &
188 + ( ( gsqrtmomz_m * rgsqrtv_m &
189 + g13_m * gsqrtmomx_m + g23_m * gsqrtmomy_m ) * nz_ ) &
190 ) / gsqrtdens_m
191
192 vel_p = ( gsqrtmomx_p * nx_ + gsqrtmomy_p * ny_ &
193 + ( ( gsqrtmomz_p * rgsqrtv_p &
194 + g13_p * gsqrtmomx_p + g23_p * gsqrtmomy_p ) * nz_ ) &
195 ) / gsqrtdens_p
196
197
198 !--
199
200 tmp1 = abs( nx_ ) + abs( ny_ )
201 gnn_m = tmp1 &
202 + ( 1.0_rp * rgsqrtv_m**2 + g13_m**2 + g23_m**2 ) * abs( nz_ )
203
204 gnn_p = tmp1 &
205 + ( 1.0_rp * rgsqrtv_p**2 + g13_p**2 + g23_p**2 ) * abs( nz_ )
206
207 alpha = max( sqrt( gnn_m * gamm * ( pres_hyd(im) + dpres_m ) * gsqrt_m / gsqrtdens_m ) + abs(vel_m), &
208 sqrt( gnn_p * gamm * ( pres_hyd(ip) + dpres_p ) * gsqrt_p / gsqrtdens_p ) + abs(vel_p) )
209
210
211 !-
212
213 !---------------------------------------
214 fscale_ = 0.5_rp * lmesh%Fscale(fp,ke)
215
216 !- density and potential temperature
217
218 del_flux(fp,dens_vid,ke) = fscale_ * ( &
219 gsqrtdens_p * vel_p - gsqrtdens_m * vel_m &
220 - alpha * ( gsqrtddens_p - gsqrtddens_m ) )
221
222 del_flux(fp,rhot_vid,ke) = fscale_ * ( &
223 gsqrtrhot_p * vel_p - gsqrtrhot_m * vel_m &
224 - alpha * ( gsqrtdrhot_p - gsqrtdrhot_m ) )
225
226 !-
227 gsqrtdpres_m = gsqrt_m * dpres_m
228 gsqrtdpres_p = gsqrt_p * dpres_p
229
230 del_flux(fp,momz_vid,ke) = fscale_ * ( &
231 gsqrtmomz_p * vel_p - gsqrtmomz_m * vel_m &
232 + ( gsqrtdpres_p * rgsqrtv_p &
233 - gsqrtdpres_m * rgsqrtv_m ) * nz_ &
234 - alpha * ( gsqrtmomz_p - gsqrtmomz_m ) )
235
236 del_flux(fp,momx_vid,ke) = fscale_ * ( &
237 gsqrtmomx_p * vel_p - gsqrtmomx_m * vel_m &
238 + ( nx_ + g13_p * nz_ ) * gsqrtdpres_p &
239 - ( nx_ + g13_m * nz_ ) * gsqrtdpres_m &
240 - alpha * ( gsqrtmomx_p - gsqrtmomx_m ) )
241
242 del_flux(fp,momy_vid,ke) = fscale_ * ( &
243 gsqrtmomy_p * vel_p - gsqrtmomy_m * vel_m &
244 + ( ny_ + g23_p * nz_ ) * gsqrtdpres_p &
245 - ( ny_ + g23_m * nz_ ) * gsqrtdpres_m &
246 - alpha * ( gsqrtmomy_p - gsqrtmomy_m ) )
247 end do
248 end do
249 !$acc end parallel
250
251 return

Referenced by scale_atm_dyn_dgm_nonhydro3d_rhot_heve_gpu::atm_dyn_dgm_nonhydro3d_rhot_heve_cal_tend_gpu(), and scale_atm_dyn_dgm_nonhydro3d_rhot_heve_gpu::atm_dyn_dgm_nonhydro3d_rhot_heve_cal_tend_gpu2().

◆ atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_get_generalhvc_gpu()

subroutine, public scale_atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_gpu::atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_get_generalhvc_gpu ( real(rp), dimension(elem%nfptot,prgvar_num,lmesh%ne), intent(out) del_flux,
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) drhot_,
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) therm_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) gsqrth,
real(rp), dimension(elem%np*lmesh%nea), intent(in) gam,
real(rp), dimension(elem%np*lmesh%nea), intent(in) g13,
real(rp), dimension(elem%np*lmesh%nea), intent(in) g23,
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 254 of file scale_atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_gpu.F90.

260
261 implicit none
262
263 class(LocalMesh3D), intent(in) :: lmesh
264 class(ElementBase3D), intent(in) :: elem
265 class(LocalMesh2D), intent(in) :: lmesh2D
266 class(ElementBase2D), intent(in) :: elem2D
267 real(RP), intent(out) :: del_flux(elem%NfpTot,PRGVAR_NUM,lmesh%Ne)
268 real(RP), intent(in) :: DDENS_(elem%Np*lmesh%NeA)
269 real(RP), intent(in) :: MOMX_(elem%Np*lmesh%NeA)
270 real(RP), intent(in) :: MOMY_(elem%Np*lmesh%NeA)
271 real(RP), intent(in) :: MOMZ_(elem%Np*lmesh%NeA)
272 real(RP), intent(in) :: DRHOT_(elem%Np*lmesh%NeA)
273 real(RP), intent(in) :: DPRES(elem%Np*lmesh%NeA)
274 real(RP), intent(in) :: DENS_hyd(elem%Np*lmesh%NeA)
275 real(RP), intent(in) :: PRES_hyd(elem%Np*lmesh%NeA)
276 real(RP), intent(in) :: THERM_hyd(elem%Np*lmesh%NeA)
277 real(RP), intent(in) :: Rtot (elem%Np*lmesh%NeA)
278 real(RP), intent(in) :: CVtot(elem%Np*lmesh%NeA)
279 real(RP), intent(in) :: CPtot(elem%Np*lmesh%NeA)
280 real(RP), intent(in) :: Gsqrt(elem%Np*lmesh%NeA)
281 real(RP), intent(in) :: G11(elem2D%Np,lmesh2D%Ne)
282 real(RP), intent(in) :: G12(elem2D%Np,lmesh2D%Ne)
283 real(RP), intent(in) :: G22(elem2D%Np,lmesh2D%Ne)
284 real(RP), intent(in) :: GsqrtH(elem2D%Np,lmesh2D%Ne)
285 real(RP), intent(in) :: gam(elem%Np*lmesh%NeA)
286 real(RP), intent(in) :: G13(elem%Np*lmesh%NeA)
287 real(RP), intent(in) :: G23(elem%Np*lmesh%NeA)
288 real(RP), intent(in) :: nx(elem%NfpTot,lmesh%Ne)
289 real(RP), intent(in) :: ny(elem%NfpTot,lmesh%Ne)
290 real(RP), intent(in) :: nz(elem%NfpTot,lmesh%Ne)
291 integer, intent(in) :: vmapM(elem%NfpTot,lmesh%Ne)
292 integer, intent(in) :: vmapP(elem%NfpTot,lmesh%Ne)
293 integer, intent(in) :: iM2Dto3D(elem%NfpTot)
294
295 integer :: ke, fp, iP, iM
296 integer :: ke2D
297 real(RP) :: Vel_M, Vel_P, alpha
298 real(RP) :: DPRES_M, DPRES_P
299 real(RP) :: GsqrtDens_M, GsqrtDens_P
300 real(RP) :: GsqrtRhot_M, GsqrtRhot_P
301 real(RP) :: GsqrtDDENS_M, GsqrtDDENS_P
302 real(RP) :: GsqrtMOMX_M, GsqrtMOMX_P
303 real(RP) :: GsqrtMOMY_M, GsqrtMOMY_P
304 real(RP) :: GsqrtMOMZ_M, GsqrtMOMZ_P
305 real(RP) :: GsqrtDRHOT_M, GsqrtDRHOT_P
306 real(RP) :: Gsqrt_M, Gsqrt_P
307 real(RP) :: GsqrtV_M, GsqrtV_P
308 real(RP) :: RGsqrtV_M, RGsqrtV_P
309 real(RP) :: G13_M, G13_P
310 real(RP) :: G23_M, G23_P
311 real(RP) :: Gnn_M, Gnn_P
312 real(RP) :: rgam2_M, rgam2_P
313
314 real(RP) :: gamm
315
316 real(RP) :: tmp1
317 real(RP) :: GsqrtDPres_M, GsqrtDPres_P
318 real(RP) :: nx_, ny_, nz_, fscale_
319
320 integer :: NeS, NeE, NfpTot
321 real(RP) :: G11_, G12_, G22_
322 real(RP) :: Gxz_M, Gxz_P
323 real(RP) :: Gyz_M, Gyz_P
324 real(RP) :: G1n_M, G1n_P
325 real(RP) :: G2n_M, G2n_P
326 !------------------------------------------------------------------------
327
328 gamm = cpdry / cvdry
329
330 nes = lmesh%NeS; nee = lmesh%NeE
331 nfptot = elem%NfpTot
332
333 !$acc parallel present( &
334 !$acc DDENS_,MOMX_,MOMY_,MOMZ_,DRHOT_,DPRES, &
335 !$acc DENS_hyd,PRES_hyd,THERM_hyd, &
336 !$acc Gsqrt,G11,G12,G22,G13,G23,gam, &
337 !$acc nx,ny,nz,vmapM,vmapP,iM2Dto3D, &
338 !$acc del_flux,lmesh,elem )
339 !$acc loop gang
340 do ke=nes, nee
341 !$acc loop vector
342 do fp=1, nfptot
343
344 im = vmapm(fp,ke); ip = vmapp(fp,ke)
345 ke2d = lmesh%EMap3Dto2D(ke)
346
347 nx_ = nx(fp,ke); ny_ = ny(fp,ke); nz_ = nz(fp,ke)
348
349 !-
350 gsqrt_m = gsqrt(im)
351 gsqrt_p = gsqrt(ip)
352
353 !-
354 rgam2_m = 1.0_rp / gam(im)**2
355 gsqrtv_m = gsqrt_m * rgam2_m / gsqrth(im2dto3d(fp),ke2d)
356 rgsqrtv_m = 1.0_rp / gsqrtv_m
357
358 rgam2_p = 1.0_rp / gam(ip)**2
359 gsqrtv_p = gsqrt_p * rgam2_p / gsqrth(im2dto3d(fp),ke2d)
360 rgsqrtv_p = 1.0_rp / gsqrtv_p
361
362 !-
363 g13_m = g13(im)
364 g13_p = g13(ip)
365 g23_m = g23(im)
366 g23_p = g23(ip)
367
368 gsqrtddens_m = gsqrt_m * ddens_(im)
369 gsqrtddens_p = gsqrt_p * ddens_(ip)
370 gsqrtmomx_m = gsqrt_m * momx_(im)
371 gsqrtmomx_p = gsqrt_p * momx_(ip)
372 gsqrtmomy_m = gsqrt_m * momy_(im)
373 gsqrtmomy_p = gsqrt_p * momy_(ip)
374 gsqrtmomz_m = gsqrt_m * momz_(im)
375 gsqrtmomz_p = gsqrt_p * momz_(ip)
376 gsqrtdrhot_m = gsqrt_m * drhot_(im)
377 gsqrtdrhot_p = gsqrt_p * drhot_(ip)
378
379 dpres_m = dpres(im)
380 dpres_p = dpres(ip)
381
382 gsqrtdens_p = gsqrtddens_p + gsqrt_p * dens_hyd(ip)
383 gsqrtdens_m = gsqrtddens_m + gsqrt_m * dens_hyd(im)
384
385 gsqrtrhot_p = gsqrt_p * therm_hyd(ip) + gsqrtdrhot_p
386 gsqrtrhot_m = gsqrt_m * therm_hyd(im) + gsqrtdrhot_m
387
388 vel_m = ( gsqrtmomx_m * nx_ + gsqrtmomy_m * ny_ &
389 + ( ( gsqrtmomz_m * rgsqrtv_m &
390 + g13_m * gsqrtmomx_m + g23_m * gsqrtmomy_m ) * nz_ ) &
391 ) / gsqrtdens_m
392
393 vel_p = ( gsqrtmomx_p * nx_ + gsqrtmomy_p * ny_ &
394 + ( ( gsqrtmomz_p * rgsqrtv_p &
395 + g13_p * gsqrtmomx_p + g23_p * gsqrtmomy_p ) * nz_ ) &
396 ) / gsqrtdens_p
397
398
399 !--
400
401 g11_ = g11(im2dto3d(fp),ke2d)
402 g12_ = g12(im2dto3d(fp),ke2d)
403 g22_ = g22(im2dto3d(fp),ke2d)
404 tmp1 = abs( g11_ * nx_ ) + abs( g22_ * ny_ )
405
406 gxz_m = rgam2_m * ( g11_ * g13_m + g12_ * g23_m )
407 gyz_m = rgam2_m * ( g12_ * g13_m + g22_ * g23_m )
408 g1n_m = rgam2_m * ( g11_ * nx_ + g12_ * ny_ )
409 g2n_m = rgam2_m * ( g12_ * nx_ + g22_ * ny_ )
410 gnn_m = rgam2_m * tmp1 &
411 + ( 1.0_rp * rgsqrtv_m**2 + g13_m * gxz_m + g23_m * gyz_m ) * abs( nz_ )
412
413 gxz_p = rgam2_p * ( g11_ * g13_p + g12_ * g23_p )
414 gyz_p = rgam2_p * ( g12_ * g13_p + g22_ * g23_p )
415 g1n_p = rgam2_p * ( g11_ * nx_ + g12_ * ny_ )
416 g2n_p = rgam2_p * ( g12_ * nx_ + g22_ * ny_ )
417 gnn_p = rgam2_p * tmp1 &
418 + ( 1.0_rp * rgsqrtv_p**2 + g13_p * gxz_p + g23_p * gyz_p ) * abs( nz_ )
419
420 alpha = max( sqrt( gnn_m * gamm * ( pres_hyd(im) + dpres_m ) * gsqrt_m / gsqrtdens_m ) + abs(vel_m), &
421 sqrt( gnn_p * gamm * ( pres_hyd(ip) + dpres_p ) * gsqrt_p / gsqrtdens_p ) + abs(vel_p) )
422
423 !---------------------------------------
424 fscale_ = 0.5_rp * lmesh%Fscale(fp,ke)
425
426 !- density and potential temperature
427
428 del_flux(fp,dens_vid,ke) = fscale_ * ( &
429 gsqrtdens_p * vel_p - gsqrtdens_m * vel_m &
430 - alpha * ( gsqrtddens_p - gsqrtddens_m ) )
431
432 del_flux(fp,rhot_vid,ke) = fscale_ * ( &
433 gsqrtrhot_p * vel_p - gsqrtrhot_m * vel_m &
434 - alpha * ( gsqrtdrhot_p - gsqrtdrhot_m ) )
435
436 !-
437 gsqrtdpres_m = gsqrt_m * dpres_m
438 gsqrtdpres_p = gsqrt_p * dpres_p
439
440 del_flux(fp,momz_vid,ke) = fscale_ * ( &
441 gsqrtmomz_p * vel_p - gsqrtmomz_m * vel_m &
442 + ( gsqrtdpres_p * rgsqrtv_p &
443 - gsqrtdpres_m * rgsqrtv_m ) * nz_ &
444 - alpha * ( gsqrtmomz_p - gsqrtmomz_m ) )
445
446 del_flux(fp,momx_vid,ke) = fscale_ * ( &
447 gsqrtmomx_p * vel_p - gsqrtmomx_m * vel_m &
448 + ( g1n_p + gxz_p * nz_ ) * gsqrtdpres_p &
449 - ( g1n_m + gxz_m * nz_ ) * gsqrtdpres_m &
450 - alpha * ( gsqrtmomx_p - gsqrtmomx_m ) )
451
452 del_flux(fp,momy_vid,ke) = fscale_ * ( &
453 gsqrtmomy_p * vel_p - gsqrtmomy_m * vel_m &
454 + ( g2n_p + gyz_p * nz_ ) * gsqrtdpres_p &
455 - ( g2n_m + gyz_m * nz_ ) * gsqrtdpres_m &
456 - alpha * ( gsqrtmomy_p - gsqrtmomy_m ) )
457 end do
458 end do
459 !$acc end parallel
460
461 return

Referenced by scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve_gpu::atm_dyn_dgm_globalnonhydro3d_rhot_heve_gpu_cal_tend_shallow_atm().