FE-Project
Loading...
Searching...
No Matches
Functions/Subroutines
scale_atm_dyn_dgm_trcadvect3d_heve Module Reference

module FElib / Fluid dyn solver / Atmosphere / Tracer advection More...

Functions/Subroutines

subroutine, public atm_dyn_dgm_trcadvect3d_heve_init (mesh, faceintmat)
 
subroutine, public atm_dyn_dgm_trcadvect3d_heve_final ()
 
subroutine, public atm_dyn_dgm_trcadvect3d_heve_cal_tend (qtrc_dt, qtrc_, momx_, momy_, momz_, alphdens_m, alphdens_p, fct_coef, rhoq_tp, dx, dy, dz, sx, sy, sz, lift, faceintmat, lmesh, elem, lmesh2d, elem2d)
 
subroutine, public atm_dyn_dgm_trcadvect3d_heve_calc_fct_coef (fct_coef, qtrc_, momx_, momy_, momz_, rhoq_tp_, alphdens_m, alphdens_p, dens_hyd, ddens_, ddens0_, rk_c_ssm1, dt, dx, dy, dz, sx, sy, sz, lift, faceintmat, lmesh, elem, lmesh2d, elem2d, disable_limiter)
 
subroutine, public atm_dyn_dgm_trcadvect3d_tmar (qtrc_, dens_hyd, ddens_, lmesh, elem, lmesh2d, elem2d)
 Second Step of limiter in which nonlinear truncation and mass aware rescaling (TMAR)
 
subroutine, public atm_dyn_dgm_trcadvect3d_save_massflux (mflx_x_tavg, mflx_y_tavg, mflx_z_tavg, alph_dens_m, alph_dens_p, ddens, momx, momy, momz, dpres, dens_hyd, pres_hyd, rtot, cvtot, cptot, lmesh, elem, rkstage, tavg_weight_h, tavg_weight_v)
 
subroutine, public atm_dyn_dgm_trcadvect3d_heve_cal_alphdens_advtest (alph_dens_m, alph_dens_p, ddens_, momx_, momy_, momz_, dens_hyd, gsqrt, nx, ny, nz, vmapm, vmapp, lmesh, elem)
 

Detailed Description

module FElib / Fluid dyn solver / Atmosphere / Tracer advection

Description
HEVE DGM scheme for tracer advection.

To preserve nonnegativity, a limiter proposed by Light and Durran (2016, MWR) is used: we apply FCT for the lowest mode and the truncation and mass aware rescaling (TMAR).

Reference
  • Light and Durran 2016: Preserving Nonnegativity in Discontinuous Galerkin Approximations to Scalar Transport via Truncation and Mass Aware Rescaling (TMAR). Monthly Weather Review, 144(12), 4771–4786.
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ atm_dyn_dgm_trcadvect3d_heve_init()

subroutine, public scale_atm_dyn_dgm_trcadvect3d_heve::atm_dyn_dgm_trcadvect3d_heve_init ( class(meshbase3d), intent(in), target mesh,
type(sparsemat), intent(inout) faceintmat )

Definition at line 74 of file scale_atm_dyn_dgm_trcadvect3d_heve.F90.

76 implicit none
77 class(MeshBase3D), intent(in), target :: mesh
78 type(SparseMat), intent(inout) :: FaceIntMat
79
80 class(LocalMesh3D), pointer :: lcmesh
81 class(ElementBase3D), pointer :: elem
82 real(RP), allocatable :: intWeight_lgl1DPts_h(:)
83 real(RP), allocatable :: intWeight_lgl1DPts_v(:)
84 real(RP), allocatable :: intWeight_h(:)
85 real(RP), allocatable :: intWeight_v(:)
86
87 integer :: f
88 integer :: i, j, k, l
89 integer :: is, ie
90
91 real(RP), allocatable :: IntWeight(:,:)
92 !-------------------------------------------------------------
93
94 lcmesh => mesh%lcmesh_list(1)
95 elem => lcmesh%refElem3D
96 allocate( intweight(elem%Nfaces,elem%NfpTot) )
97 intweight(:,:) = 0.0_rp
98
99 allocate( intweight_lgl1dpts_h(elem%Nnode_h1D) )
100 allocate( intweight_lgl1dpts_v(elem%Nnode_v) )
101 allocate( intweight_h(elem%Nnode_h1D*elem%Nnode_v) )
102 allocate( intweight_v(elem%Nnode_h1D**2) )
103
104 intweight_lgl1dpts_h(:) = polynominal_gengausslobattoptintweight(elem%PolyOrder_h)
105 intweight_lgl1dpts_v(:) = polynominal_gengausslobattoptintweight(elem%PolyOrder_v)
106
107 do f=1, elem%Nfaces_h
108 do k=1, elem%Nnode_v
109 do i=1, elem%Nnode_h1D
110 l = i + (k-1)*elem%Nnode_h1D
111 intweight_h(l) = intweight_lgl1dpts_h(i) * intweight_lgl1dpts_v(k)
112 end do
113 end do
114
115 is = (f-1)*elem%Nfp_h + 1
116 ie = is + elem%Nfp_h - 1
117 intweight(f,is:ie) = intweight_h(:)
118 end do
119
120 do f=1, elem%Nfaces_v
121 do j=1, elem%Nnode_h1D
122 do i=1, elem%Nnode_h1D
123 l = i + (j-1)*elem%Nnode_h1D
124 intweight_v(l) = intweight_lgl1dpts_h(i) * intweight_lgl1dpts_h(j)
125 end do
126 end do
127
128 is = elem%Nfaces_h*elem%Nfp_h + (f-1)*elem%Nfp_v + 1
129 ie = is + elem%Nfp_v - 1
130 intweight(elem%Nfaces_h+f,is:ie) = intweight_v(:)
131 end do
132
133 call faceintmat%Init( intweight )
134
135 return
module common / Polynominal
real(rp) function, dimension(nord+1), public polynominal_gengausslobattoptintweight(nord)
A function to calcuate the Gauss-Lobbato weights.

References scale_polynominal::polynominal_gengausslobattoptintweight().

◆ atm_dyn_dgm_trcadvect3d_heve_final()

subroutine, public scale_atm_dyn_dgm_trcadvect3d_heve::atm_dyn_dgm_trcadvect3d_heve_final

Definition at line 139 of file scale_atm_dyn_dgm_trcadvect3d_heve.F90.

140 implicit none
141 !--------------------------------------------
142
143 return

◆ atm_dyn_dgm_trcadvect3d_heve_cal_tend()

subroutine, public scale_atm_dyn_dgm_trcadvect3d_heve::atm_dyn_dgm_trcadvect3d_heve_cal_tend ( real(rp), dimension(elem%np,lmesh%nea), intent(out) qtrc_dt,
real(rp), dimension(elem%np,lmesh%nea), intent(in) qtrc_,
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%nfptot,lmesh%ne), intent(in) alphdens_m,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(in) alphdens_p,
real(rp), dimension(elem%np,lmesh%nea), intent(in) fct_coef,
real(rp), dimension(elem%np,lmesh%nea), intent(in) rhoq_tp,
type(sparsemat), intent(in) dx,
type(sparsemat), intent(in) dy,
type(sparsemat), intent(in) dz,
type(sparsemat), intent(in) sx,
type(sparsemat), intent(in) sy,
type(sparsemat), intent(in) sz,
type(sparsemat), intent(in) lift,
type(sparsemat), intent(in) faceintmat,
class(localmesh3d), intent(in) lmesh,
class(elementbase3d), intent(in) elem,
class(localmesh2d), intent(in) lmesh2d,
class(elementbase2d), intent(in) elem2d )

Definition at line 148 of file scale_atm_dyn_dgm_trcadvect3d_heve.F90.

155
156 class(LocalMesh3D), intent(in) :: lmesh
157 class(ElementBase3D), intent(in) :: elem
158 class(LocalMesh2D), intent(in) :: lmesh2D
159 class(ElementBase2D), intent(in) :: elem2D
160 type(SparseMat), intent(in) :: Dx, Dy, Dz, Sx, Sy, Sz, Lift, FaceIntMat
161
162 real(RP), intent(out) :: QTRC_dt(elem%Np,lmesh%NeA)
163 real(RP), intent(in) :: QTRC_(elem%Np,lmesh%NeA)
164 real(RP), intent(in) :: MOMX_(elem%Np,lmesh%NeA)
165 real(RP), intent(in) :: MOMY_(elem%Np,lmesh%NeA)
166 real(RP), intent(in) :: MOMZ_(elem%Np,lmesh%NeA)
167 real(RP), intent(in) :: alphDENS_M(elem%NfpTot,lmesh%Ne)
168 real(RP), intent(in) :: alphDENS_P(elem%NfpTot,lmesh%Ne)
169 real(RP), intent(in) :: fct_coef(elem%Np,lmesh%NeA)
170 real(RP), intent(in) :: RHOQ_tp(elem%Np,lmesh%NeA)
171
172 real(RP) :: Fx(elem%Np), Fy(elem%Np), Fz(elem%Np), LiftDelFlx(elem%Np)
173 real(RP) :: del_flux(elem%NfpTot,lmesh%Ne)
174 real(RP) :: momwt_(elem%Np)
175
176 integer :: ke, ke2d
177
178 real(RP) :: Q0, Q1, vol
179 integer :: p
180 !---------------------------------------------------------------------------
181
182 call prof_rapstart('cal_trcadv_tend_bndflux', 3)
183 call atm_dyn_dgm_trcadvect3d_heve_get_delflux_generalhvc( &
184 del_flux, & ! (out)
185 qtrc_, momx_, momy_, momz_, alphdens_m, alphdens_p, fct_coef, & ! (in)
186 lmesh%Gsqrt, lmesh%GsqrtH, lmesh%GI3(:,:,1), lmesh%GI3(:,:,2), & ! (in)
187 lmesh%normal_fn(:,:,1), lmesh%normal_fn(:,:,2), lmesh%normal_fn(:,:,3), & ! (in)
188 lmesh%J(:,:), lmesh%Fscale(:,:), & ! (in)
189 lmesh%vmapM, lmesh%vmapP, elem%IndexH2Dto3D_bnd, faceintmat, & ! (in)
190 lmesh, elem, lmesh2d, elem2d ) ! (in)
191 call prof_rapend('cal_trcadv_tend_bndflux', 3)
192
193 call prof_rapstart('cal_trcadv_tend_interior', 3)
194 !$omp parallel do private( &
195 !$omp momwt_, Fx, Fy, Fz, LiftDelFlx, &
196 !$omp ke, ke2d )
197 do ke=lmesh%NeS, lmesh%NeE
198 ke2d = lmesh%EMap3Dto2D(ke)
199
200 momwt_(:) = momz_(:,ke) * lmesh%GsqrtH(elem%IndexH2Dto3D,ke2d) / lmesh%Gsqrt(:,ke) &
201 + lmesh%GI3(:,ke,1) * momx_(:,ke) + lmesh%GI3(:,ke,2) * momy_(:,ke)
202
203 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * momx_(:,ke) * qtrc_(:,ke), fx)
204 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * momy_(:,ke) * qtrc_(:,ke), fy)
205 call sparsemat_matmul(dz, lmesh%Gsqrt(:,ke) * momwt_(:) * qtrc_(:,ke), fz)
206 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke), liftdelflx)
207
208 qtrc_dt(:,ke) = ( &
209 - lmesh%Escale(:,ke,1,1) * fx(:) &
210 - lmesh%Escale(:,ke,2,2) * fy(:) &
211 - lmesh%Escale(:,ke,3,3) * fz(:) &
212 - liftdelflx(:) ) &
213 / lmesh%Gsqrt(:,ke) &
214 + rhoq_tp(:,ke)
215 end do
216 call prof_rapend('cal_trcadv_tend_interior', 3)
217
218 return

◆ atm_dyn_dgm_trcadvect3d_heve_calc_fct_coef()

subroutine, public scale_atm_dyn_dgm_trcadvect3d_heve::atm_dyn_dgm_trcadvect3d_heve_calc_fct_coef ( real(rp), dimension(elem%np,lmesh%nea), intent(out) fct_coef,
real(rp), dimension(elem%np,lmesh%nea), intent(in) qtrc_,
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) rhoq_tp_,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(in) alphdens_m,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(in) alphdens_p,
real(rp), dimension(elem%np,lmesh%nea), intent(in) dens_hyd,
real(rp), dimension (elem%np,lmesh%nea), intent(in) ddens_,
real(rp), dimension(elem%np,lmesh%nea), intent(in) ddens0_,
real(rp), intent(in) rk_c_ssm1,
real(rp), intent(in) dt,
type(sparsemat), intent(in) dx,
type(sparsemat), intent(in) dy,
type(sparsemat), intent(in) dz,
type(sparsemat), intent(in) sx,
type(sparsemat), intent(in) sy,
type(sparsemat), intent(in) sz,
type(sparsemat), intent(in) lift,
type(sparsemat), intent(in) faceintmat,
class(localmesh3d), intent(in) lmesh,
class(elementbase3d), intent(in) elem,
class(localmesh2d), intent(in) lmesh2d,
class(elementbase2d), intent(in) elem2d,
logical, intent(in), optional disable_limiter )

Definition at line 222 of file scale_atm_dyn_dgm_trcadvect3d_heve.F90.

229
230 implicit none
231 class(LocalMesh3D), intent(in) :: lmesh
232 class(ElementBase3D), intent(in) :: elem
233 class(LocalMesh2D), intent(in) :: lmesh2D
234 class(ElementBase2D), intent(in) :: elem2D
235 real(RP), intent(out) :: fct_coef(elem%Np,lmesh%NeA)
236 real(RP), intent(in) :: QTRC_(elem%Np,lmesh%NeA)
237 real(RP), intent(in) :: MOMX_(elem%Np,lmesh%NeA)
238 real(RP), intent(in) :: MOMY_(elem%Np,lmesh%NeA)
239 real(RP), intent(in) :: MOMZ_(elem%Np,lmesh%NeA)
240 real(RP), intent(in) :: RHOQ_tp_(elem%Np,lmesh%NeA)
241 real(RP), intent(in) :: alphDENS_M(elem%NfpTot,lmesh%Ne)
242 real(RP), intent(in) :: alphDENS_P(elem%NfpTot,lmesh%Ne)
243 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
244 real(RP), intent(in) :: DDENS_ (elem%Np,lmesh%NeA)
245 real(RP), intent(in) :: DDENS0_(elem%Np,lmesh%NeA)
246 real(RP), intent(in) :: rk_c_ssm1
247 real(RP), intent(in) :: dt
248 type(SparseMat), intent(in) :: Dx, Dy, Dz, Sx, Sy, Sz, Lift, FaceIntMat
249 logical, intent(in), optional :: disable_limiter
250
251 real(RP) :: netOutwardFlux(lmesh%Ne)
252 real(RP) :: momwt_(elem%Np)
253
254 integer :: ke
255 real(RP) :: Q
256 real(RP) :: dens_ssm1(elem%Np)
257 !---------------------------------------------------------------------------
258
259 if ( present(disable_limiter) ) then
260 if ( disable_limiter ) then
261 !$omp parallel do
262 do ke=lmesh%NeS, lmesh%NeE
263 fct_coef(:,ke) = 1.0_rp
264 end do
265 return
266 end if
267 end if
268
269 call prof_rapstart('cal_trcadv_fct_coef_bndflux', 3)
270 call atm_dyn_dgm_trcadvect3d_heve_get_netoutwardflux_generalhvc( &
271 netoutwardflux, & ! (out)
272 qtrc_, momx_, momy_, momz_, alphdens_m, alphdens_p, & ! (in)
273 lmesh%Gsqrt, lmesh%GsqrtH, lmesh%GI3(:,:,1), lmesh%GI3(:,:,2), & ! (in)
274 lmesh%normal_fn(:,:,1), lmesh%normal_fn(:,:,2), lmesh%normal_fn(:,:,3), & ! (in)
275 lmesh%J(:,:), lmesh%Fscale(:,:), lmesh%vmapM, lmesh%vmapP, elem%IndexH2Dto3D_bnd, & ! (in)
276 faceintmat, & ! (in)
277 lmesh, elem, lmesh2d, elem2d ) ! (in)
278 call prof_rapend('cal_trcadv_fct_coef_bndflux', 3)
279
280 call prof_rapstart('cal_trcadv_fct_coef', 3)
281
282 !$omp parallel do private( ke, Q, dens_ssm1 )
283 do ke=lmesh%NeS, lmesh%NeE
284
285 dens_ssm1(:) = dens_hyd(:,ke) &
286 + ( 1.0_rp - rk_c_ssm1 ) * ddens0_(:,ke) + rk_c_ssm1 * ddens_(:,ke)
287 q = sum( lmesh%Gsqrt(:,ke) * lmesh%J(:,ke) * elem%IntWeight_lgl(:) * ( dens_ssm1(:) * qtrc_(:,ke) / dt + rhoq_tp_(:,ke) ) )
288
289 fct_coef(:,ke) = max( 0.0_rp, min( 1.0_rp, q / ( netoutwardflux(ke) + 1.0e-10_rp ) ) )
290 end do
291
292 call prof_rapend('cal_trcadv_fct_coef', 3)
293
294 return

