sort_compare_key Interface

interface
public module function sort_compare_key(key, a, b) result(c)

Arguments

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

the bound key.

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

first row, 1-based.

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

second row, 1-based.

Return Value integer

-1, 0 or +1.

Description

-1/0/+1 for rows a and b under ONE key, with its order and null placement applied.

Two rows in the same non-value tier (both null, or both NaN) compare EQUAL, so the caller's index tiebreaker keeps them in file order. descending negates the answer within the value tier only.