MOM_coms module reference

Interfaces to non-domain-oriented communication subroutines, including the MOM6 reproducing sums facility

Data Types

EFP_type

The Extended Fixed Point (EFP) type provides a public interface for doing sums and taking differences with this type.

Generic Interfaces

reproducing_sum

Making this true enables debugging output.

reproducing_sum_EFP

Find an accurate and order-invariant sum of a distributed 2d field, returning the result in the form of an extended fixed point value that can be converted back with EFP_to_real.

EFP_sum_across_PEs

Sum a value or 1-d array of values across processors, returning the sums in place

operator(+)

Add two extended-fixed-point numbers

operator(-)

Subtract one extended-fixed-point number from another

assignment(=)

Copy the value of one extended-fixed-point number into another

Functions/Subroutines

reproducing_EFP_sum_2d

This subroutine uses a conversion to an integer representation of real numbers to give an order-invariant sum of distributed 2-D arrays that reproduces across domain decomposition, with the result returned as an extended fixed point type that can be converted back to a real number using EFP_to_real. This technique is described in Hallberg & Adcroft, 2014, Parallel Computing, doi:10.1016/j.parco.2014.04.007.

reproducing_sum_2d

This subroutine uses a conversion to an integer representation of real numbers to give an order-invariant sum of distributed 2-D arrays that reproduces across domain decomposition. This technique is described in Hallberg & Adcroft, 2014, Parallel Computing, doi:10.1016/j.parco.2014.04.007.

reproducing_sum_3d

This subroutine uses a conversion to an integer representation of real numbers to give an order-invariant sum of distributed 3-D arrays that reproduces across domain decomposition. This technique is described in Hallberg & Adcroft, 2014, Parallel Computing, doi:10.1016/j.parco.2014.04.007.

real_to_ints

Convert a real number into the array of integers constitute its extended-fixed-point representation

ints_to_real

Convert the array of integers that constitute an extended-fixed-point representation into a real number

increment_ints

Increment an array of integers that constitutes an extended-fixed-point representation with a another EFP number

increment_block_ints

Sum the elements of an array in EFP form and append the result to an existing EFP array.

efp_decompose

Decompose one real into its 6 signed EFP bin contributions. NaNs and overflows are reported by flags, rather than the module-level error logicals, so that the routine is free of side effects.

carry_overflow

This subroutine handles carrying of the overflow.

regularize_ints

This subroutine carries the overflow, and then makes sure that all integers are of the same sign as the overall value.

query_EFP_overflow_error

Returns the status of the module's error flag

reset_EFP_overflow_error

Reset the module's error flag to false

EFP_plus

Add two extended-fixed-point numbers

EFP_minus

Subract one extended-fixed-point number from another

EFP_assign

Copy one extended-fixed-point number into another

EFP_to_real

Return the real number that an extended-fixed-point number corresponds with

EFP_real_diff

Take the difference between two extended-fixed-point numbers (EFP1 - EFP2) and return the result as a real number

real_to_EFP

Return the extended-fixed-point number that a real number corresponds with

EFP_list_sum_across_PEs

This subroutine does a sum across PEs of a list of EFP variables, returning the sums in place, with all overflows carried.

EFP_val_sum_across_PEs

This subroutine does a sum across PEs of an EFP variable, returning the sums in place, with all overflows carried.

Type Documentation

type, public :: EFP_type

The Extended Fixed Point (EFP) type provides a public interface for doing sums and taking differences with this type.

The use of this type is documented in Hallberg, R. & A. Adcroft, 2014: An Order-invariant Real-to-Integer Conversion Sum. Parallel Computing, 40(5-6), doi:10.1016/j.parco.2014.04.007.

Parameters
  • v

    The value in this type

Generic Interface Documentation

interface reproducing_sum

Making this true enables debugging output.

Find an accurate and order-invariant sum of a distributed 2d or 3d field, in some cases after undoing the scaling of the input array and restoring that scaling in the returned value

Callers call graph
Callers of mom_coms::interface::reproducing_sum calls cluster_mom_checksum_packages MOM_checksum_packages cluster_mom_checksums MOM_checksums cluster_mom_coms MOM_coms cluster_mom_debugging MOM_debugging cluster_mom_diagnostics MOM_diagnostics cluster_mom_horizontal_regridding MOM_horizontal_regridding cluster_mom_ice_shelf MOM_ice_shelf cluster_mom_ice_shelf_dynamics MOM_ice_shelf_dynamics cluster_mom_offline_main MOM_offline_main cluster_mom_shared_initialization MOM_shared_initialization cluster_mom_spatial_means MOM_spatial_means cluster_mom_spherical_harmonics MOM_spherical_harmonics cluster_mom_sum_output MOM_sum_output cluster_mom_tracer_registry MOM_tracer_registry cluster_tidal_bay_initialization tidal_bay_initialization mom_checksum_packages::mom_state_stats MOM_state_stats mom_coms::interface::reproducing_sum reproducing_sum (interface) mom_checksum_packages::mom_state_stats->mom_coms::interface::reproducing_sum mom_checksums::chksum2d chksum2d [private/internal] mom_checksums::chksum2d->mom_coms::interface::reproducing_sum mom_checksums::chksum3d chksum3d [private/internal] mom_checksums::chksum3d->mom_coms::interface::reproducing_sum mom_checksums::chksum_b_2d::substats chksum_b_2d subStats [private/internal] mom_checksums::chksum_b_2d::substats->mom_coms::interface::reproducing_sum mom_checksums::chksum_b_3d::substats chksum_b_3d subStats [private/internal] mom_checksums::chksum_b_3d::substats->mom_coms::interface::reproducing_sum mom_checksums::chksum_h_2d::substats chksum_h_2d subStats [private/internal] mom_checksums::chksum_h_2d::substats->mom_coms::interface::reproducing_sum mom_checksums::chksum_h_3d::substats chksum_h_3d subStats [private/internal] mom_checksums::chksum_h_3d::substats->mom_coms::interface::reproducing_sum mom_checksums::chksum_u_2d::substats chksum_u_2d subStats [private/internal] mom_checksums::chksum_u_2d::substats->mom_coms::interface::reproducing_sum mom_checksums::chksum_u_3d::substats chksum_u_3d subStats [private/internal] mom_checksums::chksum_u_3d::substats->mom_coms::interface::reproducing_sum mom_checksums::chksum_v_2d::substats chksum_v_2d subStats [private/internal] mom_checksums::chksum_v_2d::substats->mom_coms::interface::reproducing_sum mom_checksums::chksum_v_3d::substats chksum_v_3d subStats [private/internal] mom_checksums::chksum_v_3d::substats->mom_coms::interface::reproducing_sum mom_debugging::totalstuff totalStuff mom_debugging::totalstuff->mom_coms::interface::reproducing_sum mom_debugging::totaltands totalTandS mom_debugging::totaltands->mom_coms::interface::reproducing_sum mom_diagnostics::calculate_diagnostic_fields calculate_diagnostic_fields mom_diagnostics::calculate_diagnostic_fields->mom_coms::interface::reproducing_sum mom_horizontal_regridding::homogenize_field homogenize_field mom_horizontal_regridding::homogenize_field->mom_coms::interface::reproducing_sum mom_ice_shelf::integrate_over_ice_sheet_area integrate_over_ice_sheet_area [private/internal] mom_ice_shelf::integrate_over_ice_sheet_area->mom_coms::interface::reproducing_sum mom_ice_shelf_dynamics::ice_shelf_solve_inner_cg ice_shelf_solve_inner_CG [private/internal] mom_ice_shelf_dynamics::ice_shelf_solve_inner_cg->mom_coms::interface::reproducing_sum mom_ice_shelf_dynamics::ice_shelf_solve_inner_cr ice_shelf_solve_inner_CR [private/internal] mom_ice_shelf_dynamics::ice_shelf_solve_inner_cr->mom_coms::interface::reproducing_sum mom_ice_shelf_dynamics::ice_shelf_solve_inner_minres ice_shelf_solve_inner_MINRES [private/internal] mom_ice_shelf_dynamics::ice_shelf_solve_inner_minres->mom_coms::interface::reproducing_sum mom_ice_shelf_dynamics::ice_shelf_solve_outer ice_shelf_solve_outer [private/internal] mom_ice_shelf_dynamics::ice_shelf_solve_outer->mom_coms::interface::reproducing_sum mom_ice_shelf_dynamics::volume_above_floatation volume_above_floatation mom_ice_shelf_dynamics::volume_above_floatation->mom_coms::interface::reproducing_sum mom_ice_shelf_dynamics::write_ice_shelf_energy write_ice_shelf_energy mom_ice_shelf_dynamics::write_ice_shelf_energy->mom_coms::interface::reproducing_sum mom_offline_main::offline_advection_layer offline_advection_layer mom_offline_main::offline_advection_layer->mom_coms::interface::reproducing_sum mom_offline_main::remaining_transport_sum remaining_transport_sum [private/internal] mom_offline_main::remaining_transport_sum->mom_coms::interface::reproducing_sum mom_shared_initialization::compute_global_grid_integrals compute_global_grid_integrals mom_shared_initialization::compute_global_grid_integrals->mom_coms::interface::reproducing_sum mom_spatial_means::global_area_integral global_area_integral mom_spatial_means::global_area_integral->mom_coms::interface::reproducing_sum mom_spatial_means::global_area_mean global_area_mean mom_spatial_means::global_area_mean->mom_coms::interface::reproducing_sum mom_spatial_means::global_area_mean_u global_area_mean_u mom_spatial_means::global_area_mean_u->mom_coms::interface::reproducing_sum mom_spatial_means::global_area_mean_v global_area_mean_v mom_spatial_means::global_area_mean_v->mom_coms::interface::reproducing_sum mom_spatial_means::global_layer_mean global_layer_mean mom_spatial_means::global_layer_mean->mom_coms::interface::reproducing_sum mom_spatial_means::global_mass_integral global_mass_integral mom_spatial_means::global_mass_integral->mom_coms::interface::reproducing_sum mom_spatial_means::global_volume_mean global_volume_mean mom_spatial_means::global_volume_mean->mom_coms::interface::reproducing_sum mom_spherical_harmonics::spherical_harmonics_forward spherical_harmonics_forward mom_spherical_harmonics::spherical_harmonics_forward->mom_coms::interface::reproducing_sum mom_sum_output::write_energy write_energy mom_sum_output::write_energy->mom_coms::interface::reproducing_sum mom_tracer_registry::tracer_array_chkinv tracer_array_chkinv [private/internal] mom_tracer_registry::tracer_array_chkinv->mom_coms::interface::reproducing_sum mom_tracer_registry::tracer_reg_chkinv tracer_Reg_chkinv [private/internal] mom_tracer_registry::tracer_reg_chkinv->mom_coms::interface::reproducing_sum tidal_bay_initialization::tidal_bay_set_obc_data tidal_bay_set_OBC_data tidal_bay_initialization::tidal_bay_set_obc_data->mom_coms::interface::reproducing_sum
Text view
interface reproducing_sum_EFP

