Distribute - Albedo - set vis and ir albedo to None when sun is down - #83
jmichellehu wants to merge 1 commit into
Conversation
- Zero-fill of vis and ir from PR #27 overrides broadband albedo branch in SolarHRRR.calculate_net_solar - Results in net_solar radiation being made equivalent to incoming solar - Explicit None definition ensures broadband albedo branch kicks in correctly
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix addresses the branch-selection bug and includes appropriate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes HRRR net-solar calculation after nighttime steps by preserving broadband albedo selection.
Changes:
- Resets visible and infrared albedo to
Noneat night. - Adds regression tests for broadband albedo after nighttime.
| File | Description |
|---|---|
smrf/distribute/albedo.py |
Clears spectral albedo values when sunlight is absent. |
smrf/tests/distribute/test_albedo.py |
Tests nighttime-to-daytime broadband albedo behavior. |
smrf/tests/distribute/test_solar_hrrr.py |
Verifies broadband albedo reduces HRRR net solar correctly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Can we please make an effort and explain changes in PRs in a human way? These auto-generated LLM descriptions make it hard to understand things. This is also a copy of the commit message and more context should be given in a PR |
jomey
left a comment
There was a problem hiding this comment.
There is also a need to further explain why this is needed with net solar only being calculated when the sun is up
Net solar is only calculated when the sun is up, but the albedo distribution is called at every timestep, day or night. So when illumination angles are When using a broadband albedo source like SPIReS, this leads to Theoretically (I didn't test this), this issue doesn't affect runs using the vis/ir pathway as new daytime values overwrite the nighttime zero grids. But setting the grids back to None goes back to the previous net solar behavior. |
Nonedefinition ensures broadband albedo branch kicks in correctly