Repository navigation
feat(thermo): replace saturation vapour pressure with Ambaum (2020). - #51
Conversation
|
Marcos, when you got chance to work on this PR, can you rebase this to the newest beta? |
|
Yes, I rebased it, but I haven't pushed it yet because I found some inconsistency between some of the python and the fortran code. The python code (tower_conversions.py and priors.py) implicitly assumed liquid-only phase, but I don't think we want this. |
967dfd1 to
6e7fa35
Compare
Replaces Bolton (liquid) and Magnus (ice) with the closed form of the Clausius-Clapeyron equation for the model's Kirchhoff latent heat, so the slope is Clausius-Clapeyron by definition and both phases meet at es_3ple at t_3ple. The flux-tower tools mirror it, with 'ambaum' first in SATURATION_CURVES. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e new beta Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ib sat_phase The flux-tower tools' Python copy had only the liquid branch. It now has the ice branch (cp_ice, with the heat of fusion in L), the liquid-fraction blend and the slope, as the Fortran, and the liquid curve stays the default. calibrate_fast priors import it instead of keeping a second copy. Tests pin the Fortran values. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
6e7fa35 to
a460087
Compare
…e two "Answer changes" sections into a single one, and left it before the "Added" section because of the CONTRIBUTING guidelines.
…ers them Also drops the stray period after the (EDmodel#54) entry's pull request number. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@xiangtaoxu this one is ready for review, please let me know if anything needs changes. Thanks! |
xiangtaoxu
left a comment
There was a problem hiding this comment.
Hi, Marcos
Finally got time to go over the PR. Everything looks great.
I ran it for BCI and ET slightly decreased <0.1% because the Aubaum curve is below Bolton in warm temperature.
There could be some minor changes in doc, for example, the doc does not use letter equation number yet so for consistency, we should use (2) not (1b). But we will do an overhaul of science doc before stable release anyway, so I will not worry about it now.
|
I think the equation numbering was defined automatically by Claude, sorry that I overlooked it. |
What and why
This pull request is based on ED2 PR 445. The existing saturation vapour pressure function in ED-MORE used Bolton (1980) over liquid and a Magnus form over ice, blended by the liquid fraction. Both Bolton and Magnus are empirical, so d(e_sat)/dT was not the Clausius-Clapeyron slope of the latent heat of vaporisation the model uses (Kirchhoff, #49), so it is not fully consistent with the second law of thermodynamics.
This PR replaces the function with the formulation by Ambaum (2020). This uses a closed form of the Clausius-Clapeyron equation, built on the model's own
latent_heat_vap, for each phase. The slope ise L / (Rv T^2)by construction, and both phases equales_3ple(611.655 Pa, see Ambaum (2020), eq. 14) at the triple point. This ensures that the function is continuous in temperature and liquid fraction (the old curves differed by 0.06 Pa there). I did not propose this as an option because this formulation makesesconsistent with the rest of ED-MORE, and the model is sufficiently new so maybe back-compatibility is still not an issue. The liquid-fraction blend, the "nofliqmeans liquid" rule and every caller are unchanged. With the model's own heat capacities and latent heat it is within 0.24 % of Murphy and Koop (2005) over liquid from -30 to 40°C (0.5 % at -40°C) and within 0.01 % at -10°C over ice.The flux-tower tools mirror it:
tower_conversions.pyholds the Python copy, now with the ice branch, the liquid-fraction blend and slope, so it is equivalent tosat_phaseined_therm_lib.f90(liquid is still the default when no liquid fraction is given), andpriors.pyimports it instead of keeping a second copy.ambaumis added as the first ofSATURATION_CURVES, but theboltonoption is kept. Science pages, the output attribute text, unit tests (Clausius-Clapeyron againstlatent_heat_vap, equality att_3ple, Murphy and Koop values, and Python values pinned to the Fortran) and the changelog are updated.Refs #49. This pull request builds on #49 (latent heat of vaporisation as function of temperature), which is already merged.
Effect on results (tick exactly one; CI checks)
mean_le_pa(mean; largest daily change 0.09 W/m2)mean_h_pa(mean; largest 0.056 W/m2)User-facing changes (tick all that apply; each needs an "Upgrading" note in the changelog)
No config key, output variable or file format changes. The
forcing_qairglobal attribute ofED_ERA5landdiagnostic files now names Ambaum (2020) instead of Bolton (1980). In the flux-tower site TOML,variables.VPD.curvestill has to be declared;ambaumis now a valid value.Verification
are identical. Largest means: latent heat and evapotranspiration +0.22 % (the sublimation and ground-evaporation terms move with them),
snow water equivalent and depth −0.16 %, surface heat gain −0.20 %; energy and water residuals stay at round-off levels (at most 7e-11W/m2 and 2e-17 kg/m2/s). Everything else moves by 0.06 % or less.
long; expected for a science change): not runlibedmoreand runedmore.Credit and AI use
es_3pleagainst Ambaum (2020), and reviewed the results.Not in this PR
dayofyearbeing deprecated. This was fixed in a separate pull request (refactor(scripts): replace dayofyear with day_of_year (pandas) #52, merged).This message is based on draft generated with Claude Code.