Improve Rainfall and Mass-Balance Precision - #49
Merged
lrntct merged 7 commits intoAug 13, 2026
Conversation
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improves the numerical accuracy of rainfall, infiltration, and mass-balance reporting, with focused precision tests for float32 and float64 simulations.
Computational Changes
Mass-Balance Output
MassBalanceDatachanges:volume_errorbecomescreated_volume: the nonnegative water volume introduced when a numerically negative calculated depth is clipped to zero.percent_errorbecomescreated_volume_ratio: the created volume divided by the signed domain-volume change.MassBalanceDataadditions:closure_residual: the signed difference between the observed domain-volume change and the sum of all reported signed volume terms.relative_closure_error: the absolute closure residual normalized by the larger of the absolute volume change and total water throughput. It is a dimensionless relative error; a value of0.001corresponds to0.1%.These names distinguish numerical water creation from unexplained mass-balance closure.
The CSV mass-balance provider writes all real-valued fields, including ratios, as decimal values with up to 17 significant digits.
created_volume_ratiois reported as a dimensionless decimal ratio instead of percent in the CSV.Arrays output
The array
volume_errorbecomescreated_volume.Internal changes
ContinuityDatachanges:volume_errorbecomescreated_volumecontinuity_errorbecomescreated_volume_ration