You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
real(kind(0d0)), dimension(1:num_broadband_freq) :: period_BB !< period of each sine wave in broadband source
140
+
real(kind(0d0)), dimension(1:num_broadband_freq) :: sl_BB !< spectral level at each frequency
141
+
real(kind(0d0)), dimension(1:num_broadband_freq) :: ffre_BB !< source term corresponding to each frequency
142
+
real(kind(0d0)), dimension(1:num_broadband_freq) :: phi_rn !< random phase shift for each frequency
143
+
real(kind(0d0)) :: sum_BB !< total source term for the broadband wave
141
144
142
145
integer:: i, j, k, l, q !< generic loop variables
143
146
integer:: ai !< acoustic source index
@@ -173,16 +176,21 @@ contains
173
176
174
177
num_points = source_spatials_num_points(ai) ! Use scalar to force firstprivate to prevent GPU bug
175
178
176
-
callrandom_number(phi_rn(1:100))
179
+
callrandom_number(phi_rn(1:num_broadband_freq))
180
+
! Ensure all the ranks have the same random phase shift
177
181
call s_mpi_send_random_number(phi_rn)
178
182
sum_BB =0d0
179
183
180
-
!$acc loop
184
+
!$acc loop seq
181
185
do k =1, num_broadband_freq
182
-
period_BB(k) =1d0/(broadband_freq_lowest + k*broadband_bandwidth) ! Acoustic period of the wave at each discrete frequency
183
-
sl_BB(k) = broadband_spectral_level_constant*mag(ai) + k*mag(ai)/broadband_spectral_level_growth_rate ! Spectral level at each frequency
184
-
ffre_BB(k) = dsqrt((2d0*sl_BB(k)*broadband_bandwidth))*cos((sim_time)*2.d0*pi/period_BB(k) +2d0*pi*phi_rn(k)) ! Source term corresponding to each frequencies
185
-
sum_BB = sum_BB + ffre_BB(k) ! Total source term for the broadband wave
186
+
! Acoustic period of the wave at each discrete frequency
0 commit comments