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

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

Functions/Subroutines

subroutine, public atm_dyn_dgm_globalnonhydro3d_rhot_heve_init (mesh)
 
subroutine, public atm_dyn_dgm_globalnonhydro3d_rhot_heve_final ()
 
subroutine, public atm_dyn_dgm_globalnh3d_rhot_heve_cal_tend_shallow_atm_asis (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_heve_cal_tend_shallow_atm (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_heve_cal_tend_deep_atm (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)
 

Detailed Description

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

Description
HEVE 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_heve_init()

subroutine, public scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve::atm_dyn_dgm_globalnonhydro3d_rhot_heve_init ( class(meshbase3d), intent(in) mesh)

Definition at line 76 of file scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve.F90.

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

References scale_atm_dyn_dgm_nonhydro3d_common::atm_dyn_dgm_nonhydro3d_common_init().

◆ atm_dyn_dgm_globalnonhydro3d_rhot_heve_final()

subroutine, public scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve::atm_dyn_dgm_globalnonhydro3d_rhot_heve_final

Definition at line 87 of file scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve.F90.

88 implicit none
89 !--------------------------------------------
90
91 call atm_dyn_dgm_nonhydro3d_common_final()
92 return

References scale_atm_dyn_dgm_nonhydro3d_common::atm_dyn_dgm_nonhydro3d_common_final().

◆ atm_dyn_dgm_globalnh3d_rhot_heve_cal_tend_shallow_atm_asis()

subroutine, public scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve::atm_dyn_dgm_globalnh3d_rhot_heve_cal_tend_shallow_atm_asis ( 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 98 of file scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve.F90.

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

References scale_atm_dyn_dgm_nonhydro3d_rhot_heve_numflux::atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_get_generalhvc_asis(), and scale_atm_dyn_dgm_nonhydro3d_common::intrpmat_vpordm1.

◆ atm_dyn_dgm_globalnonhydro3d_rhot_heve_cal_tend_shallow_atm()

subroutine, public scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve::atm_dyn_dgm_globalnonhydro3d_rhot_heve_cal_tend_shallow_atm ( 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 336 of file scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve.F90.

342
345 use scale_const, only: &
346 ohm => const_ohm
347 implicit none
348
349 class(LocalMesh3D), intent(in) :: lmesh
350 class(ElementBase3D), intent(in) :: elem
351 class(LocalMesh2D), intent(in) :: lmesh2D
352 class(ElementBase2D), intent(in) :: elem2D
353 class(ElementOperationBase3D), intent(in) :: element3D_operation
354 type(SparseMat), intent(in) :: Dx, Dy, Dz, Sx, Sy, Sz, Lift
355 real(RP), intent(out) :: DENS_dt(elem%Np,lmesh%NeA)
356 real(RP), intent(out) :: MOMX_dt(elem%Np,lmesh%NeA)
357 real(RP), intent(out) :: MOMY_dt(elem%Np,lmesh%NeA)
358 real(RP), intent(out) :: MOMZ_dt(elem%Np,lmesh%NeA)
359 real(RP), intent(out) :: RHOT_dt(elem%Np,lmesh%NeA)
360 real(RP), intent(in) :: DDENS_(elem%Np,lmesh%NeA)
361 real(RP), intent(in) :: MOMX_(elem%Np,lmesh%NeA)
362 real(RP), intent(in) :: MOMY_(elem%Np,lmesh%NeA)
363 real(RP), intent(in) :: MOMZ_(elem%Np,lmesh%NeA)
364 real(RP), intent(in) :: DRHOT_(elem%Np,lmesh%NeA)
365 real(RP), intent(in) :: DPRES_(elem%Np,lmesh%NeA)
366 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
367 real(RP), intent(in) :: PRES_hyd(elem%Np,lmesh%NeA)
368 real(RP), intent(in) :: PRES_hyd_ref(elem%Np,lmesh%NeA)
369 real(RP), intent(in) :: CORIOLIS(elem2D%Np,lmesh2D%NeA)
370 real(RP), intent(in) :: Rtot (elem%Np,lmesh%NeA)
371 real(RP), intent(in) :: CVtot(elem%Np,lmesh%NeA)
372 real(RP), intent(in) :: CPtot(elem%Np,lmesh%NeA)
373 real(RP), intent(in) :: DPhydDx(elem%Np,lmesh%NeA)
374 real(RP), intent(in) :: DPhydDy(elem%Np,lmesh%NeA)
375
376 real(RP) :: Flux(elem%Np,3,5), DFlux(elem%Np,4,5)
377 real(RP) :: del_flux(elem%NfpTot,PRGVAR_NUM,lmesh%Ne)
378 real(RP) :: rdens_, u_, v_, w_, pt_
379 real(RP) :: drho(elem%Np)
380 real(RP) :: GsqrtV(elem%Np), RGsqrtV(elem%Np), RGsqrt(elem%Np)
381 real(RP) :: Gsqrt_, GsqrtDPRES_, E11, E22, E33
382
383 real(RP) :: G11(elem%Np), G12(elem%Np), G22(elem%Np)
384 real(RP) :: X2D(elem2D%Np,lmesh2D%Ne), Y2D(elem2D%Np,lmesh2D%Ne)
385 real(RP) :: X(elem%Np), Y(elem%Np), twoOVdel2(elem%Np)
386 real(RP) :: CORI(elem%Np,2)
387 logical :: is_panel1to4
388 real(RP) :: s
389
390 integer :: ke, ke2d
391 integer :: p, p12, p3
392
393 real(RP) :: gamm, rgamm
394 real(RP) :: rP0
395 real(RP) :: RovP0, P0ovR
396 !------------------------------------------------------------------------
397
398 call prof_rapstart('cal_dyn_tend_bndflux', 3)
399 call get_ebnd_flux( &
400 del_flux, & ! (out)
401 ddens_, momx_, momy_, momz_, drhot_, dpres_, dens_hyd, pres_hyd, & ! (in)
402 rtot, cvtot, cptot, & ! (in)
403 lmesh%Gsqrt, lmesh%GIJ(:,:,1,1), lmesh%GIJ(:,:,1,2), lmesh%GIJ(:,:,2,2), & ! (in)
404 lmesh%GsqrtH, lmesh%gam, lmesh%GI3(:,:,1), lmesh%GI3(:,:,2), & ! (in)
405 lmesh%normal_fn(:,:,1), lmesh%normal_fn(:,:,2), lmesh%normal_fn(:,:,3), & ! (in)
406 lmesh%vmapM, lmesh%vmapP, elem%IndexH2Dto3D_bnd, & ! (in)
407 lmesh, elem, lmesh2d, elem2d ) ! (in)
408 call prof_rapend('cal_dyn_tend_bndflux', 3)
409
410 !-----
411 call prof_rapstart('cal_dyn_tend_interior', 3)
412 gamm = cpdry / cvdry
413 rgamm = cvdry / cpdry
414 rp0 = 1.0_rp / pres00
415 rovp0 = rdry * rp0
416 p0ovr = pres00 / rdry
417
418 s = 1.0_rp
419 is_panel1to4 = .true.
420 if ( lmesh%panelID == 5 ) then
421 is_panel1to4 = .false.
422 else if ( lmesh%panelID == 6 ) then
423 is_panel1to4 = .false.
424 s = - 1.0_rp
425 end if
426
427 !$omp parallel private( ke, ke2d, p, &
428 !$omp rdens_, u_, v_, w_, pt_, &
429 !$omp drho, CORI, &
430 !$omp RGsqrt, GsqrtV, RGsqrtV, Gsqrt_, GsqrtDPRES_, &
431 !$omp G11, G12, G22, X, Y, twoOVdel2, &
432 !$omp E11, E22, E33, DFlux, Flux )
433
434 !$omp do
435 do ke2d = lmesh2d%NeS, lmesh2d%NeE
436 x2d(:,ke2d) = tan(lmesh2d%pos_en(:,ke2d,1))
437 y2d(:,ke2d) = tan(lmesh2d%pos_en(:,ke2d,2))
438 end do
439
440 !$omp do
441 do ke = lmesh%NeS, lmesh%NeE
442 !--
443 ke2d = lmesh%EMap3Dto2D(ke)
444
445 do p=1, elem%Np
446 g11(p) = lmesh%GIJ(elem%IndexH2Dto3D(p),ke2d,1,1)
447 g12(p) = lmesh%GIJ(elem%IndexH2Dto3D(p),ke2d,1,2)
448 g22(p) = lmesh%GIJ(elem%IndexH2Dto3D(p),ke2d,2,2)
449 end do
450 do p=1, elem%Np
451 gsqrtv(p) = lmesh%Gsqrt(p,ke) / lmesh%GsqrtH(elem%IndexH2Dto3D(p),ke2d)
452 rgsqrtv(p) = 1.0_rp / gsqrtv(p)
453 rgsqrt(p) = 1.0_rp / lmesh%Gsqrt(p,ke)
454 end do
455
456 !--
457
458 do p=1, elem%Np
459 gsqrt_ = lmesh%Gsqrt(p,ke)
460 flux(p,1,dens_vid) = gsqrt_ * momx_(p,ke)
461 flux(p,2,dens_vid) = gsqrt_ * momy_(p,ke)
462 flux(p,3,dens_vid) = gsqrt_ * ( &
463 momz_(p,ke) * rgsqrtv(p) &
464 + lmesh%GI3(p,ke,1) * momx_(p,ke) &
465 + lmesh%GI3(p,ke,2) * momy_(p,ke) )
466 end do
467 do p=1, elem%Np
468 pt_ = ( p0ovr * (pres_hyd(p,ke) * rp0)**rgamm + drhot_(p,ke) ) &
469 / ( ddens_(p,ke) + dens_hyd(p,ke) )
470
471 flux(p,1,rhot_vid) = flux(p,1,dens_vid) * pt_
472 flux(p,2,rhot_vid) = flux(p,2,dens_vid) * pt_
473 flux(p,3,rhot_vid) = flux(p,3,dens_vid) * pt_
474 end do
475
476 do p=1, elem%Np
477 w_ = momz_(p,ke) / (ddens_(p,ke) + dens_hyd(p,ke))
478
479 flux(p,1,momz_vid) = flux(p,1,dens_vid) * w_
480 flux(p,2,momz_vid) = flux(p,2,dens_vid) * w_
481 flux(p,3,momz_vid) = flux(p,3,dens_vid) * w_ + lmesh%Gsqrt(p,ke) * rgsqrtv(p) * dpres_(p,ke)
482 end do
483
484 do p=1, elem%Np
485 gsqrtdpres_ = lmesh%Gsqrt(p,ke) * dpres_(p,ke)
486
487 rdens_ = 1.0_rp / (ddens_(p,ke) + dens_hyd(p,ke))
488 u_ = momx_(p,ke) * rdens_
489 v_ = momy_(p,ke) * rdens_
490
491 flux(p,1,momx_vid) = flux(p,1,dens_vid) * u_ + g11(p) * gsqrtdpres_
492 flux(p,2,momx_vid) = flux(p,2,dens_vid) * u_ + g12(p) * gsqrtdpres_
493 flux(p,3,momx_vid) = flux(p,3,dens_vid) * u_ + gsqrtdpres_ * ( g11(p) * lmesh%GI3(p,ke,1) + g12(p) * lmesh%GI3(p,ke,2) )
494
495 flux(p,1,momy_vid) = flux(p,1,dens_vid) * v_ + g12(p) * gsqrtdpres_
496 flux(p,2,momy_vid) = flux(p,2,dens_vid) * v_ + g22(p) * gsqrtdpres_
497 flux(p,3,momy_vid) = flux(p,3,dens_vid) * v_ + gsqrtdpres_ * ( g12(p) * lmesh%GI3(p,ke,1) + g22(p) * lmesh%GI3(p,ke,2) )
498 end do
499
500 call element3d_operation%Div_var5( &
501 flux, del_flux(:,:,ke), & ! (in)
502 dflux ) ! (out)
503
504
505 do p=1, elem%Np
506 e11 = lmesh%Escale(p,ke,1,1)
507 e22 = lmesh%Escale(p,ke,2,2)
508 e33 = lmesh%Escale(p,ke,3,3)
509
510 dens_dt(p,ke) = - ( &
511 e11 * dflux(p,1,dens_vid) &
512 + e22 * dflux(p,2,dens_vid) &
513 + e33 * dflux(p,3,dens_vid) &
514 + dflux(p,4,dens_vid) ) * rgsqrt(p)
515
516 rhot_dt(p,ke) = - ( &
517 e11 * dflux(p,1,rhot_vid) &
518 + e22 * dflux(p,2,rhot_vid) &
519 + e33 * dflux(p,3,rhot_vid) &
520 + dflux(p,4,rhot_vid) ) * rgsqrt(p)
521 end do
522
523 call element3d_operation%VFilterPM1( ddens_(:,ke), & ! (in)
524 drho ) ! (out)
525
526 do p=1, elem%Np
527 e11 = lmesh%Escale(p,ke,1,1)
528 e22 = lmesh%Escale(p,ke,2,2)
529 e33 = lmesh%Escale(p,ke,3,3)
530
531 momz_dt(p,ke) = - ( &
532 e11 * dflux(p,1,momz_vid) &
533 + e22 * dflux(p,2,momz_vid) &
534 + e33 * dflux(p,3,momz_vid) &
535 + dflux(p,4,momz_vid) ) * rgsqrt(p) &
536 - grav * drho(p)
537 end do
538
539 !--
540 do p=1, elem%Np
541 x(p) = x2d(elem%IndexH2Dto3D(p),ke2d)
542 y(p) = y2d(elem%IndexH2Dto3D(p),ke2d)
543 twoovdel2(p) = 2.0_rp / ( 1.0_rp + x(p)**2 + y(p)**2 )
544 end do
545
546 do p=1, elem%Np
547 cori(p,1) = s * ohm * twoovdel2(p) * ( - x(p) * y(p) * momx_(p,ke) + ( 1.0_rp + y(p)**2 ) * momy_(p,ke) )
548 cori(p,2) = s * ohm * twoovdel2(p) * ( - ( 1.0_rp + x(p)**2 ) * momx_(p,ke) + x(p) * y(p) * momy_(p,ke) )
549 end do
550 if ( is_panel1to4 ) then
551 do p=1, elem%Np
552 cori(p,1) = s * y(p) * cori(p,1)
553 cori(p,2) = s * y(p) * cori(p,2)
554 end do
555 end if
556
557 do p=1, elem%Np
558 rdens_ = 1.0_rp / (ddens_(p,ke) + dens_hyd(p,ke))
559 u_ = momx_(p,ke) * rdens_
560 v_ = momy_(p,ke) * rdens_
561
562 momx_dt(p,ke) = - ( g11(p) * dphyddx(p,ke) + g12(p) * dphyddy(p,ke) ) &
563 - twoovdel2(p) * y(p) * &
564 ( x(p) * y(p) * u_ - (1.0_rp + y(p)**2) * v_ ) * momx_(p,ke) &
565 + cori(p,1)
566
567 momy_dt(p,ke) = - ( g12(p) * dphyddx(p,ke) + g22(p) * dphyddy(p,ke) ) &
568 - twoovdel2(p) * x(p) * &
569 ( - (1.0_rp + x(p)**2) * u_ + x(p) * y(p) * v_ ) * momy_(p,ke) &
570 + cori(p,2)
571 end do
572
573 do p=1, elem%Np
574 e11 = lmesh%Escale(p,ke,1,1)
575 e22 = lmesh%Escale(p,ke,2,2)
576 e33 = lmesh%Escale(p,ke,3,3)
577
578 momx_dt(p,ke) = momx_dt(p,ke) - ( &
579 e11 * dflux(p,1,momx_vid) &
580 + e22 * dflux(p,2,momx_vid) &
581 + e33 * dflux(p,3,momx_vid) &
582 + dflux(p,4,momx_vid) ) * rgsqrt(p)
583
584 momy_dt(p,ke) = momy_dt(p,ke) - ( &
585 e11 * dflux(p,1,momy_vid) &
586 + e22 * dflux(p,2,momy_vid) &
587 + e33 * dflux(p,3,momy_vid) &
588 + dflux(p,4,momy_vid) ) * rgsqrt(p)
589 end do
590 end do
591 !$omp end do
592 !$omp end parallel
593 call prof_rapend('cal_dyn_tend_interior', 3)
594
595 return
subroutine, public atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_get_generalhvc(del_flux, ddens_, momx_, momy_, momz_, drhot_, dpres, dens_hyd, pres_hyd, rtot, cvtot, cptot, gsqrt, g11, g12, g22, gsqrth, gam, g13, g23, nx, ny, nz, vmapm, vmapp, im2dto3d, lmesh, elem, lmesh2d, elem2d)

References scale_atm_dyn_dgm_nonhydro3d_rhot_heve_numflux::atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_get_generalhvc().

◆ atm_dyn_dgm_globalnonhydro3d_rhot_heve_cal_tend_deep_atm()

subroutine, public scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve::atm_dyn_dgm_globalnonhydro3d_rhot_heve_cal_tend_deep_atm ( 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 599 of file scale_atm_dyn_dgm_globalnonhydro3d_rhot_heve.F90.

604
607 use scale_const, only: &
608 ohm => const_ohm
609 implicit none
610
611 class(LocalMesh3D), intent(in) :: lmesh
612 class(ElementBase3D), intent(in) :: elem
613 class(LocalMesh2D), intent(in) :: lmesh2D
614 class(ElementBase2D), intent(in) :: elem2D
615 class(ElementOperationBase3D), intent(in) :: element3D_operation
616 type(SparseMat), intent(in) :: Dx, Dy, Dz, Sx, Sy, Sz, Lift
617 real(RP), intent(out) :: DENS_dt(elem%Np,lmesh%NeA)
618 real(RP), intent(out) :: MOMX_dt(elem%Np,lmesh%NeA)
619 real(RP), intent(out) :: MOMY_dt(elem%Np,lmesh%NeA)
620 real(RP), intent(out) :: MOMZ_dt(elem%Np,lmesh%NeA)
621 real(RP), intent(out) :: RHOT_dt(elem%Np,lmesh%NeA)
622 real(RP), intent(in) :: DDENS_(elem%Np,lmesh%NeA)
623 real(RP), intent(in) :: MOMX_(elem%Np,lmesh%NeA)
624 real(RP), intent(in) :: MOMY_(elem%Np,lmesh%NeA)
625 real(RP), intent(in) :: MOMZ_(elem%Np,lmesh%NeA)
626 real(RP), intent(in) :: DRHOT_(elem%Np,lmesh%NeA)
627 real(RP), intent(in) :: DPRES_(elem%Np,lmesh%NeA)
628 real(RP), intent(in) :: DENS_hyd(elem%Np,lmesh%NeA)
629 real(RP), intent(in) :: PRES_hyd(elem%Np,lmesh%NeA)
630 real(RP), intent(in) :: PRES_hyd_ref(elem%Np,lmesh%NeA)
631 real(RP), intent(in) :: CORIOLIS(elem2D%Np,lmesh2D%NeA)
632 real(RP), intent(in) :: Rtot (elem%Np,lmesh%NeA)
633 real(RP), intent(in) :: CVtot(elem%Np,lmesh%NeA)
634 real(RP), intent(in) :: CPtot(elem%Np,lmesh%NeA)
635 real(RP), intent(in) :: DPhydDx(elem%Np,lmesh%NeA)
636 real(RP), intent(in) :: DPhydDy(elem%Np,lmesh%NeA)
637
638 real(RP) :: Fx(elem%Np), Fy(elem%Np), Fz(elem%Np), LiftDelFlx(elem%Np)
639 real(RP) :: DPRES_hyd(elem%Np), GradPhyd_x(elem%Np), GradPhyd_y(elem%Np)
640 real(RP) :: del_flux(elem%NfpTot,lmesh%Ne,PRGVAR_NUM)
641 real(RP) :: del_flux_hyd(elem%NfpTot,lmesh%Ne,2)
642 real(RP) :: RHOT_(elem%Np)
643 real(RP) :: rdens_(elem%Np), u_(elem%Np), v_(elem%Np), w_(elem%Np), wt_(elem%np), drho(elem%Np)
644
645 real(RP) :: G11(elem%Np), G12(elem%Np), G22(elem%Np)
646 real(RP) :: GsqrtV(elem%Np), RGsqrtV(elem%Np), Rgam2(elem%Np)
647 real(RP) :: X2D(elem2D%Np,lmesh2D%Ne), Y2D(elem2D%Np,lmesh2D%Ne)
648 real(RP) :: X(elem%Np), Y(elem%Np), twoOVdel2(elem%Np)
649 real(RP) :: OM1(elem%Np), OM2(elem%Np), OM3(elem%Np), DEL(elem%Np), R(elem%Np)
650 logical :: is_panel1to4
651 real(RP) :: s
652
653 integer :: ke, ke2d
654 integer :: p
655
656 real(RP) :: rgamm
657 real(RP) :: rP0
658 real(RP) :: P0ovR
659 !------------------------------------------------------------------------
660
661 call prof_rapstart('cal_dyn_tend_bndflux', 3)
662 call get_ebnd_flux( &
663 del_flux, del_flux_hyd, & ! (out)
664 ddens_, momx_, momy_, momz_, drhot_, dpres_, dens_hyd, pres_hyd, & ! (in)
665 rtot, cvtot, cptot, & ! (in)
666 lmesh%Gsqrt, lmesh%GIJ(:,:,1,1), lmesh%GIJ(:,:,1,2), lmesh%GIJ(:,:,2,2), & ! (in)
667 lmesh%GsqrtH, lmesh%gam, lmesh%GI3(:,:,1), lmesh%GI3(:,:,2), & ! (in)
668 lmesh%normal_fn(:,:,1), lmesh%normal_fn(:,:,2), lmesh%normal_fn(:,:,3), & ! (in)
669 lmesh%vmapM, lmesh%vmapP, elem%IndexH2Dto3D_bnd, & ! (in)
670 lmesh, elem, lmesh2d, elem2d ) ! (in)
671 call prof_rapend('cal_dyn_tend_bndflux', 3)
672
673 !-----
674 call prof_rapstart('cal_dyn_tend_interior', 3)
675 rgamm = cvdry / cpdry
676 rp0 = 1.0_rp / pres00
677 p0ovr = pres00 / rdry
678
679 s = 2.0_rp * ohm
680 is_panel1to4 = .true.
681 if ( lmesh%panelID == 5 ) then
682 is_panel1to4 = .false.
683 else if ( lmesh%panelID == 6 ) then
684 is_panel1to4 = .false.
685 s = - s
686 end if
687
688 !$omp parallel private( &
689 !$omp RHOT_, rdens_, u_, v_, w_, wt_, &
690 !$omp Fx, Fy, Fz, LiftDelFlx, &
691 !$omp drho, DPRES_hyd, GradPhyd_x, GradPhyd_y, &
692 !$omp G11, G12, G22, Rgam2, GsqrtV, RGsqrtV, &
693 !$omp X, Y, twoOVdel2, &
694 !$omp OM1, OM2, OM3, DEL, R, ke, ke2D )
695
696 !$omp do
697 do ke2d = lmesh2d%NeS, lmesh2d%NeE
698 x2d(:,ke2d) = tan(lmesh2d%pos_en(:,ke2d,1))
699 y2d(:,ke2d) = tan(lmesh2d%pos_en(:,ke2d,2))
700 end do
701
702 !$omp do
703 do ke = lmesh%NeS, lmesh%NeE
704 !--
705 ke2d = lmesh%EMap3Dto2D(ke)
706 rgam2(:) = 1.0_rp / lmesh%gam(:,ke)**2
707 g11(:) = lmesh%GIJ(elem%IndexH2Dto3D,ke2d,1,1) * rgam2(:)
708 g12(:) = lmesh%GIJ(elem%IndexH2Dto3D,ke2d,1,2) * rgam2(:)
709 g22(:) = lmesh%GIJ(elem%IndexH2Dto3D,ke2d,2,2) * rgam2(:)
710 gsqrtv(:) = lmesh%Gsqrt(:,ke) * rgam2(:) / lmesh%GsqrtH(elem%IndexH2Dto3D,ke2d)
711 rgsqrtv(:) = 1.0_rp / gsqrtv(:)
712
713 !--
714 rhot_(:) = p0ovr * ( pres_hyd(:,ke) * rp0 )**rgamm + drhot_(:,ke)
715 ! DPRES_(:) = PRES00 * ( Rtot(:,ke) * rP0 * RHOT_(:) )**( CPtot(:,ke) / CVtot(:,ke) ) &
716 ! - PRES_hyd(:,ke)
717
718 rdens_(:) = 1.0_rp / ( ddens_(:,ke) + dens_hyd(:,ke) )
719 u_(:) = momx_(:,ke) * rdens_(:)
720 v_(:) = momy_(:,ke) * rdens_(:)
721 w_(:) = momz_(:,ke) * rdens_(:)
722 wt_(:) = w_(:) * rgsqrtv(:) + lmesh%GI3(:,ke,1) * u_(:) + lmesh%GI3(:,ke,2) * v_(:)
723
724 x(:) = x2d(elem%IndexH2Dto3D,ke2d)
725 y(:) = y2d(elem%IndexH2Dto3D,ke2d)
726 del(:) = sqrt( 1.0_rp + x(:)**2 + y(:)**2 )
727 twoovdel2(:) = 2.0_rp / ( 1.0_rp + x(:)**2 + y(:)**2 )
728
729 r(:) = rplanet * lmesh%gam(:,ke)
730
731 !- pnl=1~4: OM1: 0, OM2: s del / (r (1+Y^2)) , s OM3 : Y /del
732 !- pnl=5,6: OM1: - s X del/(r (1+X^2)), OM2: - s Y del/(r(1+Y^2)), OM3 : s/del
733 if ( is_panel1to4 ) then
734 om1(:) = 0.0_rp
735 om2(:) = s * del(:) / ( r(:) * ( 1.0_rp + y(:)**2 ) )
736 om3(:) = s * y(:) / del(:)
737 else
738 om1(:) = - s * x(:) * del(:) / ( r(:) * ( 1.0_rp + x(:)**2 ) )
739 om2(:) = - s * y(:) * del(:) / ( r(:) * ( 1.0_rp + y(:)**2 ) )
740 om3(:) = s / del(:)
741 end if
742
743 drho(:) = matmul(intrpmat_vpordm1, ddens_(:,ke))
744
745 !-- Gradient hydrostatic pressure
746
747 dpres_hyd(:) = pres_hyd(:,ke) - pres_hyd_ref(:,ke)
748
749 call sparsemat_matmul(dx, gsqrtv(:) * dpres_hyd(:), fx)
750 call sparsemat_matmul(dz, gsqrtv(:) * lmesh%GI3(:,ke,1) * dpres_hyd(:), fz)
751 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux_hyd(:,ke,1), liftdelflx)
752 gradphyd_x(:) = lmesh%Escale(:,ke,1,1) * fx(:) &
753 + lmesh%Escale(:,ke,3,3) * fz(:) &
754 + liftdelflx(:)
755
756 call sparsemat_matmul(dy, gsqrtv(:) * dpres_hyd(:), fy)
757 call sparsemat_matmul(dz, gsqrtv(:) * lmesh%GI3(:,ke,2) * dpres_hyd(:), fz)
758 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux_hyd(:,ke,2), liftdelflx)
759 gradphyd_y(:) = lmesh%Escale(:,ke,2,2) * fy(:) &
760 + lmesh%Escale(:,ke,3,3) * fz(:) &
761 + liftdelflx(:)
762
763 !-- DENS
764 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * momx_(:,ke), fx)
765 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * momy_(:,ke), fy)
766 call sparsemat_matmul(dz, lmesh%Gsqrt(:,ke) * ( ddens_(:,ke) + dens_hyd(:,ke) ) * wt_(:), fz)
767 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,dens_vid), liftdelflx)
768
769 dens_dt(:,ke) = - ( &
770 lmesh%Escale(:,ke,1,1) * fx(:) &
771 + lmesh%Escale(:,ke,2,2) * fy(:) &
772 + lmesh%Escale(:,ke,3,3) * fz(:) &
773 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke)
774
775 !-- MOMX
776 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * ( u_(:) * momx_(:,ke) + g11(:) * dpres_(:,ke) ), fx)
777 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * ( v_(:) * momx_(:,ke) + g12(:) * dpres_(:,ke) ), fy)
778 call sparsemat_matmul(dz, lmesh%Gsqrt(:,ke) * ( wt_(:) * momx_(:,ke) &
779 + ( lmesh%GI3(:,ke,1) * g11(:) + lmesh%GI3(:,ke,2) * g12(:) ) * dpres_(:,ke) ), fz)
780 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,momx_vid), liftdelflx)
781
782 momx_dt(:,ke) = &
783 - ( lmesh%Escale(:,ke,1,1) * fx(:) &
784 + lmesh%Escale(:,ke,2,2) * fy(:) &
785 + lmesh%Escale(:,ke,3,3) * fz(:) &
786 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke) &
787 - twoovdel2(:) * y(:) * & !-> metric terms
788 ( x(:) * y(:) * u_(:) - ( 1.0_rp + y(:)**2 ) * v_(:) ) * momx_(:,ke) & !
789 - 2.0_rp * u_(:) * momz_(:,ke) / r(:) &
790 - ( g11(:) * gradphyd_x(:) + g12(:) * gradphyd_y(:) ) * rgsqrtv(:) & !-> gradient hydrostatic pressure
791 - lmesh%Gsqrt(:,ke) * ( g11(:) * ( om2(:) * momz_(:,ke) - om3(:) * momy_(:,ke) ) & !-> Coriolis term
792 - g12(:) * ( om1(:) * momz_(:,ke) - om3(:) * momx_(:,ke) ) )
793
794 !-- MOMY
795 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * ( u_(:) * momy_(:,ke) + g12(:) * dpres_(:,ke) ), fx)
796 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * ( v_(:) * momy_(:,ke) + g22(:) * dpres_(:,ke) ), fy)
797 call sparsemat_matmul(dz, lmesh%Gsqrt(:,ke) * ( wt_(:) * momy_(:,ke) &
798 + ( lmesh%GI3(:,ke,1) * g12(:) + lmesh%GI3(:,ke,2) * g22(:) ) * dpres_(:,ke) ), fz)
799 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,momy_vid), liftdelflx)
800
801 momy_dt(:,ke) = &
802 - ( lmesh%Escale(:,ke,1,1) * fx(:) &
803 + lmesh%Escale(:,ke,2,2) * fy(:) &
804 + lmesh%Escale(:,ke,3,3) * fz(:) &
805 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke) &
806 - twoovdel2(:) * x(:) * & !-> metric terms
807 ( - (1.0_rp + x(:)**2) * u_(:) + x(:) * y(:) * v_(:) ) * momy_(:,ke) & !
808 - 2.0_rp * v_(:) * momz_(:,ke) / r(:) &
809 - ( g12(:) * gradphyd_x(:) + g22(:) * gradphyd_y(:) ) * rgsqrtv(:) & !-> gradient hydrostatic pressure
810 - lmesh%Gsqrt(:,ke) * ( g12(:) * ( om2(:) * momz_(:,ke) - om3(:) * momy_(:,ke) ) & !-> Coriolis term
811 - g22(:) * ( om1(:) * momz_(:,ke) - om3(:) * momx_(:,ke) ) )
812
813 !-- MOMZ
814 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * u_(:) * momz_(:,ke), fx)
815 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * v_(:) * momz_(:,ke), fy)
816 call sparsemat_matmul(dz, lmesh%Gsqrt(:,ke) * ( wt_(:) * momz_(:,ke) + rgsqrtv(:) * dpres_(:,ke) ), fz)
817 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,momz_vid), liftdelflx)
818
819 momz_dt(:,ke) = &
820 - ( lmesh%Escale(:,ke,1,1) * fx(:) &
821 + lmesh%Escale(:,ke,2,2) * fy(:) &
822 + lmesh%Escale(:,ke,3,3) * fz(:) &
823 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke) &
824 - 0.25_rp * r(:) * twoovdel2(:)**2 * ( 1.0_rp * x(:)**2 ) * ( 1.0_rp * y(:)**2 ) & !-> metric terms
825 * ( - ( 1.0_rp + x(:)**2 ) * momx_(:,ke) * u_(:) & !
826 + 2.0_rp * x(:) * y(:) * momx_(:,ke) * v_(:) & !
827 - ( 1.0_rp + y(:)**2 ) * momy_(:,ke) * v_(:) ) &
828 + 2.0_rp * dpres_(:,ke) / r(:) & !-> metric term with gradient of pressure deviaition
829 - lmesh%Gsqrt(:,ke) * ( om1(:) * momy_(:,ke) - om2(:) * momx_(:,ke) ) & !-> Coriolis term
830 - grav * rgam2(:) * drho(:) !-> buoyancy term
831
832 !-- RHOT
833 call sparsemat_matmul(dx, lmesh%Gsqrt(:,ke) * u_(:) * rhot_(:), fx)
834 call sparsemat_matmul(dy, lmesh%Gsqrt(:,ke) * v_(:) * rhot_(:), fy)
835 call sparsemat_matmul(dz, lmesh%Gsqrt(:,ke) * wt_(:) * rhot_(:), fz)
836 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,rhot_vid), liftdelflx)
837
838 rhot_dt(:,ke) = &
839 - ( lmesh%Escale(:,ke,1,1) * fx(:) &
840 + lmesh%Escale(:,ke,2,2) * fy(:) &
841 + lmesh%Escale(:,ke,3,3) * fz(:) &
842 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke)
843 end do
844 !$omp end do
845 !$omp end parallel
846 call prof_rapend('cal_dyn_tend_interior', 3)
847
848 return

References scale_atm_dyn_dgm_nonhydro3d_rhot_heve_numflux::atm_dyn_dgm_nonhydro3d_rhot_heve_numflux_get_generalhvc_asis(), and scale_atm_dyn_dgm_nonhydro3d_common::intrpmat_vpordm1.