Find an accurate and order-invariant sum of a distributed 2d field, returning the result in the form of an extended fixed point value that can be converted back with EFP_to_real.

Callers call graph
Callers of mom_coms::interface::reproducing_sum_efp calls cluster_mom_coms MOM_coms cluster_mom_diag_remap MOM_diag_remap cluster_mom_spatial_means MOM_spatial_means cluster_mom_sum_output MOM_sum_output mom_coms::interface::reproducing_sum_efp reproducing_sum_EFP (interface) mom_diag_remap::horizontally_average_field horizontally_average_field [private/internal] mom_diag_remap::horizontally_average_field->mom_coms::interface::reproducing_sum_efp mom_spatial_means::adjust_area_mean_to_zero adjust_area_mean_to_zero mom_spatial_means::adjust_area_mean_to_zero->mom_coms::interface::reproducing_sum_efp mom_spatial_means::global_mass_int_efp global_mass_int_EFP mom_spatial_means::global_mass_int_efp->mom_coms::interface::reproducing_sum_efp mom_sum_output::accumulate_net_input accumulate_net_input mom_sum_output::accumulate_net_input->mom_coms::interface::reproducing_sum_efp mom_sum_output::write_energy write_energy mom_sum_output::write_energy->mom_coms::interface::reproducing_sum_efp
Text view
interface EFP_sum_across_PEs

Sum a value or 1-d array of values across processors, returning the sums in place

Implementations

EFP_list_sum_across_PEs

Callers call graph
Callers of mom_coms::interface::efp_sum_across_pes calls cluster_mom_coms MOM_coms cluster_mom_diag_remap MOM_diag_remap cluster_mom_energetic_pbl MOM_energetic_PBL cluster_mom_spatial_means MOM_spatial_means cluster_mom_sum_output MOM_sum_output cluster_mom_tracer_flow_control MOM_tracer_flow_control mom_coms::interface::efp_sum_across_pes EFP_sum_across_PEs (interface) mom_diag_remap::horizontally_average_field horizontally_average_field [private/internal] mom_diag_remap::horizontally_average_field->mom_coms::interface::efp_sum_across_pes mom_energetic_pbl::energetic_pbl_end energetic_PBL_end mom_energetic_pbl::energetic_pbl_end->mom_coms::interface::efp_sum_across_pes mom_spatial_means::adjust_area_mean_to_zero adjust_area_mean_to_zero mom_spatial_means::adjust_area_mean_to_zero->mom_coms::interface::efp_sum_across_pes mom_spatial_means::global_i_mean global_i_mean mom_spatial_means::global_i_mean->mom_coms::interface::efp_sum_across_pes mom_spatial_means::global_j_mean global_j_mean mom_spatial_means::global_j_mean->mom_coms::interface::efp_sum_across_pes mom_spatial_means::global_layer_mean global_layer_mean mom_spatial_means::global_layer_mean->mom_coms::interface::efp_sum_across_pes mom_sum_output::write_energy write_energy mom_sum_output::write_energy->mom_coms::interface::efp_sum_across_pes mom_tracer_flow_control::call_tracer_stocks call_tracer_stocks mom_tracer_flow_control::call_tracer_stocks->mom_coms::interface::efp_sum_across_pes
Text view
interface operator(+)

Add two extended-fixed-point numbers

Implementations

EFP_plus

interface operator(-)

Subtract one extended-fixed-point number from another

Implementations

EFP_minus

interface assignment(=)

Copy the value of one extended-fixed-point number into another

Functions/Subroutine Documentation

function reproducing_EFP_sum_2d(array, isr, ier, jsr, jer, overflow_check, err, only_on_PE, unscale) result(EFP_sum)

This subroutine uses a conversion to an integer representation of real numbers to give an order-invariant sum of distributed 2-D arrays that reproduces across domain decomposition, with the result returned as an extended fixed point type that can be converted back to a real number using EFP_to_real. This technique is described in Hallberg & Adcroft, 2014, Parallel Computing, doi:10.1016/j.parco.2014.04.007.

