.TI F77/SORT_MEMORY "Sep. 4, 1985"
Sorting Values in Memory

Vectors and arrays may be sorted using the UNIX qsort() procedure
or procedures in the IMSL and NAG libraries.

The UNIX qsort() procedure is designed to sort a vector.
It can also be used to sort an arrays by column.  The vector 
or array can contain reals, double precision values, integers,
or character strings.  See "man 3f qsort" for more details.

NAG section M01 contains 20 subroutines for sorting vectors, pointers
to vectors, arrays, etc.  IMSL chapter V contains 14 subroutines for
sorting.  Although there is overlap between the IMSL and NAG
subroutines, there are also subroutines in each not in the other.
See "help f77 nag" and "help f77 imsl" for information on whether IMSL
and NAG are available on this system.

To sort a vector vec of length lenvec of single precision reals in
ascending order, you can use IMSL's VSRTA:

	CALL VSRTA( VEC, LENVEC )

For double precision vectors, use either IMSL's VSRTAD:

	CALL VRSTAD( VEC, LENVEC )

or NAG's M01ANF:

.nf
	IFAIL = 0
	CALL M01ANF( VEC, 1, LENVEC, IFAIL )
.fi

For more information, see the NAG and IMSL manuals.
