efp_bin1_within_transport_bound Function

public pure function efp_bin1_within_transport_bound(a, nranks) result(ok)

Bin 1 is NOT bounded by efp_carry (only bins 2..6 are – see the module docstring), so the double-precision transport needs its own guard: after summing nranks local values, the partial sum in bin 1 must stay <= 2**53 / nranks for the MPI_SUM-on-doubles combine to remain exact (the analogue of MOM6’s prec_error = huge(1_int64) / num_PEs, but for the int64-as- double transport rather than int64 transport). .false. ⇒ the caller must error stop, never silently proceed.

Arguments

Type IntentOptional Attributes Name
type(efp_t), intent(in) :: a
integer, intent(in) :: nranks

Return Value logical


Called by

proc~~efp_bin1_within_transport_bound~~CalledByGraph proc~efp_bin1_within_transport_bound efp_bin1_within_transport_bound proc~halo_allreduce_efp_list halo_allreduce_efp_list proc~halo_allreduce_efp_list->proc~efp_bin1_within_transport_bound proc~ocean_console_stats_report ocean_console_stats_report proc~ocean_console_stats_report->proc~halo_allreduce_efp_list 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

Variables

Type Visibility Attributes Name Initial
integer(kind=int64), private :: bound

Source Code

   pure function efp_bin1_within_transport_bound(a, nranks) result(ok)
      !! Bin 1 is NOT bounded by `efp_carry` (only bins 2..6 are -- see the
      !! module docstring), so the double-precision transport needs its
      !! own guard: after summing `nranks` local values, the partial sum
      !! in bin 1 must stay `<= 2**53 / nranks` for the MPI_SUM-on-doubles
      !! combine to remain exact (the analogue of MOM6's
      !! `prec_error = huge(1_int64) / num_PEs`, but for the int64-as-
      !! double transport rather than int64 transport).  `.false.` ⇒ the
      !! caller must `error stop`, never silently proceed.
      type(efp_t), intent(in) :: a
      integer, intent(in) :: nranks
      logical :: ok
      integer(int64) :: bound
      if (nranks <= 0) then
         ok = .true.
         return
      end if
      bound = (2_int64**53)/int(nranks, int64)
      ok = abs(a%v(1)) <= bound
   end function efp_bin1_within_transport_bound