FMS
2024.03
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. More... | |
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. More... | |
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.
Private 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). | |
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.
Public Attributes | |
integer(i8_kind), dimension(numint) | v |
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.
Private 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. More... | |
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. More... | |
|
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.
interface mpp_efp_mod::operator(+) |
Operator override interface for mpp_efp_type.
Definition at line 88 of file mpp_efp.F90.
Private Member Functions | |
type(mpp_efp_type) function | mpp_efp_plus (EFP1, EFP2) |
interface mpp_efp_mod::operator(-) |
Operator override interface for mpp_efp_type.
Definition at line 91 of file mpp_efp.F90.
Private Member Functions | |
type(mpp_efp_type) function | mpp_efp_minus (EFP1, EFP2) |
|
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.