Thermodynamic constants and functions
by T Horinouchi
RGas constant of dry air [J.kg-1.K-1] (287.04)
RvGas constant of water vapor [J.kg-1.K-1] (461.50)
Cpheat capacity at constant pressure for dry air [J.kg-1.K-1] (1004.6)
Cpvheat capacity at constant pressure for water vapor [J.kg-1.K-1] (1870.0)
KappaR/Cp
T0K - Celcius (273.15)
Lat0Latent heat of vaporization at 0 degC [J.kg-1] (2.500780e6)
theta_prs2tempC(theta,prs)derive temprature[Celcius] from potential temperature[K] and pressure[hPa]
tempC_prs2theta(temp,prs)derive potential temperature[K] from temprature[Celcius] and pressure[hPa]
q2r(q)specific humidity -> mixing ratio
ARGEUMENTS
RETURN VALUE
r2q(r)mixing ratio -> specific humidity
ARGEUMENTS
RETURN VALUE
r_p2e(r,prs)derive water vapor partial pressure from mixing ratio and pressure
ARGUMENTS
RETURN VALUE
q_p2e(q,prs)derive water vapor partial pressure from specific humidity and pressure
ARGUMENTS
RETURN VALUE
lat(tempC)Returns the latent heat as a function of temperature
ARGUMENTS
t_dewpoint(r,prs)calculate dew point temperature using enhanced Teten''s formula from mixing ratioa and pressure. Based on thermolib3.f in APRS 4.5.1
ARGUMENTS:
CAUTION:
RETURN VALUE:
theta_es(tempC,prs)Saturation potential temperature (no condensate -- conserv along pseudo-adiabatic processes). In an approximate formulation theta_es = theta * exp(L r_sat / CpT).
ARGUMENTS
RETURN VALUE
theta_es_prs2tempC(th_es,prs)derive tempareture from saturation potential temperature. See theta_es for argument specification. This method reverses theta_es iteratively by the secont method.
e_sat(tempC,prs)calculates saturation water vapor pressure using enhanced Teten''s formula. Based on thermolib3.f in APRS 4.5.1
ARGUMENTS:
CAUTION:
shapes of the arguments must agree with each other(whether scalar or array)
RETURN VALUE:
r_sat(tempC,prs)Same as e_sat but for saturation water vapor mixing ratio [g/g]
q_sat(tempC,prs)Same as e_sat but for saturation water vapor specific humidity [g/g].
rel_hum(tempC,e,prs)calculates relative humidity (from tempC,e,prs)
ARGUMENTS:
CAUTION:
RETURN VALUE: