Skip to content

Commit 7aafa53

Browse files
committed
Fix BCAST issue
1 parent f9fa5c1 commit 7aafa53

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/simulation/m_acoustic_src.fpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,11 @@ contains
192192
! Allocate buffers for random phase shift
193193
allocate (phi_rn(1:bb_num_freq(ai)))
194194

195-
call random_number(phi_rn(1:bb_num_freq(ai)))
196-
! Ensure all the ranks have the same random phase shift
197-
call s_mpi_send_random_number(phi_rn, bb_num_freq(ai))
195+
if (pulse(ai) == 4) then
196+
call random_number(phi_rn(1:bb_num_freq(ai)))
197+
! Ensure all the ranks have the same random phase shift
198+
call s_mpi_send_random_number(phi_rn, bb_num_freq(ai))
199+
end if
198200

199201
!$acc loop reduction(+:sum_BB)
200202
do k = 1, bb_num_freq(ai)

0 commit comments

Comments
 (0)