Compute the sum of flow originating in downstream basins

downstream_flow(basin_ids, downstream_ids, flows)

Arguments

basin_ids

a vector of basin ids

downstream_ids

a vector of downstream basin ids, aligned with the entries in basin_ids

flows

a vector of flows generated in each basin, aligned with the entries in basin_ids

Value

a vector of downstream flows for each basin (excluding flow generated within the basin), aligned with the entries in basin_ids