Skip to content

Commit 2d65b67

Browse files
sbryngelsonclaude
andcommitted
Fix loc_violations used uninitialized in MPI_Allreduce
loc_violations is never set to 0 before the conditional that may or may not assign it. Non-violating ranks sum garbage in the reduction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3781b98 commit 2d65b67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pre_process/m_data_output.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ contains
476476

477477
! Generic loop iterators
478478
integer :: i, j, k, l
479-
real(wp) :: loc_violations, glb_violations
479+
real(wp) :: loc_violations = 0._wp, glb_violations
480480

481481
! Downsample variables
482482
integer :: m_ds, n_ds, p_ds

0 commit comments

Comments
 (0)