FMS 2025.01-dev
Flexible Modeling System
|
This module provides interfaces to the non-domain-oriented communication subroutines. More...
Data Types | |
interface | assignment(=) |
Assignment override interface for mpp_efp_type. More... | |
type | mpp_efp_type |
The Extended Fixed Point (mpp_efp) type provides a public interface for doing sums and taking differences with this type. More... | |
interface | mpp_reproducing_sum |
This interface uses a conversion to an integer representation of real numbers to give order-invariant sums that will reproduce across PE count. More... | |
interface | operator(+) |
Operator override interface for mpp_efp_type. More... | |
interface | operator(-) |
Operator override interface for mpp_efp_type. More... | |
Functions/Subroutines | |
subroutine | carry_overflow (int_sum, prec_error) |
This subroutine handles carrying of the overflow. | |
subroutine | increment_ints (int_sum, int2, prec_error) |
This subroutine increments a number with another, both using the integer representation in real_to_ints. | |
subroutine | increment_ints_faster (int_sum, r, max_mag_term) |
This subroutine increments a number with another, both using the integer representation in real_to_ints, but without doing any carrying of overflow. The entire operation is embedded in a single call for greater speed. | |
real(r8_kind) function | ints_to_real (ints) |
This function reverses the conversion in real_to_ints. | |
subroutine | mpp_efp_assign (efp1, efp2) |
This subroutine assigns all components of the extended fixed point type variable on the RHS (EFP2) to the components of the variable on the LHS (EFP1). | |
subroutine, public | mpp_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. | |
type(mpp_efp_type) function, public | mpp_efp_minus (efp1, efp2) |
type(mpp_efp_type) function, public | mpp_efp_plus (efp1, efp2) |
real(r8_kind) function, public | mpp_efp_real_diff (efp1, efp2) |
real(r8_kind) function, public | mpp_efp_to_real (efp1) |
logical function, public | mpp_query_efp_overflow_error () |
type(mpp_efp_type) function, public | mpp_real_to_efp (val, overflow) |
real(r4_kind) function | mpp_reproducing_sum_r4_2d (array, isr, ier, jsr, jer, efp_sum, reproducing, overflow_check, err) |
real(r8_kind) function | mpp_reproducing_sum_r8_2d (array, isr, ier, jsr, jer, efp_sum, reproducing, overflow_check, err) |
Calculates a reproducing sum for a 2D, 8-byte real array. | |
real(r8_kind) function | mpp_reproducing_sum_r8_3d (array, isr, ier, jsr, jer, sums, efp_sum, err) |
Reproducing sum for 3d arrays of 8-bit reals. | |
subroutine, public | mpp_reset_efp_overflow_error () |
integer(i8_kind) function, dimension(numint) | real_to_ints (r, prec_error, overflow) |
This function converts a real number to an equivalent representation using several long integers. | |
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. | |
Variables | |
logical | debug = .false. |
Making this true enables debugging output. | |
real(r8_kind), dimension(numint), parameter | i_pr = (/ 1.0_8/r_prec**2, 1.0_8/r_prec, 1.0_8, r_prec, r_prec**2, r_prec**3 /) |
real(r8_kind), parameter | i_prec =1.0_8/(2.0_8**NUMBIT) |
The inverse of prec. | |
integer, parameter | max_count_prec =2**(63-NUMBIT)-1 |
The number of values that can be added together with the current value of prec before there will be roundoff problems. | |
logical | nan_error = .false. |
integer, parameter | numint = 6 |
The number of long integers to use to represent a real number. | |
logical | overflow_error = .false. |
real(r8_kind), dimension(numint), parameter | pr = (/ r_prec**2, r_prec, 1.0_8, 1.0_8/r_prec, 1.0_8/r_prec**2, 1.0_8/r_prec**3 /) |
integer(i8_kind), parameter | prec =2_8**NUMBIT |
The precision of each integer. | |
real(r8_kind), parameter | r_prec =2.0_8**NUMBIT |
A real version of prec. | |
This module provides interfaces to the non-domain-oriented communication subroutines.
Mainly includes interfaces and type definitions for reproducing operations with extended fixed point data.
interface mpp_efp_mod::assignment(=) |
Assignment override interface for mpp_efp_type.
Definition at line 94 of file mpp_efp.F90.
Public Member Functions | |
subroutine | mpp_efp_assign (efp1, efp2) |
This subroutine assigns all components of the extended fixed point type variable on the RHS (EFP2) to the components of the variable on the LHS (EFP1). | |
subroutine mpp_efp_assign | ( | type(mpp_efp_type), intent(out) | efp1, |
type(mpp_efp_type), intent(in) | efp2 | ||
) |
This subroutine assigns all components of the extended fixed point type variable on the RHS (EFP2) to the components of the variable on the LHS (EFP1).
Definition at line 617 of file mpp_efp.F90.
type mpp_efp_mod::mpp_efp_type |
The Extended Fixed Point (mpp_efp) type provides a public interface for doing sums and taking differences with this type.
Definition at line 80 of file mpp_efp.F90.
Private Attributes | |
integer(i8_kind), dimension(numint) | v |
|
private |
Definition at line 82 of file mpp_efp.F90.
interface mpp_efp_mod::mpp_reproducing_sum |
This interface uses a conversion to an integer representation of real numbers to give order-invariant sums that will reproduce across PE count.
This idea comes from R. Hallberg and A. Adcroft.
Definition at line 71 of file mpp_efp.F90.
Public Member Functions | |
real(r4_kind) function | mpp_reproducing_sum_r4_2d (array, isr, ier, jsr, jer, efp_sum, reproducing, overflow_check, err) |
real(r8_kind) function | mpp_reproducing_sum_r8_2d (array, isr, ier, jsr, jer, efp_sum, reproducing, overflow_check, err) |
Calculates a reproducing sum for a 2D, 8-byte real array. | |
real(r8_kind) function | mpp_reproducing_sum_r8_3d (array, isr, ier, jsr, jer, sums, efp_sum, err) |
Reproducing sum for 3d arrays of 8-bit reals. | |
real(r4_kind) function mpp_reproducing_sum_r4_2d | ( | real(r4_kind), dimension(:,:), intent(in) | array, |
integer, intent(in), optional | isr, | ||
integer, intent(in), optional | ier, | ||
integer, intent(in), optional | jsr, | ||
integer, intent(in), optional | jer, | ||
type(mpp_efp_type), intent(out), optional | efp_sum, | ||
logical, intent(in), optional | reproducing, | ||
logical, intent(in), optional | overflow_check, | ||
integer, intent(out), optional | err | ||
) |
Definition at line 243 of file mpp_efp.F90.
real(r8_kind) function mpp_reproducing_sum_r8_2d | ( | real(r8_kind), dimension(:,:), intent(in) | array, |
integer, intent(in), optional | isr, | ||
integer, intent(in), optional | ier, | ||
integer, intent(in), optional | jsr, | ||
integer, intent(in), optional | jer, | ||
type(mpp_efp_type), intent(out), optional | efp_sum, | ||
logical, intent(in), optional | reproducing, | ||
logical, intent(in), optional | overflow_check, | ||
integer, intent(out), optional | err | ||
) |
Calculates a reproducing sum for a 2D, 8-byte real array.
Definition at line 102 of file mpp_efp.F90.
real(r8_kind) function mpp_reproducing_sum_r8_3d | ( | real(r8_kind), dimension(:,:,:), intent(in) | array, |
integer, intent(in), optional | isr, | ||
integer, intent(in), optional | ier, | ||
integer, intent(in), optional | jsr, | ||
integer, intent(in), optional | jer, | ||
real(r8_kind), dimension(:), intent(out), optional | sums, | ||
type(mpp_efp_type), intent(out), optional | efp_sum, | ||
integer, intent(out), optional | err | ||
) |
Reproducing sum for 3d arrays of 8-bit reals.
This function uses a conversion to an integer representation of real numbers to give order-invariant sums that will reproduce across PE count. This idea comes from R. Hallberg and A. Adcroft.
Definition at line 269 of file mpp_efp.F90.
interface mpp_efp_mod::operator(+) |
Operator override interface for mpp_efp_type.
Definition at line 88 of file mpp_efp.F90.
Public Member Functions | |
type(mpp_efp_type) function | mpp_efp_plus (efp1, efp2) |
type(mpp_efp_type) function mpp_efp_plus | ( | type(mpp_efp_type), intent(in) | efp1, |
type(mpp_efp_type), intent(in) | efp2 | ||
) |
Definition at line 595 of file mpp_efp.F90.
interface mpp_efp_mod::operator(-) |
Operator override interface for mpp_efp_type.
Definition at line 91 of file mpp_efp.F90.
Public Member Functions | |
type(mpp_efp_type) function | mpp_efp_minus (efp1, efp2) |
type(mpp_efp_type) function mpp_efp_minus | ( | type(mpp_efp_type), intent(in) | efp1, |
type(mpp_efp_type), intent(in) | efp2 | ||
) |
Definition at line 604 of file mpp_efp.F90.
|
private |
This subroutine handles carrying of the overflow.
Definition at line 532 of file mpp_efp.F90.
|
private |
This subroutine increments a number with another, both using the integer representation in real_to_ints.
Definition at line 479 of file mpp_efp.F90.
|
private |
This subroutine increments a number with another, both using the integer representation in real_to_ints, but without doing any carrying of overflow. The entire operation is embedded in a single call for greater speed.
Definition at line 509 of file mpp_efp.F90.
|
private |
This function reverses the conversion in real_to_ints.
Definition at line 467 of file mpp_efp.F90.
|
private |
This subroutine assigns all components of the extended fixed point type variable on the RHS (EFP2) to the components of the variable on the LHS (EFP1).
Definition at line 617 of file mpp_efp.F90.
subroutine, public mpp_efp_list_sum_across_pes | ( | type(mpp_efp_type), dimension(:), intent(inout) | efps, |
integer, intent(in) | nval, | ||
logical, dimension(:), intent(out), optional | errors | ||
) |
This subroutine does a sum across PEs of a list of EFP variables, returning the sums in place, with all overflows carried.
Definition at line 667 of file mpp_efp.F90.
type(mpp_efp_type) function, public mpp_efp_minus | ( | type(mpp_efp_type), intent(in) | efp1, |
type(mpp_efp_type), intent(in) | efp2 | ||
) |
Definition at line 604 of file mpp_efp.F90.
type(mpp_efp_type) function, public mpp_efp_plus | ( | type(mpp_efp_type), intent(in) | efp1, |
type(mpp_efp_type), intent(in) | efp2 | ||
) |
Definition at line 595 of file mpp_efp.F90.
real(r8_kind) function, public mpp_efp_real_diff | ( | type(mpp_efp_type), intent(in) | efp1, |
type(mpp_efp_type), intent(in) | efp2 | ||
) |
Definition at line 633 of file mpp_efp.F90.
real(r8_kind) function, public mpp_efp_to_real | ( | type(mpp_efp_type), intent(inout) | efp1 | ) |
Definition at line 625 of file mpp_efp.F90.
logical function, public mpp_query_efp_overflow_error |
Definition at line 586 of file mpp_efp.F90.
type(mpp_efp_type) function, public mpp_real_to_efp | ( | real(r8_kind), intent(in) | val, |
logical, intent(inout), optional | overflow | ||
) |
Definition at line 644 of file mpp_efp.F90.
|
private |
Definition at line 243 of file mpp_efp.F90.
|
private |
Calculates a reproducing sum for a 2D, 8-byte real array.
Definition at line 102 of file mpp_efp.F90.
|
private |
Reproducing sum for 3d arrays of 8-bit reals.
This function uses a conversion to an integer representation of real numbers to give order-invariant sums that will reproduce across PE count. This idea comes from R. Hallberg and A. Adcroft.
Definition at line 269 of file mpp_efp.F90.
subroutine, public mpp_reset_efp_overflow_error |
Definition at line 591 of file mpp_efp.F90.
|
private |
This function converts a real number to an equivalent representation using several long integers.
Definition at line 432 of file mpp_efp.F90.
|
private |
This subroutine carries the overflow, and then makes sure that all integers are of the same sign as the overall value.
Definition at line 551 of file mpp_efp.F90.
|
private |
Making this true enables debugging output.
Definition at line 60 of file mpp_efp.F90.
|
private |
Definition at line 56 of file mpp_efp.F90.
|
private |
The inverse of prec.
Definition at line 49 of file mpp_efp.F90.
|
private |
The number of values that can be added together with the current value of prec before there will be roundoff problems.
Definition at line 50 of file mpp_efp.F90.
|
private |
Definition at line 59 of file mpp_efp.F90.
|
private |
The number of long integers to use to represent a real number.
Definition at line 44 of file mpp_efp.F90.
|
private |
Definition at line 59 of file mpp_efp.F90.
|
private |
Definition at line 54 of file mpp_efp.F90.
|
private |
The precision of each integer.
Definition at line 47 of file mpp_efp.F90.
|
private |
A real version of prec.
Definition at line 48 of file mpp_efp.F90.