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

module FElib / Fluid dyn solver / Atmosphere / Global nonhydrostatic model / HEVI More...

Functions/Subroutines

subroutine, public atm_dyn_dgm_globalnonhydro3d_rhot_hevi_init (mesh)
 
subroutine, public atm_dyn_dgm_globalnonhydro3d_rhot_hevi_final ()
 
subroutine, public atm_dyn_dgm_globalnonhydro3d_rhot_hevi_cal_tend (dens_dt, momx_dt, momy_dt, momz_dt, rhot_dt, ddens_, momx_, momy_, momz_, drhot_, dpres_, dens_hyd, pres_hyd, pres_hyd_ref, coriolis, rtot, cvtot, cptot, dphyddx, dphyddy, element3d_operation, dx, dy, dz, sx, sy, sz, lift, lmesh, elem, lmesh2d, elem2d)
 
subroutine, public atm_dyn_dgm_globalnonhydro3d_rhot_hevi_cal_vi (dens_dt, momx_dt, momy_dt, momz_dt, rhot_dt, ddens_, momx_, momy_, momz_, drhot_, dens_hyd, pres_hyd, ddens0_, momx0_, momy0_, momz0_, drhot0_, rtot, cvtot, cptot, element3d_operation, dz, lift, impl_fac, dt, lmesh, elem, lmesh2d, elem2d)
 

Detailed Description

module FElib / Fluid dyn solver / Atmosphere / Global nonhydrostatic model / HEVI

Description
HEVI DGM scheme for Global Atmospheric Dynamical process. The governing equations is a fully compressible nonhydrostatic equations, which consist of mass, momentum, and thermodynamics (density * potential temperature conservation) equations.
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ atm_dyn_dgm_globalnonhydro3d_rhot_hevi_init()

subroutine, public scale_atm_dyn_dgm_globalnonhydro3d_rhot_hevi::atm_dyn_dgm_globalnonhydro3d_rhot_hevi_init ( class(meshbase3d), intent(in) mesh)

Definition at line 75 of file scale_atm_dyn_dgm_globalnonhydro3d_rhot_hevi.F90.

76 implicit none
77 class(MeshBase3D), intent(in) :: mesh
78 !--------------------------------------------
79
80 call atm_dyn_dgm_nonhydro3d_common_init( mesh )
81 return

References scale_atm_dyn_dgm_nonhydro3d_common::atm_dyn_dgm_nonhydro3d_common_init().

◆ atm_dyn_dgm_globalnonhydro3d_rhot_hevi_final()

subroutine, public scale_atm_dyn_dgm_globalnonhydro3d_rhot_hevi::atm_dyn_dgm_globalnonhydro3d_rhot_hevi_final

Definition at line 85 of file scale_atm_dyn_dgm_globalnonhydro3d_rhot_hevi.F90.

86 implicit none
87 !--------------------------------------------
88
89 call atm_dyn_dgm_nonhydro3d_common_final()
90 return

References scale_atm_dyn_dgm_nonhydro3d_common::atm_dyn_dgm_nonhydro3d_common_final().

◆ atm_dyn_dgm_globalnonhydro3d_rhot_hevi_cal_tend()

subroutine, public scale_atm_dyn_dgm_globalnonhydro3d_rhot_hevi::atm_dyn_dgm_globalnonhydro3d_rhot_hevi_cal_tend ( real(rp), dimension(elem%np,lmesh%nea), intent(out) dens_dt,
real(rp), dimension(elem%np,lmesh%nea), intent(out) momx_dt,
real(rp), dimension(elem%np,lmesh%nea), intent(out) momy_dt,
real(rp), dimension(elem%np,lmesh%nea), intent(out) momz_dt,
real(rp), dimension(elem%np,lmesh%nea), intent(out) rhot_dt,
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) pres_hyd_ref,
real(rp), dimension(elem2d%np,lmesh2d%nea), intent(in) coriolis,
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) dphyddx,
real(rp), dimension(elem%np,lmesh%nea), intent(in) dphyddy,
class(elementoperationbase3d), intent(in) element3d_operation,
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,
class(localmesh3d), intent(in) lmesh,
class(elementbase3d), intent(in) elem,
class(localmesh2d), intent(in) lmesh2d,
class(elementbase2d), intent(in) elem2d )

Definition at line 96 of file scale_atm_dyn_dgm_globalnonhydro3d_rhot_hevi.F90.

102
105 use scale_const, only: &
106 ohm => const_ohm
107 implicit none
108
109 class(LocalMesh3D), intent(in) :: lmesh
110 class(ElementBase3D), intent(in) :: elem
111 class(LocalMesh2D), intent(in) :: lmesh2D
112 class(ElementBase2D), intent(in) :: elem2D
113 class(ElementOperationBase3D), intent(in) :: element3D_operation
114 type(SparseMat), intent(in) :: Dx, Dy, Dz, Sx, Sy, Sz, Lift
115 real(RP), intent(out) :: DENS_dt(elem%Np,lmesh%NeA)
116 real(RP), intent(out) :: MOMX_dt(elem%Np,lmesh%NeA)
117 real(RP), intent(out) :: MOMY_dt(elem%Np,lmesh%NeA)
118 real(RP), intent(out) :: MOMZ_dt(elem%Np,lmesh%NeA)
119 real(RP), intent(out) :: RHOT_dt(elem%Np,lmesh%NeA)
120 real(RP), intent(in) :: DDENS_(elem%Np,lmesh%NeA)
121 real(RP), intent(in) :: MOMX_(elem%Np,lmesh%NeA)
122 real(RP), intent(in) :: MOMY_(elem%Np,lmesh%NeA)
123 real(RP), intent(in) :: MOMZ_(elem%Np,lmesh%NeA)
124 real(RP), intent(in) :: DRHOT_(elem%Np,lmesh%NeA)
125 real(RP), intent(in) :: DPRES_(elem%Np,lmesh%NeA)
126 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
127 real(RP), intent(in) :: PRES_hyd(elem%Np,lmesh%NeA)
128 real(RP), intent(in) :: PRES_hyd_ref(elem%Np,lmesh%NeA)
129 real(RP), intent(in) :: CORIOLIS(elem2D%Np,lmesh2D%NeA)
130 real(RP), intent(in) :: Rtot (elem%Np,lmesh%NeA)
131 real(RP), intent(in) :: CVtot(elem%Np,lmesh%NeA)
132 real(RP), intent(in) :: CPtot(elem%Np,lmesh%NeA)
133 real(RP), intent(in) :: DPhydDx(elem%Np,lmesh%NeA)
134 real(RP), intent(in) :: DPhydDy(elem%Np,lmesh%NeA)
135
136 real(RP) :: Fx(elem%Np), Fy(elem%Np), Fz(elem%Np), LiftDelFlx(elem%Np)
137 real(RP) :: DPRES_hyd(elem%Np), GradPhyd_x(elem%Np), GradPhyd_y(elem%Np)
138 real(RP) :: del_flux(elem%NfpTot,lmesh%Ne,PRGVAR_NUM)
139 real(RP) :: del_flux_hyd(elem%NfpTot,lmesh%Ne,2)
140 real(RP) :: RHOT_(elem%Np)
141 real(RP) :: rdens_(elem%Np), u_(elem%Np), v_(elem%Np), w_(elem%Np), wt_(elem%Np)
142
143 real(RP) :: G11(elem%Np), G12(elem%Np), G22(elem%Np), Rgam2(elem%Np)
144 real(RP) :: GsqrtV(elem%Np), RGsqrtV(elem%Np)
145 real(RP) :: X2D(elem2D%Np,lmesh2D%Ne), Y2D(elem2D%Np,lmesh2D%Ne)
146 real(RP) :: X(elem%Np), Y(elem%Np), twoOVdel2(elem%Np)
147 real(RP) :: CORI(elem%Np,2)
148 logical :: is_panel1to4
149 real(RP) :: s
150
151 integer :: ke, ke2d
152
153 real(RP) :: gamm, rgamm
154 real(RP) :: rP0
155 real(RP) :: RovP0, P0ovR
156 !------------------------------------------------------------------------
157
158 call prof_rapstart('cal_dyn_tend_bndflux', 3)
159 call get_ebnd_flux( &
160 del_flux, del_flux_hyd, & ! (out)
161 ddens_, momx_, momy_, momz_, drhot_, dpres_, dens_hyd, pres_hyd, & ! (in)
162 rtot, cvtot, cptot, & ! (in)
163 lmesh%Gsqrt, lmesh%GIJ(:,:,1,1), lmesh%GIJ(:,:,1,2), lmesh%GIJ(:,:,2,2), & ! (in)
164 lmesh%GsqrtH, lmesh%GI3(:,:,1), lmesh%GI3(:,:,2), & ! (in)
165 lmesh%normal_fn(:,:,1), lmesh%normal_fn(:,:,2), lmesh%normal_fn(:,:,3), & ! (in)
166 lmesh%vmapM, lmesh%vmapP, elem%IndexH2Dto3D_bnd, & ! (in)
167 lmesh, elem, lmesh2d, elem2d ) ! (in)
168 call prof_rapend('cal_dyn_tend_bndflux', 3)
169
170 !-----
171 call prof_rapstart('cal_dyn_tend_interior', 3)
172 gamm = cpdry / cvdry
173 rgamm = cvdry / cpdry
174 rp0 = 1.0_rp / pres00
175 rovp0 = rdry * rp0
176 p0ovr = pres00 / rdry
177
178 s = 1.0_rp
179 is_panel1to4 = .true.
180 if ( lmesh%panelID == 5 ) then
181 is_panel1to4 = .false.
182 else if ( lmesh%panelID == 6 ) then
183 is_panel1to4 = .false.
184 s = - 1.0_rp
185 end if
186
187 !$omp parallel private( &
188 !$omp RHOT_, rdens_, u_, v_, w_, wt_, &
189 !$omp Fx, Fy, Fz, LiftDelFlx, &
190 !$omp DPRES_hyd, GradPhyd_x, GradPhyd_y, &
191 !$omp G11, G12, G22, Rgam2, GsqrtV, RGsqrtV, &
192 !$omp X, Y, twoOVdel2, &
193 !$omp CORI, ke, ke2D )
194
195 !$omp do
196 do ke2d = lmesh2d%NeS, lmesh2d%NeE
197 x2d(:,ke2d) = tan(lmesh2d%pos_en(:,ke2d,1))
198 y2d(:,ke2d) = tan(lmesh2d%pos_en(:,ke2d,2))
199 end do
200
201 !$omp do
202 do ke = lmesh%NeS, lmesh%NeE
203 !--
204 ke2d = lmesh%EMap3Dto2D(ke)
205 rgam2(:) = 1.0_rp / lmesh%gam(:,ke)**2
206 g11(:) = lmesh%GIJ(elem%IndexH2Dto3D,ke2d,1,1) * rgam2(:)
207 g12(:) = lmesh%GIJ(elem%IndexH2Dto3D,ke2d,1,2) * rgam2(:)
208 g22(:) = lmesh%GIJ(elem%IndexH2Dto3D,ke2d,2,2) * rgam2(:)
209 gsqrtv(:) = lmesh%Gsqrt(:,ke) * rgam2(:) / lmesh%GsqrtH(elem%IndexH2Dto3D,ke2d)
210 rgsqrtv(:) = 1.0_rp / gsqrtv(:)
211
212 !--
213 rhot_(:) = p0ovr * ( pres_hyd(:,ke) * rp0 )**rgamm + drhot_(:,ke)
214 ! DPRES_(:) = PRES00 * ( Rtot(:,ke) * rP0 * RHOT_(:) )**( CPtot(:,ke) / CVtot(:,ke) ) &
215 ! - PRES_hyd(:,ke)
216
217 rdens_(:) = 1.0_rp / ( ddens_(:,ke) + dens_hyd(:,ke) )
218 u_(:) = momx_(:,ke) * rdens_(:)
219 v_(:) = momy_(:,ke) * rdens_(:)
220 w_(:) = momz_(:,ke) * rdens_(:)
221 wt_(:) = w_(:) * rgsqrtv(:) + lmesh%GI3(:,ke,1) * u_(:) + lmesh%GI3(:,ke,2) * v_(:)
222
223 x(:) = x2d(elem%IndexH2Dto3D,ke2d)
224 y(:) = y2d(elem%IndexH2Dto3D,ke2d)
225 twoovdel2(:) = 2.0_rp / ( 1.0_rp + x(:)**2 + y(:)**2 )
226
227 cori(:,1) = s * ohm * twoovdel2(:) * ( - x(:) * y(:) * momx_(:,ke) + (1.0_rp + y(:)**2) * momy_(:,ke) )
228 cori(:,2) = s * ohm * twoovdel2(:) * ( - (1.0_rp + x(:)**2) * momx_(:,ke) + x(:) * y(:) * momy_(:,ke) )
229 if ( is_panel1to4 ) then
230 cori(:,1) = s * y(:) * cori(:,1)
231 cori(:,2) = s * y(:) * cori(:,2)
232 end if
233
234 !-- Gradient hydrostatic pressure
235
236 dpres_hyd(:) = pres_hyd(:,ke) - pres_hyd_ref(:,ke)
237
238 call sparsemat_matmul(dx, gsqrtv(:) * dpres_hyd(:), fx)
239 call sparsemat_matmul(dz, gsqrtv(:) * lmesh%GI3(:,ke,1) * dpres_hyd(:), fz)
240 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux_hyd(:,ke,1), liftdelflx)
241 gradphyd_x(:) = lmesh%Escale(:,ke,1,1) * fx(:) &
242 + lmesh%Escale(:,ke,3,3) * fz(:) &
243 + liftdelflx(:)
244
245 call sparsemat_matmul(dy, gsqrtv(:) * dpres_hyd(:), fy)
246 call sparsemat_matmul(dz, gsqrtv(:) * lmesh%GI3(:,ke,2) * dpres_hyd(:), fz)
247 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux_hyd(:,ke,2), liftdelflx)
248 gradphyd_y(:) = lmesh%Escale(:,ke,2,2) * fy(:) &
249 + lmesh%Escale(:,ke,3,3) * fz(:) &
250 + liftdelflx(:)
251
252 !-- DENS
253 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * momx_(:,ke), fx)
254 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * momy_(:,ke), fy)
255 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,dens_vid), liftdelflx)
256
257 dens_dt(:,ke) = - ( &
258 lmesh%Escale(:,ke,1,1) * fx(:) &
259 + lmesh%Escale(:,ke,2,2) * fy(:) &
260 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke)
261
262 !-- MOMX
263 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * ( u_(:) * momx_(:,ke) + g11(:) * dpres_(:,ke) ), fx)
264 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * ( v_(:) * momx_(:,ke) + g12(:) * dpres_(:,ke) ), fy)
265 call sparsemat_matmul(dz, lmesh%Gsqrt(:,ke) * ( wt_(:) * momx_(:,ke) &
266 + ( lmesh%GI3(:,ke,1) * g11(:) + lmesh%GI3(:,ke,2) * g12(:) ) * dpres_(:,ke) ), fz)
267 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,momx_vid), liftdelflx)
268
269 momx_dt(:,ke) = &
270 - ( lmesh%Escale(:,ke,1,1) * fx(:) &
271 + lmesh%Escale(:,ke,2,2) * fy(:) &
272 + lmesh%Escale(:,ke,3,3) * fz(:) &
273 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke) &
274 + twoovdel2(:) * y(:) * &
275 ( - x(:) * y(:) * u_(:) + (1.0_rp + y(:)**2) * v_(:) ) * momx_(:,ke) &
276 - ( g11(:) * gradphyd_x(:) + g12(:) * gradphyd_y(:) ) * rgsqrtv(:) &
277 + cori(:,1)
278
279 !-- MOMY
280 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * ( u_(:) * momy_(:,ke) + g12(:) * dpres_(:,ke) ), fx)
281 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * ( v_(:) * momy_(:,ke) + g22(:) * dpres_(:,ke) ), fy)
282 call sparsemat_matmul(dz, lmesh%Gsqrt(:,ke) * ( wt_(:) * momy_(:,ke) &
283 + ( lmesh%GI3(:,ke,1) * g12(:) + lmesh%GI3(:,ke,2) * g22(:) ) * dpres_(:,ke) ), fz)
284 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,momy_vid), liftdelflx)
285
286 momy_dt(:,ke) = &
287 - ( lmesh%Escale(:,ke,1,1) * fx(:) &
288 + lmesh%Escale(:,ke,2,2) * fy(:) &
289 + lmesh%Escale(:,ke,3,3) * fz(:) &
290 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke) &
291 + twoovdel2(:) * x(:) * &
292 ( (1.0_rp + x(:)**2) * u_(:) - x(:) * y(:) * v_(:) ) * momy_(:,ke) &
293 - ( g12(:) * gradphyd_x(:) + g22(:) * gradphyd_y(:) ) * rgsqrtv(:) &
294 + cori(:,2)
295
296 !-- MOMZ
297 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * u_(:) * momz_(:,ke), fx)
298 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * v_(:) * momz_(:,ke), fy)
299 call sparsemat_matmul(dz, lmesh%Gsqrt(:,ke) * wt_(:) * momz_(:,ke), fz)
300 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,momz_vid), liftdelflx)
301
302 momz_dt(:,ke) = &
303 - ( lmesh%Escale(:,ke,1,1) * fx(:) &
304 + lmesh%Escale(:,ke,2,2) * fy(:) &
305 + lmesh%Escale(:,ke,3,3) * fz(:) &
306 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke)
307
308 !-- RHOT
309 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * u_(:) * rhot_(:), fx)
310 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * v_(:) * rhot_(:), fy)
311 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,rhot_vid), liftdelflx)
312
313 rhot_dt(:,ke) = &
314 - ( lmesh%Escale(:,ke,1,1) * fx(:) &
315 + lmesh%Escale(:,ke,2,2) * fy(:) &
316 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke)
317 end do
318 !$omp end parallel
319 call prof_rapend('cal_dyn_tend_interior', 3)
320
321 return
module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / HEVI / Numflux
subroutine, public atm_dyn_dgm_nonhydro3d_rhot_hevi_numflux_get_generalhvc(del_flux, del_flux_hyd, ddens_, momx_, momy_, momz_, drhot_, dpres_, dens_hyd, pres_hyd, rtot, cvtot, cptot, gsqrt, g11, g12, g22, gsqrth, g13, g23, nx, ny, nz, vmapm, vmapp, im2dto3d, lmesh, elem, lmesh2d, elem2d)