Parameters
  • array [in]

    The array to be summed in arbitrary units [a], or in arbitrary scaled units [A ~> a] if unscale is present

  • isr [in]

    The starting i-index of the sum, noting that the array indices starts at 1

  • ier [in]

    The ending i-index of the sum, noting that the array indices starts at 1

  • jsr [in]

    The starting j-index of the sum, noting that the array indices starts at 1

  • jer [in]

    The ending j-index of the sum, noting that the array indices starts at 1

  • overflow_check [in]

    If present and false, disable checking for overflows in incremental results. This can speed up calculations if the number of values being summed is small enough

  • err [out]

    If present, return an error code instead of triggering any fatal errors directly from this routine.

  • only_on_PE [in]

    If present and true, do not do the sum across processors, only reporting the local sum

  • unscale [in]

    A factor that is used to undo scaling of array before it is summed, often to compensate for the scaling in [a A-1 ~> 1]

  • EFP_sum

    The result in extended fixed point format

Callees call graph
Callees of mom_coms::reproducing_efp_sum_2d calls cluster_mom_coms MOM_coms cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler mom_coms::carry_overflow carry_overflow [private/internal] mom_coms::increment_block_ints increment_block_ints [private/internal] mom_coms::regularize_ints regularize_ints [private/internal] mom_coms::reproducing_efp_sum_2d reproducing_EFP_sum_2d [private/internal] mom_coms::reproducing_efp_sum_2d->mom_coms::carry_overflow mom_coms::reproducing_efp_sum_2d->mom_coms::increment_block_ints mom_coms::reproducing_efp_sum_2d->mom_coms::regularize_ints mom_coms_infra::interface::sum_across_pes sum_across_PEs (interface) mom_coms::reproducing_efp_sum_2d->mom_coms_infra::interface::sum_across_pes mom_coms_infra::num_pes num_PEs mom_coms::reproducing_efp_sum_2d->mom_coms_infra::num_pes mom_error_handler::mom_error MOM_error mom_coms::reproducing_efp_sum_2d->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_coms::reproducing_efp_sum_2d calls cluster_mom_coms MOM_coms mom_coms::reproducing_efp_sum_2d reproducing_EFP_sum_2d [private/internal] mom_coms::reproducing_sum_2d reproducing_sum_2d [private/internal] mom_coms::reproducing_sum_2d->mom_coms::reproducing_efp_sum_2d
Text view
function reproducing_sum_2d(array, isr, ier, jsr, jer, EFP_sum, reproducing, overflow_check, err, only_on_PE, unscale) result(sum)

This subroutine uses a conversion to an integer representation of real numbers to give an order-invariant sum of distributed 2-D arrays that reproduces across domain decomposition. This technique is described in Hallberg & Adcroft, 2014, Parallel Computing, doi:10.1016/j.parco.2014.04.007.

Parameters
  • array [in]

    The array to be summed in arbitrary units [a], or in arbitrary scaled units [A ~> a] if unscale is present

  • isr [in]

    The starting i-index of the sum, noting that the array indices starts at 1

  • ier [in]

    The ending i-index of the sum, noting that the array indices starts at 1

  • jsr [in]

    The starting j-index of the sum, noting that the array indices starts at 1

  • jer [in]

    The ending j-index of the sum, noting that the array indices starts at 1

  • EFP_sum [out]

    The result in extended fixed point format

  • reproducing [in]

    If present and false, do the sum using the naive non-reproducing approach

  • overflow_check [in]

    If present and false, disable checking for overflows in incremental results. This can speed up calculations if the number of values being summed is small enough

  • err [out]

    If present, return an error code instead of triggering any fatal errors directly from this routine.

  • only_on_PE [in]

    If present and true, do not do the sum across processors, only reporting the local sum

  • unscale [in]

    A factor that is used to undo scaling of array before it is summed, often to compensate for the scaling in [a A-1 ~> 1]

  • sum

    The sum of the values in array in the same arbitrary units as array [a] or [A ~> a]

Callees call graph
Callees of mom_coms::reproducing_sum_2d calls cluster_mom_coms MOM_coms cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler mom_coms::ints_to_real ints_to_real [private/internal] mom_coms::real_to_ints real_to_ints [private/internal] mom_coms::reproducing_efp_sum_2d reproducing_EFP_sum_2d [private/internal] mom_coms::reproducing_sum_2d reproducing_sum_2d [private/internal] mom_coms::reproducing_sum_2d->mom_coms::ints_to_real mom_coms::reproducing_sum_2d->mom_coms::real_to_ints mom_coms::reproducing_sum_2d->mom_coms::reproducing_efp_sum_2d mom_coms_infra::interface::sum_across_pes sum_across_PEs (interface) mom_coms::reproducing_sum_2d->mom_coms_infra::interface::sum_across_pes mom_coms_infra::num_pes num_PEs mom_coms::reproducing_sum_2d->mom_coms_infra::num_pes mom_error_handler::mom_error MOM_error mom_coms::reproducing_sum_2d->mom_error_handler::mom_error mom_error_handler::mom_mesg MOM_mesg mom_coms::reproducing_sum_2d->mom_error_handler::mom_mesg
Text view
function reproducing_sum_3d(array, isr, ier, jsr, jer, sums, EFP_sum, EFP_lay_sums, err, only_on_PE, unscale) result(sum)

This subroutine uses a conversion to an integer representation of real numbers to give an order-invariant sum of distributed 3-D arrays that reproduces across domain decomposition. This technique is described in Hallberg & Adcroft, 2014, Parallel Computing, doi:10.1016/j.parco.2014.04.007.

Parameters
  • array [in]

    The array to be summed in arbitrary units [a], or in arbitrary scaled units [A ~> a] if unscale is present

  • isr [in]

    The starting i-index of the sum, noting that the array indices starts at 1

  • ier [in]

    The ending i-index of the sum, noting that the array indices starts at 1

  • jsr [in]

    The starting j-index of the sum, noting that the array indices starts at 1

  • jer [in]

    The ending j-index of the sum, noting that the array indices starts at 1

  • sums [out]

    The sums by vertical layer in the same arbitrary units as array [a] or [A ~> a]

  • EFP_sum [out]

    The result in extended fixed point format

  • EFP_lay_sums [out]

    The sums by vertical layer in EFP format

  • err [out]

    If present, return an error code instead of triggering any fatal errors directly from this routine.

  • only_on_PE [in]

    If present and true, do not do the sum across processors, only reporting the local sum

  • unscale [in]

    A factor that is used to undo scaling of array before it is summed, often to compensate for the scaling in [a A-1 ~> 1]

  • sum

    The sum of the values in array in the same arbitrary units as array [a] or [A ~> a]

Callees call graph
Callees of mom_coms::reproducing_sum_3d calls cluster_mom_coms MOM_coms cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler mom_coms::increment_block_ints increment_block_ints [private/internal] mom_coms::increment_ints increment_ints [private/internal] mom_coms::ints_to_real ints_to_real [private/internal] mom_coms::regularize_ints regularize_ints [private/internal] mom_coms::reproducing_sum_3d reproducing_sum_3d [private/internal] mom_coms::reproducing_sum_3d->mom_coms::increment_block_ints mom_coms::reproducing_sum_3d->mom_coms::increment_ints mom_coms::reproducing_sum_3d->mom_coms::ints_to_real mom_coms::reproducing_sum_3d->mom_coms::regularize_ints mom_coms_infra::interface::sum_across_pes sum_across_PEs (interface) mom_coms::reproducing_sum_3d->mom_coms_infra::interface::sum_across_pes mom_coms_infra::num_pes num_PEs mom_coms::reproducing_sum_3d->mom_coms_infra::num_pes mom_error_handler::mom_error MOM_error mom_coms::reproducing_sum_3d->mom_error_handler::mom_error mom_error_handler::mom_mesg MOM_mesg mom_coms::reproducing_sum_3d->mom_error_handler::mom_mesg
Text view
function real_to_ints(r, prec_error, overflow) result(ints)

Convert a real number into the array of integers constitute its extended-fixed-point representation

Parameters
  • r [in]

    The real number being converted in arbitrary units [a]

  • prec_error [in]

    The PE-count dependent precision of the integers that is safe from overflows during global sums. This will be larger than the compile-time precision parameter, and is used to detect overflows.

  • overflow [inout]

    Returns true if the conversion is being done on a value that is too large to be represented

Callees call graph
Callees of mom_coms::real_to_ints calls cluster_mom_coms MOM_coms cluster_mom_error_handler MOM_error_handler mom_coms::real_to_ints real_to_ints [private/internal] mom_error_handler::mom_error MOM_error mom_coms::real_to_ints->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_coms::real_to_ints calls cluster_mom_coms MOM_coms mom_coms::real_to_efp real_to_EFP mom_coms::real_to_ints real_to_ints [private/internal] mom_coms::real_to_efp->mom_coms::real_to_ints mom_coms::reproducing_sum_2d reproducing_sum_2d [private/internal] mom_coms::reproducing_sum_2d->mom_coms::real_to_ints
Text view
function ints_to_real(ints) result(r)

Convert the array of integers that constitute an extended-fixed-point representation into a real number

Parameters
  • ints [in]

    The array of EFP integers

Callers call graph
Callers of mom_coms::ints_to_real calls cluster_mom_coms MOM_coms mom_coms::efp_to_real EFP_to_real mom_coms::ints_to_real ints_to_real [private/internal] mom_coms::efp_to_real->mom_coms::ints_to_real mom_coms::reproducing_sum_2d reproducing_sum_2d [private/internal] mom_coms::reproducing_sum_2d->mom_coms::ints_to_real mom_coms::reproducing_sum_3d reproducing_sum_3d [private/internal] mom_coms::reproducing_sum_3d->mom_coms::ints_to_real
Text view
subroutine increment_ints(int_sum, int2, prec_error)

Increment an array of integers that constitutes an extended-fixed-point representation with a another EFP number

Parameters
  • int_sum [inout]

    The array of EFP integers being incremented

  • int2 [in]

    The array of EFP integers being added

  • prec_error [in]

    The PE-count dependent precision of the integers that is safe from overflows during global sums. This will be larger than the compile-time precision parameter, and is used to detect overflows.

