%N sortr %F $MIR/src/subs/sort.for
%D Sort a real array.
%P rjs
%: sorting
%B
        subroutine sortr(array,n)

        implicit none
        integer n
        real array(n)

  Sorts an array, ARRAY, of length N into ascending order using a
  Heapsort algorithm. ARRAY is replaced on output by its sorted
  rearrangement.

  Input:
    n          Number of elements to be sorted.

  Input/Output:
    array      Input: Elements to be sorted.
               Output: Sorted elements.
