Skip to main content

ArgIntroSort

This routine performs an indirect sort on an array.

Reference: Coretran

It returns the integer array which can be used for obtaining the sorted array.

Calling example:

CALL ArgIntroSort(array, arg)

Then, array(arg) will be sorted in increasing order.

Interface

  MODULE PURE SUBROUTINE ArgIntroSort(array, arg)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: array(:)
INTEGER(I4B), INTENT(OUT) :: arg(0:)
END SUBROUTINE ArgIntroSort
  • Here, entries of array are NOT modified by the routine.
  • arg should be allocated by the user
  • array(arg) returns the sorted array.