Callers call graph
Callers of mom_coms::increment_ints calls cluster_mom_coms MOM_coms mom_coms::efp_minus EFP_minus mom_coms::increment_ints increment_ints [private/internal] mom_coms::efp_minus->mom_coms::increment_ints mom_coms::efp_plus EFP_plus mom_coms::efp_plus->mom_coms::increment_ints mom_coms::reproducing_sum_3d reproducing_sum_3d [private/internal] mom_coms::reproducing_sum_3d->mom_coms::increment_ints
Text view
subroutine increment_block_ints(array, is, ie, js, je, descale, ints_sum, max_mag_term, prec_error)

Sum the elements of an array in EFP form and append the result to an existing EFP array.

Parameters
  • array [in]

    The field being added, in arbitrary units [A ~> a]

  • is [in]

    Start i-index of the summed domain

  • ie [in]

    End i-index of the summed domain

  • js [in]

    Start j-index of the summed domain

  • je [in]

    End j-index of the summed domain

  • descale [in]

    Factor to descale array to physical value [a A-1 ~> 1]

  • ints_sum [inout]

    The array of EFP integers being incremented

  • max_mag_term [inout]

    A running maximum magnitude of the r's, in arbitrary units [a]

  • prec_error [in]

    The maximum resolvable value for a given number of PEs

Callees call graph
Callees of mom_coms::increment_block_ints calls cluster_mom_coms MOM_coms cluster_mom_error_handler MOM_error_handler mom_coms::carry_overflow carry_overflow [private/internal] mom_coms::efp_decompose efp_decompose [private/internal] mom_coms::increment_block_ints increment_block_ints [private/internal] mom_coms::increment_block_ints->mom_coms::carry_overflow mom_coms::increment_block_ints->mom_coms::efp_decompose mom_error_handler::mom_error MOM_error mom_coms::increment_block_ints->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_coms::increment_block_ints calls cluster_mom_coms MOM_coms mom_coms::increment_block_ints increment_block_ints [private/internal] mom_coms::reproducing_efp_sum_2d reproducing_EFP_sum_2d [private/internal] mom_coms::reproducing_efp_sum_2d->mom_coms::increment_block_ints mom_coms::reproducing_sum_3d reproducing_sum_3d [private/internal] mom_coms::reproducing_sum_3d->mom_coms::increment_block_ints
Text view
pure subroutine efp_decompose(r, e, rmag, is_nan, is_ovf)

Decompose one real into its 6 signed EFP bin contributions. NaNs and overflows are reported by flags, rather than the module-level error logicals, so that the routine is free of side effects.

Parameters
  • r [in]

    The real number being decomposed [a]

  • e [out]

    Signed contribution to EFP bins

  • rmag [out]

    Equals abs(r), or 0 if r is NaN/Inf [a]

  • is_nan [out]

    Equals 1 if r is a NaN or Inf, else 0

  • is_ovf [out]

    Equals 1 if abs(r) has no EFP representation, else 0

Callers call graph
Callers of mom_coms::efp_decompose calls cluster_mom_coms MOM_coms mom_coms::efp_decompose efp_decompose [private/internal] mom_coms::increment_block_ints increment_block_ints [private/internal] mom_coms::increment_block_ints->mom_coms::efp_decompose
Text view
subroutine carry_overflow(int_sum, prec_error)

This subroutine handles carrying of the overflow.

Parameters
  • int_sum [inout]

    The array of EFP integers being modified by carries, but without changing value.

  • prec_error [in]

    The PE-count dependent precision of the integers that is safe from overflows during global sums. This will be larger than the compile-time precision parameter, and is used to detect overflows.

Callers call graph
Callers of mom_coms::carry_overflow calls cluster_mom_coms MOM_coms mom_coms::carry_overflow carry_overflow [private/internal] mom_coms::efp_list_sum_across_pes EFP_list_sum_across_PEs mom_coms::efp_list_sum_across_pes->mom_coms::carry_overflow mom_coms::efp_val_sum_across_pes EFP_val_sum_across_PEs [private/internal] mom_coms::efp_val_sum_across_pes->mom_coms::carry_overflow mom_coms::increment_block_ints increment_block_ints [private/internal] mom_coms::increment_block_ints->mom_coms::carry_overflow mom_coms::reproducing_efp_sum_2d reproducing_EFP_sum_2d [private/internal] mom_coms::reproducing_efp_sum_2d->mom_coms::carry_overflow
Text view
subroutine regularize_ints(int_sum)

This subroutine carries the overflow, and then makes sure that all integers are of the same sign as the overall value.

Parameters
  • int_sum [inout]

    The array of integers being modified to take a regular form with all integers of the same sign, but without changing value.

Callers call graph
Callers of mom_coms::regularize_ints calls cluster_mom_coms MOM_coms mom_coms::efp_to_real EFP_to_real mom_coms::regularize_ints regularize_ints [private/internal] mom_coms::efp_to_real->mom_coms::regularize_ints mom_coms::reproducing_efp_sum_2d reproducing_EFP_sum_2d [private/internal] mom_coms::reproducing_efp_sum_2d->mom_coms::regularize_ints mom_coms::reproducing_sum_3d reproducing_sum_3d [private/internal] mom_coms::reproducing_sum_3d->mom_coms::regularize_ints
Text view
function query_EFP_overflow_error()

