Skip to content

Commit d614938

Browse files
sbryngelsonclaude
andcommitted
Add ASSERT for psi_idx and clarifying comment for IB loop scope
src/pre_process/m_start_up.fpp: - Add @:ASSERT(psi_idx > 0) before hyper_cleaning block to catch misconfigured cases where hyper_cleaning is enabled but psi_idx is unset src/pre_process/m_mpi_proxy.fpp: - Add comment explaining why IB patch broadcasts are in the num_patches_max loop rather than the num_bc_patches_max loop (patch_ib is sized by num_patches_max, not num_bc_patches_max) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 22304a1 commit d614938

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/pre_process/m_mpi_proxy.fpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ contains
116116
if (chemistry) then
117117
call MPI_BCAST(patch_icpp(i)%Y, size(patch_icpp(i)%Y), mpi_p, 0, MPI_COMM_WORLD, ierr)
118118
end if
119-
! Broadcast IB variables
119+
! Broadcast IB variables: patch_ib is indexed 1:num_patches_max,
120+
! not 1:num_bc_patches_max, so these must live in the num_patches_max loop.
120121
#:for VAR in ['vel', 'angular_vel', 'angles']
121122
call MPI_BCAST(patch_ib(i)%${VAR}$, size(patch_ib(i)%${VAR}$), mpi_p, 0, MPI_COMM_WORLD, ierr)
122123
#:endfor

src/pre_process/m_start_up.fpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ contains
788788

789789
! hard-coded psi
790790
if (hyper_cleaning) then
791+
@:ASSERT(psi_idx > 0, "hyper_cleaning requires psi_idx to be set")
791792
do l = 0, p
792793
do k = 0, n
793794
do j = 0, m

0 commit comments

Comments
 (0)