Tools usually found in a standard library.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=*), | private, | parameter | :: | moduleN | = | 'dbcsr_toollib' |
Swaps two integers
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | a |
Integers to swap Integers to swap |
||
| integer, | intent(inout) | :: | b |
Integers to swap Integers to swap |
Swaps two logicals
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(inout) | :: | a |
Logicals to swap Logicals to swap |
||
| logical, | intent(inout) | :: | b |
Logicals to swap Logicals to swap |
Sorts an array inplace using a combination of merge- and bubble-sort. It also returns the indices, which the elements had before the sort.
| Type | Intent | Optional | 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 |
Sorts an array inplace using a combination of merge- and bubble-sort. It also returns the indices, which the elements had before the sort.
| Type | Intent | Optional | 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 |
Sorts an array inplace using a combination of merge- and bubble-sort. It also returns the indices, which the elements had before the sort.
| Type | Intent | Optional | 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 |
Sorts an array inplace using a combination of merge- and bubble-sort. It also returns the indices, which the elements had before the sort.
| Type | Intent | Optional | 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 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | most | |||
| integer, | intent(in) | :: | least |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | a | |||
| integer, | intent(in) | :: | b |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | a | |||
| integer, | intent(in) | :: | b |
generates the hash of a string and the index in the table
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | DIMENSION(:) | :: | key |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | a |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | a |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | a |
Swaps two integers
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | a |
Integers to swap Integers to swap |
||
| integer, | intent(inout) | :: | b |
Integers to swap Integers to swap |
Swaps two logicals
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(inout) | :: | a |
Logicals to swap Logicals to swap |
||
| logical, | intent(inout) | :: | b |
Logicals to swap Logicals to swap |
Splits an array of int8 values into two int4 arrays.
| Type | Intent | Optional | 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 |
search a value in an ordered array of indices
| Type | Intent | Optional | 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 |