icon_sc.icon.thermo — thermodynamic relations¶
ICON thermodynamic relations, exactly as ICON defines them (S06).
Formulas are transcribed from the pinned references (REFERENCES.lock, S06):
diag_tempin ICONsrc/atm_dyn_iconam/mo_nh_diagnose_pres_temp.f90(equals icon4py v0.2.0diagnose_temperature.py):tempv = theta_v * exner,temp = tempv / (1 + vtmpc1*qv - qsum);pressure (cpd) Exner path:
exner = (p/p0ref)**rd_o_cpd(mo_nh_vert_extrap_utils.f90), inversep = p0ref * exner**(cpd/rd);density (cvd) Exner path:
exner = EXP(rd_o_cvd*LOG(rd_o_p0ref*rho*theta_v))(mo_nh_nest_utilities.f90) — ICON’s isochoric coupling uses cvd downstream, so both paths exist here from the start and are named unambiguously (PLAN pitfall).
All functions are array-namespace generic (PEP 3118/array-API duck typing via
array_api_compat): numpy in → numpy out, cupy in → cupy out, and — unchanged — JAX
in S10 (the start of the functional cores). Nothing here allocates other than the
result; no field/DataArray types appear at this layer.
- icon_sc.icon.thermo.exner_from_pressure(pressure)¶
Exner function from pressure — the pressure (cpd) path.
exner = (p / p0ref)**(rd/cpd)(ICONmo_nh_vert_extrap_utils.f90).
- icon_sc.icon.thermo.exner_from_rho_thetav(rho, theta_v)¶
Exner function from density and θv — the density (cvd) path.
exner = EXP(rd/cvd * LOG(rd/p0ref * rho * theta_v))operation-for-operation as ICON writes it (mo_nh_nest_utilities.f90:1657); the dycore/physics isochoric coupling is cvd-based, distinct from the cpd exponent of the pressure path.
- icon_sc.icon.thermo.pressure_from_exner(exner)¶
Pressure from the Exner function — inverse of the pressure (cpd) path.
p = p0ref * exner**(cpd/rd)(plain form:mo_nh_vert_extrap_utils.f90:754; the fusedEXP(cpd_o_rd*LOG(exner)+...)surface-pressure variant lives inmo_nh_diagnose_pres_temp.f90).
- icon_sc.icon.thermo.temperature_from_thetav_exner(theta_v, exner, qv, q_condensate=0.0)¶
Temperature from θv, Exner function and moisture — ICON
diag_tempverbatim.tempv = theta_v * exner;temp = tempv / (1 + vtmpc1*qv - qsum).
- icon_sc.icon.thermo.virtual_potential_temperature(temperature, exner, qv, q_condensate=0.0)¶
θv from temperature, Exner function and moisture (inverse of
diag_temp).theta_v = temp * (1 + vtmpc1*qv - qsum) / exner.
- icon_sc.icon.thermo.virtual_temperature(temperature, qv, q_condensate=0.0)¶
Virtual temperature with moisture and condensate loading.
tempv = temp * (1 + vtmpc1*qv - qsum)whereqsumis the total mass fraction of prognostic condensate (qc+qi+qr+qs+qgin ICONdiag_temp, inverted; here a single pre-summedq_condensateargument).