qsort_down(array, len, isize)

Purpose

The qsort_down subroutine performs a parallel quicksort on a one-dimensional 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 descending order. As opposed to qsort_, the qsort_down 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).

Result Type and Attributes

Result Value

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_down(ARRAY, LEN, ISIZE)
  PRINT *, ARRAY
! Result value is [9, 7, 5, 4, 3, 2, 1, 0]
RETURN
END
IBM Copyright 2003