96 DENS_dt, MOMX_dt, MOMY_dt, MOMZ_dt, RHOT_dt, & ! (out)
97 ddens_, momx_, momy_, momz_, drhot_, dpres_, &
98 dens_hyd, pres_hyd, pres_hyd_ref, therm_hyd, &
99 coriolis, rtot, cvtot, cptot, dphyddx, dphyddy, &
100 element3d_operation, dx, dy, dz, sx, sy, sz, lift, &
101 lmesh, elem, lmesh2d, elem2d )
118 type(
sparsemat),
intent(in) :: dx, dy, dz, sx, sy, sz, lift
119 real(rp),
intent(out) :: dens_dt(elem%np,lmesh%nea)
120 real(rp),
intent(out) :: momx_dt(elem%np,lmesh%nea)
121 real(rp),
intent(out) :: momy_dt(elem%np,lmesh%nea)
122 real(rp),
intent(out) :: momz_dt(elem%np,lmesh%nea)
123 real(rp),
intent(out) :: rhot_dt(elem%np,lmesh%nea)
124 real(rp),
intent(in) :: ddens_(elem%np,lmesh%nea)
125 real(rp),
intent(in) :: momx_(elem%np,lmesh%nea)
126 real(rp),
intent(in) :: momy_(elem%np,lmesh%nea)
127 real(rp),
intent(in) :: momz_(elem%np,lmesh%nea)
128 real(rp),
intent(in) :: drhot_(elem%np,lmesh%nea)
129 real(rp),
intent(in) :: dpres_(elem%np,lmesh%nea)
130 real(rp),
intent(in) :: dens_hyd(elem%np,lmesh%nea)
131 real(rp),
intent(in) :: pres_hyd(elem%np,lmesh%nea)
132 real(rp),
intent(in) :: pres_hyd_ref(elem%np,lmesh%nea)
133 real(rp),
intent(in) :: therm_hyd(elem%np,lmesh%nea)
134 real(rp),
intent(in) :: coriolis(elem2d%np,lmesh2d%nea)
135 real(rp),
intent(in) :: rtot(elem%np,lmesh%nea)
136 real(rp),
intent(in) :: cvtot(elem%np,lmesh%nea)
137 real(rp),
intent(in) :: cptot(elem%np,lmesh%nea)
138 real(rp),
intent(in) :: dphyddx(elem%np,lmesh%nea)
139 real(rp),
intent(in) :: dphyddy(elem%np,lmesh%nea)
141 real(rp) :: flux2d(elem%nnode_h1d**2,5,2,lmesh%ne)
142 real(rp) :: flux2d_(elem%nnode_h1d**2,2,elem%nnode_v,lmesh%ne)
143 real(rp) :: mflxx, mflxy, mflxz
144 real(rp) :: fluxz_store(elem%nnode_h1d**2,5,elem%nnode_v,lmesh%ne)
145 real(rp) :: del_flux(elem%nfptot,
prgvar_num,lmesh%ne)
146 real(rp) :: u_, v_, w_, pt_
148 real(rp) :: drho(elem%np,lmesh%ne)
149 real(rp) :: rdens_, gsqrth, gsqrtv, rgsqrtv, rgsqrt
150 real(rp) :: gsqrt_, gsqrtdpres_, e11, e22, e33
156 integer :: indexh2dto3d(elem%np)
157 integer :: emap3dto2d(lmesh%ne)
160 real(rp) :: tend_tmp(elem%nnode_h1d**2,5,elem%nnode_v,lmesh%ne)
162 integer :: nes, nee, nnode_h1d, nnode_v
165 indexh2dto3d(:) = elem%IndexH2Dto3D(:)
166 call element3d_operation_driver%Init( element3d_operation )
169 nnode_h1d = elem%Nnode_h1D
170 nnode_v = elem%Nnode_v
178 call prof_rapstart(
'cal_dyn_tend_bndflux', 3)
179 call get_ebnd_flux( &
181 ddens_, momx_, momy_, momz_, drhot_, dpres_, dens_hyd, pres_hyd, therm_hyd, &
182 rtot, cvtot, cptot, &
183 lmesh%Gsqrt, lmesh%GI3(:,:,1), lmesh%GI3(:,:,2), &
184 lmesh%normal_fn(:,:,1), lmesh%normal_fn(:,:,2), lmesh%normal_fn(:,:,3), &
185 lmesh%vmapM, lmesh%vmapP, &
186 lmesh, elem, lmesh2d, elem2d )
187 call prof_rapend(
'cal_dyn_tend_bndflux', 3)
189 call prof_rapstart(
'cal_dyn_tend_interior', 3)
193 ke2d = lmesh%EMap3Dto2D(ke)
196 do ph=1, nnode_h1d**2
197 p = ph + (pz-1) * nnode_h1d**2
199 gsqrt_ = lmesh%Gsqrt(p,ke)
200 gsqrtv = gsqrt_ / lmesh%GsqrtH(indexh2dto3d(p),ke2d)
201 rgsqrtv = 1.0_rp / gsqrtv
202 rgsqrt = 1.0_rp / gsqrt_
204 flux2d_(ph,1,pz,ke) = gsqrt_ * momx_(p,ke)
205 flux2d_(ph,2,pz,ke) = gsqrt_ * momy_(p,ke)
206 fluxz_store(ph,dens_vid,pz,ke) = gsqrt_ * ( &
207 momz_(p,ke) * rgsqrtv &
208 + lmesh%GI3(p,ke,1) * momx_(p,ke) &
209 + lmesh%GI3(p,ke,2) * momy_(p,ke) )
211 call div_kplane( element3d_operation_driver, flux2d_(:,:,pz,ke), lmesh%Escale(:,ke,1,1), lmesh%Escale(:,ke,2,2), pz, &
212 tend_tmp(:,dens_vid,pz,ke) )
215 do ph=1, nnode_h1d**2
216 p = ph + (pz-1) * nnode_h1d**2
218 gsqrt_ = lmesh%Gsqrt(p,ke)
219 rdens_ = 1.0_rp / (ddens_(p,ke) + dens_hyd(p,ke))
220 pt_ = ( therm_hyd(p,ke) + drhot_(p,ke) ) * rdens_
222 flux2d_(ph,1,pz,ke) = gsqrt_ * momx_(p,ke) * pt_
223 flux2d_(ph,2,pz,ke) = gsqrt_ * momy_(p,ke) * pt_
224 fluxz_store(ph,rhot_vid,pz,ke) = fluxz_store(ph,dens_vid,pz,ke) * pt_
226 call div_kplane( element3d_operation_driver, flux2d_(:,:,pz,ke), lmesh%Escale(:,ke,1,1), lmesh%Escale(:,ke,2,2), pz, &
227 tend_tmp(:,rhot_vid,pz,ke) )
230 do ph=1, nnode_h1d**2
231 p = ph + (pz-1) * nnode_h1d**2
233 gsqrt_ = lmesh%Gsqrt(p,ke)
234 gsqrth = lmesh%GsqrtH(indexh2dto3d(p),ke2d)
235 rdens_ = 1.0_rp / (ddens_(p,ke) + dens_hyd(p,ke))
236 w_ = momz_(p,ke) * rdens_
238 flux2d_(ph,1,pz,ke) = gsqrt_ * momx_(p,ke) * w_
239 flux2d_(ph,2,pz,ke) = gsqrt_ * momy_(p,ke) * w_
240 fluxz_store(ph,momz_vid,pz,ke) = fluxz_store(ph,dens_vid,pz,ke) * w_ + gsqrth * dpres_(p,ke)
242 call div_kplane( element3d_operation_driver, flux2d_(:,:,pz,ke), lmesh%Escale(:,ke,1,1), lmesh%Escale(:,ke,2,2), pz, &
243 tend_tmp(:,momz_vid,pz,ke) )
246 do ph=1, nnode_h1d**2
247 p = ph + (pz-1) * nnode_h1d**2
249 gsqrt_ = lmesh%Gsqrt(p,ke)
250 gsqrth = lmesh%GsqrtH(indexh2dto3d(p),ke2d)
251 rdens_ = 1.0_rp / (ddens_(p,ke) + dens_hyd(p,ke))
253 u_ = momx_(p,ke) * rdens_
254 gsqrtdpres_ = gsqrt_ * dpres_(p,ke)
256 flux2d_(ph,1,pz,ke) = gsqrt_ * momx_(p,ke) * u_ + gsqrtdpres_
257 flux2d_(ph,2,pz,ke) = gsqrt_ * momy_(p,ke) * u_
258 fluxz_store(ph,momx_vid,pz,ke) = fluxz_store(ph,dens_vid,pz,ke) * u_ + gsqrtdpres_ * lmesh%GI3(p,ke,1)
260 call div_kplane( element3d_operation_driver, flux2d_(:,:,pz,ke), lmesh%Escale(:,ke,1,1), lmesh%Escale(:,ke,2,2), pz, &
261 tend_tmp(:,momx_vid,pz,ke) )
265 do ph=1, nnode_h1d**2
266 p = ph + (pz-1) * nnode_h1d**2
268 gsqrt_ = lmesh%Gsqrt(p,ke)
269 gsqrth = lmesh%GsqrtH(indexh2dto3d(p),ke2d)
270 rdens_ = 1.0_rp / (ddens_(p,ke) + dens_hyd(p,ke))
272 v_ = momy_(p,ke) * rdens_
273 gsqrtdpres_ = gsqrt_ * dpres_(p,ke)
275 flux2d_(ph,1,pz,ke) = gsqrt_ * momx_(p,ke) * v_ + gsqrtdpres_
276 flux2d_(ph,2,pz,ke) = gsqrt_ * momy_(p,ke) * v_
277 fluxz_store(ph,momy_vid,pz,ke) = fluxz_store(ph,dens_vid,pz,ke) * v_ + gsqrtdpres_ * lmesh%GI3(p,ke,2)
279 call div_kplane( element3d_operation_driver, flux2d_(:,:,pz,ke), lmesh%Escale(:,ke,1,1), lmesh%Escale(:,ke,2,2), pz, &
280 tend_tmp(:,momy_vid,pz,ke) )
337 call divvar5_z_lift( element3d_operation_driver, &
338 fluxz_store(:,:,:,ke), del_flux(:,:,ke), lmesh%Escale(:,ke,3,3), lmesh%Gsqrt(:,ke), &
342 call vfilterpm1( element3d_operation_driver, ddens_, lmesh%NeA, lmesh%Ne, &
349 ke2d = lmesh%EMap3Dto2D(ke)
352 do ph=1, nnode_h1d**2
353 p = ph + (pz-1) * nnode_h1d**2
355 dens_dt(p,ke) = - tend_tmp(ph,dens_vid,pz,ke)
356 rhot_dt(p,ke) = - tend_tmp(ph,rhot_vid,pz,ke)
359 momz_dt(p,ke) = - tend_tmp(ph,momz_vid,pz,ke) &
362 cor = coriolis(ph,ke2d)
363 momx_dt(p,ke) = - tend_tmp(ph,momx_vid,pz,ke) &
366 momy_dt(p,ke) = - tend_tmp(ph,momy_vid,pz,ke) &
372 call prof_rapend(
'cal_dyn_tend_interior', 3)
375 call element3d_operation_driver%Final()
381 DENS_dt, MOMX_dt, MOMY_dt, MOMZ_dt, RHOT_dt, & ! (out)
382 ddens_, momx_, momy_, momz_, drhot_, dpres_, &
383 dens_hyd, pres_hyd, pres_hyd_ref, therm_hyd, &
384 coriolis, rtot, cvtot, cptot, dphyddx, dphyddy, &
385 element3d_operation, dx, dy, dz, sx, sy, sz, lift, &
386 lmesh, elem, lmesh2d, elem2d )
399 type(
sparsemat),
intent(in) :: dx, dy, dz, sx, sy, sz, lift
400 real(rp),
intent(out) :: dens_dt(elem%np,lmesh%nea)
401 real(rp),
intent(out) :: momx_dt(elem%np,lmesh%nea)
402 real(rp),
intent(out) :: momy_dt(elem%np,lmesh%nea)
403 real(rp),
intent(out) :: momz_dt(elem%np,lmesh%nea)
404 real(rp),
intent(out) :: rhot_dt(elem%np,lmesh%nea)
405 real(rp),
intent(in) :: ddens_(elem%np,lmesh%nea)
406 real(rp),
intent(in) :: momx_(elem%np,lmesh%nea)
407 real(rp),
intent(in) :: momy_(elem%np,lmesh%nea)
408 real(rp),
intent(in) :: momz_(elem%np,lmesh%nea)
409 real(rp),
intent(in) :: drhot_(elem%np,lmesh%nea)
410 real(rp),
intent(in) :: dpres_(elem%np,lmesh%nea)
411 real(rp),
intent(in) :: dens_hyd(elem%np,lmesh%nea)
412 real(rp),
intent(in) :: pres_hyd(elem%np,lmesh%nea)
413 real(rp),
intent(in) :: pres_hyd_ref(elem%np,lmesh%nea)
414 real(rp),
intent(in) :: therm_hyd(elem%np,lmesh%nea)
415 real(rp),
intent(in) :: coriolis(elem2d%np,lmesh2d%nea)
416 real(rp),
intent(in) :: rtot(elem%np,lmesh%nea)
417 real(rp),
intent(in) :: cvtot(elem%np,lmesh%nea)
418 real(rp),
intent(in) :: cptot(elem%np,lmesh%nea)
419 real(rp),
intent(in) :: dphyddx(elem%np,lmesh%nea)
420 real(rp),
intent(in) :: dphyddy(elem%np,lmesh%nea)
423 real(rp) :: tend_tmp(elem%nnode_h1d**2,5,elem%nnode_v,lmesh%ne)
424 real(rp) :: flux2d(elem%nnode_h1d**2,5,elem%nnode_v,lmesh%ne,2)
425 real(rp) :: fluxz_store(elem%nnode_h1d**2,5,elem%nnode_v,lmesh%ne)
426 real(rp) :: del_flux(elem%nfptot,
prgvar_num,lmesh%ne)
427 real(rp) :: drho(elem%np,lmesh%ne)
429 integer :: indexh2dto3d(elem%np)
431 integer :: nes, nee, nnode_h1d, nnode_v
434 indexh2dto3d(:) = elem%IndexH2Dto3D(:)
435 call element3d_operation_driver%Init( element3d_operation )
438 nnode_h1d = elem%Nnode_h1D
439 nnode_v = elem%Nnode_v
447 call prof_rapstart(
'cal_dyn_tend_bndflux', 3)
448 call get_ebnd_flux( &
450 ddens_, momx_, momy_, momz_, drhot_, dpres_, dens_hyd, pres_hyd, therm_hyd, &
451 rtot, cvtot, cptot, &
452 lmesh%Gsqrt, lmesh%GI3(:,:,1), lmesh%GI3(:,:,2), &
453 lmesh%normal_fn(:,:,1), lmesh%normal_fn(:,:,2), lmesh%normal_fn(:,:,3), &
454 lmesh%vmapM, lmesh%vmapP, &
455 lmesh, elem, lmesh2d, elem2d )
457 call prof_rapend(
'cal_dyn_tend_bndflux', 3)
459 call prof_rapstart(
'cal_dyn_tend_interior', 3)
460 call atm_dyn_dgm_nonhydro3d_rhot_heve_cal_tend_interior_gpu( &
461 dens_dt, momx_dt, momy_dt, momz_dt, rhot_dt, &
462 ddens_, momx_, momy_, momz_, drhot_, dpres_, del_flux, &
463 dens_hyd, therm_hyd, coriolis, dphyddx, dphyddy, &
464 lmesh%Gsqrt,lmesh%GsqrtH,lmesh%GI3(:,:,1),lmesh%GI3(:,:,2), &
465 lmesh%Escale(:,:,1,1), lmesh%Escale(:,:,2,2), lmesh%Escale(:,:,3,3), &
466 flux2d, fluxz_store, tend_tmp, drho, &
467 element3d_operation_driver, &
468 lmesh%EMap3Dto2D, lmesh,elem, lmesh%NeS, lmesh%NeE, lmesh%NeA, lmesh%Ne2DA, elem%Nnode_h1D, elem%Nnode_v )
470 call prof_rapend(
'cal_dyn_tend_interior', 3)
473 call element3d_operation_driver%Final()