Skip to content

Commit 5385190

Browse files
Fix Periodic Neighborhood Checking (#1608)
1 parent cbf8a54 commit 5385190

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/simulation/m_start_up.fpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,13 @@ contains
14941494
call MPI_SENDRECV(end_val, 1, mpi_p, send_neighbor, ${TAG + 1}$, recv_val, 1, mpi_p, recv_neighbor, &
14951495
& ${TAG + 1}$, MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
14961496
end_val = recv_val
1497+
1498+
! protect from looping back around on yourself multiple times
1499+
if (f_approx_equal(beg_val, ${X}$_cb(${DIM}$)) .or. f_approx_equal(end_val, ${X}$_cb(-1))) then
1500+
beg_val = -huge(0._wp)
1501+
end_val = huge(0._wp)
1502+
exit
1503+
end if
14971504
end do
14981505
neighbor_domain_${X}$%beg = beg_val
14991506
neighbor_domain_${X}$%end = end_val

0 commit comments

Comments
 (0)