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

bug_fix_AET #142

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

bug_fix_AET #142

wants to merge 1 commit into from

Conversation

ajkhattak
Copy link
Contributor

@ajkhattak ajkhattak commented Mar 3, 2025

The PR fixes a bug in the AET extraction. The AET should come from surface water retention depth before it is extracted from the soil.

Additions

  • none

Removals

  • None

Changes

  • Bug fix - this will impact different component of water mass balance

Testing

  1. The change has been tested and it closes the mass balance and make sense

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Passes all existing automated tests
  • Reviewers requested with the Reviewers tool ➡️

@@ -3325,11 +3326,12 @@ extern void mass_balance_check(cfe_state_struct* cfe_ptr){
giuh_residual = cfe_ptr->vol_struct.vol_runoff - cfe_ptr->vol_struct.vol_out_surface - cfe_ptr->vol_struct.vol_end_surface -
cfe_ptr->vol_struct.vol_runon_infilt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: is vol_struct>vol_et_from_retention_depth included in cfe_ptr->vol_struct.vol_end_surfaced? Secong question, should this mass balance equation on line 3325 be: giuh_residual = cfe_ptr->vol_struct.vol_runoff - cfe_ptr->vol_struct.vol_out_surface - cfe_ptr->vol_struct.vol_end_surface - cfe_ptr->vol_struct.vol_runon_infilt - cfe_ptr->vol-struct.vol_et_from_retention_depth; ?

ajkhattak added a commit that referenced this pull request Mar 13, 2025
* chore: small formatting refactor

Co-authored-by: ajkhattak <ajkhattak@gmail.com>

* feat: add method to compute et_from_retention_depth

Co-authored-by: ajkhattak <ajkhattak@gmail.com>

* fix: take AET from surface retention depth

Co-authored-by: ajkhattak <ajkhattak@gmail.com>

* fix: try to prevent segfault when computing AET from retention depth

---------

Co-authored-by: ajkhattak <ajkhattak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants