Various routines to sort real/integer arrays
Given an order vector, sort a real or integer vector
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(inout), | dimension(n) | :: | tab_inout |
array to sort |
|
integer(kind=I4), | intent(inout), | dimension(n) | :: | order |
order vector |
|
integer(kind=I4), | intent(in) | :: | n |
size of the arrays |
Vector initialization: 1 … n
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(out), | dimension(n) | :: | order |
order vector |
|
integer(kind=I4), | intent(in) | :: | n |
size of the vector |
Sort 1D arrays, real or integer, according the first one
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(inout), | dimension(n) | :: | tab_inout |
reference array to sort |
|
integer(kind=I4), | intent(inout), | optional, | dimension(n) | :: | tab0 |
second array to sort according the order of the first one |
class(*), | intent(inout), | optional, | dimension(n) | :: | tab1 |
third array to sort according the order of the first one |
class(*), | intent(inout), | optional, | dimension(n) | :: | tab2 |
4th array to sort according the order of the first one |
class(*), | intent(inout), | optional, | dimension(n) | :: | tab3 |
5th array to sort according the order of the first one |
integer(kind=I4), | intent(in) | :: | n |
size of the arrays |
Sort a vector of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(in) | :: | g |
left index |
||
integer(kind=I4), | intent(in) | :: | d |
right index |
||
integer(kind=I4), | intent(inout), | dimension(:) | :: | itabref |
vector to sort |
Sort a vector of integers and store the order
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(in) | :: | g |
left index |
||
integer(kind=I4), | intent(in) | :: | d |
right index |
||
integer(kind=I4), | intent(inout), | dimension(:) | :: | itabref |
vector to sort |
|
integer(kind=I4), | intent(inout), | dimension(:) | :: | order |
sort order |
Sort a vector of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(in) | :: | g |
left index |
||
integer(kind=I4), | intent(in) | :: | d |
right index |
||
real(kind=R8), | intent(inout), | dimension(:) | :: | rtabref |
vector to sort |
Sort a vector of reals and store the order
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(in) | :: | g |
left index |
||
integer(kind=I4), | intent(in) | :: | d |
right index |
||
real(kind=R8), | intent(inout), | dimension(:) | :: | rtabref |
vector to sort |
|
integer(kind=I4), | intent(inout), | dimension(:) | :: | order |
sort order |