helpers_m Module

Module implementing useful routines for unit testing


Uses

  • module~~helpers_m~~UsesGraph module~helpers_m helpers_m module~constants_m constants_m module~helpers_m->module~constants_m module~csrmat_m csrmat_m module~helpers_m->module~csrmat_m module~precision_m precision_m module~helpers_m->module~precision_m module~screen_io_m screen_io_m module~helpers_m->module~screen_io_m module~constants_m->module~precision_m module~csrmat_m->module~precision_m module~csrmat_m->module~screen_io_m iso_c_binding iso_c_binding module~csrmat_m->iso_c_binding module~error_handling_m error_handling_m module~csrmat_m->module~error_handling_m module~list_operations_m list_operations_m module~csrmat_m->module~list_operations_m module~status_codes_m status_codes_m module~csrmat_m->module~status_codes_m netcdf netcdf module~csrmat_m->netcdf module~precision_m->iso_c_binding iso_fortran_env iso_fortran_env module~precision_m->iso_fortran_env mpi mpi module~precision_m->mpi module~precision_m->netcdf module~screen_io_m->module~precision_m module~screen_io_m->iso_fortran_env module~screen_io_m->netcdf module~error_handling_m->module~precision_m module~error_handling_m->module~screen_io_m module~error_handling_m->module~status_codes_m module~error_handling_m->mpi module~error_handling_m->netcdf module~comm_handling_m comm_handling_m module~error_handling_m->module~comm_handling_m module~list_operations_m->module~precision_m module~list_operations_m->module~screen_io_m module~comm_handling_m->mpi

Interfaces

public interface almost_equal

Check equality between single or double precision numbers

  • public function almost_equal_single(a, b, rtol, atol) result(res)

    Checks whether (a-b) / max(a,eps) within tolerance

    Arguments

    Type IntentOptional Attributes Name
    real(kind=SP), intent(in) :: a

    values to be compared

    real(kind=SP), intent(in) :: b

    values to be compared

    real(kind=SP) :: rtol

    relative tolerance

    real(kind=SP) :: atol

    minumum value for normalisation (~absolute tolerance for rtol=0)

    Return Value logical

  • public function almost_equal_double(a, b, rtol, atol) result(res)

    Checks whether (a-b) / max(a,eps) within tolerance

    Arguments

    Type IntentOptional Attributes Name
    real(kind=DP), intent(in) :: a

    values to be compared

    real(kind=DP), intent(in) :: b

    values to be compared

    real(kind=DP) :: rtol

    relative tolerance

    real(kind=DP) :: atol

    minumum value for normalisation (~absolute tolerance for rtol=0)

    Return Value logical


Functions

public function almost_equal_single(a, b, rtol, atol) result(res)

Checks whether (a-b) / max(a,eps) within tolerance

Arguments

Type IntentOptional Attributes Name
real(kind=SP), intent(in) :: a

values to be compared

real(kind=SP), intent(in) :: b

values to be compared

real(kind=SP) :: rtol

relative tolerance

real(kind=SP) :: atol

minumum value for normalisation (~absolute tolerance for rtol=0)

Return Value logical

public function almost_equal_double(a, b, rtol, atol) result(res)

Checks whether (a-b) / max(a,eps) within tolerance

Arguments

Type IntentOptional Attributes Name
real(kind=DP), intent(in) :: a

values to be compared

real(kind=DP), intent(in) :: b

values to be compared

real(kind=DP) :: rtol

relative tolerance

real(kind=DP) :: atol

minumum value for normalisation (~absolute tolerance for rtol=0)

Return Value logical

public function exclude_third_quadrant_circular(x, y, phi)

Excludes third quadrant in field line tracing for circular equilibrium

Arguments

Type IntentOptional Attributes Name
real(kind=FP), intent(in) :: x
real(kind=FP), intent(in) :: y
real(kind=FP), intent(in) :: phi

Return Value logical

public function exclude_third_quadrant_cerfons(x, y, phi)

Excludes third quadrant in field line tracing for cerfons equilibrium

Arguments

Type IntentOptional Attributes Name
real(kind=FP), intent(in) :: x
real(kind=FP), intent(in) :: y
real(kind=FP), intent(in) :: phi

Return Value logical

public function excl_3rd_quadrant_segment_circtor(x, y, phi)

Excludes third quadrant in field line tracing for the circular toroidal equilibrium between phi = [pi/4,pi/2].

Arguments

Type IntentOptional Attributes Name
real(kind=FP), intent(in) :: x
real(kind=FP), intent(in) :: y
real(kind=FP), intent(in) :: phi

Return Value logical


Subroutines

public subroutine digit_sum_csr(mat, isum, jsum, valsum)

Calculates the digit sum of the csr matrix mat

Arguments

Type IntentOptional Attributes Name
type(csrmat_t), intent(in) :: mat

csr matrix

integer, intent(out) :: isum

sum over i index of matrix

integer, intent(out) :: jsum

sum over j index of matrix

real(kind=FP), intent(out) :: valsum

sum over values of matrix