Skip to content

bug_fix_AET#142

Closed
ajkhattak wants to merge 1 commit intomasterfrom
ajk/fix_aet
Closed

bug_fix_AET#142
ajkhattak wants to merge 1 commit intomasterfrom
ajk/fix_aet

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>
donaldwj added a commit that referenced this pull request Jan 16, 2026
* update submodule url to gitlab

* Implementation of the new Logging mechanism for C-based modules - NGWPC-3889

* fix to CFE unit test for mass balance check

* More changes including the move of setup_logger call to BMI initialize() function in bmi_cfe.c

* Final change to make it work with environment variable NGEN_LOG_FILE_PATH

* Revert "Merge branch 'NGWPC-3889' into 'development'"

This reverts merge request !3

* recommit of logger changes for CFE module

* NGWPC-4428 - CFE logging changes

* Logger optimization

* Added release number, date and commit hash of official release

* Adding feature for dynamically setting log level systemwide

* changed the way logLevel char pointer is checked for NULL

* Revert "changed the way logLevel char pointer is checked for NULL"

This reverts commit a7e8451.

* Revert "Adding feature for dynamically setting log level systemwide"

This reverts commit 2945134.

* Updated version file for release rc-1.1.0

* enhancement to allow flexible order in cfe config

* Update version file for release rc-1.1.0A

* Updated license file to reflect OWP government language

Added Apache license and copyright information for cfe repo via modification of existing LICENSE file

* Update version file for Release 1.1.0

* fix cfe error

* Update version file for master hotfix 1.1.1

* Added RTX licensing verbiage

* Remove duplicated RTX licensing verbiage

* Update version file for release rc-1.2.0 on 2025-02-12

* Update version file for release 1.2.0 on 2025-02-25

* Update cfe.c (#139)

* Update cfe.c

Fixed major bug in xinanjiang function.  One minor bass balance fix.  Refactored.  Verified code against NWM Fortran Xinanjiang function.  Changed "infiltation_excess_params_struct" to "infiltration_excess_params_structure".   Added "#ifdef DEBUG #endif around mass balance warning print statement at end of xinanjiang scheme function.

* fix: adjust white space for better review, fix struct parameter

---------

Co-authored-by: hellkite500 <nfrazier@lynker.com>

* ci: use pull_request_target when collecting project info for PR's from forks

* ci: us pull_request_target the right way...

* ci: remove duplicate event, pull_request is a subset of pull_request_target

* fix: don't double count impervious_runoff in infiltration_excess calculation

Co-authored-by: Nels <nels.frazier@noaa.gov>

* Fix aet, replaces #142 (#143)

* 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>

* Delete version.txt

* Refactor and add env var checking

* Change ENABLE to ENABLED for EWTS flag

* build: broken reference to bmi_cfe header file

* Update logger to be consistent with other module loggers

* Change log levels ERROR to WARNING and WARNING to SEVERE

* Flush stdout after print

* Remove placholder comments

* Fix merge errors

* Fix header file reference

* Created serialization methods for CFE state data

* Change malloc to calloc to ensure null pointers

* Fix log level from SEVERE to WARNING for a warning.

* fix flux larger than storage error

* changed warning msg per OWP request

* Express dimensionless units of ice_fraction_xinanjiang and soil_moisture_profile as "1" so UDUNITS2 can parse them

* Throttle groundwater flux warning message to a single log entry.

* Adapt serialization to revised protocol

* ice_fraction_schaake (dimensionless)

* SURF_RUNOFF_SCHEME unit from None to 1 (dimensionless)

---------

Co-authored-by: Mohammed Karim <mohammed.r.karim@rtx.com>
Co-authored-by: Carolyn Maynard <carolyn.maynard@rtx.com>
Co-authored-by: areg.amirkhanian <areg.amirkhanian@rtx.com>
Co-authored-by: yuqiong.liu <yuqiong.liu@ertcorp.com>
Co-authored-by: Zhengtao Cui <zhengtao.cui@rtx.com>
Co-authored-by: David Gillingham <david.gillingham@rtx.com>
Co-authored-by: Shanti Surapaneni <shanti.surapaneni@rtx.com>
Co-authored-by: peter.a.kronenberg <peter.a.kronenberg@rtx.com>
Co-authored-by: Brian-Cosgrove <131808837+Brian-Cosgrove@users.noreply.github.com>
Co-authored-by: Fred Ogden <56281521+fred-ogden@users.noreply.github.com>
Co-authored-by: hellkite500 <nfrazier@lynker.com>
Co-authored-by: Nels <nels.frazier@noaa.gov>
Co-authored-by: ajkhattak <ajkhattak@gmail.com>
Co-authored-by: Austin Raney <austin.raney@noaa.gov>
Co-authored-by: Ian Todd <itodd@dewberry.com>
Co-authored-by: Yuqiong Liu <yuqiong.liu@U-28HBMJQ9PK1NS.nextgenwaterprediction.com>
Co-authored-by: Phil Miller <philip.miller@noaa.gov>
Co-authored-by: Phil Miller - NOAA <pmiller@lynker.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.

3 participants