@@ -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
@@ -804,7 +819,7 @@ contains
804819 q_cons_qp%vf, &
805820 q_prim_qp%vf, &
806821 gm_alpha_qp%vf, &
807- ix, iy, iz )
822+ ibounds_interior( 1 ), ibounds_interior( 2 ), ibounds_interior( 3 ) )
808823 call nvtxEndRange
809824
810825 call nvtxStartRange(" RHS-MPI" )
0 commit comments