wildf_numerror Module

Numerical error

Numerical error handling.

Constants:

  • eps_wp: Working precision machine epsilon
  • tol_wp: Tolerance for approximations

Procedures:

  • ismall: Evaluates the smallness of a variable compared to a reference value.
  • isclose: Evaluates the closeness between two real or complex variables.

References

  1. Christopher Barker. 2015. PEP 485 – A Function for testing approximate equality. https://peps.python.org/pep-0485/

Uses

  • module~~wildf_numerror~~UsesGraph module~wildf_numerror wildf_numerror module~wildf_kinds wildf_kinds module~wildf_numerror->module~wildf_kinds iso_fortran_env iso_fortran_env module~wildf_kinds->iso_fortran_env

Used by

  • module~~wildf_numerror~~UsedByGraph module~wildf_numerror wildf_numerror module~wildf_exponential_integral wildf_exponential_integral module~wildf_exponential_integral->module~wildf_numerror module~wildf wildf module~wildf->module~wildf_exponential_integral

Variables

Type Visibility Attributes Name Initial
real(kind=wp), public, parameter :: eps_wp = epsilon(1.0_wp)

Working precision machine epsilon

real(kind=wp), public, parameter :: tol_wp = 1.0e-8_wp

Tolerance for approximations


Interfaces

public interface isclose

Evaluates the closeness between two real or complex variables.

  • private pure function isclose_real(a, b, rel_tol, abs_tol)

    Evaluates the closeness between two real variables.

    .true. if a and b are close to each other according to a tolerance, and .false. otherwise. Tolerance is defined by rel_tol and abs_tol, where abs_tol is used for comparing values close no zero.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in) :: a
    real(kind=wp), intent(in) :: b
    real(kind=wp), intent(in), optional :: rel_tol

    Relative tolerance, default=tol_wp

    real(kind=wp), intent(in), optional :: abs_tol

    Absolute tolerace, default=tol_wp

    Return Value logical

  • private pure function isclose_complex(a, b, rel_tol, abs_tol)

    Evaluates the closeness between two complex variables.

    .true. if a and b are close to each other according to a tolerance, and .false. otherwise. Tolerance is defined by rel_tol and abs_tol, where abs_tol is used for comparing values close no zero.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=wp), intent(in) :: a
    complex(kind=wp), intent(in) :: b
    real(kind=wp), intent(in), optional :: rel_tol

    Relative tolerance, default=tol_wp

    real(kind=wp), intent(in), optional :: abs_tol

    Absolute tolerance, default=tol_wp

    Return Value logical


Functions

public pure function ismall(x, ref)

Evaluates the smallness of a variable compared to a reference value.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in), optional :: ref

Reference value, default=1.0

Return Value logical