efp_summands_guard Subroutine

private 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”).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
character(len=*), intent(in) :: name

Calls

proc~~efp_summands_guard~~CallsGraph proc~efp_summands_guard efp_summands_guard error error proc~efp_summands_guard->error

Called by

proc~~efp_summands_guard~~CalledByGraph proc~efp_summands_guard efp_summands_guard proc~compute_ice_totals_efp compute_ice_totals_efp proc~compute_ice_totals_efp->proc~efp_summands_guard proc~compute_total_h_efp compute_total_h_efp proc~compute_total_h_efp->proc~efp_summands_guard proc~compute_total_ke_efp compute_total_ke_efp proc~compute_total_ke_efp->proc~efp_summands_guard proc~compute_total_tracer_efp compute_total_tracer_efp proc~compute_total_tracer_efp->proc~efp_summands_guard proc~ocean_console_stats_report ocean_console_stats_report proc~ocean_console_stats_report->proc~compute_ice_totals_efp proc~ocean_console_stats_report->proc~compute_total_h_efp proc~ocean_console_stats_report->proc~compute_total_ke_efp proc~ocean_console_stats_report->proc~compute_total_tracer_efp proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~ocean_console_stats_report proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Source Code

   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