Skip to content

Commit 5cd6c66

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 913a136 commit 5cd6c66

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/specfem2D/write_seismograms.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ subroutine write_seismograms()
231231
do i_sig = 1,NSIGTYPE
232232
seismotype_l = seismotypeVec(i_sig)
233233

234-
if (GPU_MODE .and. seismo_current > 0) then
234+
! only flush partially filled GPU seismogram buffers here; when the buffer is
235+
! full, compute_seismograms_cuda has already copied it back to the host
236+
if (GPU_MODE .and. seismo_current > 0 .and. seismo_current < nlength_seismogram) then
235237
call flush_seismograms_cuda(Mesh_pointer,i_sig,sisux(:,:,i_sig),sisuz(:,:,i_sig), &
236238
seismo_current,nlength_seismogram)
237239
endif

0 commit comments

Comments
 (0)