sort_arrays Module

Various routines to sort real/integer arrays


Uses

  • module~~sort_arrays~~UsesGraph module~sort_arrays sort_arrays module~data_arch data_arch module~sort_arrays->module~data_arch iso_fortran_env iso_fortran_env module~data_arch->iso_fortran_env

Used by

  • module~~sort_arrays~~UsedByGraph module~sort_arrays sort_arrays module~solver solver module~solver->module~sort_arrays module~surfile surfile module~surfile->module~sort_arrays program~main main program~main->module~sort_arrays program~test_algen test_algen program~test_algen->module~sort_arrays program~test_solvers test_solvers program~test_solvers->module~solver program~test_surfile test_surfile program~test_surfile->module~surfile

Subroutines

private subroutine change_array_order(tab_inout, order, n)

Given an order vector, sort a real or integer vector

Arguments

Type IntentOptional Attributes Name
class(*), intent(inout), dimension(n) :: tab_inout

array to sort

integer(kind=I4), intent(inout), dimension(n) :: order

order vector

integer(kind=I4), intent(in) :: n

size of the arrays

public subroutine init_order(order, n)

Vector initialization: 1 … n

Arguments

Type IntentOptional Attributes Name
integer(kind=I4), intent(out), dimension(n) :: order

order vector

integer(kind=I4), intent(in) :: n

size of the vector

public subroutine sort_array2(tab_inout, tab0, tab1, tab2, tab3, n)

Sort 1D arrays, real or integer, according the first one

Arguments

Type IntentOptional Attributes Name
class(*), intent(inout), dimension(n) :: tab_inout

reference array to sort

integer(kind=I4), intent(inout), optional, dimension(n) :: tab0

second array to sort according the order of the first one

class(*), intent(inout), optional, dimension(n) :: tab1

third array to sort according the order of the first one

class(*), intent(inout), optional, dimension(n) :: tab2

4th array to sort according the order of the first one

class(*), intent(inout), optional, dimension(n) :: tab3

5th array to sort according the order of the first one

integer(kind=I4), intent(in) :: n

size of the arrays

private recursive subroutine sort_array_integer(g, d, itabref)

Sort a vector of integers

Arguments

Type IntentOptional Attributes Name
integer(kind=I4), intent(in) :: g

left index

integer(kind=I4), intent(in) :: d

right index

integer(kind=I4), intent(inout), dimension(:) :: itabref

vector to sort

private recursive subroutine sort_array_integer_with_order(g, d, itabref, order)

Sort a vector of integers and store the order

Arguments

Type IntentOptional Attributes Name
integer(kind=I4), intent(in) :: g

left index

integer(kind=I4), intent(in) :: d

right index

integer(kind=I4), intent(inout), dimension(:) :: itabref

vector to sort

integer(kind=I4), intent(inout), dimension(:) :: order

sort order

private recursive subroutine sort_array_real(g, d, rtabref)

Sort a vector of reals

Arguments

Type IntentOptional Attributes Name
integer(kind=I4), intent(in) :: g

left index

integer(kind=I4), intent(in) :: d

right index

real(kind=R8), intent(inout), dimension(:) :: rtabref

vector to sort

private recursive subroutine sort_array_real_with_order(g, d, rtabref, order)

Sort a vector of reals and store the order

Arguments

Type IntentOptional Attributes Name
integer(kind=I4), intent(in) :: g

left index

integer(kind=I4), intent(in) :: d

right index

real(kind=R8), intent(inout), dimension(:) :: rtabref

vector to sort

integer(kind=I4), intent(inout), dimension(:) :: order

sort order