
The generic subroutine interface implementing the UNIQUE algorithm to
compute the distinct elements of a rank-1 array.
The output array either preserves the order of first occurrence or
contains the distinct elements in sorted order, depending on the
value of the SORTED_OUTPUT argument. SORTED_OUTPUT is .false.
by default. The SORTED_OUTPUT argument is not available for complex
overloads.
For real arrays, an optional TOLERANCE argument may be supplied
when SORTED_OUTPUT is .true.. Two values whose absolute
difference is less than or equal to TOLERANCE are considered
equal.
For complex arrays, only the unsorted implementation is available. The distinct elements are returned in the order of their first occurrence.
call cdp_unique(array, output[, sorted_output]) stores the
distinct elements of the input array of type complex(dp) in output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=dp), | intent(in) | :: | array(:) | |||
| complex(kind=dp), | intent(inout), | allocatable | :: | output(:) |
call char_unique(array, output[, sorted_output]) stores the
distinct elements of the input array of type character(len=*) in output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | array(:) | |||
| character(len=len), | intent(inout), | allocatable | :: | output(:) | ||
| logical, | intent(in), | optional | :: | sorted_output |
call csp_unique(array, output[, sorted_output]) stores the
distinct elements of the input array of type complex(sp) in output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=sp), | intent(in) | :: | array(:) | |||
| complex(kind=sp), | intent(inout), | allocatable | :: | output(:) |
call dp_unique(array, output[, sorted_output, tolerance])
stores the distinct elements of the input array of type real(dp) in
output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | array(:) | |||
| real(kind=dp), | intent(inout), | allocatable | :: | output(:) | ||
| logical, | intent(in), | optional | :: | sorted_output | ||
| real(kind=dp), | intent(in), | optional | :: | tolerance |
call int16_unique(array, output[, sorted_output]) stores the
distinct elements of the input array of type integer(int16) in output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int16), | intent(in) | :: | array(:) | |||
| integer(kind=int16), | intent(inout), | allocatable | :: | output(:) | ||
| logical, | intent(in), | optional | :: | sorted_output |
call int32_unique(array, output[, sorted_output]) stores the
distinct elements of the input array of type integer(int32) in output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | array(:) | |||
| integer(kind=int32), | intent(inout), | allocatable | :: | output(:) | ||
| logical, | intent(in), | optional | :: | sorted_output |
call int64_unique(array, output[, sorted_output]) stores the
distinct elements of the input array of type integer(int64) in output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | array(:) | |||
| integer(kind=int64), | intent(inout), | allocatable | :: | output(:) | ||
| logical, | intent(in), | optional | :: | sorted_output |
call int8_unique(array, output[, sorted_output]) stores the
distinct elements of the input array of type integer(int8) in output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int8), | intent(in) | :: | array(:) | |||
| integer(kind=int8), | intent(inout), | allocatable | :: | output(:) | ||
| logical, | intent(in), | optional | :: | sorted_output |
call sp_unique(array, output[, sorted_output, tolerance])
stores the distinct elements of the input array of type real(sp) in
output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=sp), | intent(in) | :: | array(:) | |||
| real(kind=sp), | intent(inout), | allocatable | :: | output(:) | ||
| logical, | intent(in), | optional | :: | sorted_output | ||
| real(kind=sp), | intent(in), | optional | :: | tolerance |
call string_type_unique(array, output[, sorted_output]) stores the
distinct elements of the input array of type type(string_type) in output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(string_type), | intent(in) | :: | array(:) | |||
| type(string_type), | intent(inout), | allocatable | :: | output(:) | ||
| logical, | intent(in), | optional | :: | sorted_output |