Fail-loud (never silent) guard: a k-slab’s physical cell count
must not exceed EFP_MAX_SUMMANDS, else a bin could overflow
int64 before the next efp_carry. 1.34e8 is an 11500^2
single-rank layer – unreachable today, but the check costs one
comparison at status cadence (CLAUDE.md: an unchecked bound “is a
silent-corruption path exactly like the NZ_STACK_MAX one”).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| character(len=*), | intent(in) | :: | name |
subroutine efp_summands_guard(nx, ny, name) !! Fail-loud (never silent) guard: a k-slab's physical cell count !! must not exceed `EFP_MAX_SUMMANDS`, else a bin could overflow !! `int64` before the next `efp_carry`. 1.34e8 is an 11500^2 !! single-rank layer -- unreachable today, but the check costs one !! comparison at status cadence (CLAUDE.md: an unchecked bound "is a !! silent-corruption path exactly like the NZ_STACK_MAX one"). integer, intent(in) :: nx, ny character(len=*), intent(in) :: name if (int(nx, int64)*int(ny, int64) > EFP_MAX_SUMMANDS) then call logger%error("============================================") call logger%error("[panic] "//name//": k-slab cell count exceeds EFP_MAX_SUMMANDS") call logger%error("============================================") error stop "EFP k-slab reduction: EFP_MAX_SUMMANDS exceeded" end if end subroutine efp_summands_guard