Returns the status of the module's error flag

Callers call graph
Callers of mom_coms::query_efp_overflow_error calls cluster_mom_coms MOM_coms cluster_mom_spatial_means MOM_spatial_means mom_coms::query_efp_overflow_error query_EFP_overflow_error mom_spatial_means::global_i_mean global_i_mean mom_spatial_means::global_i_mean->mom_coms::query_efp_overflow_error mom_spatial_means::global_j_mean global_j_mean mom_spatial_means::global_j_mean->mom_coms::query_efp_overflow_error
Text view
subroutine reset_EFP_overflow_error()

Reset the module's error flag to false

Callers call graph
Callers of mom_coms::reset_efp_overflow_error calls cluster_mom_coms MOM_coms cluster_mom_spatial_means MOM_spatial_means mom_coms::reset_efp_overflow_error reset_EFP_overflow_error mom_spatial_means::global_i_mean global_i_mean mom_spatial_means::global_i_mean->mom_coms::reset_efp_overflow_error mom_spatial_means::global_j_mean global_j_mean mom_spatial_means::global_j_mean->mom_coms::reset_efp_overflow_error
Text view
function EFP_plus(EFP1, EFP2)

Add two extended-fixed-point numbers

Parameters
  • EFP_plus

    The result in extended fixed point format

  • EFP1 [in]

    The first extended fixed point number

  • EFP2 [in]

    The second extended fixed point number

Callees call graph
Callees of mom_coms::efp_plus calls cluster_mom_coms MOM_coms mom_coms::efp_plus EFP_plus mom_coms::increment_ints increment_ints [private/internal] mom_coms::efp_plus->mom_coms::increment_ints
Text view
function EFP_minus(EFP1, EFP2)

Subract one extended-fixed-point number from another

Parameters
  • EFP_minus

    The result in extended fixed point format

  • EFP1 [in]

    The first extended fixed point number

  • EFP2 [in]

    The extended fixed point number being subtracted from the first extended fixed point number

Callees call graph
Callees of mom_coms::efp_minus calls cluster_mom_coms MOM_coms mom_coms::efp_minus EFP_minus mom_coms::increment_ints increment_ints [private/internal] mom_coms::efp_minus->mom_coms::increment_ints
Text view
subroutine EFP_assign(EFP1, EFP2)

Copy one extended-fixed-point number into another

Parameters
  • EFP1 [out]

    The recipient extended fixed point number

  • EFP2 [in]

    The source extended fixed point number

function EFP_to_real(EFP1)

Return the real number that an extended-fixed-point number corresponds with

Parameters
  • EFP1 [inout]

    The extended fixed point number being converted

  • EFP_to_real

    The real version of the number in arbitrary units [a]

Callees call graph
Callees of mom_coms::efp_to_real calls cluster_mom_coms MOM_coms mom_coms::efp_to_real EFP_to_real mom_coms::ints_to_real ints_to_real [private/internal] mom_coms::efp_to_real->mom_coms::ints_to_real mom_coms::regularize_ints regularize_ints [private/internal] mom_coms::efp_to_real->mom_coms::regularize_ints
Text view
Callers call graph
Callers of mom_coms::efp_to_real calls cluster_mom_coms MOM_coms cluster_mom_diag_remap MOM_diag_remap cluster_mom_energetic_pbl MOM_energetic_PBL cluster_mom_spatial_means MOM_spatial_means cluster_mom_sum_output MOM_sum_output cluster_mom_tracer_flow_control MOM_tracer_flow_control mom_coms::efp_list_sum_across_pes EFP_list_sum_across_PEs mom_coms::efp_to_real EFP_to_real mom_coms::efp_list_sum_across_pes->mom_coms::efp_to_real mom_coms::efp_real_diff EFP_real_diff mom_coms::efp_real_diff->mom_coms::efp_to_real mom_coms::efp_val_sum_across_pes EFP_val_sum_across_PEs [private/internal] mom_coms::efp_val_sum_across_pes->mom_coms::efp_to_real mom_diag_remap::horizontally_average_field horizontally_average_field [private/internal] mom_diag_remap::horizontally_average_field->mom_coms::efp_to_real mom_energetic_pbl::energetic_pbl_end energetic_PBL_end mom_energetic_pbl::energetic_pbl_end->mom_coms::efp_to_real mom_spatial_means::adjust_area_mean_to_zero adjust_area_mean_to_zero mom_spatial_means::adjust_area_mean_to_zero->mom_coms::efp_to_real mom_spatial_means::global_i_mean global_i_mean mom_spatial_means::global_i_mean->mom_coms::efp_to_real mom_spatial_means::global_j_mean global_j_mean mom_spatial_means::global_j_mean->mom_coms::efp_to_real mom_spatial_means::global_layer_mean global_layer_mean mom_spatial_means::global_layer_mean->mom_coms::efp_to_real mom_sum_output::write_energy write_energy mom_sum_output::write_energy->mom_coms::efp_to_real mom_tracer_flow_control::call_tracer_stocks call_tracer_stocks mom_tracer_flow_control::call_tracer_stocks->mom_coms::efp_to_real
Text view
function EFP_real_diff(EFP1, EFP2)

Take the difference between two extended-fixed-point numbers (EFP1 - EFP2) and return the result as a real number

Parameters
  • EFP1 [in]

    The first extended fixed point number

  • EFP2 [in]

    The extended fixed point number being subtracted from the first extended fixed point number

  • EFP_real_diff

    The real result in arbitrary units [a]

Callees call graph
Callees of mom_coms::efp_real_diff calls cluster_mom_coms MOM_coms mom_coms::efp_real_diff EFP_real_diff mom_coms::efp_to_real EFP_to_real mom_coms::efp_real_diff->mom_coms::efp_to_real
Text view
function real_to_EFP(val, overflow)

Return the extended-fixed-point number that a real number corresponds with

Parameters
  • val [in]

    The real number being converted in arbitrary units [a]

  • overflow [inout]

    Returns true if the conversion is being done on a value that is too large to be represented

Callees call graph
Callees of mom_coms::real_to_efp calls cluster_mom_coms MOM_coms cluster_mom_error_handler MOM_error_handler mom_coms::real_to_efp real_to_EFP mom_coms::real_to_ints real_to_ints [private/internal] mom_coms::real_to_efp->mom_coms::real_to_ints mom_error_handler::mom_error MOM_error mom_coms::real_to_efp->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_coms::real_to_efp calls cluster_mom_coms MOM_coms cluster_mom_energetic_pbl MOM_energetic_PBL cluster_mom_generic_tracer MOM_generic_tracer cluster_mom_spatial_means MOM_spatial_means cluster_mom_sum_output MOM_sum_output mom_coms::real_to_efp real_to_EFP mom_energetic_pbl::energetic_pbl energetic_PBL mom_energetic_pbl::energetic_pbl->mom_coms::real_to_efp mom_energetic_pbl::energetic_pbl_init energetic_PBL_init mom_energetic_pbl::energetic_pbl_init->mom_coms::real_to_efp mom_generic_tracer::mom_generic_tracer_stock MOM_generic_tracer_stock mom_generic_tracer::mom_generic_tracer_stock->mom_coms::real_to_efp mom_spatial_means::global_i_mean global_i_mean mom_spatial_means::global_i_mean->mom_coms::real_to_efp mom_spatial_means::global_j_mean global_j_mean mom_spatial_means::global_j_mean->mom_coms::real_to_efp mom_sum_output::write_energy write_energy mom_sum_output::write_energy->mom_coms::real_to_efp
Text view
subroutine EFP_list_sum_across_PEs(EFPs, nval, errors)

This subroutine does a sum across PEs of a list of EFP variables, returning the sums in place, with all overflows carried.

Parameters
  • EFPs [inout]

    The list of extended fixed point numbers being summed across PEs.

  • nval [in]

    The number of values being summed.

  • errors [out]

    A list of error flags for each sum

Callees call graph
Callees of mom_coms::efp_list_sum_across_pes calls cluster_mom_coms MOM_coms cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler mom_coms::carry_overflow carry_overflow [private/internal] mom_coms::efp_list_sum_across_pes EFP_list_sum_across_PEs mom_coms::efp_list_sum_across_pes->mom_coms::carry_overflow mom_coms::efp_to_real EFP_to_real mom_coms::efp_list_sum_across_pes->mom_coms::efp_to_real mom_coms_infra::interface::sum_across_pes sum_across_PEs (interface) mom_coms::efp_list_sum_across_pes->mom_coms_infra::interface::sum_across_pes mom_coms_infra::num_pes num_PEs mom_coms::efp_list_sum_across_pes->mom_coms_infra::num_pes mom_error_handler::mom_error MOM_error mom_coms::efp_list_sum_across_pes->mom_error_handler::mom_error
Text view
subroutine EFP_val_sum_across_PEs(EFP, error)

This subroutine does a sum across PEs of an EFP variable, returning the sums in place, with all overflows carried.

Parameters
  • EFP [inout]

    The extended fixed point numbers being summed across PEs.

  • error [out]

    An error flag for this sum

Callees call graph
Callees of mom_coms::efp_val_sum_across_pes calls cluster_mom_coms MOM_coms cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler mom_coms::carry_overflow carry_overflow [private/internal] mom_coms::efp_to_real EFP_to_real mom_coms::efp_val_sum_across_pes EFP_val_sum_across_PEs [private/internal] mom_coms::efp_val_sum_across_pes->mom_coms::carry_overflow mom_coms::efp_val_sum_across_pes->mom_coms::efp_to_real mom_coms_infra::interface::sum_across_pes sum_across_PEs (interface) mom_coms::efp_val_sum_across_pes->mom_coms_infra::interface::sum_across_pes mom_coms_infra::num_pes num_PEs mom_coms::efp_val_sum_across_pes->mom_coms_infra::num_pes mom_error_handler::mom_error MOM_error mom_coms::efp_val_sum_across_pes->mom_error_handler::mom_error
Text view
API generated with Flint · Rendered from reStructuredText