![]() |
libSUFR
a LIBrary of Some Useful Fortran Routines
|
Procedures for sorting. More...
Functions/Subroutines | |
subroutine | sorted_index_list (array, index_list, mask, index_n) |
Return a list of indices index_list that sorts the members of array to ascending value, using a Quicksort algorithm. | |
subroutine | sort_array (array) |
Sort an array to ascending value. | |
subroutine | sort_array_sp (array) |
Sort an array to ascending value - single-precision wrapper for sort_array. | |
subroutine | sort_string_array (narr, strlen, strarr, index_list) |
Sort strings alphabetically. | |
Procedures for sorting.
subroutine sufr_sorting::sort_array | ( | real(double), dimension(:), intent(inout) | array | ) |
Sort an array to ascending value.
array | Input: array to be sorted, output: sorted array (double) |
Definition at line 203 of file sorting.f90.
References sufr_kinds::double, and sorted_index_list().
subroutine sufr_sorting::sort_array_sp | ( | real, dimension(:), intent(inout) | array | ) |
Sort an array to ascending value - single-precision wrapper for sort_array.
array | Input: array to be sorted, output: sorted array (double) |
Definition at line 228 of file sorting.f90.
References sorted_index_list().
subroutine sufr_sorting::sort_string_array | ( | integer, intent(in) | narr, |
integer, intent(in) | strlen, | ||
character, dimension(strlen), intent(in) | strarr, | ||
integer, dimension(narr), intent(out) | index_list ) |
Sort strings alphabetically.
narr | Number of strings in array str |
strlen | Length of the strings in array str |
strarr | Array of n strings with length len |
index_list | Sorting index (output) |
Definition at line 252 of file sorting.f90.
References sorted_index_list().
subroutine sufr_sorting::sorted_index_list | ( | real(double), dimension(:), intent(in) | array, |
integer, dimension(:), intent(out) | index_list, | ||
logical, dimension(:), intent(in), optional | mask, | ||
integer, intent(out), optional | index_n ) |
Return a list of indices index_list that sorts the members of array to ascending value, using a Quicksort algorithm.
array | Array of size n with values that must be sorted - use dble(array) for other variable types |
index_list | List with indices of array values, sorted to ascending value, same dimension and size as array. (output) array(index_list) gives the sorted array. |
mask | Mask to apply to array. If present, index_list will have zeroes after the last meaningful entry (optional) |
index_n | Number of meaningful elements in index_list, after applying mask (output, optional) |
Definition at line 44 of file sorting.f90.
References sufr_kinds::double, and sufr_system::quit_program_error().
Referenced by sufr_statistics::median(), sufr_statistics::prob_range(), sufr_statistics::prob_range_sp(), sort_array(), sort_array_sp(), and sort_string_array().