SIP310 Implement H2O mass-balance checking#343
Conversation
Mirror the PR PecanProject#248 balance framework for H2O: track soilWater and snow, compare timestep change against external water fluxes, and log warnings when conservation fails. Expose bcdeltaC, bcdeltaN, and bcdeltaW in sipnet.out; extend testBalance and smoke baselines accordingly. Closes PecanProject#310
Regenerate sipnet.out and russell_1/events.out after make clean so CI smoke tests agree with freshly built binaries. Removes stale reference values and accidental events.out drift from the initial baseline update.
@ANAMASGARD Can you say more about this? I don't see the failure. |
|
@Alomir sorry for the confusion, and also sorry my previous reply missed your actual question entirely (I answered the wrong thing). You're right that you don't see the failure - because it wasn't a real pre-existing issue. That note was based on a testBalance failure I saw only in my local environment before syncing with master. After merging master, it disappeared completely and all tests pass cleanly in CI. I can't reproduce it anymore either. It was likely a stale local build artifact rather than an actual code issue. I've removed that checkbox from the PR description to avoid further confusion. |
FIXES #310
Summary
Implements water mass-balance checking following the same framework as PR #248 (carbon/nitrogen):
soilWater+snoweach timestep (pre-update → post-update → post-clamp)deltaWaterexceeds tolerance (EPS)bcdeltaC,bcdeltaN, andbcdeltaWcolumns tosipnet.outtestBalancewithcheckWater()and updates smoke baselinesDesign notes
ctx.leafWateronly capsimmedEvap; excess interception goes to soil vianetRainsnowMeltexcluded — internal transfer (snow → soil), not external I/OeventEvapon both sides — gross irrigation enters the system (input) and the evaporated portion leaves immediately (output); net soil addition iseventSoilWaterTest plan
make testbuild— builds successfullybcdeltaW = 0.00000in smoke output; zero"Water balance check failed"warningscheckWater()passes in alltestBalancesubtestsmake smoke— passes after baseline update