References scale_atm_dyn_dgm_nonhydro3d_rhot_hevi_numflux::atm_dyn_dgm_nonhydro3d_rhot_hevi_numflux_get_generalhvc().

◆ atm_dyn_dgm_globalnonhydro3d_rhot_hevi_cal_vi()

subroutine, public scale_atm_dyn_dgm_globalnonhydro3d_rhot_hevi::atm_dyn_dgm_globalnonhydro3d_rhot_hevi_cal_vi ( real(rp), dimension(elem%np,lmesh%nea), intent(out) dens_dt,
real(rp), dimension(elem%np,lmesh%nea), intent(out) momx_dt,
real(rp), dimension(elem%np,lmesh%nea), intent(out) momy_dt,
real(rp), dimension(elem%np,lmesh%nea), intent(out) momz_dt,
real(rp), dimension(elem%np,lmesh%nea), intent(out) rhot_dt,
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) dens_hyd,
real(rp), dimension(elem%np,lmesh%nea), intent(in) pres_hyd,
real(rp), dimension(elem%np,lmesh%nea), intent(in) ddens0_,
real(rp), dimension(elem%np,lmesh%nea), intent(in) momx0_,
real(rp), dimension(elem%np,lmesh%nea), intent(in) momy0_,
real(rp), dimension(elem%np,lmesh%nea), intent(in) momz0_,
real(rp), dimension(elem%np,lmesh%nea), intent(in) drhot0_,
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(elementoperationbase3d), intent(in) element3d_operation,
class(sparsemat), intent(in) dz,
class(sparsemat), intent(in) lift,
real(rp), intent(in) impl_fac,
real(rp), intent(in) dt,
class(localmesh3d), intent(in) lmesh,
class(elementbase3d), intent(in) elem,
class(localmesh2d), intent(in) lmesh2d,
class(elementbase2d), intent(in) elem2d )

