Repository navigation
[#441] Fix freezing precipitation handling with --no-snow - #442
ANAMASGARD wants to merge 4 commits into
Conversation
Respect the snow flag when partitioning freezing precipitation. Add CLI regression coverage at -5, 0, and 5 C with both snow settings, and run it through make test. Fixes PecanProject#441 Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Alomir
left a comment
There was a problem hiding this comment.
As stated in my other comment, please redo the test for this change. The change itself looks good - and thanks! - but needs a much more focused test.
| @@ -0,0 +1,56 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
I'm sorry to say this, but this change does not warrant a new category of testing. A much smaller focused test in the unit test subdirectories (maybe test_modeling?) should be sufficient.
There was a problem hiding this comment.
@Alomir Thanks for the feedback! I replaced the CLI test with a small, focused test in test_modeling and removed the extra Makefile target. It covers −5, 0, and 5 °C with snow enabled and disabled. All local build, test, and lint checks passed.
Test precipitation partitioning directly in testFluxCalculations at -5, 0, and 5 C with snow enabled and disabled. Remove the separate CLI test and Makefile target so coverage uses the existing unit-test workflow. Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
Alomir
left a comment
There was a problem hiding this comment.
Looks great, thanks a bunch!
|
@Alomir Thank you so much for the review. As you can see, all the tests have passed on the GitHub actions CI, so please, can you, if you feel right, merge this PR, because there are other PRs that I want to raise for issues I have been assigned to, but because of the three PR only restriction on repositories, I am not able to open a PR. So my humble request is, please, if you think that this PR is ready to be merged. |
Summary
make test.--no-snowshould treat all precipitation as liquid, as documented. Previously, freezing precipitation still entered the snowpack instead of reaching the soil. Snow-enabled behavior remains unchanged.How was this change tested?
make unitandmake testrun.russell_4skip was retained.--no-snowcontrol.No smoke reference outputs were changed.
Reproduction steps
Run the new regression test:
The test starts with 3 cm of soil water, an empty snowpack, and 10 mm of precipitation. With
--no-snow, soil water should reach 4 cm and snow should remain zero at all three temperatures.Before the fix, the −5 °C and 0 °C cases instead ended with 3 cm of soil water and 1 cm of snow. With
--snow, those cases continue to produce snow as expected.Related issues
--no-snowstill sends freezing precipitation to the snowpack #441Checklist
--no-snowstill sends freezing precipitation to the snowpack #441 was assigned and the implementation plan approved.docs/CHANGELOG.mdupdated with noteworthy changes.clang-format; the pre-commit formatting check passed.