qsort_up(array, len, isize)

Purpose

The qsort_up subroutine performs a parallel quicksort on a one-dimensional, contiguous array ARRAY whose length LEN is the number of elements in the array with each element having a size of ISIZE. The result is stored in array ARRAY in ascending order. As opposed to qsort_, the qsort_up subroutine does not require the COMPAR function.

Class

Subroutine

Argument type and attributes

array
The array to be sorted. It can be of any type.
len
The number of elements in the array. The argument is of type INTEGER(4).
isize
The size of a single element of the array. The argument is of type INTEGER(4).

Examples

SUBROUTINE FOO()
  INTEGER(4) ARRAY(8), LEN, ISIZE
  DATA ARRAY/0, 3, 1, 2, 9, 5, 7, 4/
  LEN = 8
  ISIZE = 4
  CALL qsort_up(ARRAY, LEN, ISIZE)
  PRINT *, ARRAY
! Result value is [0, 1, 2, 3, 4, 5, 7, 9]
RETURN
END