ord_sort Interface

public interface ord_sort

The generic subroutine interface implementing the ORD_SORT algorithm, a translation to Fortran 2008, of the "Rust" sort algorithm found in slice.rs https://github.com/rust-lang/rust/blob/90eb44a5897c39e3dff9c7e48e3973671dcd9496/src/liballoc/slice.rs#L2159 ORD_SORT is a hybrid stable comparison algorithm combining merge sort, and insertion sort. (Specification)

It is always at worst O(N Ln(N)) in sorting random data, having a performance about 25% slower than SORT on such data, but has much better performance than SORT on partially sorted data, having O(N) performance on uniformly non-increasing or non-decreasing data.


Contents


Subroutines

private module subroutine char_ord_sort(array, work, reverse)

char_ord_sort( array ) sorts the input ARRAY of type character(len=*) using a hybrid sort based on the 'Rust" sort algorithm found in slice.rs

Arguments

TypeIntentOptionalAttributesName
character(len=*), intent(inout) :: array(0:)
character(len=len), intent(out), optional :: work(0:)
logical, intent(in), optional :: reverse

private module subroutine dp_ord_sort(array, work, reverse)

dp_ord_sort( array ) sorts the input ARRAY of type real(dp) using a hybrid sort based on the 'Rust" sort algorithm found in slice.rs

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(inout) :: array(0:)
real(kind=dp), intent(out), optional :: work(0:)
logical, intent(in), optional :: reverse

private module subroutine int16_ord_sort(array, work, reverse)

int16_ord_sort( array ) sorts the input ARRAY of type integer(int16) using a hybrid sort based on the 'Rust" sort algorithm found in slice.rs

Arguments

TypeIntentOptionalAttributesName
integer(kind=int16), intent(inout) :: array(0:)
integer(kind=int16), intent(out), optional :: work(0:)
logical, intent(in), optional :: reverse

private module subroutine int32_ord_sort(array, work, reverse)

int32_ord_sort( array ) sorts the input ARRAY of type integer(int32) using a hybrid sort based on the 'Rust" sort algorithm found in slice.rs

Arguments

TypeIntentOptionalAttributesName
integer(kind=int32), intent(inout) :: array(0:)
integer(kind=int32), intent(out), optional :: work(0:)
logical, intent(in), optional :: reverse

private module subroutine int64_ord_sort(array, work, reverse)

int64_ord_sort( array ) sorts the input ARRAY of type integer(int64) using a hybrid sort based on the 'Rust" sort algorithm found in slice.rs

Arguments

TypeIntentOptionalAttributesName
integer(kind=int64), intent(inout) :: array(0:)
integer(kind=int64), intent(out), optional :: work(0:)
logical, intent(in), optional :: reverse

private module subroutine int8_ord_sort(array, work, reverse)

int8_ord_sort( array ) sorts the input ARRAY of type integer(int8) using a hybrid sort based on the 'Rust" sort algorithm found in slice.rs

Arguments

TypeIntentOptionalAttributesName
integer(kind=int8), intent(inout) :: array(0:)
integer(kind=int8), intent(out), optional :: work(0:)
logical, intent(in), optional :: reverse

private module subroutine sp_ord_sort(array, work, reverse)

sp_ord_sort( array ) sorts the input ARRAY of type real(sp) using a hybrid sort based on the 'Rust" sort algorithm found in slice.rs

Arguments

TypeIntentOptionalAttributesName
real(kind=sp), intent(inout) :: array(0:)
real(kind=sp), intent(out), optional :: work(0:)
logical, intent(in), optional :: reverse

private module subroutine string_type_ord_sort(array, work, reverse)

string_type_ord_sort( array ) sorts the input ARRAY of type type(string_type) using a hybrid sort based on the 'Rust" sort algorithm found in slice.rs

Arguments

TypeIntentOptionalAttributesName
type(string_type), intent(inout) :: array(0:)
type(string_type), intent(out), optional :: work(0:)
logical, intent(in), optional :: reverse