Compare commits
No commits in common. "5a22a5fd371e3b627668b40d6a6125c9e9166bbe" and "bc9a2977a5c564db99824d5baefd0cb722d524b2" have entirely different histories.
5a22a5fd37
...
bc9a2977a5
1 changed files with 8 additions and 8 deletions
|
@ -19,21 +19,21 @@ def saturated_vapor_pressure(temp: float) -> float:
|
||||||
|
|
||||||
def mixing_ratio(dewpoint: float, pressure: float) -> float:
|
def mixing_ratio(dewpoint: float, pressure: float) -> float:
|
||||||
"""
|
"""
|
||||||
Return the amount, in kilograms, of water vapor versus dry air in a parcel
|
Return the amount, in grams, of water vapor versus dry air in a parcel of
|
||||||
of a given dewpoint and pressure.
|
a given dewpoint and pressure.
|
||||||
"""
|
"""
|
||||||
e = vapor_pressure(dewpoint)
|
e = vapor_pressure(dewpoint)
|
||||||
|
|
||||||
return (0.62197 * e) / (pressure - e)
|
return 621.97 * (e / (pressure - e))
|
||||||
|
|
||||||
def saturated_mixing_ratio(temp: float, pressure: float) -> float:
|
def saturated_mixing_ratio(temp: float, pressure: float) -> float:
|
||||||
"""
|
"""
|
||||||
Return the maximum amount, in kilograms, of water vapor a parcel of a
|
Return the maximum amount, in grams, of water vapor a parcel of a given
|
||||||
given temperature and pressure can hold.
|
temperature and pressure can hold.
|
||||||
"""
|
"""
|
||||||
es = saturated_vapor_pressure(temp)
|
es = saturated_vapor_pressure(temp)
|
||||||
|
|
||||||
return (0.62197 * es) / (pressure - es)
|
return 621.97 * (es / (pressure - es))
|
||||||
|
|
||||||
def lcl(temp: float, dewpoint: float) -> float:
|
def lcl(temp: float, dewpoint: float) -> float:
|
||||||
"""
|
"""
|
||||||
|
@ -59,11 +59,11 @@ def lapse(temp: float, delta: float, rate=LAPSE_RATE_DRY) -> float:
|
||||||
def moist_lapse_rate(temp: float, dewpoint: float, pressure: float) -> float:
|
def moist_lapse_rate(temp: float, dewpoint: float, pressure: float) -> float:
|
||||||
g = 9.8076
|
g = 9.8076
|
||||||
Hv = 2501000
|
Hv = 2501000
|
||||||
|
r = mixing_ratio(dewpoint, pressure)
|
||||||
Rsd = 287
|
Rsd = 287
|
||||||
Rsw = 461.5
|
Rsw = 461.5
|
||||||
Cpd = 1003.5
|
Cpd = 1003.5
|
||||||
r = saturated_mixing_ratio(dewpoint, pressure)
|
|
||||||
T = kelvin(temp)
|
T = kelvin(temp)
|
||||||
|
|
||||||
return g * (1 + (Hv * r) / (Rsd * T)) \
|
return g * (1 + (Hv * r) / (Rsd * T)) \
|
||||||
/ (Cpd + (((Hv**2) * r) / (Rsw * (T**2))))
|
/ (Cpd + ((Hv**2 * r) / (Rsw * T**2)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue