Routine for sorting an array

source: cp_array_sort.FLoading...

Sorts an array inplace using a combination of merge- and bubble-sort. It also returns the indices, which the elements had before the sort.

INTEGER(int_4), |
INTENT(inout) |
:: | arr(1:n) | the array to sort | |

INTEGER, |
INTENT(in) |
:: | n | length of array | |

INTEGER, |
INTENT(out) |
:: | indices(1:n) | returns elements-indices before the sort |

INTEGER(int_8), |
INTENT(inout) |
:: | arr(1:n) | the array to sort | |

INTEGER, |
INTENT(in) |
:: | n | length of array | |

INTEGER, |
INTENT(out) |
:: | indices(1:n) | returns elements-indices before the sort |

REAL(dp), |
INTENT(inout) |
:: | arr(1:n) | the array to sort | |

INTEGER, |
INTENT(in) |
:: | n | length of array | |

INTEGER, |
INTENT(out) |
:: | indices(1:n) | returns elements-indices before the sort |

REAL(sp), |
INTENT(inout) |
:: | arr(1:n) | the array to sort | |

INTEGER, |
INTENT(in) |
:: | n | length of array | |

INTEGER, |
INTENT(out) |
:: | indices(1:n) | returns elements-indices before the sort |