auxiliar_functions Module

Auxiliary numerical functions

Description

Relative-error and array-comparison helpers used in tests and consistency checks. The relative-error normalization is by the first argument, so callers should avoid a zero reference value.

Examples

if (allclose(reference, calculated, 1.0e-8_pr)) print *, "consistent"

Uses

  • module~~auxiliar_functions~~UsesGraph module~auxiliar_functions auxiliar_functions module~yaeos__constants yaeos__constants module~auxiliar_functions->module~yaeos__constants iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env

Functions

public function allclose(x, y, rtol)

Check whether all elements of two arrays agree within rtol.

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(in) :: x(:)

First array

real(kind=pr), intent(in) :: y(:)

Second array

real(kind=pr), intent(in) :: rtol

Relative tolerance

Return Value logical

public elemental function rel_error(x, y)

Return the absolute relative error with x as reference.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(in) :: x

Nonzero reference value.

real(kind=pr), intent(in) :: y

Value compared against the reference.

Return Value real(kind=pr)