◆ atm_dyn_dgm_trcadvect3d_tmar()

subroutine, public scale_atm_dyn_dgm_trcadvect3d_heve::atm_dyn_dgm_trcadvect3d_tmar ( real(rp), dimension(elem%np,lmesh%nea), intent(inout) qtrc_,
real(rp), dimension(elem%np,lmesh%nea), intent(in) dens_hyd,
real(rp), dimension (elem%np,lmesh%nea), intent(in) ddens_,
class(localmesh3d), intent(in) lmesh,
class(elementbase3d), intent(in) elem,
class(localmesh2d), intent(in) lmesh2d,
class(elementbase2d), intent(in) elem2d )

Second Step of limiter in which nonlinear truncation and mass aware rescaling (TMAR)

Definition at line 300 of file scale_atm_dyn_dgm_trcadvect3d_heve.F90.

302
303 implicit none
304 class(LocalMesh3D), intent(in) :: lmesh
305 class(ElementBase3D), intent(in) :: elem
306 class(LocalMesh2D), intent(in) :: lmesh2D
307 class(ElementBase2D), intent(in) :: elem2D
308 real(RP), intent(inout) :: QTRC_(elem%Np,lmesh%NeA)
309 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
310 real(RP), intent(in) :: DDENS_ (elem%Np,lmesh%NeA)
311
312 integer :: ke
313 real(RP) :: Q0, Q1
314 real(RP) :: Q(elem%Np)
315 real(RP) :: dens(elem%Np)
316 !--------------------------------------------------------
317
318 !$omp parallel do private( dens, Q, Q0, Q1 )
319 do ke=lmesh%NeS, lmesh%NeE
320 dens(:) = dens_hyd(:,ke) + ddens_(:,ke)
321 q(:) = max( 0.0_rp, qtrc_(:,ke) )
322
323 q0 = sum( lmesh%Gsqrt(:,ke) * lmesh%J(:,ke) * elem%IntWeight_lgl(:) * dens(:) * qtrc_(:,ke) )
324 q1 = sum( lmesh%Gsqrt(:,ke) * lmesh%J(:,ke) * elem%IntWeight_lgl(:) * dens(:) * q(:) )
325 qtrc_(:,ke) = q0 / ( q1 + 1.0e-32_rp ) * q(:)
326 end do
327
328 return

