efp_carry Subroutine

public pure subroutine efp_carry(e)

Renormalise bins 6..2 into (-2**P, 2**P), propagating the excess into the next-more-significant bin, without changing the represented value. Bin 1 is left untouched (unbounded by construction; see the module docstring on EFP_MAX_RANKS). Mirrors MOM6 carry_overflow, which loops EFP_DIGITS..2 for the same reason.

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: e(EFP_DIGITS)

Called by

proc~~efp_carry~~CalledByGraph proc~efp_carry efp_carry proc~compute_ice_totals_efp compute_ice_totals_efp proc~compute_ice_totals_efp->proc~efp_carry proc~compute_total_h_efp compute_total_h_efp proc~compute_total_h_efp->proc~efp_carry proc~compute_total_ke_efp compute_total_ke_efp proc~compute_total_ke_efp->proc~efp_carry proc~compute_total_tracer_efp compute_total_tracer_efp proc~compute_total_tracer_efp->proc~efp_carry proc~efp_regularize efp_regularize proc~efp_regularize->proc~efp_carry proc~ocean_accumulate_mass_out ocean_accumulate_mass_out proc~ocean_accumulate_mass_out->proc~efp_carry proc~efp_from_transport efp_from_transport proc~efp_from_transport->proc~efp_regularize proc~efp_minus efp_minus proc~efp_minus->proc~efp_regularize proc~efp_plus efp_plus proc~efp_plus->proc~efp_regularize proc~efp_to_real efp_to_real proc~efp_to_real->proc~efp_regularize 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~ocean_console_stats_report->proc~efp_to_real proc~halo_allreduce_efp_list halo_allreduce_efp_list proc~ocean_console_stats_report->proc~halo_allreduce_efp_list proc~console_stats_report console_stats_report proc~ocean_console_stats_report->proc~console_stats_report proc~run_continuity_chain run_continuity_chain proc~run_continuity_chain->proc~ocean_accumulate_mass_out proc~run_stage run_stage proc~run_stage->proc~ocean_accumulate_mass_out proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~ocean_console_stats_report proc~engine_step engine_step proc~driver_run_ocean->proc~engine_step proc~efp_real_diff efp_real_diff proc~efp_real_diff->proc~efp_minus proc~efp_real_diff->proc~efp_to_real proc~halo_allreduce_efp_list->proc~efp_from_transport proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~run_stage proc~run_stage_split run_stage_split proc~run_stage_split->proc~run_continuity_chain proc~console_stats_report->proc~efp_real_diff proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~engine_step->proc~ocean_dyn_step proc~ocean_dyn_step_split ocean_dyn_step_split proc~engine_step->proc~ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_stage_split proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step

Variables

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

Source Code

   pure subroutine efp_carry(e)
      !! Renormalise bins 6..2 into `(-2**P, 2**P)`, propagating the excess
      !! into the next-more-significant bin, without changing the
      !! represented value.  Bin 1 is left untouched (unbounded by
      !! construction; see the module docstring on `EFP_MAX_RANKS`).
      !! Mirrors MOM6 `carry_overflow`, which loops
      !! `EFP_DIGITS..2` for the same reason.
      integer(int64), intent(inout) :: e(EFP_DIGITS)
      integer :: n
      integer(int64) :: carry_amt

      do n = EFP_DIGITS, 2, -1
         if (e(n) >= EFP_PREC_I64 .or. e(n) <= -EFP_PREC_I64) then
            carry_amt = e(n)/EFP_PREC_I64
            e(n) = e(n) - carry_amt*EFP_PREC_I64
            e(n - 1) = e(n - 1) + carry_amt
         end if
      end do
   end subroutine efp_carry