Documentation for module dbcsr_toollib

Tools usually found in a standard library.

source: dbcsr_toollib.F
Loading...

Generic procedures:

sort
swap
iswap
bswap

public Subroutines/Functions:

Splits an array of int8 values into two int4 arrays.
FUNCTION
INTEGER ELEMENTAL
gcd (a, b)
...
FUNCTION
INTEGER
joaat_hash (key)
generates the hash of a string and the index in the table
FUNCTION
INTEGER ELEMENTAL
lcm (a, b)
...
FUNCTION
INTEGER(int_8) ELEMENTAL
make_coordinate_tuple (most, least)
...
SUBROUTINE PURE
ordered_search (array, key, loc, found, lb, ub)
search a value in an ordered array of indices
SUBROUTINE
uppercase (string)
...

Generic procedure sort

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

INTEGER(int_4),
INTENT(inout)
:: arr(1:n) ×
INTEGER(int_8),
INTENT(inout)
:: arr(1:n) ×
REAL(real_4),
INTENT(inout)
:: arr(1:n) ×
REAL(real_8),
INTENT(inout)
:: arr(1:n) ×
INTEGER,
INTENT(in)
:: n × × × ×
INTEGER,
INTENT(out)
:: indices(1:n) × × × ×

Generic procedure swap

...

INTEGER,
INTENT(inout)
:: a ×
LOGICAL,
INTENT(inout)
:: a ×
INTEGER,
INTENT(inout)
:: b ×
LOGICAL,
INTENT(inout)
:: b ×

SUBROUTINEdbcsr_unpack_i8_2i4(merged, array_upper, array_lower)

Splits an array of int8 values into two int4 arrays.

Arguments:
INTEGER(int_8),
INTENT(in)
:: merged(:) array of merged values
INTEGER(int_4),
INTENT(out)
:: array_upper(:) array to fill with the upper bytes of the merged values
INTEGER(int_4),
INTENT(out)
:: array_lower(:) array to fill with the lower bytes of the merged values

ELEMENTAL FUNCTIONgcd(a, b)

...

Return Value ::
INTEGER
Arguments:
INTEGER,
INTENT(in)
:: a ...
INTEGER,
INTENT(in)
:: b ...

FUNCTIONjoaat_hash(key)

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

Return Value ::
INTEGER
Arguments:
INTEGER,
INTENT(in)
:: key(:) a string of any length

ELEMENTAL FUNCTIONlcm(a, b)

...

Return Value ::
INTEGER
Arguments:
INTEGER,
INTENT(in)
:: a ...
INTEGER,
INTENT(in)
:: b ...

ELEMENTAL FUNCTIONmake_coordinate_tuple(most, least)

...

Return Value ::
INTEGER(int_8)
Arguments:
INTEGER,
INTENT(in)
:: most ...
INTEGER,
INTENT(in)
:: least ...

SUBROUTINEuppercase(string)

...

Arguments:
CHARACTER(*),
INTENT(inout)
:: string ...

ELEMENTAL SUBROUTINEiswap(a, b)

Swaps two integers

Arguments:
INTEGER,
INTENT(inout)
:: a Integers to swap
INTEGER,
INTENT(inout)
:: b Integers to swap

ELEMENTAL SUBROUTINEbswap(a, b)

Swaps two logicals

Arguments:
LOGICAL,
INTENT(inout)
:: a Logicals to swap
LOGICAL,
INTENT(inout)
:: b Logicals to swap