Skip to content

Commit 29431e2

Browse files
committed
Remove Newton solve for T in buffer regions
1 parent 4883ec9 commit 29431e2

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

src/common/m_variables_conversion.fpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,8 @@ contains
866866

867867
type(int_bounds_info), optional, intent(in) :: ix, iy, iz
868868

869+
type(int_bounds_info) :: aix, aiy, aiz
870+
869871
real(kind(0d0)), dimension(num_fluids) :: alpha_K, alpha_rho_K
870872
real(kind(0d0)), dimension(2) :: Re_K
871873
real(kind(0d0)) :: rho_K, gamma_K, pi_inf_K, qv_K, dyn_pres_K
@@ -908,10 +910,14 @@ contains
908910
end if
909911
#:endif
910912

911-
!$acc parallel loop collapse(3) gang vector default(present) private(alpha_K, alpha_rho_K, Re_K, nRtmp, rho_K, gamma_K, pi_inf_K, qv_K, dyn_pres_K, R3tmp, rhoyks)
912-
do l = izb, ize
913-
do k = iyb, iye
914-
do j = ixb, ixe
913+
if (present(ix)) then; aix = ix; else; aix%beg = ixb; aix%end = ixe; end if
914+
if (present(iy)) then; aiy = iy; else; aiy%beg = iyb; aiy%end = iye; end if
915+
if (present(iz)) then; aiz = iz; else; aiz%beg = izb; aiz%end = ize; end if
916+
917+
!$acc parallel loop collapse(3) gang vector default(present) copyin(aix, aiy, aiz) private(alpha_K, alpha_rho_K, Re_K, nRtmp, rho_K, gamma_K, pi_inf_K, qv_K, dyn_pres_K, R3tmp, rhoyks)
918+
do l = aiz%beg, aiz%end
919+
do k = aiy%beg, aiy%end
920+
do j = aix%beg, aix%end
915921
dyn_pres_K = 0d0
916922

917923
!$acc loop seq

src/simulation/m_rhs.fpp

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ module m_rhs
172172
type(int_bounds_info) :: ix, iy, iz
173173
!$acc declare create(ix, iy, iz)
174174

175+
type(int_bounds_info) :: ibounds_interior(1:3)
176+
!$acc declare create(ibounds_interior)
177+
178+
type(int_bounds_info) :: ibounds_wbuffer(1:3)
179+
!$acc declare create(ibounds_wbuffer)
180+
175181
type(int_bounds_info) :: is1, is2, is3
176182
!$acc declare create(is1, is2, is3)
177183

@@ -236,15 +242,24 @@ contains
236242
integer :: i, j, k, l, id !< Generic loop iterators
237243

238244
! Configuring Coordinate Direction Indexes =========================
239-
ix%beg = -buff_size; iy%beg = 0; iz%beg = 0
245+
ibounds_interior(1)%beg = 0; ibounds_interior(2)%beg = 0; ibounds_interior(3)%beg = 0
246+
ibounds_interior(1)%end = m; ibounds_interior(2)%end = n; ibounds_interior(3)%end = p
240247

241-
if (n > 0) iy%beg = -buff_size; if (p > 0) iz%beg = -buff_size
248+
ibounds_wbuffer(1)%beg = -buff_size
249+
ibounds_wbuffer(2)%beg = 0
250+
ibounds_wbuffer(3)%beg = 0
251+
if (num_dims > 1) then ibounds_wbuffer(2)%beg = -buff_size; end if
252+
if (num_dims > 2) then ibounds_wbuffer(3)%beg = -buff_size; end if
242253

243-
ix%end = m - ix%beg; iy%end = n - iy%beg; iz%end = p - iz%beg
254+
ibounds_wbuffer(1)%end = m + buff_size
255+
ibounds_wbuffer(2)%end = n + buff_size
256+
ibounds_wbuffer(3)%end = p + buff_size
257+
258+
ix = ibounds_interior(1); iy = ibounds_interior(2); iz = ibounds_interior(3)
244259
! ==================================================================
245260

246-
!$acc enter data copyin(ix, iy, iz)
247-
!$acc update device(ix, iy, iz)
261+
!$acc enter data copyin(ibounds_interior, ibounds_wbuffer, ix, iy, iz)
262+
!$acc update device(ibounds_interior, ibounds_wbuffer, ix, iy, iz)
248263

249264
ixt = ix; iyt = iy; izt = iz
250265

@@ -797,7 +812,7 @@ contains
797812
q_cons_qp%vf, &
798813
q_prim_qp%vf, &
799814
gm_alpha_qp%vf, &
800-
ix, iy, iz)
815+
ibounds_interior(1), ibounds_interior(2), ibounds_interior(3))
801816
call nvtxEndRange
802817

803818
call nvtxStartRange("RHS-MPI")

0 commit comments

Comments
 (0)