oracle_nth Subroutine

public subroutine oracle_nth(keys, nrows, nth, proc, idx)

Relay onto p_nth; see oracle_argsort for why these exist.

Arguments

Type IntentOptional Attributes Name
type(sort_key_buf), intent(in), target :: keys(:)

the keys, primary first.

integer(kind=int64), intent(in) :: nrows

rows each key describes.

integer(kind=int64), intent(in) :: nth

the rank wanted, 1-based.

character(len=*), intent(in) :: proc

calling procedure, for messages.

integer(kind=int64), intent(out) :: idx

the row holding that rank.


Source Code

    subroutine oracle_nth(keys, nrows, nth, proc, idx)
        type(sort_key_buf), intent(in), target :: keys(:)  !! the keys, primary first.
        integer(int64), intent(in) :: nrows                !! rows each key describes.
        integer(int64), intent(in) :: nth                  !! the rank wanted, 1-based.
        character(len=*), intent(in) :: proc               !! calling procedure, for messages.
        integer(int64), intent(out) :: idx                 !! the row holding that rank.
        !
        call check_oracle(associated(p_nth), proc)
        call p_nth(keys, nrows, nth, proc, idx)
    end subroutine oracle_nth