| 
    NuMFor cf0f85d (2025-09-27)
    
   Numerical (Modern) Fortran. Library for Simple Numerical computing 
   | 
 
sort provides a framework for searching elements and sorting arrays More...
Data Types | |
| interface | searchsorted | 
| searchsorted: Find index where an element should be inserted in an array to maintain order.  More... | |
Functions/Subroutines | |
| subroutine, public | sort (vec, reverse) | 
| Routine to sort a vector.   | |
Variables | |
| integer, parameter | minsize_bisection = 100 | 
| Minimum value of elements for using bisection.  | |
sort provides a framework for searching elements and sorting arrays
| subroutine, public sort | ( | real(dp), dimension(:), intent(inout) | vec, | 
| logical, intent(in), optional | reverse ) | 
Routine to sort a vector.
Sorting routine, slightly modified from the original sources:
It uses a simple insertion point algorithm for small arrays (less than 20 elements) and quicksort algorithm for larger arrays.
Examples:
| [in,out] | vec | Vector to sort | 
| [in] | reverse | .TRUE. to sort in descending order |