◆ atm_dyn_dgm_trcadvect3d_save_massflux()

subroutine, public scale_atm_dyn_dgm_trcadvect3d_heve::atm_dyn_dgm_trcadvect3d_save_massflux ( real(rp), dimension(elem%np,lmesh%nea), intent(inout) mflx_x_tavg,
real(rp), dimension(elem%np,lmesh%nea), intent(inout) mflx_y_tavg,
real(rp), dimension(elem%np,lmesh%nea), intent(inout) mflx_z_tavg,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(inout) alph_dens_m,
real(rp), dimension(elem%nfptot,lmesh%ne), intent(inout) alph_dens_p,
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) 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,
class(localmesh3d), intent(in) lmesh,
class(elementbase3d), intent(in) elem,
integer, intent(in) rkstage,
real(rp), intent(in) tavg_weight_h,
real(rp), intent(in) tavg_weight_v )

Definition at line 332 of file scale_atm_dyn_dgm_trcadvect3d_heve.F90.

337
338 implicit none
339 class(LocalMesh3D), intent(in) :: lmesh
340 class(ElementBase3D), intent(in) :: elem
341 real(RP), intent(inout) :: MFLX_x_tavg(elem%Np,lmesh%NeA)
342 real(RP), intent(inout) :: MFLX_y_tavg(elem%Np,lmesh%NeA)
343 real(RP), intent(inout) :: MFLX_z_tavg(elem%Np,lmesh%NeA)
344 real(RP), intent(inout) :: alph_dens_M(elem%NfpTot,lmesh%Ne)
345 real(RP), intent(inout) :: alph_dens_P(elem%NfpTot,lmesh%Ne)
346 real(RP), intent(in) :: DDENS(elem%Np,lmesh%NeA)
347 real(RP), intent(in) :: MOMX(elem%Np,lmesh%NeA)
348 real(RP), intent(in) :: MOMY(elem%Np,lmesh%NeA)
349 real(RP), intent(in) :: MOMZ(elem%Np,lmesh%NeA)
350 real(RP), intent(in) :: DPRES(elem%Np,lmesh%NeA)
351 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
352 real(RP), intent(in) :: PRES_hyd(elem%Np,lmesh%NeA)
353 real(RP), intent(in) :: Rtot(elem%Np,lmesh%NeA)
354 real(RP), intent(in) :: CVtot(elem%Np,lmesh%NeA)
355 real(RP), intent(in) :: CPtot(elem%Np,lmesh%NeA)
356 integer, intent(in) :: rkstage
357 real(RP), intent(in) :: tavg_weight_h
358 real(RP), intent(in) :: tavg_weight_v
359
360 integer :: ke
361 !--------------------------------------------------------------
362
363 !$omp parallel do private(ke)
364 do ke=lmesh%NeS, lmesh%NeE
365 if (rkstage == 1) then
366 mflx_x_tavg(:,ke) = tavg_weight_h * momx(:,ke)
367 mflx_y_tavg(:,ke) = tavg_weight_h * momy(:,ke)
368 mflx_z_tavg(:,ke) = tavg_weight_v * momz(:,ke)
369 alph_dens_m(:,ke) = 0.0_rp
370 alph_dens_p(:,ke) = 0.0_rp
371 else
372 mflx_x_tavg(:,ke) = mflx_x_tavg(:,ke) + tavg_weight_h * momx(:,ke)
373 mflx_y_tavg(:,ke) = mflx_y_tavg(:,ke) + tavg_weight_h * momy(:,ke)
374 mflx_z_tavg(:,ke) = mflx_z_tavg(:,ke) + tavg_weight_v * momz(:,ke)
375 end if
376 end do
377
378 call atm_dyn_dgm_trcadvect3d_heve_cal_alphdens_dyn( &
379 alph_dens_m, alph_dens_p, & ! (out)
380 ddens, momx, momy, momz, dpres, dens_hyd, pres_hyd, & ! (in)
381 rtot, cvtot, cptot, & ! (in)
382 lmesh%Gsqrt, lmesh%GIJ(:,:,1,1), lmesh%GIJ(:,:,1,2), lmesh%GIJ(:,:,2,2), & ! (in)
383 lmesh%normal_fn(:,:,1), lmesh%normal_fn(:,:,2), lmesh%normal_fn(:,:,3), & ! (in)
384 lmesh%vmapM, lmesh%vmapP, elem%IndexH2Dto3D_bnd, & ! (in)
385 lmesh, lmesh%lcmesh2D, lmesh%refElem3D, lmesh%lcmesh2D%refElem2D, & ! (in)
386 tavg_weight_h, tavg_weight_v ) ! (in)
387
388 return

◆ atm_dyn_dgm_trcadvect3d_heve_cal_alphdens_advtest()

subroutine, public scale_atm_dyn_dgm_trcadvect3d_heve::atm_dyn_dgm_trcadvect3d_heve_cal_alphdens_advtest ( real(rp), dimension(elem%nfptot*lmesh%ne), intent(inout) alph_dens_m,
real(rp), dimension(elem%nfptot*lmesh%ne), intent(inout) alph_dens_p,
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) dens_hyd,
real(rp), dimension(elem%np*lmesh%nea), intent(in) gsqrt,
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 )

Definition at line 392 of file scale_atm_dyn_dgm_trcadvect3d_heve.F90.

395
396 use scale_const, only: &
397 grav => const_grav, &
398 rdry => const_rdry, &
399 cpdry => const_cpdry, &
400 cvdry => const_cvdry, &
401 pres00 => const_pre00
402
403 implicit none
404
405 class(LocalMesh3D), intent(in) :: lmesh
406 class(ElementBase3D), intent(in) :: elem
407 real(RP), intent(inout) :: alph_dens_M(elem%NfpTot*lmesh%Ne)
408 real(RP), intent(inout) :: alph_dens_P(elem%NfpTot*lmesh%Ne)
409 real(RP), intent(in) :: DDENS_(elem%Np*lmesh%NeA)
410 real(RP), intent(in) :: MOMX_(elem%Np*lmesh%NeA)
411 real(RP), intent(in) :: MOMY_(elem%Np*lmesh%NeA)
412 real(RP), intent(in) :: MOMZ_(elem%Np*lmesh%NeA)
413 real(RP), intent(in) :: DENS_hyd(elem%Np*lmesh%NeA)
414 real(RP), intent(in) :: Gsqrt(elem%Np*lmesh%NeA)
415 real(RP), intent(in) :: nx(elem%NfpTot*lmesh%Ne)
416 real(RP), intent(in) :: ny(elem%NfpTot*lmesh%Ne)
417 real(RP), intent(in) :: nz(elem%NfpTot*lmesh%Ne)
418 integer, intent(in) :: vmapM(elem%NfpTot*lmesh%Ne)
419 integer, intent(in) :: vmapP(elem%NfpTot*lmesh%Ne)
420
421 integer :: i, iP, iM
422 real(RP) :: VelP, VelM, alpha, densM, densP
423 !------------------------------------------------------------------------
424
425
426 !$omp parallel do private( &
427 !$omp iM, iP, VelP, VelM, alpha, densM, densP )
428 do i=1, elem%NfpTot*lmesh%Ne
429 im = vmapm(i); ip = vmapp(i)
430
431 densm = ddens_(im) + dens_hyd(im)
432 densp = ddens_(ip) + dens_hyd(ip)
433
434 velm = ( momx_(im) * nx(i) + momy_(im) * ny(i) + momz_(im) * nz(i) ) / densm
435 velp = ( momx_(ip) * nx(i) + momy_(ip) * ny(i) + momz_(ip) * nz(i) ) / densp
436
437 alpha = max( abs(velm), abs(velp) )
438 alph_dens_m(i) = alpha * densm * gsqrt(im)
439 alph_dens_p(i) = alpha * densp * gsqrt(ip)
440 end do
441
442 return