dbcsr_toollib Module

Tools usually found in a standard library.



Variables

Type Visibility Attributes Name Initial
character(len=*), private, parameter :: moduleN = 'dbcsr_toollib'

Interfaces

public interface swap

  • private elemental subroutine iswap(a, b)

    Swaps two integers

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(inout) :: a

    Integers to swap Integers to swap

    integer, intent(inout) :: b

    Integers to swap Integers to swap

  • private elemental subroutine bswap(a, b)

    Swaps two logicals

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(inout) :: a

    Logicals to swap Logicals to swap

    logical, intent(inout) :: b

    Logicals to swap Logicals to swap

public interface sort

  • public subroutine dbcsr_1d_i4_sort(arr, n, indices)

    Sorts an array inplace using a combination of merge- and bubble-sort. It also returns the indices, which the elements had before the sort.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int_4), intent(inout), dimension(1:n) :: arr

    the array to sort

    integer, intent(in) :: n

    length of array

    integer, intent(out), dimension(1:n) :: indices

    returns elements-indices before the sort

  • public subroutine dbcsr_1d_i8_sort(arr, n, indices)

    Sorts an array inplace using a combination of merge- and bubble-sort. It also returns the indices, which the elements had before the sort.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int_8), intent(inout), dimension(1:n) :: arr

    the array to sort

    integer, intent(in) :: n

    length of array

    integer, intent(out), dimension(1:n) :: indices

    returns elements-indices before the sort

  • public subroutine dbcsr_1d_s_sort(arr, n, indices)

    Sorts an array inplace using a combination of merge- and bubble-sort. It also returns the indices, which the elements had before the sort.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real_4), intent(inout), dimension(1:n) :: arr

    the array to sort

    integer, intent(in) :: n

    length of array

    integer, intent(out), dimension(1:n) :: indices

    returns elements-indices before the sort

  • public subroutine dbcsr_1d_d_sort(arr, n, indices)

    Sorts an array inplace using a combination of merge- and bubble-sort. It also returns the indices, which the elements had before the sort.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real_8), intent(inout), dimension(1:n) :: arr

    the array to sort

    integer, intent(in) :: n

    length of array

    integer, intent(out), dimension(1:n) :: indices

    returns elements-indices before the sort


Functions

public elemental function make_coordinate_tuple(most, least) result(tuple)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: most
integer, intent(in) :: least

Return Value integer(kind=int_8)

public elemental function gcd(a, b)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: a
integer, intent(in) :: b

Return Value integer

public elemental function lcm(a, b)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: a
integer, intent(in) :: b

Return Value integer

public function joaat_hash(key) result(hash_index)

generates the hash of a string and the index in the table

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(:) :: key

Return Value integer

public function atoi(a)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: a

Return Value integer

public function atol(a)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: a

Return Value logical

public function ator(a)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: a

Return Value real(kind=real_8)


Subroutines

private elemental subroutine iswap(a, b)

Swaps two integers

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: a

Integers to swap Integers to swap

integer, intent(inout) :: b

Integers to swap Integers to swap

private elemental subroutine bswap(a, b)

Swaps two logicals

Arguments

Type IntentOptional Attributes Name
logical, intent(inout) :: a

Logicals to swap Logicals to swap

logical, intent(inout) :: b

Logicals to swap Logicals to swap

public subroutine dbcsr_unpack_i8_2i4(merged, array_upper, array_lower)

Splits an array of int8 values into two int4 arrays.

Arguments

Type IntentOptional Attributes Name
integer(kind=int_8), intent(in), DIMENSION(:) :: merged

array of merged values

integer(kind=int_4), intent(out), DIMENSION(:) :: array_upper

array to fill with the upper bytes of the merged values array to fill with the lower bytes of the merged values

integer(kind=int_4), intent(out), DIMENSION(:) :: array_lower

array to fill with the upper bytes of the merged values array to fill with the lower bytes of the merged values

public pure subroutine ordered_search(array, key, loc, found, lb, ub)

search a value in an ordered array of indices

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(:) :: array
integer, intent(in) :: key
integer, intent(out) :: loc
logical, intent(out) :: found
integer, intent(in), optional :: lb
integer, intent(in), optional :: ub