Skip to content

Fix n_rch_up/n_rch_down mismatch from flow corrections #206

Description

@jameshgrn

Bug

n_rch_up and n_rch_down scalar columns on 148 reaches did not match the actual neighbor counts in reach_topology. Root cause: flow correction flips updated topology direction entries (up/down) but did not update the scalar count columns.

93% (138/148) were exact swaps (n_rch_up had the correct n_rch_down value and vice versa). Affected regions: AF (10), AS (42), EU (14), NA (44), SA (38). OC had 0.

Impact

POM sword_validity.m Test 1b/2b detects this: declared n_rch_up count does not match actual upstream entries in rch_id_up array.

Fix

Single UPDATE recalculating from reach_topology. 148 reaches fixed. 0 remaining mismatches. All exports re-generated.

Separate: non-reciprocal pairs (151)

POM also flagged non-reciprocal topology (both reaches listing each other as upstream). Known v17b-inherited issue (documented in release notes as 150 pairs, actual count 151). Zero overlap with the n_rch_up/down bug.

Reported by: Pierre-Olivier Malaterre (INRAE)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions