is_sorted provides a simple way to checking if a 1d array is sorted it is implemented for int32, int64, sp, and dp datatypes. The default is to check if an array is sorted in ascending fashion.
Usage: result = is_sorted(array, [optional] ASCENDING/DESCENDING)
check if a 1d array of type int32 is sorted
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | array(:) | |||
| integer(kind=default_int), | intent(in), | optional | :: | order |
check if a 1d array of type int64 is sorted
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | array(:) | |||
| integer(kind=default_int), | intent(in), | optional | :: | order |
check if a 1d array of type sp is sorted
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=sp), | intent(in) | :: | array(:) | |||
| integer(kind=default_int), | intent(in), | optional | :: | order |
check if a 1d array of type dp is sorted
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | array(:) | |||
| integer(kind=default_int), | intent(in), | optional | :: | order |
check if a 1d array of type char is sorted
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | array(:) | |||
| integer(kind=default_int), | intent(in), | optional | :: | order |