Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 27 additions & 23 deletions src/simulation/m_rhs.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,11 +599,12 @@ contains

if (.not. igr) then
! Association/Population of Working Variables
$:GPU_PARALLEL_LOOP(private='[i, j, k, l]', collapse=4)
do i = 1, sys_size
do l = idwbuff(3)%beg, idwbuff(3)%end
do k = idwbuff(2)%beg, idwbuff(2)%end
do j = idwbuff(1)%beg, idwbuff(1)%end
$:GPU_PARALLEL_LOOP(private='[i, j, k, l]', collapse=3)
do l = idwbuff(3)%beg, idwbuff(3)%end
do k = idwbuff(2)%beg, idwbuff(2)%end
do j = idwbuff(1)%beg, idwbuff(1)%end
$:GPU_LOOP(parallelism='[seq]')
do i = 1, sys_size
q_cons_qp%vf(i)%sf(j, k, l) = q_cons_vf(i)%sf(j, k, l)
end do
end do
Expand Down Expand Up @@ -1124,12 +1125,13 @@ contains
end if

if (hypo_nc_mode /= hypo_nc_mode_dual_pass) then
$:GPU_PARALLEL_LOOP(collapse=4,private='[j, k_loop, l_loop, q_loop, inv_ds, flux_face1, flux_face2]')
do j = 1, sys_size
do q_loop = 0, p
do l_loop = 0, n
do k_loop = 0, m
inv_ds = 1._wp/dx(k_loop)
$:GPU_PARALLEL_LOOP(collapse=3,private='[j, k_loop, l_loop, q_loop, inv_ds, flux_face1, flux_face2]')
do q_loop = 0, p
do l_loop = 0, n
do k_loop = 0, m
inv_ds = 1._wp/dx(k_loop)
$:GPU_LOOP(parallelism='[seq]')
do j = 1, sys_size
flux_face1 = flux_n(1)%vf(j)%sf(k_loop - 1, l_loop, q_loop)
flux_face2 = flux_n(1)%vf(j)%sf(k_loop, l_loop, q_loop)
rhs_vf(j)%sf(k_loop, l_loop, q_loop) = inv_ds*(flux_face1 - flux_face2)
Expand Down Expand Up @@ -1200,12 +1202,13 @@ contains
end if

if (hypo_nc_mode /= hypo_nc_mode_dual_pass) then
$:GPU_PARALLEL_LOOP(collapse=4,private='[j, k, l, q, inv_ds, flux_face1, flux_face2]')
do j = 1, sys_size
do l = 0, p
do k = 0, n
do q = 0, m
inv_ds = 1._wp/dy(k)
$:GPU_PARALLEL_LOOP(collapse=3,private='[j, k, l, q, inv_ds, flux_face1, flux_face2]')
do l = 0, p
do k = 0, n
do q = 0, m
inv_ds = 1._wp/dy(k)
$:GPU_LOOP(parallelism='[seq]')
do j = 1, sys_size
flux_face1 = flux_n(2)%vf(j)%sf(q, k - 1, l)
flux_face2 = flux_n(2)%vf(j)%sf(q, k, l)
rhs_vf(j)%sf(q, k, l) = rhs_vf(j)%sf(q, k, l) + inv_ds*(flux_face1 - flux_face2)
Expand Down Expand Up @@ -1362,12 +1365,13 @@ contains
$:END_GPU_PARALLEL_LOOP()
else ! Cartesian Coordinates
if (hypo_nc_mode /= hypo_nc_mode_dual_pass) then
$:GPU_PARALLEL_LOOP(collapse=4,private='[j, k, l, q, inv_ds, flux_face1, flux_face2]')
do j = 1, sys_size
do k = 0, p
do q = 0, n
do l = 0, m
inv_ds = 1._wp/dz(k)
$:GPU_PARALLEL_LOOP(collapse=3,private='[j, k, l, q, inv_ds, flux_face1, flux_face2]')
do k = 0, p
do q = 0, n
do l = 0, m
inv_ds = 1._wp/dz(k)
$:GPU_LOOP(parallelism='[seq]')
do j = 1, sys_size
flux_face1 = flux_n(3)%vf(j)%sf(l, q, k - 1)
flux_face2 = flux_n(3)%vf(j)%sf(l, q, k)
rhs_vf(j)%sf(l, q, k) = rhs_vf(j)%sf(l, q, k) + inv_ds*(flux_face1 - flux_face2)
Expand Down
33 changes: 18 additions & 15 deletions src/simulation/m_riemann_state.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1345,11 +1345,12 @@ contains
! Reshaping Outputted Data in y-direction

if (norm_dir == 2) then
$:GPU_PARALLEL_LOOP(collapse=4)
do i = 1, sys_size
do l = is3%beg, is3%end
do j = is1%beg, is1%end
do k = is2%beg, is2%end
$:GPU_PARALLEL_LOOP(collapse=3)
do l = is3%beg, is3%end
do j = is1%beg, is1%end
do k = is2%beg, is2%end
$:GPU_LOOP(parallelism='[seq]')
do i = 1, sys_size
flux_vf(i)%sf(k, j, l) = flux_${INFIX}$rsx_vf(k, j, l, i)
end do
end do
Expand Down Expand Up @@ -1401,11 +1402,12 @@ contains
#:endif
! Reshaping Outputted Data in z-direction
else if (norm_dir == 3) then
$:GPU_PARALLEL_LOOP(collapse=4)
do i = 1, sys_size
do j = is1%beg, is1%end
do k = is2%beg, is2%end
do l = is3%beg, is3%end
$:GPU_PARALLEL_LOOP(collapse=3)
do j = is1%beg, is1%end
do k = is2%beg, is2%end
do l = is3%beg, is3%end
$:GPU_LOOP(parallelism='[seq]')
do i = 1, sys_size
flux_vf(i)%sf(l, k, j) = flux_${INFIX}$rsx_vf(l, k, j, i)
end do
end do
Expand Down Expand Up @@ -1455,11 +1457,12 @@ contains
end if
#:endif
else if (norm_dir == 1) then
$:GPU_PARALLEL_LOOP(collapse=4)
do i = 1, sys_size
do l = is3%beg, is3%end
do k = is2%beg, is2%end
do j = is1%beg, is1%end
$:GPU_PARALLEL_LOOP(collapse=3)
do l = is3%beg, is3%end
do k = is2%beg, is2%end
do j = is1%beg, is1%end
$:GPU_LOOP(parallelism='[seq]')
do i = 1, sys_size
flux_vf(i)%sf(j, k, l) = flux_${INFIX}$rsx_vf(j, k, l, i)
end do
end do
Expand Down
11 changes: 6 additions & 5 deletions src/simulation/m_weno.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,12 @@ contains
type(scalar_field), dimension(1:), intent(in) :: v_vf
integer :: i, j, k, l, n_vars

$:GPU_PARALLEL_LOOP(collapse=4)
do i = 1, v_size
do l = idwbuff(3)%beg, idwbuff(3)%end
do k = idwbuff(2)%beg, idwbuff(2)%end
do j = idwbuff(1)%beg, idwbuff(1)%end
$:GPU_PARALLEL_LOOP(collapse=3)
do l = idwbuff(3)%beg, idwbuff(3)%end
do k = idwbuff(2)%beg, idwbuff(2)%end
do j = idwbuff(1)%beg, idwbuff(1)%end
$:GPU_LOOP(parallelism='[seq]')
do i = 1, v_size
v_rs_weno(j, k, l, i) = v_vf(i)%sf(j, k, l)
end do
end do
Expand Down
Loading