MOM6
MOM_coms.F90 File Reference

Go to the source code of this file.

Data Types

interface  mom_coms::reproducing_sum
 Find an accurate and order-invariant sum of distributed 2d or 3d fields. More...
 
type  mom_coms::efp_type
 The Extended Fixed Point (EFP) type provides a public interface for doing sums and taking differences with this type. More...
 
interface  mom_coms::operator(+)
 Add two extended-fixed-point numbers. More...
 
interface  mom_coms::operator(-)
 Subtract one extended-fixed-point number from another. More...
 
interface  mom_coms::assignment(=)
 Copy the value of one extended-fixed-point number into another. More...
 

Modules

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

Functions/Subroutines

real function mom_coms::reproducing_sum_2d (array, isr, ier, jsr, jer, EFP_sum, reproducing, overflow_check, err)
 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. More...
 
real function mom_coms::reproducing_sum_3d (array, isr, ier, jsr, jer, sums, EFP_sum, err)
 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. More...
 
integer(kind=8) function, dimension(ni) mom_coms::real_to_ints (r, prec_error, overflow)
 Convert a real number into the array of integers constitute its extended-fixed-point representation. More...
 
real function mom_coms::ints_to_real (ints)
 Convert the array of integers that constitute an extended-fixed-point representation into a real number. More...
 
subroutine mom_coms::increment_ints (int_sum, int2, prec_error)
 Increment an array of integers that constitutes an extended-fixed-point representation with a another EFP number. More...
 
subroutine mom_coms::increment_ints_faster (int_sum, r, max_mag_term)
 Increment an EFP number with a real number without doing any carrying of of overflows and using only minimal error checking. More...
 
subroutine mom_coms::carry_overflow (int_sum, prec_error)
 This subroutine handles carrying of the overflow. More...
 
subroutine mom_coms::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. More...
 
logical function, public mom_coms::query_efp_overflow_error ()
 Returns the status of the module's error flag. More...
 
subroutine, public mom_coms::reset_efp_overflow_error ()
 Reset the module's error flag to false. More...
 
type(efp_type) function, public mom_coms::efp_plus (EFP1, EFP2)
 Add two extended-fixed-point numbers. More...
 
type(efp_type) function, public mom_coms::efp_minus (EFP1, EFP2)
 Subract one extended-fixed-point number from another. More...
 
subroutine mom_coms::efp_assign (EFP1, EFP2)
 Copy one extended-fixed-point number into another. More...
 
real function, public mom_coms::efp_to_real (EFP1)
 Return the real number that an extended-fixed-point number corresponds with. More...
 
real function, public mom_coms::efp_real_diff (EFP1, EFP2)
 Take the difference between two extended-fixed-point numbers (EFP1 - EFP2) and return the result as a real number. More...
 
type(efp_type) function, public mom_coms::real_to_efp (val, overflow)
 Return the extended-fixed-point number that a real number corresponds with. More...
 
subroutine, public mom_coms::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. More...
 
subroutine, public mom_coms::mom_infra_end
 This subroutine carries out all of the calls required to close out the infrastructure cleanly. This should only be called in ocean-only runs, as the coupler takes care of this in coupled runs. More...
 

Variables

integer(kind=8), parameter mom_coms::prec =2_8**46
 The precision of each integer. More...
 
real, parameter mom_coms::r_prec =2.0**46
 A real version of prec. More...
 
real, parameter mom_coms::i_prec =1.0/(2.0**46)
 The inverse of prec. More...
 
integer, parameter mom_coms::max_count_prec =2**(63-46)-1
 The number of values that can be added together with the current value of prec before there will be roundoff problems. More...
 
integer, parameter mom_coms::ni =6
 The number of long integers to use to represent a real number. More...
 
real, dimension(ni), parameter mom_coms::pr = (/ r_prec**2, r_prec, 1.0, 1.0/r_prec, 1.0/r_prec**2, 1.0/r_prec**3 /)
 An array of the real precision of each of the integers. More...
 
real, dimension(ni), parameter mom_coms::i_pr = (/ 1.0/r_prec**2, 1.0/r_prec, 1.0, r_prec, r_prec**2, r_prec**3 /)
 An array of the inverse of the real precision of each of the integers. More...
 
real, parameter mom_coms::max_efp_float = pr(1) * (2.**63 - 1.)
 The largest float with an EFP representation. NOTE: Only the first bin can exceed precision, but is bounded by the largest signed integer. More...
 
logical mom_coms::overflow_error = .false.
 This becomes true if an overflow is encountered. More...
 
logical mom_coms::nan_error = .false.
 This becomes true if a NaN is encountered. More...
 
logical mom_coms::debug = .false.
 Making this true enables debugging output. More...