Thermodynamics
Thermodynamics.Thermodynamics — Module
ThermodynamicsMoist thermodynamic functions for atmospheric modeling, including air pressure, latent heats, saturation vapor pressures, and saturation specific humidities.
Parameter Sets
Many functions defined in this module rely on ClimaParams.jl. ClimaParams.jl defines several functions (e.g., many planet parameters). For example, to compute the mole-mass ratio of dry air and water vapor:
import ClimaParams as CP
import Thermodynamics.Parameters as TP
FT = Float64
param_set = TP.ThermodynamicsParameters(FT)
_Rv_over_Rd = TP.Rv_over_Rd(param_set)Because these parameters are widely used throughout this module, param_set is an argument for many Thermodynamics functions.
Saturation adjustment
Saturation adjustment functions accept:
sat_adjust_method: numerical method type (from RootSolvers.jl)- A function returning the numerical method instance (e.g.,
sa_numerical_method_ρpqreturns an instance of the numerical method for theρ-p-q_totformulation)
Supported methods in RootSolvers.jl:
NewtonsMethod: Newton method with analytic gradientsNewtonsMethodAD: Newton method with autodiffSecantMethod: Secant methodRegulaFalsiMethod: Regula-Falsi method
Thermodynamics Parameters
Thermodynamics.Parameters.ThermodynamicsParameters — Type
ThermodynamicsParametersParameters for Thermodynamics.jl.
Example
import ClimaParams as CP
import Thermodynamics.Parameters as TP
FT = Float64;
param_set = TP.ThermodynamicsParameters(FT)
# Alternatively:
toml_dict = CP.create_toml_dict(FT)
param_set = TP.ThermodynamicsParameters(toml_dict)
Thermodynamic State Constructors
Thermodynamics.PhasePartition — Type
PhasePartitionRepresents the mass fractions of the moist air mixture (the partitioning of water substance between vapor, liquid, and ice phases).
The total specific humidity q_tot represents the total water content, while q_liq and q_ice represent the liquid and ice specific humidities, respectively. The vapor specific humidity is computed as q_vap = q_tot - q_liq - q_ice.
Constructors
PhasePartition(q_tot::Real[, q_liq::Real[, q_ice::Real]])
PhasePartition(param_set::APS, ts::ThermodynamicState)See also PhasePartition_equil
Fields
tot: total specific humidityliq: liquid water specific humidity (default:0)ice: ice specific humidity (default:0)
Thermodynamics.ThermodynamicState — Type
ThermodynamicState{FT}A thermodynamic state representing the complete thermodynamic properties of a moist air parcel. All ThermodynamicState subtypes provide access to functions to compute all other thermodynamic properties through the equation of state and thermodynamic relations.
The state can be initialized using various thermodynamic formulations (via its subtypes), each representing different assumptions about phase equilibrium and the specific variables used to define the state.
Thermodynamics.PhaseDry — Type
PhaseDry{FT} <: AbstractPhaseDryA dry thermodynamic state representing air with no water vapor (q_tot = 0). This state assumes the air parcel contains only dry air components.
Constructors
PhaseDry(param_set, e_int, ρ)Fields
e_int: internal energyρ: density of dry air
Thermodynamics.PhaseDry_ρe — Function
PhaseDry_ρe(param_set, ρ, e_int)Constructs a PhaseDry thermodynamic state from density and internal energy, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρair densitye_intspecific internal energy
This constructor directly stores the provided density and internal energy without any additional computations, assuming the air is completely dry.
Thermodynamics.PhaseDry_pT — Function
PhaseDry_pT(param_set, p, T)Constructs a PhaseDry thermodynamic state from pressure and temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressureTtemperature
The internal energy is computed from the temperature using the dry air equation of state, and the density is computed from the ideal gas law using the pressure and temperature.
Thermodynamics.PhaseDry_pθ — Function
PhaseDry_pθ(param_set, p, θ_dry)Constructs a PhaseDry thermodynamic state from pressure and dry potential temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressureθ_drydry potential temperature
The temperature is computed from the pressure and potential temperature using the Exner function, and the density is computed from the ideal gas law using the pressure and temperature.
Thermodynamics.PhaseDry_pe — Function
PhaseDry_pe(param_set, p, e_int)Constructs a PhaseDry thermodynamic state from pressure and internal energy, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressuree_intspecific internal energy
The temperature is computed from the internal energy using the dry air equation of state, and the density is computed from the ideal gas law using the pressure and temperature.
Thermodynamics.PhaseDry_ph — Function
PhaseDry_ph(param_set, p, h)Constructs a PhaseDry thermodynamic state from pressure and specific enthalpy, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressurehspecific enthalpy
The temperature is computed from the specific enthalpy using the dry air equation of state, and the density is computed from the ideal gas law using the pressure and temperature.
Thermodynamics.PhaseDry_ρθ — Function
PhaseDry_ρθ(param_set, ρ, θ_dry)Constructs a PhaseDry thermodynamic state from density and dry potential temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρdensityθ_drydry potential temperature
The temperature is computed from the density and potential temperature using the dry air equation of state, and the internal energy is computed from the temperature.
Thermodynamics.PhaseDry_ρT — Function
PhaseDry_ρT(param_set, ρ, T)Constructs a PhaseDry thermodynamic state from density and temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρdensityTtemperature
The internal energy is computed directly from the temperature using the dry air equation of state.
Thermodynamics.PhaseDry_ρp — Function
PhaseDry_ρp(param_set, ρ, p)Constructs a PhaseDry thermodynamic state from density and pressure, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρdensityppressure
The temperature is computed from the ideal gas law using the pressure and density, and the internal energy is computed from the temperature.
Thermodynamics.PhaseEquil — Type
PhaseEquil{FT} <: AbstractPhaseEquilA thermodynamic state assuming thermodynamic equilibrium between water phases. This state assumes that the water vapor is in equilibrium with liquid and/or ice, requiring saturation adjustment to compute the temperature and phase partitioning.
The state stores the density, pressure, internal energy, total specific humidity, and the computed temperature from saturation adjustment.
Constructors
PhaseEquil(param_set, ρ, e_int, q_tot)Fields
ρ: density of air (potentially moist)p: air pressuree_int: internal energyq_tot: total specific humidityT: temperature: computed viasaturation_adjustment
Thermodynamics.PhaseEquil_ρeq — Function
PhaseEquil_ρeq(param_set, ρ, e_int, q_tot[, maxiter, relative_temperature_tol, sat_adjust_method, T_guess])Constructs a PhaseEquil thermodynamic state from density, internal energy, and total specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρdensitye_intspecific internal energyq_tottotal specific humidity
and, optionally
maxitermaximum iterations for saturation adjustment (default: 8)relative_temperature_tolrelative temperature tolerance for saturation adjustment (default: 1e-4)sat_adjust_methodthe numerical method to use for saturation adjustment (default: NewtonsMethod) See theThermodynamicsfor options.T_guessinitial guess for temperature in saturation adjustment
The temperature is computed using saturation adjustment to ensure thermodynamic equilibrium, and the pressure is computed from the equation of state using the temperature and density.
Thermodynamics.PhaseEquil_ρTq — Function
PhaseEquil_ρTq(param_set, ρ, T, q_tot)Constructs a PhaseEquil thermodynamic state from density, temperature, and total specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρdensityTtemperatureq_tottotal specific humidity
The phase partitioning is computed assuming thermodynamic equilibrium at the given temperature, and the pressure and internal energy are computed from the equation of state.
Thermodynamics.PhaseEquil_pTq — Function
PhaseEquil_pTq(param_set, p, T, q_tot)Constructs a PhaseEquil thermodynamic state from pressure, temperature, and total specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressureTtemperatureq_tottotal specific humidity
The phase partitioning is computed assuming thermodynamic equilibrium at the given temperature, and the density and internal energy are computed from the equation of state.
Thermodynamics.PhaseEquil_pθq — Function
PhaseEquil_pθq(param_set, p, θ_liq_ice, q_tot[, maxiter, relative_temperature_tol, sat_adjust_method, T_guess])Constructs a PhaseEquil thermodynamic state from pressure, liquid-ice potential temperature, and total specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailspair pressureθ_liq_iceliquid-ice potential temperatureq_tottotal specific humidity
and, optionally
maxitermaximum iterations for saturation adjustment (default: 50)relative_temperature_tolrelative temperature tolerance for saturation adjustment (default: 1e-4)sat_adjust_methodthe numerical method to use for saturation adjustment (default: SecantMethod) See theThermodynamicsfor options.T_guessinitial guess for temperature in saturation adjustment
The temperature is computed using saturation adjustment with respect to the liquid-ice potential temperature, and the density and internal energy are computed from the equation of state.
Thermodynamics.PhaseEquil_peq — Function
PhaseEquil_peq(param_set, p, e_int, q_tot[, maxiter, relative_temperature_tol, sat_adjust_method, T_guess])Constructs a PhaseEquil thermodynamic state from pressure, internal energy, and total specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressuree_intspecific internal energyq_tottotal specific humidity
and, optionally
maxitermaximum iterations for saturation adjustment (default: 40)relative_temperature_tolrelative temperature tolerance for saturation adjustment (default: 1e-4)sat_adjust_methodthe numerical method to use for saturation adjustment (default: SecantMethod) See theThermodynamicsfor options.T_guessinitial guess for temperature in saturation adjustment
The temperature is computed using saturation adjustment given pressure and internal energy, and the density is computed from the equation of state using the pressure and temperature.
Thermodynamics.PhaseEquil_phq — Function
PhaseEquil_phq(param_set, p, h, q_tot[, maxiter, relative_temperature_tol, sat_adjust_method, T_guess])Constructs a PhaseEquil thermodynamic state from pressure, specific enthalpy, and total specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressurehspecific enthalpyq_tottotal specific humidity
and, optionally
maxitermaximum iterations for saturation adjustment (default: 40)relative_temperature_tolrelative temperature tolerance for saturation adjustment (default: 1e-4)sat_adjust_methodthe numerical method to use for saturation adjustment (default: SecantMethod) See theThermodynamicsfor options.T_guessinitial guess for temperature in saturation adjustment
The temperature is computed using saturation adjustment given pressure and specific enthalpy, and the density and internal energy are computed from the equation of state.
Thermodynamics.PhaseEquil_ρθq — Function
PhaseEquil_ρθq(param_set, ρ, θ_liq_ice, q_tot[, maxiter, relative_temperature_tol, T_guess])Constructs a PhaseEquil thermodynamic state from density, liquid-ice potential temperature, and total specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρ(moist-)air densityθ_liq_iceliquid-ice potential temperatureq_tottotal specific humidity
and, optionally
maxitermaximum iterations for saturation adjustment (default: 36)relative_temperature_tolrelative temperature tolerance for saturation adjustment (default: 1e-4)T_guessinitial guess for temperature in saturation adjustment
The temperature is computed using saturation adjustment with respect to the liquid-ice potential temperature, and the pressure and internal energy are computed from the equation of state.
Thermodynamics.PhaseEquil_ρpq — Function
PhaseEquil_ρpq(param_set, ρ, p, q_tot[, perform_sat_adjust=true, maxiter, sat_adjust_method, T_guess])Constructs a PhaseEquil thermodynamic state from density, pressure, and total specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρdensityppressureq_tottotal specific humidity
and, optionally
perform_sat_adjustBoolean indicating whether to perform saturation adjustment (default: false)maxitermaximum number of iterations to perform in saturation adjustment (default: 5)sat_adjust_methodthe numerical method to use for saturation adjustment (default: NewtonsMethodAD) See theThermodynamicsfor options.T_guessinitial guess for temperature in saturation adjustment
If perform_sat_adjust is true, the temperature is computed using saturation adjustment. Otherwise, the temperature is computed directly from the ideal gas law. The internal energy is computed from the temperature and phase partitioning.
TODO: change input argument order: performsatadjust is unique to this constructor, so it should be last. (breaking change)
Thermodynamics.PhaseNonEquil — Type
PhaseNonEquil{FT} <: ThermodynamicStateA thermodynamic state assuming thermodynamic non-equilibrium between water phases. This state allows for arbitrary phase partitioning without requiring saturation adjustment, enabling direct computation of temperature from the given thermodynamic variables.
The state stores the internal energy, density, and a complete phase partition specifying the distribution of water substance between vapor, liquid, and ice phases.
Constructors
PhaseNonEquil(param_set, e_int, q::PhasePartition, ρ)Fields
e_int: internal energyρ: density of air (potentially moist)q: phase partition
Thermodynamics.PhaseNonEquil_ρTq — Function
PhaseNonEquil_ρTq(param_set, ρ, T, q_pt)Constructs a PhaseNonEquil thermodynamic state from density, temperature, and phase partition, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρ(moist-)air densityTtemperatureq_ptphase partition
The internal energy is computed from the temperature and phase partition using the equation of state.
Thermodynamics.PhaseNonEquil_pTq — Function
PhaseNonEquil_pTq(param_set, p, T, q_pt)Constructs a PhaseNonEquil thermodynamic state from pressure, temperature, and phase partition, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressureTair temperatureq_ptphase partition
The density is computed from the ideal gas law using the pressure and temperature, and the internal energy is computed from the temperature and phase partition.
Thermodynamics.PhaseNonEquil_ρθq — Function
PhaseNonEquil_ρθq(param_set, ρ, θ_liq_ice, q_pt)Constructs a PhaseNonEquil thermodynamic state from density, liquid-ice potential temperature, and phase partition, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρ(moist-)air densityθ_liq_iceliquid-ice potential temperatureq_ptphase partition
and, optionally
maxitermaximum iterations for non-linear equation solve (default: 10)relative_temperature_tolrelative temperature tolerance for non-linear equation solve (default: 1e-2)
The temperature is computed from the density and liquid-ice potential temperature using a non-linear solver, and the internal energy is computed from the temperature and phase partition.
Thermodynamics.PhaseNonEquil_pθq — Function
PhaseNonEquil_pθq(param_set, p, θ_liq_ice, q_pt)Constructs a PhaseNonEquil thermodynamic state from pressure, liquid-ice potential temperature, and phase partition, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressureθ_liq_iceliquid-ice potential temperatureq_ptphase partition
The temperature is computed from the pressure and liquid-ice potential temperature, and the density and internal energy are computed from the equation of state.
Thermodynamics.PhaseNonEquil_peq — Function
PhaseNonEquil_peq(param_set, p, e_int, q_pt)Constructs a PhaseNonEquil thermodynamic state from pressure, internal energy, and phase partition, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressuree_intspecific internal energyq_ptphase partition
The temperature is computed from the internal energy and phase partition using the equation of state, and the density is computed from the ideal gas law using the pressure and temperature.
Thermodynamics.PhaseNonEquil_phq — Function
PhaseNonEquil_phq(param_set, p, h, q_pt)Constructs a PhaseNonEquil thermodynamic state from pressure, specific enthalpy, and phase partition, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressurehspecific enthalpyq_ptphase partition
The temperature is computed from the specific enthalpy and phase partition using the equation of state, and the density and internal energy are computed from the equation of state.
Thermodynamics.PhaseNonEquil_ρpq — Function
PhaseNonEquil_ρpq(param_set, ρ, p, q_pt)Constructs a PhaseNonEquil thermodynamic state from density, pressure, and phase partition, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρdensityppressureq_ptphase partition
The temperature is computed from the ideal gas law using the pressure and density, and the internal energy is computed from the temperature and phase partition.
Types
Thermodynamics.Ice — Type
Ice <: PhaseAn ice phase, to dispatch over saturation_vapor_pressure and q_vap_saturation_generic.
Thermodynamics.Liquid — Type
Liquid <: PhaseA liquid phase, to dispatch over saturation_vapor_pressure and q_vap_saturation_generic.
Thermodynamic Functions
Thermodynamics.air_density — Function
air_density(param_set, T, p[, q::PhasePartition])The (moist-)air density from the equation of state (ideal gas law), given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTair temperatureppressure
and, optionally,
When q is not provided, the results are for dry air.
air_density(param_set, ts::ThermodynamicState)The (moist-)air density, given a thermodynamic state ts.
Thermodynamics.air_pressure — Function
air_pressure(param_set, T, ρ[, q::PhasePartition])The air pressure from the equation of state (ideal gas law), given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTair temperatureρ(moist-)air density
and, optionally,
When q is not provided, the results are for dry air.
air_pressure(param_set, T, T∞, p∞, ::DryAdiabaticProcess)The air pressure for an isentropic process, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTcurrent temperatureT∞reference temperaturep∞reference pressure
The pressure is computed using the isentropic relation: p = p∞ * (T/T∞)^(1/κ), where κ = R/cₚ is the ratio of the gas constant to the isobaric specific heat capacity of dry air.
air_pressure(param_set, ts::ThermodynamicState)The air pressure from the equation of state (ideal gas law), given a thermodynamic state ts.
Thermodynamics.air_temperature — Function
air_temperature(param_set, e_int[, q::PhasePartition])The air temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailse_intspecific internal energy of moist air
and, optionally,
When q is not provided, the results are for dry air.
air_temperature(param_set, p, θ, ::DryAdiabaticProcess)The air temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressureθpotential temperature
The temperature is computed using the definition of the dry potential temperature: T = θ * (p/p₀)^(R/cₚ), where p₀ is the reference pressure, R is the gas constant of dry air, and cₚ is the isobaric specific heat capacity of dry air.
air_temperature(param_set, ts::ThermodynamicState)The air temperature, given a thermodynamic state ts.
Thermodynamics.air_pressure_given_θ — Function
air_pressure_given_θ(param_set, θ, Φ, ::DryAdiabaticProcess)The air pressure for an isentropic process, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsθpotential temperatureΦgravitational potential
The pressure is computed using the hydrostatic balance and the definition of potential temperature for an isentropic process: p = p₀ * (1 - Φ/(θ * cₚ))^(cₚ/R), where p₀ is the reference pressure, cₚ is the isobaric specific heat capacity of dry air, and R is the gas constant of dry air.
Thermodynamics.air_temperature_given_ρp — Function
air_temperature_given_ρp(param_set, p, ρ[, q::PhasePartition])The air temperature, where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailspair pressureρair density
and, optionally,
When q is not provided, the results are for dry air.
Thermodynamics.condensate_specific_humidity — Function
condensate_specific_humidity(q::PhasePartition{FT})The condensate specific humidity (liquid + ice) of the phase partition q.
condensate_specific_humidity(param_set, ts::ThermodynamicState)The condensate specific humidity (liquid + ice) given a thermodynamic state ts.
Thermodynamics.cp_m — Function
cp_m(param_set, q_tot, q_liq, q_ice)The isobaric specific heat capacity of moist air, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsq_tottotal specific humidity of waterq_liqspecific humidity of liquidq_icespecific humidity of ice
cp_m(param_set[, q::PhasePartition])The isobaric specific heat capacity of moist air given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsqPhasePartition.
When q is not provided, the results are for dry air.
cp_m(param_set, ts::ThermodynamicState)The isobaric specific heat capacity of moist air, given a thermodynamic state ts.
Thermodynamics.cv_m — Function
cv_m(param_set[, q::PhasePartition])The isochoric specific heat capacity of moist air, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsqPhasePartition. Without humidity argument, the results are for dry air.
cv_m(param_set, ts::ThermodynamicState)The isochoric specific heat capacity of moist air, given a thermodynamic state ts.
Thermodynamics.dry_pottemp — Function
dry_pottemp(param_set, T, ρ[, q::PhasePartition])The dry potential temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air density
and, optionally,
When q is not provided, the results are for dry air.
dry_pottemp(param_set, ts::ThermodynamicState)The dry potential temperature, given a thermodynamic state ts.
Thermodynamics.exner — Function
exner(param_set, T, ρ[, q::PhasePartition)])The Exner function, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air density
and, optionally,
When q is not provided, the results are for dry air.
exner(param_set, ts::ThermodynamicState)The Exner function, given a thermodynamic state ts.
Thermodynamics.gas_constant_air — Function
gas_constant_air(param_set, q_tot, q_liq, q_ice)The specific gas constant of moist air, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsq_tot,q_liq,q_ice- specific humidities for total water, liquid water, and ice
gas_constant_air(param_set[, q::PhasePartition])The specific gas constant of moist air, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsqPhasePartition.
When q is not provided, the results are for dry air.
gas_constant_air(param_set, ts::ThermodynamicState)The specific gas constant of moist air given a thermodynamic state ts.
Thermodynamics.gas_constants — Function
(R_m, cp_m, cv_m, γ_m) = gas_constants(param_set, q::PhasePartition)Wrapper to compute the gas constant, specific heat capacities, and their ratio at once, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsqPhasePartition
The function returns a tuple of
R_mgas_constant_aircp_mcp_mcv_mcv_mγ_m = cp_m/cv_m
This function is deprecated and will be removed in a future release.
(R_m, cp_m, cv_m, γ_m) = gas_constants(param_set, ts::ThermodynamicState)Wrapper to compute the gas constant, specific heat capacities, and their ratio at once, given a thermodynamic state ts.
Thermodynamics.has_condensate — Function
has_condensate(q::PhasePartition{FT})Bool indicating if condensate exists in the phase partition
has_condensate(param_set, ts::ThermodynamicState)Bool indicating if condensate exists given a thermodynamic state ts.
Thermodynamics.ice_specific_humidity — Function
ice_specific_humidity(q::PhasePartition)The ice specific humidity, given
qaPhasePartition
ice_specific_humidity(param_set, ts::ThermodynamicState)The ice specific humidity, given a thermodynamic state ts.
Thermodynamics.internal_energy — Function
internal_energy(param_set, T[, q::PhasePartition])The internal energy per unit mass, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
and, optionally,
When q is not provided, the results are for dry air.
internal_energy(param_set, ts::ThermodynamicState)The internal energy per unit mass, given a thermodynamic state ts.
Thermodynamics.internal_energy_dry — Function
internal_energy_dry(param_set, T)The dry air internal energy, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
internal_energy_dry(param_set, ts::ThermodynamicState)The dry air internal energy, given a thermodynamic state ts.
Thermodynamics.internal_energy_vapor — Function
internal_energy_vapor(param_set, T)The water vapor internal energy, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
internal_energy_vapor(param_set, ts::ThermodynamicState)The water vapor internal energy, given a thermodynamic state ts.
Thermodynamics.internal_energy_liquid — Function
internal_energy_liquid(param_set, T)The liquid water internal energy, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
internal_energy_liquid(param_set, ts::ThermodynamicState)The liquid water internal energy, given a thermodynamic state ts.
Thermodynamics.internal_energy_ice — Function
internal_energy_ice(param_set, T)The ice internal energy, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
internal_energy_ice(param_set, ts::ThermodynamicState)The ice internal energy, given a thermodynamic state ts.
Thermodynamics.internal_energy_sat — Function
internal_energy_sat(param_set, T, ρ, q_tot, phase_type)The internal energy per unit mass in thermodynamic equilibrium at saturation with a fixed temperature and total specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityq_tottotal specific humidityphase_typea thermodynamic state type
internal_energy_sat(param_set, ts::ThermodynamicState)The internal energy per unit mass in thermodynamic equilibrium at saturation with a fixed temperature and total specific humidity, given a thermodynamic state ts.
Thermodynamics.latent_heat_fusion — Function
latent_heat_fusion(param_set, T)The specific latent heat of fusion, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
latent_heat_fusion(param_set, ts::ThermodynamicState)The specific latent heat of fusion, given a thermodynamic state ts.
Thermodynamics.latent_heat_liq_ice — Function
latent_heat_liq_ice(param_set[, q::PhasePartition])Specific-humidity weighted sum of latent heats of liquid and ice evaluated at reference temperature T_0, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsqPhasePartition.
When q is not provided, latent_heat_liq_ice is zero.
This is used in the evaluation of the liquid-ice potential temperature.
latent_heat_liq_ice(param_set::APS, ts::ThermodynamicState)Specific-humidity weighted sum of latent heats of liquid and ice evaluated at reference temperature T_0, given a thermodynamic state ts.
Thermodynamics.latent_heat_sublim — Function
latent_heat_sublim(param_set, T)The specific latent heat of sublimation, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
latent_heat_sublim(param_set, ts::ThermodynamicState)The specific latent heat of sublimation, given a thermodynamic state ts.
Thermodynamics.latent_heat_vapor — Function
latent_heat_vapor(param_set, T)The specific latent heat of vaporization, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
latent_heat_vapor(param_set, ts::ThermodynamicState)The specific latent heat of vaporization, given a thermodynamic state ts.
Thermodynamics.liquid_fraction — Function
liquid_fraction(param_set, T, phase_type[, q::PhasePartition])The fraction of condensate that is liquid, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperaturephase_typea thermodynamic state type
PhaseNonEquil behavior
If q.liq or q.ice are nonzero, the liquid fraction is computed from them.
PhaseEquil, PhaseDry behavior
Otherwise, the liquid fraction goes from 0 below T_icenuc to 1 above T_freeze, with a power law interpolation between the two temperatures based on Kaul et al., Monthly Weather Rev., 2015, https://doi.org/10.1029/2009JD012384
liquid_fraction(param_set, ts::ThermodynamicState)The fraction of condensate that is liquid, given a thermodynamic state ts.
Thermodynamics.liquid_ice_pottemp — Function
liquid_ice_pottemp(param_set, T, ρ[, q::PhasePartition])The liquid-ice potential temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air density
and, optionally,
When q is not provided, the result is the dry-air potential temperature.
liquid_ice_pottemp(param_set, ts::ThermodynamicState)The liquid-ice potential temperature, given a thermodynamic state ts.
Thermodynamics.liquid_ice_pottemp_sat — Function
liquid_ice_pottemp_sat(param_set, T, ρ, phase_type[, q::PhasePartition, cpm])The saturated liquid ice potential temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityphase_typea thermodynamic state type
and, optionally,
When q is not provided, the air assumed to be dry.
liquid_ice_pottemp_sat(param_set, T, ρ, phase_type, q_tot)The saturated liquid ice potential temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityphase_typea thermodynamic state typeq_tottotal specific humidity
liquid_ice_pottemp_sat(param_set, ts::ThermodynamicState)The liquid potential temperature, given a thermodynamic state ts.
Thermodynamics.liquid_specific_humidity — Function
liquid_specific_humidity(q::PhasePartition)The liquid specific humidity, given
qaPhasePartition
liquid_specific_humidity(param_set, ts::ThermodynamicState)The liquid specific humidity, given a thermodynamic state ts.
Thermodynamics.mixing_ratios — Function
mixing_ratios(q::PhasePartition)The mixing ratios, given a specific humidity phase partition, q, returned in a PhasePartition with the fields
r.tottotal mixing ratior.liqliquid mixing ratior.iceice mixing ratio
mixing_ratios(param_set, ts::ThermodynamicState)The mixing ratios, stored in a PhasePartition, given a thermodynamic state ts.
Thermodynamics.moist_static_energy — Function
moist_static_energy(param_set, ts, e_pot)The moist static energy, given a thermodynamic state ts.
Thermodynamics.dry_static_energy — Function
dry_static_energy(param_set, T, e_pot)The dry static energy, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperaturee_potgravitational potential energy per unit mass (geopotential)
Thermodynamics.vapor_static_energy — Function
vapor_static_energy(param_set, T, e_pot)The dry static energy of water vapor, cp_v * (T - T_0) + e_pot, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperaturee_potgravitational potential energy per unit mass (geopotential)
Thermodynamics.virtual_dry_static_energy — Function
virtual_dry_static_energy(param_set, ts, e_pot)The virtual dry static energy, given a thermodynamic state ts.
Thermodynamics.q_vap_from_RH_liquid — Function
q_vap_from_RH_liquid(param_set, p, T, RH)The water vapor specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressureTtemperatureRHrelative humidity with respect to liquid water
Thermodynamics.q_vap_saturation — Function
q_vap_saturation(param_set, T, ρ, phase_type[, q::PhasePartition])The saturation specific humidity, given
param_set: anAbstractParameterSet, see theThermodynamicsfor more detailsT: temperatureρ: air densityphase_type: a thermodynamic state type- (optional)
q:PhasePartition
If the PhasePartition q is given, the saturation specific humidity is that over a mixture of liquid and ice, computed in a thermodynamically consistent way from the weighted sum of the latent heats of the respective phase transitions (Pressel et al., JAMES, 2015). That is, the saturation vapor pressure and from it the saturation specific humidity are computed from a weighted mean of the latent heats of vaporization and sublimation, with the weights given by the liquid fraction.
If the PhasePartition q is not given, or has zero liquid and ice specific humidities, the saturation specific humidity is that over a mixture of liquid and ice, with the fraction of liquid given by the temperature dependent liquid_fraction(param_set, T, phase_type) and the fraction of ice by the complement 1 - liquid_fraction(param_set, T, phase_type).
q_vap_saturation(param_set, ts::ThermodynamicState)The saturation specific humidity, given a thermodynamic state ts.
Thermodynamics.q_vap_saturation_liquid — Function
q_vap_saturation_liquid(param_set, ts::ThermodynamicState)The saturation specific humidity over liquid, given a thermodynamic state ts.
Thermodynamics.q_vap_saturation_ice — Function
q_vap_saturation_ice(param_set, ts::ThermodynamicState)The saturation specific humidity over ice, given a thermodynamic state ts.
Thermodynamics.q_vap_from_p_vap — Function
q_vap_from_p_vap(param_set, T, ρ, p_v)The vapor specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature,ρ(moist-)air densityp_vpartial pressure of vapor
Thermodynamics.partial_pressure_vapor — Function
partial_pressure_vapor(param_set, p[, q::PhasePartition])The partial pressure of water vapor, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailspair pressureqphase partition
When q is not provided, the partial pressure is zero.
partial_pressure_vapor(param_set, ts::ThermodynamicState)The partial pressure of water vapor, given a thermodynamic state ts.
Thermodynamics.partial_pressure_dry — Function
partial_pressure_dry(param_set, p[, q::PhasePartition])The partial pressure of dry air, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailspair pressureqphase partition
When q is not provided, the partial pressure is the total pressure.
partial_pressure_dry(param_set, ts::ThermodynamicState)The partial pressure of dry air, given a thermodynamic state ts.
Thermodynamics.relative_humidity — Function
relative_humidity(param_set, T, p, phase_type[, q::PhasePartition])The relative humidity (clipped between 0 and 1), given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureppressurephase_typea thermodynamic state type
and, optionally,
When q is not provided, the relative humidity is 0.
relative_humidity(param_set, ts::ThermodynamicState)The relative humidity, given a thermodynamic state ts.
Thermodynamics.saturated — Function
saturated(param_set::APS, ts::ThermodynamicState)Boolean indicating if thermodynamic state is saturated.
Thermodynamics.saturation_adjustment — Function
saturation_adjustment(
sat_adjust_method,
param_set,
e_int,
ρ,
q_tot,
phase_type,
maxiter,
relative_temperature_tol,
T_guess,
)Computes the saturation equilibrium temperature given internal energy e_int, density ρ, and total specific humidity q_tot.
This function finds the temperature T that satisfies the root equation: e_int - internal_energy_sat(T, ρ, q_tot) = 0. It is the most common entry point for saturation adjustment.
Arguments
sat_adjust_method: The numerical method for root-finding (e.g.,NewtonsMethod,SecantMethod).param_set: AnAbstractParameterSetcontaining thermodynamic parameters.e_int: Specific internal energy.ρ: Density of moist air.q_tot: Total specific humidity (vapor + condensate).phase_type: A thermodynamic phase type (PhaseEquil, etc.).maxiter: Maximum iterations for the solver.relative_temperature_tol: Relative tolerance for the temperature solution.T_guess: An initial guess for the temperature.
Thermodynamics.saturation_excess — Function
saturation_excess(param_set, T, ρ, phase_type, q::PhasePartition)The saturation excess in equilibrium, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityphase_typea thermodynamic state typeqPhasePartition
The saturation excess is the difference between the total specific humidity q.tot and the saturation specific humidity in equilibrium, and it is defined to be nonzero only if this difference is positive.
saturation_excess(param_set, T, ρ, p_vap_sat, q::PhasePartition)The saturation excess given the saturation vapor pressure p_vap_sat:
param_set: Thermodynamic parameter setT: Temperatureρ: Air densityp_vap_sat: Saturation vapor pressureq: Phase partition
The saturation excess is the difference between the total specific humidity q.tot and the saturation specific humidity, and it is defined to be nonzero only if this difference is positive.
saturation_excess(param_set, ts::ThermodynamicState)The saturation excess in equilibrium, given a thermodynamic state ts.
Thermodynamics.saturation_vapor_pressure — Function
saturation_vapor_pressure(param_set, T, ::Phase)
saturation_vapor_pressure(param_set, T, LH_0, Δcp)The saturation vapor pressure over a plane surface of condensate, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature ortsa thermodynamic statePhaseeitherLiquid()orIce()to dispatch over the condensate type
or, given
param_setanAbstractParameterSetTtemperatureLH_0latent heat at reference temperatureT_0Δcpdifference in isobaric specific heat capacity between the two phases
The saturation vapor pressure is computed by integration of the Clausius-Clapeyron relation, assuming constant specific heat capacities. The closed-form solution is: p_v^*(T) = p_tr * (T/T_tr)^(Δc_p/R_v) * exp((L_0 - Δc_p*T_0)/R_v * (1/T_tr - 1/T)), where p_tr is the triple point pressure, T_tr is the triple point temperature, L_0 is the latent heat at the reference temperature T_0, and Δc_p is the difference in isobaric specific heat capacities between the phases.
saturation_vapor_pressure(param_set, ts::ThermodynamicState, ::Liquid)The saturation vapor pressure over a plane surface of condensate, given a thermodynamic state ts and phase Liquid.
saturation_vapor_pressure(param_set, ts::ThermodynamicState, ::Ice)The saturation vapor pressure over a plane surface of condensate, given a thermodynamic state ts and phase Ice.
Thermodynamics.soundspeed_air — Function
soundspeed_air(param_set, T[, q::PhasePartition])The speed of sound in unstratified air, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
and, optionally,
When q is not provided, the results are for dry air.
soundspeed_air(param_set, ts::ThermodynamicState)The speed of sound in unstratified air, given a thermodynamic state ts.
Thermodynamics.specific_enthalpy — Function
specific_enthalpy(e_int, R_m, T)The specific enthalpy, given
e_intinternal specific energyR_mgas_constant_airTair temperature
This method is deprecated and will be removed in a future release.
specific_enthalpy(param_set, T[, q::PhasePartition])The specific enthalpy, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
and, optionally,
When q is not provided, the results are for dry air.
specific_enthalpy(param_set, ts)The specific enthalpy, given a thermodynamic state ts.
Thermodynamics.specific_enthalpy_dry — Function
specific_enthalpy_dry(param_set, T)The specific enthalpy of dry air, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
Thermodynamics.specific_enthalpy_vapor — Function
specific_enthalpy_vapor(param_set, T)The specific enthalpy of vapor, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
Thermodynamics.specific_enthalpy_liquid — Function
specific_enthalpy_liquid(param_set, T)The specific enthalpy of liquid, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
Thermodynamics.specific_enthalpy_ice — Function
specific_enthalpy_ice(param_set, T)The specific enthalpy of ice, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
Thermodynamics.specific_volume — Function
specific_volume(param_set, ts::ThermodynamicState)The (moist-)air specific volume, given a thermodynamic state ts.
Thermodynamics.supersaturation — Function
supersaturation(param_set, q, ρ, T, Liquid())
supersaturation(param_set, q, ρ, T, Ice())The supersaturation (pv/pv_sat -1) over water or ice, given
param_set- abstract set with earth parametersq- phase partitionρ- air density,T- air temperatureLiquid(),Ice()- liquid or ice phase to dispatch over.
supersaturation(param_set, q::PhasePartition, ρ, T, p_v_sat)The supersaturation (pv/pvsat - 1) given the saturation vapor pressure `pv_sat`:
param_set: Thermodynamic parameter setq: Phase partitionρ: Air densityT: Temperaturep_v_sat: Saturation vapor pressure
supersaturation(param_set::APS, ts::ThermodynamicState, phase::Phase)The supersaturation (pv/pv_sat -1) over water or ice, given a thermodynamic state ts.
Thermodynamics.total_energy — Function
total_energy(param_set, e_kin, e_pot, T[, q::PhasePartition])The total energy per unit mass, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailse_kinkinetic energy per unit masse_potgravitational potential energy per unit massTtemperature
and, optionally,
When q is not provided, the results are for dry air.
total_energy(param_set, ts::ThermodynamicState, e_kin, e_pot)The total energy per unit mass, given a thermodynamic state ts.
Thermodynamics.total_specific_enthalpy — Function
total_specific_enthalpy(param_set, e_tot, T[, q::PhasePartition])The total specific enthalpy, defined as e_tot + R_m * T, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailse_tottotal specific energyTtemperature
and, optionally,
When q is not provided, the results are for dry air.
total_specific_enthalpy(e_tot, R_m, T)The total specific enthalpy, given
e_tottotal specific energyR_mgas_constant_airTair temperature
total_specific_enthalpy(param_set, ts, e_tot::Real)The total specific enthalpy, given a thermodynamic state ts.
Thermodynamics.total_specific_humidity — Function
total_specific_humidity(param_set, ts::ThermodynamicState)The total specific humidity, given a thermodynamic state ts.
Thermodynamics.vapor_pressure_deficit — Function
vapor_pressure_deficit(param_set, T, p[, q::PhasePartition])The vapor pressure deficit (saturation vapor pressure minus actual vapor pressure, truncated to be non-negative) over liquid water for temperatures above freezing and over ice for temperatures below freezing, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTair temperaturepair pressureqPhasePartition
When q is not provided, the vapor pressure deficit is the saturation vapor pressure.
vapor_pressure_deficit(param_set, T, p, q_vap)The vapor pressure deficit over liquid water (saturation vapor pressure minus actual vapor pressure, truncated to be non-negative), given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTair temperaturepair pressureq_vapvapor specific humidity
Thermodynamics.vapor_specific_humidity — Function
vapor_specific_humidity(q::PhasePartition)The vapor specific humidity, given a
qaPhasePartition
vapor_specific_humidity(param_set, ts::ThermodynamicState)The vapor specific humidity, given a thermodynamic state ts.
Thermodynamics.vol_vapor_mixing_ratio — Function
vol_vapor_mixing_ratio(param_set, q::PhasePartition)The volume mixing ratio of water vapor, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsqPhasePartition
vol_vapor_mixing_ratio(param_set, ts::ThermodynamicState)The volume mixing ratio of water vapor, given a thermodynamic state ts.
Thermodynamics.virtual_pottemp — Function
virtual_pottemp(param_set, T, ρ[, q::PhasePartition])The virtual potential temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air density
and, optionally,
When q is not provided, the result is the dry-air potential temperature.
The virtual potential temperature is defined as θ_v = (R_m/R_d) * θ, where θ is the potential temperature. It is the potential temperature a dry air parcel would need to have to have the same density as the moist air parcel at the same pressure.
virtual_pottemp(param_set, ts::ThermodynamicState)The virtual potential temperature, given a thermodynamic state ts.
Thermodynamics.virtual_temperature — Function
virtual_temperature(param_set, T[, q::PhasePartition])The virtual temperature, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
and, optionally,
When q is not provided, the result is the regular temperature.
The virtual temperature is defined as T_v = (R_m/R_d) * T. It is the temperature a dry air parcel would need to have to have the same density as the moist air parcel at the same pressure.
virtual_temperature(param_set, ts::ThermodynamicState)The virtual temperature, given a thermodynamic state ts.
Thermodynamics.specific_entropy — Function
specific_entropy(param_set, p, T, q)
specific_entropy(param_set, ts)The specific entropy, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressureTtemperatureqphase partition
The specific entropy is computed from equations (29)-(33) of [8].
specific_entropy(param_set, ts)The specific entropy, given a thermodynamic state ts.
Internal Methods
Thermodynamics.shum_to_mixing_ratio — Function
shum_to_mixing_ratio(q, q_tot)The mixing ratio, given
qspecific humidityq_tottotal specific humidity
Thermodynamics.q_vap_saturation_generic — Function
q_vap_saturation_generic(param_set, T, ρ[, phase=Liquid()])The saturation specific humidity over a plane surface of condensate, given - param_set: an AbstractParameterSet, see the Thermodynamics for more details - T: temperature - ρ: air density - (optional) Liquid(): indicating condensate is liquid (default) - (optional) Ice(): indicating condensate is ice
The saturation specific humidity is computed as q_v^* = p_v^*(T) / (ρ * R_v * T), where p_v^* is the saturation vapor pressure.
Thermodynamics.q_vap_saturation_from_pressure — Function
q_vap_saturation_from_pressure(param_set, q_tot, p, T, phase_type)The saturation specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsq_tottotal water specific humidity,pair pressure,Tair tempearturephase_typea thermodynamic state type
Thermodynamics.PhasePartition_equil — Function
PhasePartition_equil(param_set, T, ρ, q_tot, phase_type)
PhasePartition_equil(param_set, T, ρ, q_tot, p_vap_sat, λ)Partition the phases in equilibrium, returning a PhasePartition object, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityq_tottotal specific humidityphase_typea thermodynamic state typep_vap_satsaturation vapor pressureλliquid fraction
The residual q.tot - q.liq - q.ice is the vapor specific humidity.
PhasePartition_equil(param_set, ts::ThermodynamicState)Partition the phases in equilibrium, returning a PhasePartition object, given a thermodynamic state ts.
Thermodynamics.PhasePartition_equil_given_p — Function
PhasePartition_equil_given_p(param_set, T, p, q_tot, phase_type)Partition the phases in equilibrium, returning a PhasePartition object using the liquid_fraction function, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperaturepair pressureq_tottotal specific humidityphase_typea thermodynamic state type
The residual q.tot - q.liq - q.ice is the vapor specific humidity.
Dispatch Types
Thermodynamics.DryAdiabaticProcess — Type
DryAdiabaticProcessA type for dispatching to isentropic (dry adiabatic) formulas.
Temperature Profiles
Thermodynamics.TemperatureProfiles.IsothermalProfile — Function
IsothermalProfile(param_set, T_virt)
IsothermalProfile(param_set, ::Type{FT<:Real})Uniform virtual temperature profile implemented as a special case of DecayingTemperatureProfile.
Thermodynamics.TemperatureProfiles.TemperatureProfile — Type
TemperatureProfileAbstract type for temperature or virtual temperature reference profiles that can be used in atmosphere models.
Instances of this type are required to be callable objects with the following signature
T,p = (::TemperatureProfile)(param_set::APS, z::FT) where {FT}where T is the temperature or virtual temperature (K), and p is the pressure (Pa).
Thermodynamics.TemperatureProfiles.DryAdiabaticProfile — Type
DryAdiabaticProfile{FT} <: TemperatureProfile{FT}Temperature profile with uniform dry potential temperature θ up to the height where a minimum temperature is reached.
Fields
T_surface: Surface temperature (K)T_min_ref: Minimum temperature (K)
Thermodynamics.TemperatureProfiles.DecayingTemperatureProfile — Type
DecayingTemperatureProfile{FT} <: TemperatureProfile{FT}Virtual temperature profile that decays smoothly with height z from T_virt_surf to T_min_ref over height scale H_t (default: density scale height with T_virt_surf).
\[T_{\text{v}}(z) = \max(T_{\text{v, sfc}} − (T_{\text{v, sfc}} - T_{\text{v, min}}) \tanh(z/H_{\text{t}})\]
Fields
T_virt_surf: Virtual temperature at surface (K)T_min_ref: Minimum virtual temperature at the top of the atmosphere (K)H_t: Height scale over which virtual temperature drops (m)
Tested Profiles
Thermodynamics.TestedProfiles — Module
TestedProfilesThis module contains functions to compute all of the thermodynamic states that Thermodynamics is tested with in runtests.jl
Data Collection
Thermodynamics.DataCollection — Module
DataCollectionThis module is designed to help judge the accuracy and performance for a particular formulation, tolerance, and or solver configuration, by providing tools to collect various statistics when Thermodynamic saturation_adjustment is called.
Example:
import Thermodynamics as TD
import RootSolvers as RS
function do_work()
# Calls TD.PhaseEquil_ρeq()..., possibly many times
end
TD.solution_type() = RS.VerboseSolution()
do_work()
TD.DataCollection.print_summary()