Definition at line 325 of file scale_atm_dyn_dgm_globalnonhydro3d_rhot_hevi.F90.

333
339
340 implicit none
341
342 class(LocalMesh3D), intent(in) :: lmesh
343 class(ElementBase3D), intent(in) :: elem
344 class(LocalMesh2D), intent(in) :: lmesh2D
345 class(ElementBase2D), intent(in) :: elem2D
346 real(RP), intent(out) :: DENS_dt(elem%Np,lmesh%NeA)
347 real(RP), intent(out) :: MOMX_dt(elem%Np,lmesh%NeA)
348 real(RP), intent(out) :: MOMY_dt(elem%Np,lmesh%NeA)
349 real(RP), intent(out) :: MOMZ_dt(elem%Np,lmesh%NeA)
350 real(RP), intent(out) :: RHOT_dt(elem%Np,lmesh%NeA)
351 real(RP), intent(in) :: DDENS_(elem%Np,lmesh%NeA)
352 real(RP), intent(in) :: MOMX_(elem%Np,lmesh%NeA)
353 real(RP), intent(in) :: MOMY_(elem%Np,lmesh%NeA)
354 real(RP), intent(in) :: MOMZ_(elem%Np,lmesh%NeA)
355 real(RP), intent(in) :: DRHOT_(elem%Np,lmesh%NeA)
356 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
357 real(RP), intent(in) :: PRES_hyd(elem%Np,lmesh%NeA)
358 real(RP), intent(in) :: DDENS0_(elem%Np,lmesh%NeA)
359 real(RP), intent(in) :: MOMX0_(elem%Np,lmesh%NeA)
360 real(RP), intent(in) :: MOMY0_(elem%Np,lmesh%NeA)
361 real(RP), intent(in) :: MOMZ0_(elem%Np,lmesh%NeA)
362 real(RP), intent(in) :: DRHOT0_(elem%Np,lmesh%NeA)
363 real(RP), intent(in) :: Rtot(elem%Np,lmesh%NeA)
364 real(RP), intent(in) :: CVtot(elem%Np,lmesh%NeA)
365 real(RP), intent(in) :: CPtot(elem%Np,lmesh%NeA)
366 class(ElementOperationBase3D), intent(in) :: element3D_operation
367 class(SparseMat), intent(in) :: Dz, Lift
368 real(RP), intent(in) :: impl_fac
369 real(RP), intent(in) :: dt
370
371 real(RP) :: PROG_VARS (elem%Np,lmesh%NeZ,PRGVAR_NUM,lmesh%NeX*lmesh%NeY)
372 real(RP) :: PROG_VARS0(elem%Np,lmesh%NeZ,PRGVAR_NUM,lmesh%NeX*lmesh%NeY)
373 real(RP) :: b1D(3,elem%Nnode_v,lmesh%NeZ,elem%Nnode_h1D**2,lmesh%NeX*lmesh%NeY)
374 integer :: ipiv(elem%Nnode_v*3*lmesh%NeZ,elem%Nnode_h1D**2)
375 real(RP) :: b1D_uv(elem%Nnode_v,lmesh%NeZ,2,elem%Nnode_h1D**2,lmesh%NeX*lmesh%NeY)
376 integer :: ipiv_uv(elem%Nnode_v*1*lmesh%NeZ,elem%Nnode_h1D**2)
377 real(RP) :: alph(elem%NfpTot,lmesh%NeZ,lmesh%NeX*lmesh%NeY)
378 real(RP) :: Rtot_z(elem%Np,lmesh%NeZ,lmesh%NeX*lmesh%NeY)
379 real(RP) :: CPtot_ov_CVtot(elem%Np,lmesh%NeZ,lmesh%NeX*lmesh%NeY)
380 real(RP) :: DENS_hyd_z(elem%Np,lmesh%NeZ,lmesh%NeX*lmesh%NeY)
381 real(RP) :: PRES_hyd_z(elem%Np,lmesh%NeZ,lmesh%NeX*lmesh%NeY)
382 real(RP) :: GnnM_z(elem%Np,lmesh%NeZ,lmesh%NeX*lmesh%NeY)
383 real(RP) :: G13_z(elem%Np,lmesh%NeZ,lmesh%NeX*lmesh%NeY)
384 real(RP) :: G23_z(elem%Np,lmesh%NeZ,lmesh%NeX*lmesh%NeY)
385 real(RP) :: GsqrtV_z(elem%Np,lmesh%NeZ,lmesh%NeX*lmesh%NeY)
386 real(RP) :: nz(elem%NfpTot,lmesh%NeZ,lmesh%NeX*lmesh%NeY)
387 integer :: vmapM(elem%NfpTot,lmesh%NeZ)
388 integer :: vmapP(elem%NfpTot,lmesh%NeZ)
389 integer :: ColMask(elem%Nnode_v)
390 integer :: ke_xy, ke_z, ke, ke2D, v
391 integer :: itr_nlin
392 integer :: kl, ku, nz_1D
393 integer :: kl_uv, ku_uv, nz_1D_uv
394 integer :: ij
395 logical :: is_converged
396
397 real(RP), allocatable :: PmatBnd(:,:,:)
398 real(RP), allocatable :: PmatBnd_uv(:,:,:)
399 integer :: info, info_uv
400 !------------------------------------------------------------------------
401
402 call prof_rapstart( 'hevi_cal_vi_prep', 3)
403
404 nz_1d = elem%Nnode_v * 3 * lmesh%NeZ
405 kl = ( elem%Nnode_v + 1 ) * 3 - 1
406 ku = kl
407 nz_1d_uv = elem%Nnode_v * 1 * lmesh%NeZ
408 kl_uv = elem%Nnode_v
409 ku_uv = kl_uv
410 allocate( pmatbnd(2*kl+ku+1,nz_1d,elem%Nnode_h1D**2) )
411 allocate( pmatbnd_uv(2*kl_uv+ku_uv+1,nz_1d_uv,elem%Nnode_h1D**2) )
412
413 call lmesh%GetVmapZ1D( vmapm, vmapp ) ! (out)
414
415 !-
416
417 !$omp parallel private( ke_xy, ke_z, ke, ke2D )
418 !$omp do collapse(2)
419 do ke_xy=1, lmesh%NeX*lmesh%NeY
420 do ke_z=1, lmesh%NeZ
421 ke = ke_xy + (ke_z-1)*lmesh%NeX*lmesh%NeY
422 ke2d = lmesh%EMap3Dto2D(ke)
423
424 prog_vars(:,ke_z,dens_vid,ke_xy) = ddens0_(:,ke)
425 prog_vars(:,ke_z,momx_vid,ke_xy) = momx0_(:,ke)
426 prog_vars(:,ke_z,momy_vid,ke_xy) = momy0_(:,ke)
427 prog_vars(:,ke_z,momz_vid,ke_xy) = momz0_(:,ke)
428 prog_vars(:,ke_z,rhot_vid,ke_xy) = drhot0_(:,ke)
429
430 dens_hyd_z(:,ke_z,ke_xy) = dens_hyd(:,ke)
431 pres_hyd_z(:,ke_z,ke_xy) = pres_hyd(:,ke)
432
433 rtot_z(:,ke_z,ke_xy) = rtot(:,ke)
434 cptot_ov_cvtot(:,ke_z,ke_xy) = cptot(:,ke) / cvtot(:,ke)
435
436 nz(:,ke_z,ke_xy) = lmesh%normal_fn(:,ke,3)
437 g13_z(:,ke_z,ke_xy) = lmesh%GI3(:,ke,1)
438 g23_z(:,ke_z,ke_xy) = lmesh%GI3(:,ke,2)
439 gsqrtv_z(:,ke_z,ke_xy) = lmesh%Gsqrt(:,ke) / lmesh%GsqrtH(elem%IndexH2Dto3D,ke2d)
440
441 gnnm_z(:,ke_z,ke_xy) = ( &
442 1.0_rp / gsqrtv_z(:,ke_z,ke_xy)**2 &
443 + g13_z(:,ke_z,ke_xy) * ( lmesh%GIJ(elem%IndexH2Dto3D,ke2d,1,1) * g13_z(:,ke_z,ke_xy) &
444 + lmesh%GIJ(elem%IndexH2Dto3D,ke2d,1,2) * g23_z(:,ke_z,ke_xy) ) &
445 + g23_z(:,ke_z,ke_xy) * ( lmesh%GIJ(elem%IndexH2Dto3D,ke2d,1,2) * g13_z(:,ke_z,ke_xy) &
446 + lmesh%GIJ(elem%IndexH2Dto3D,ke2d,2,2) * g23_z(:,ke_z,ke_xy) ) )
447 end do
448 end do
449 !$omp end do
450 !$omp workshare
451 prog_vars0(:,:,:,:) = prog_vars(:,:,:,:)
452 !$omp end workshare
453 !$omp end parallel
454
455 call prof_rapend( 'hevi_cal_vi_prep', 3)
456
457 !--
458
459 if ( abs(impl_fac) > 0.0_rp ) then
460 call prof_rapstart( 'hevi_cal_vi_itr', 3)
461
462 ! G = (q^n+1 - q^n*) + impl_fac * A(q^n+1) = 0
463 ! dG/dq^n+1 del[q] = - G(q^n*)
464 do itr_nlin = 1, 1
465 call prof_rapstart( 'hevi_cal_vi_ax', 3)
466
467 call vi_eval_ax_uv( &
468 momx_dt(:,:), momy_dt(:,:), alph(:,:,:), & ! (out)
469 prog_vars, prog_vars0, & ! (in)
470 ddens_, momx_, momy_, momz_, drhot_, & ! (in)
471 dens_hyd_z, pres_hyd_z, & ! (in)
472 rtot_z, cptot_ov_cvtot, & ! (in)
473 dz, lift, intrpmat_vpordm1, & ! (in)
474 gnnm_z, g13_z, g23_z, gsqrtv_z, & ! (in)
475 impl_fac, dt, & ! (in)
476 lmesh, elem, nz, vmapm, vmapp, & ! (in)
477 b1d_uv(:,:,:,:,:) ) ! (out)
478
479 call prof_rapend( 'hevi_cal_vi_ax', 3)
480
481 do ke_xy=1, lmesh%NeX * lmesh%NeY
482 call prof_rapstart( 'hevi_cal_vi_matbnd', 3)
483
484 call vi_construct_matbnd_uv( pmatbnd_uv(:,:,:), & ! (out)
485 kl_uv, ku_uv, nz_1d_uv, & ! (in)
486 prog_vars(:,:,:,ke_xy), & ! (in)
487 dens_hyd_z(:,:,ke_xy), pres_hyd_z(:,:,ke_xy), & ! (in)
488 g13_z(:,:,ke_xy), g23_z(:,:,ke_xy), gsqrtv_z(:,:,ke_xy), & ! (in)
489 alph(:,:,ke_xy), & ! (in)
490 rtot_z(:,:,ke_xy), cptot_ov_cvtot(:,:,ke_xy), & ! (in)
491 dz, lift, intrpmat_vpordm1, & ! (in)
492 impl_fac, dt, & ! (in)
493 lmesh, elem, nz(:,:,ke_xy), vmapm, vmapp, ke_xy, 1 ) ! (in)
494
495 call prof_rapend( 'hevi_cal_vi_matbnd', 3)
496
497 call prof_rapstart( 'hevi_cal_vi_lin', 3)
498 !$omp parallel private(ij, v, ke_z, info_uv, ColMask)
499 !$omp do
500 do ij=1, elem%Nnode_h1D**2
501 call dgbsv( nz_1d_uv, kl_uv, ku_uv, 2, pmatbnd_uv(:,:,ij), 2*kl_uv+ku_uv+1, ipiv_uv(:,ij), b1d_uv(:,:,:,ij,ke_xy), nz_1d_uv, info_uv)
502
503 colmask(:) = elem%Colmask(:,ij)
504 do ke_z=1, lmesh%NeZ
505 prog_vars(colmask(:),ke_z,momx_vid,ke_xy) = prog_vars(colmask(:),ke_z,momx_vid,ke_xy) + b1d_uv(:,ke_z,1,ij,ke_xy)
506 prog_vars(colmask(:),ke_z,momy_vid,ke_xy) = prog_vars(colmask(:),ke_z,momy_vid,ke_xy) + b1d_uv(:,ke_z,2,ij,ke_xy)
507 end do
508 end do ! for ij
509 !$omp end do
510 !$omp end parallel
511 call prof_rapend( 'hevi_cal_vi_lin', 3)
512 end do ! for ke_xy
513
514 call prof_rapstart( 'hevi_cal_vi_ax', 3)
515 call vi_eval_ax( &
516 dens_dt(:,:), momz_dt(:,:), rhot_dt(:,:), & ! (out, dummy)
517 alph(:,:,:), & ! (in)
518 prog_vars, prog_vars0, & ! (in)
519 ddens_, momx_, momy_, momz_, drhot_, & ! (in)
520 dens_hyd_z, pres_hyd_z, & ! (in)
521 rtot_z, cptot_ov_cvtot, & ! (in)
522 dz, lift, intrpmat_vpordm1, & ! (in)
523 gnnm_z, g13_z, g23_z, gsqrtv_z, & ! (in)
524 impl_fac, dt, & ! (in)
525 lmesh, elem, nz, vmapm, vmapp, & ! (in)
526 b1d(:,:,:,:,:) ) ! (out)
527 call prof_rapend( 'hevi_cal_vi_ax', 3)
528
529 do ke_xy=1, lmesh%NeX * lmesh%NeY
530 call prof_rapstart( 'hevi_cal_vi_matbnd', 3)
531 call vi_construct_matbnd( pmatbnd(:,:,:), & ! (out)
532 kl, ku, nz_1d, & ! (in)
533 prog_vars(:,:,:,ke_xy), & ! (in)
534 dens_hyd_z(:,:,ke_xy), pres_hyd_z(:,:,ke_xy), & ! (in)
535 g13_z(:,:,ke_xy), g23_z(:,:,ke_xy), gsqrtv_z(:,:,ke_xy), & ! (in)
536 alph(:,:,ke_xy), & ! (in)
537 rtot_z(:,:,ke_xy), cptot_ov_cvtot(:,:,ke_xy), & ! (in)
538 dz, lift, intrpmat_vpordm1, & ! (in)
539 impl_fac, dt, & ! (in)
540 lmesh, elem, nz(:,:,ke_xy), vmapm, vmapp, ke_xy, 1 ) ! (in)
541
542 call prof_rapend( 'hevi_cal_vi_matbnd', 3)
543
544 call prof_rapstart( 'hevi_cal_vi_lin', 3)
545 !$omp parallel private(ij, v, ke_z, info, ColMask)
546 !$omp do
547 do ij=1, elem%Nnode_h1D**2
548 call dgbsv( nz_1d, kl, ku, 1, pmatbnd(:,:,ij), 2*kl+ku+1, ipiv(:,ij), b1d(:,:,:,ij,ke_xy), nz_1d, info)
549
550 colmask(:) = elem%Colmask(:,ij)
551 do ke_z=1, lmesh%NeZ
552 prog_vars(colmask(:),ke_z,dens_vid,ke_xy) = prog_vars(colmask(:),ke_z,dens_vid,ke_xy) + b1d(1,:,ke_z,ij,ke_xy)
553 prog_vars(colmask(:),ke_z,momz_vid,ke_xy) = prog_vars(colmask(:),ke_z,momz_vid,ke_xy) + b1d(2,:,ke_z,ij,ke_xy)
554 prog_vars(colmask(:),ke_z,rhot_vid,ke_xy) = prog_vars(colmask(:),ke_z,rhot_vid,ke_xy) + b1d(3,:,ke_z,ij,ke_xy)
555 end do
556 end do ! for ij
557 !$omp end do
558 !$omp end parallel
559 call prof_rapend( 'hevi_cal_vi_lin', 3)
560
561 end do ! for ke_xy
562 end do ! itr nlin
563
564 call prof_rapend( 'hevi_cal_vi_itr', 3)
565 end if
566
567 call prof_rapstart( 'hevi_cal_vi_retrun_var', 3)
568 if ( abs(impl_fac) > 0.0_rp) then
569 !$omp parallel do collapse(2) private(ke_xy, ke_z, ke)
570 do ke_xy=1, lmesh%NeX * lmesh%NeY
571 do ke_z=1, lmesh%NeZ
572 ke = ke_xy + (ke_z-1)*lmesh%NeX*lmesh%NeY
573 dens_dt(:,ke) = ( prog_vars(:,ke_z,dens_vid,ke_xy) - ddens_(:,ke) ) / impl_fac
574 momx_dt(:,ke) = ( prog_vars(:,ke_z,momx_vid,ke_xy) - momx_(:,ke) ) / impl_fac
575 momy_dt(:,ke) = ( prog_vars(:,ke_z,momy_vid,ke_xy) - momy_(:,ke) ) / impl_fac
576 momz_dt(:,ke) = ( prog_vars(:,ke_z,momz_vid,ke_xy) - momz_(:,ke) ) / impl_fac
577 rhot_dt(:,ke) = ( prog_vars(:,ke_z,rhot_vid,ke_xy) - drhot_(:,ke) ) / impl_fac
578 end do
579 end do
580 else
581 call vi_eval_ax_uv( &
582 momx_dt(:,:), momy_dt(:,:), & ! (out)
583 alph(:,:,:), & ! (out, dummy)
584 prog_vars, prog_vars0, & ! (in)
585 ddens_, momx_, momy_, momz_, drhot_, & ! (in)
586 dens_hyd_z, pres_hyd_z, & ! (in)
587 rtot_z, cptot_ov_cvtot, & ! (in)
588 dz, lift, intrpmat_vpordm1, & ! (in)
589 gnnm_z, g13_z, g23_z, gsqrtv_z, & ! (in)
590 impl_fac, dt, & ! (in)
591 lmesh, elem, nz, vmapm, vmapp ) ! (in)
592
593 call vi_eval_ax( &
594 dens_dt(:,:), momz_dt(:,:), rhot_dt(:,:), & ! (out)
595 alph(:,:,:), & ! (in, dummy)
596 prog_vars, prog_vars0, & ! (in)
597 ddens_, momx_, momy_, momz_, drhot_, & ! (in)
598 dens_hyd_z, pres_hyd_z, & ! (in)
599 rtot_z, cptot_ov_cvtot, & ! (in)
600 dz, lift, intrpmat_vpordm1, & ! (in)
601 gnnm_z, g13_z, g23_z, gsqrtv_z, & ! (in)
602 impl_fac, dt, & ! (in)
603 lmesh, elem, nz, vmapm, vmapp ) ! (in)
604 end if
605 call prof_rapend( 'hevi_cal_vi_retrun_var', 3)
606
607 return
module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / HEVI / Common
subroutine, public atm_dyn_dgm_nonhydro3d_rhot_hevi_common_eval_ax(dens_t, momz_t, rhot_t, alph, prog_vars, prog_vars0, ddens00, momx00, momy00, momz00, drhot00, dens_hyd, pres_hyd, rtot, cptot_ov_cvtot, dz, lift, intrpmat_vpordm1, gnnm, g13, g23, gsqrtv, impl_fac, dt, lmesh, elem, nz, vmapm, vmapp, b1d_ij)
subroutine, public atm_dyn_dgm_nonhydro3d_rhot_hevi_common_eval_ax_uv(momx_t, momy_t, alph, prog_vars, prog_vars0, ddens00, momx00, momy00, momz00, drhot00, dens_hyd, pres_hyd, rtot, cptot_ov_cvtot, dz, lift, intrpmat_vpordm1, gnnm, g13, g23, gsqrtv, impl_fac, dt, lmesh, elem, nz, vmapm, vmapp, b1d_ij_uv)
subroutine, public atm_dyn_dgm_nonhydro3d_rhot_hevi_common_construct_matbnd(pmatbnd, kl, ku, nz_1d, prog_vars0, dens_hyd, pres_hyd, g13, g23, gsqrtv, alph, rtot, cptot_ov_cvtot, dz, lift, intrpmat_vpordm1, impl_fac, dt, lmesh, elem, nz, vmapm, vmapp, ke_x, ke_y)
subroutine, public atm_dyn_dgm_nonhydro3d_rhot_hevi_common_construct_matbnd_uv(pmatbnd_uv, kl_uv, ku_uv, nz_1d_uv, prog_vars0, dens_hyd, pres_hyd, g13, g23, gsqrtv, alph, rtot, cptot_ov_cvtot, dz, lift, intrpmat_vpordm1, impl_fac, dt, lmesh, elem, nz, vmapm, vmapp, ke_x, ke_y)

References scale_atm_dyn_dgm_nonhydro3d_rhot_hevi_common::atm_dyn_dgm_nonhydro3d_rhot_hevi_common_construct_matbnd(), scale_atm_dyn_dgm_nonhydro3d_rhot_hevi_common::atm_dyn_dgm_nonhydro3d_rhot_hevi_common_construct_matbnd_uv(), scale_atm_dyn_dgm_nonhydro3d_rhot_hevi_common::atm_dyn_dgm_nonhydro3d_rhot_hevi_common_eval_ax(), scale_atm_dyn_dgm_nonhydro3d_rhot_hevi_common::atm_dyn_dgm_nonhydro3d_rhot_hevi_common_eval_ax_uv(), and scale_atm_dyn_dgm_nonhydro3d_common::intrpmat_vpordm1.