Repository navigation
Conversation
…p layer When snow layers over an unfrozen top lake layer were melted, the layer was set to t_lake - heatrem/C = tfrz + heatsum/C instead of the energy-conserving t_lake - heatsum/C = tfrz + heatrem/C. Fixes ESCOMP#4356 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quicktest results (LAKE-001)Will ran this fix in an 80 year test against an unmodified baseline (case
Below is Claude's summary of the results for this PR.
Expected: Rare corrections to the top lake-layer temperature when snow melts on a lake. Found: Lake surface-layer temperature and lake ice fraction show no detectable change over years 71–80. The affected code path (snow melting on a lake while the top layer is near freezing) is rare, so a 10-year global mean is not a sensitive test; the fix is a correctness change.
Setup80-year land-only runs: Analysis scripts: |
pSASU spin-up results (LAKE-001)Follow-up to the quicktest results above. Will also ran this fix through a full cold-start spin-up (AD → SASU → pSASU; case
Below is Claude's summary of the results for this PR.
Found: Lake surface-layer temperature and lake ice fraction are identical to the baseline spin-up over years 221–240. The affected code path (snow melting on a lake near freezing) is rare, so a 20-year global mean is not a sensitive test. The fix is a correctness change; this configuration is not a sensitive test of it.
SetupEach case is a cold-start spin-up with its fix in place: Analysis scripts: |
Implications (LAKE-001)Short summary of what the full cold-start spin-up (AD → SASU → pSASU, f19 BGC-Crop, 1850) means for this fix. LAKE-001 (Snow-over-unfrozen-lake melt sets t_lake(1) to tfrz+heatsum/C instead of t_lake-heatsum/C): Not exercised. Tested in the audit-easy bundle. The 1850 spin-up shows no measurable lake effect. Rely on the targeted lake test. Details: full pSASU results above Prepared with AI assistance (Claude) from the pSASU analysis in |
|
This seems like a simple fix, an may rarely be triggered. This seems ready for review. Do we have a test case that would be more useful to evaluate lake dynamics? |
Lake diagnostics: pSASU and HIST (LAKE-001)Follow-up to the pSASU results and to the question in #4356 about how often this branch runs. Will asked Claude to add TLAKE diagnostics for the Approach. Lake columns exchange nothing with the vegetated and soil columns, and every case uses identical forcing. So a lake grid cell in Found: the branch almost never runs in global simulations.
Implication. This matches the reasoning in #4356. Snow layers only sit on an ice-free lake above freezing in the short window after the top layer melts, so the condition is rarely met. When it is met, the error is local but not negligible (about 1 K in the f09 cell). Global climate runs at this resolution can't test the fix; the targeted test with a debug write (C·ΔT = −heatsum) remains the right check. The answer change for typical global configurations should be confined to a handful of lake cells. Setup
Analysis scripts: |
Targeted single-point test (LAKE-001)Follow-up to the lake diagnostics, which found that the fixed branch ran in only one f09 quicktest gridcell (39.1°N, 120°W, near Lake Tahoe). Will asked Claude to rerun that gridcell as a single column with a temporary energy check in the changed branch. Below is Claude's summary. Found: the branch fired on the same date as in the quicktest. The current code loses about 75% of the snowmelt energy; the fix conserves it to roundoff.
This covers the "temporary debug write" item in the testing plan. The remaining item is Setup
Cases: |


Description of changes
When snow layers sit over an unfrozen top lake layer that has enough heat to melt them,
LakeHydrologyremoves the snow and is meant to take the melt energy (heatsum) out of the top lake layer. It subtracted the leftover heat (heatrem) instead, so the layer ended attfrz + heatsum/Crather than the energy-conservingt_lake − heatsum/C(=tfrz + heatrem/C). The resulting energy error, of either sign, is not seen by any balance check, because it happens afterLakeTemperature. The code has been unchanged since clm4_0_60 (2013). Details and history are in #4356.This PR changes only
src/biogeophys/LakeHydrologyMod.F90: in theheatrem > 0branch,t_lake(c,1)is reduced byheatsum(c)/(cpliq*denh2o*dz_lake(c,1)). A comment gives the equivalenttfrz + heatrem/Cform. The partial-freeze branch was already correct and is unchanged.Status: draft. The code has not been compiled or run yet.
Specific notes
Contributors other than yourself, if any:
CTSM issues resolved or otherwise addressed, if any:
If answers are expected to change, describe (delete this line otherwise):
TLAKE, lake heat content, ice onset and later lake surface fluxes can change. Non-lake columns are unchanged.Any user interface changes (namelist or namelist defaults changes)?
Testing planned or performed, if any:
ERP_D_Ld5.f10_f10_mg37.I1850Clm60Bgc.derecho_intel.clm-ciso(contains lakes)heatsumto roundoff: single-column run at the f09 Lake Tahoe gridcell, 20 years. The branch fired twice; the residual is ~1e-9 J/m² with this fix and +1.4e6 J/m² on master (results)audit_easybundle: f09 80-year quicktest, f19 spin-up (pSASU) and HIST. The branch fired in only one gridcell (lake diagnostics)Questions for reviewers