Skip to content

fix(P3): correct the Cober-List impact-factor sign in the local rime density#764

Draft
haakon-e wants to merge 1 commit into
mainfrom
he/p3-rime-density-sign
Draft

fix(P3): correct the Cober-List impact-factor sign in the local rime density#764
haakon-e wants to merge 1 commit into
mainfrom
he/p3-rime-density-sign

Conversation

@haakon-e

Copy link
Copy Markdown
Member

compute_local_rime_density divides the Cober and List (1993) Eq. 16 impact factor by the signed Celsius temperature. Every subfreezing temperature therefore produced a negative impact factor, the [1, 12] range clamp pinned it at 1, and the local rime density was a constant 159.5 kg/m3 at all temperatures. The parameterization was effectively inert: rime never densified toward the solid-ice limit approaching the freezing point, and all rime-volume (B_rim) sources used floor-density rime.

The fix follows the Cober and List convention with the sub-zero surface temperature bounded strictly below 0 C, min(T - T_freeze, -1e-3), matching the P3 fortran code (microphy_p3.f90, iTc = 1/min(-0.001, Tc)), and applies the sign so the impact factor is positive for subfreezing temperatures.

Impact: at the collision smoke-test state, BCCOL decreases by ~6% and BRCOL by a factor of ~5.7 (large raindrops now produce near-solid rime instead of floor-density rime). The local rime density at fixed sizes now ranges from ~294 kg/m3 at 240 K to the solid-ice limit approaching the freezing point, instead of a constant 159.5 kg/m3. Downstream, this changes the B_rim sources and hence the predicted rime density rho_rim.

Semantics at and above the freezing point (flagged for review): the temperature bound makes the impact factor large, so the clamp returns the solid-ice density. Collisions are evaluated in melt regimes too, and this choice keeps the function finite and monotone there; alternatives (e.g. reusing the 400 kg/m3 default) are possible if preferred.

Tests: interior Cober-List polynomial values, clamp limits, subfreezing densification monotonicity, a pinned value at 240 K, and the freezing-point edge. The two rime-volume smoke-test references are updated to the corrected values; all other collision outputs are unchanged, as expected since only the B_rim components depend on the local rime density.

…density

The impact factor divided by the signed Celsius temperature, so every
subfreezing temperature produced a negative impact factor, which the
[1, 12] range clamp pinned at 1. The local rime density was therefore a
constant 159.5 kg/m3 at all temperatures, and rime never densified
toward the solid-ice limit approaching the freezing point.

Follow the Cober and List (1993) convention with the sub-zero surface
temperature bounded strictly below 0 C, matching the P3 fortran code.
Update the two rime-volume smoke-test references and extend the local
rime density tests with interior Cober-List values, clamp limits,
subfreezing densification, and the freezing-point edge.
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.92%. Comparing base (cd6581c) to head (5ef64cb).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #764   +/-   ##
=======================================
  Coverage   92.92%   92.92%           
=======================================
  Files          56       56           
  Lines        2896     2896           
=======================================
  Hits         2691     2691           
  Misses        205      205           
Components Coverage Δ
src 93.71% <100.00%> (ø)
ext 69.47% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant