Routines operating on lists, like sorting, removing duplicates etc...
Ranks array XVALT into index array IRNGT, using merge-sort
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | Dimension (:) | :: | XVALT | ||
| integer, | intent(out), | Dimension (:) | :: | IRNGT |
Ranks array XVALT into index array IRNGT, using merge-sort
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=FP), | intent(in), | Dimension (:) | :: | xvalt | ||
| integer, | intent(out), | Dimension (:) | :: | IRNGT |
Finds first index i where arr(i) = val. Returns 0 if val not found or size of array is 0
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | dimension(:) | :: | arr |
Array |
|
| integer, | intent(in) | :: | val |
Value to be searched for |
Finds first index i where arr(i) = val. Returns 0 if val not found or size of array is 0
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | dimension(:) | :: | arr |
Array |
|
| integer, | intent(in) | :: | val |
Value to be searched for |
Removes duplicate entries from integer tuple arr
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | ndim |
Dimension of tuple |
||
| integer, | intent(inout) | :: | nz |
Number of tuples, on return number of unique tuples |
||
| integer, | intent(inout), | dimension(ndim, nz) | :: | arr |
Tuples, on return unique tuples (nz adapted) |
Sorts integer tuple arr in ascending order according to row decr
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nz |
Number of tuples |
||
| integer, | intent(in) | :: | ndim |
Dimension of tuples |
||
| integer, | intent(in) | :: | decrow |
Is sorted in ascending order according to row decrow |
||
| integer, | intent(inout), | dimension(ndim, nz) | :: | arr |
Tuples, on return sorted |
Sorts integer tuples arr in ascending order, where pecedence of rows in sorting is prescribed
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nz |
Number of tuples |
||
| integer, | intent(in) | :: | ndim |
Dimension of tuples |
||
| integer, | intent(in), | dimension(ndim) | :: | precedence |
Precedence of sorting, i.e. for ndim=2 precedence=[2,1] sorts firstly according to second row |
|
| integer, | intent(inout), | dimension(ndim,nz) | :: | arr |
Tuples, on return sorted |
Searches in grid lists (li, lj) if it contains point (i, j) and returns its index in lg. If index cannot be found, returns lg=0 Note: (li, lj) shall be uniqued tuple
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | lpi |
Start index of lists li and lj |
||
| integer, | intent(in) | :: | lpf |
Final index of lists li and lj |
||
| integer, | intent(in), | dimension(lpi:lpf) | :: | li |
Grid list li |
|
| integer, | intent(in), | dimension(lpi:lpf) | :: | lj |
Grid list lj |
|
| integer, | intent(in) | :: | i |
Integer coordinate i that is looked for in li |
||
| integer, | intent(in) | :: | j |
Integer coordinate j that is looked for in lj |
||
| integer, | intent(out) | :: | lg |
If present (i,j)=(li(lg), lj(lg)), if not present lg=0 is returned |
Simple bubble sort for small arrays. Different from the sort_and_sum function below as it does not include the summed-up part.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | size |
Dimension of the arrays |
||
| integer, | intent(inout) | :: | col_ind(size) |
Column index of the input and the output sorted array |
||
| real(kind=FP), | intent(inout) | :: | values(size) |
Element value |
Uniques and sorts values according to j-ascending ordering Same j-values are summed up in val
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | nz |
On input: Dimension of j and val On output: Number of unique |
||
| integer, | intent(inout), | dimension(nz) | :: | j |
Integer list, on output uniqued and sorted in ascending order |
|
| real(kind=FP), | intent(inout), | dimension(nz) | :: | val |
Values, on output sorted and summed according to new j-ordering |