| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(sort_key_buf), | intent(in) | :: | keys(:) |
the keys, in precedence order. |
||
| integer(kind=int64), | intent(in) | :: | a |
first row, 1-based. |
||
| integer(kind=int64), | intent(in) | :: | b |
second row, 1-based. |
.true. when a sorts before b.
THE sort comparator: every key in precedence order, then the row index as tiebreaker.
The index tiebreaker makes this a TOTAL ORDER in which no two distinct rows compare
equal, which is what makes an unstable sort produce the stable answer, makes
nth_element deterministic, and makes a parallel result bit-identical to a serial one
by construction. Keep it beside sort_keys_compare -- feature_risks.md Risk-34.