Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mask_output fvd aggregation #853

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaraney
Copy link
Member

@aaraney aaraney commented Feb 12, 2025

If a output_parameters->stream_output->mask_output file was configured, the flows, velocities, and depths written to disk are an erroneous mixture of flows, velocities, and depths. For example, the flow field for a given feature_id contains values for a mixture of aggregated flows, velocities, and depths. Not the expected flows.

This patch corrects this behavior so the expected aggregated flows and depths are produced. However, I am not certain that velocities are correctly aggregated. I observed NAN values returned for aggregated velocities. The optimized_v_data subroutine needs to be checked to ensure velocity values are correctly aggregated.

Technical Description

If a output_parameters->stream_output->mask_output file is included and contains a nex section, t-route will aggregate contributions from flowpaths directly upstream of a nexus. The aggregation subroutine contained an error which changed the output column ordering of the flow velocity depth dataframe changes from (0, q), (0, v), (0, d), ... to (0, q), (1, q), (0, v), (1, v), (0, d), (1, d), .... The subroutine that operated on the potentially aggregated flow, velocity, and depth dataframe expects the (0, q), (0, v), (0, d), ... column ordering. The mismatching expectations resulted in erroneous flow velocity and depth values written to disk. For example, the flow field for a given feature_id would contain values for a mixture of aggregated flows, velocities, and depths. Not the expected flows.

Reindexing the flow velocity depth dataframe returned from the aggregation subroutine resolves this issue.

If a output_parameters->stream_output->mask_output file was
configured, the flows, velocities, and depths written to disk are an
erroneous mixture of flows, velocities, and depths. For example, the
flow field for a given feature_id contains values for a mixture of
aggregated flows, velocities, and depths. Not the expected flows.

This patch corrects this behavior so the expected aggregated flows _and_
depths are written. However, I am not certain that velocities are
correctly aggregated. I observed NAN values returned for aggregated
velocities. The `optimized_v_data` subroutine needs to be checked to
ensure velocity values are correctly aggregated.
@aaraney aaraney self-assigned this Feb 12, 2025
@aaraney aaraney added bug Something isn't working t-route IO labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working IO t-route
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant