Skip to content

Commit 9f33f4a

Browse files
author
Benjamin Wilfong
committed
Passes on GPUs
1 parent b348f29 commit 9f33f4a

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

src/simulation/m_monopole.f90

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ module m_monopole
3232
real(kind(0d0)), allocatable, dimension(:) :: mag, length, npulse, dir, delay
3333
!$acc declare create(mag, length, npulse, dir, delay)
3434

35+
real(kind(0d0)), allocatable, dimension(:) :: gammas, pi_infs
36+
!$acc declare create(gammas, pi_infs)
37+
3538
contains
3639

3740
subroutine s_initialize_monopole_module()
@@ -54,10 +57,18 @@ subroutine s_initialize_monopole_module()
5457
end do
5558
end do
5659
!$acc update device(mag, support, length, npulse, pulse, dir, delay, foc_length, aperture, loc_mono)
60+
61+
allocate (gammas(1:num_fluids), pi_infs(1:num_fluids))
62+
63+
do i = 1, num_fluids
64+
gammas(i) = fluid_pp(i)%gamma
65+
pi_infs(i) = fluid_pp(i)%pi_inf
66+
end do
67+
!$acc update device(gammas, pi_infs)
5768
end subroutine
5869

5970
subroutine s_monopole_calculations(mono_mass_src, mono_mom_src, mono_e_src, myalpha_rho, myalpha, q_cons_vf, &
60-
q_prim_vf, t_step, id, rhs_vf, gammas, pi_infs)
71+
q_prim_vf, t_step, id, rhs_vf)
6172

6273
type(scalar_field), dimension(sys_size), intent(inout) :: q_cons_vf !<
6374
!! This variable contains the WENO-reconstructed values of the cell-average
@@ -75,8 +86,6 @@ subroutine s_monopole_calculations(mono_mass_src, mono_mom_src, mono_e_src, myal
7586
real(kind(0d0)) :: myR, myV, alf, myP, myRho, R2Vav
7687
integer, intent(IN) :: t_step
7788

78-
real(kind(0d0)), dimension(1:num_fluids) :: gammas, pi_infs
79-
8089
integer :: i, j, k, l, q, ii, id !< generic loop variables
8190
integer :: term_index
8291

src/simulation/m_rhs.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
13251325
if (monopole) then
13261326
call s_monopole_calculations(mono_mass_src, mono_mom_src, mono_e_src, myalpha_rho, myalpha,&
13271327
q_cons_qp%vf(1:sys_size), q_prim_qp%vf(1:sys_size), t_step, id, &
1328-
rhs_vf, gammas, pi_infs)
1328+
rhs_vf)
13291329
end if
13301330

13311331
if (model_eqns == 3) then
@@ -1647,7 +1647,7 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
16471647
if (monopole) then
16481648
call s_monopole_calculations(mono_mass_src, mono_mom_src, mono_e_src, myalpha_rho, myalpha,&
16491649
q_cons_qp%vf(1:sys_size), q_prim_qp%vf(1:sys_size), t_step, id, &
1650-
rhs_vf, gammas, pi_infs)
1650+
rhs_vf)
16511651
end if
16521652

16531653
if (model_eqns == 3) then
@@ -2170,7 +2170,7 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
21702170
if (monopole) then
21712171
call s_monopole_calculations(mono_mass_src, mono_mom_src, mono_e_src, myalpha_rho, myalpha,&
21722172
q_cons_qp%vf(1:sys_size), q_prim_qp%vf(1:sys_size), t_step, id, &
2173-
rhs_vf, gammas, pi_infs)
2173+
rhs_vf)
21742174
end if
21752175

21762176
call nvtxEndRange()

src/simulation/m_viscous.f90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ subroutine s_compute_viscous_stress_tensor(q_prim_vf, grad_x_vf, grad_y_vf, grad
9191

9292
type(int_bounds_info) :: ix, iy, iz
9393

94+
!$acc update device(ix, iy, iz)
95+
9496
!$acc parallel loop collapse(3) gang vector default(present)
9597
do l = iz%beg, iz%end
9698
do k = iy%beg, iy%end
@@ -107,7 +109,7 @@ subroutine s_compute_viscous_stress_tensor(q_prim_vf, grad_x_vf, grad_y_vf, grad
107109
do l = iz%beg, iz%end
108110
do k = -1, 1
109111
do j = ix%beg, ix%end
110-
print*, j, k, l
112+
111113
!$acc loop seq
112114
do i = 1, num_fluids
113115
alpha_rho_visc(i) = q_prim_vf(i)%sf(j, k, l)

0 commit comments

Comments
 (0)