mergesort Module

module implementing merge sort algorithm


Uses


Interfaces

public interface merge_sort

sorts array argument

  • public subroutine merge_sort_int(a)

    sorts integer array A

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(inout) :: a(:)

public interface merge_argsort

returns the indices that sorts the array

  • public subroutine merge_argsort_int(a, idx)

    arg sorts integer array A

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(inout) :: a(:)
    integer, intent(inout) :: idx(size(a,1))
  • public subroutine merge_argsort_double(a, idx)

    arg sorts integer array A

    Arguments

    Type IntentOptional Attributes Name
    real(kind=long), intent(inout) :: a(:)
    integer, intent(inout) :: idx(size(a,1))

Subroutines

public subroutine merge_sort_int(a)

sorts integer array A

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: a(:)

public subroutine merge_argsort_int(a, idx)

arg sorts integer array A

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: a(:)
integer, intent(inout) :: idx(size(a,1))

public subroutine merge_argsort_double(a, idx)

arg sorts integer array A

Arguments

Type IntentOptional Attributes Name
real(kind=long), intent(inout) :: a(:)
integer, intent(inout) :: idx(size(a,1))