function GetTWetBulbFromTDewPoint(TDryBulb, TDewPoint, Pressure) result(TWetBulb)
!+ Return wet-bulb temperature given dry-bulb temperature, dew-point temperature, and pressure.
!+ References:
!+ ASHRAE Handbook - Fundamentals (2017) ch. 1
real, intent(in) :: TDryBulb
!+ Dry-bulb temperature in °F [IP] or °C [SI]
real, intent(in) :: TDewPoint
!+ Dew-point temperature in °F [IP] or °C [SI]
real, intent(in) :: Pressure
!+ Atmospheric pressure in Psi [IP] or Pa [SI]
real :: TWetBulb
!+ Wet-bulb temperature in °F [IP] or °C [SI]
real :: HumRatio
!+ Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]
if (TDewPoint > TDryBulb) then
error stop "Error: dew point temperature is above dry bulb temperature"
end if
HumRatio = GetHumRatioFromTDewPoint(TDewPoint, Pressure)
TWetBulb = GetTWetBulbFromHumRatio(TDryBulb, HumRatio, Pressure)
end function GetTWetBulbFromTDewPoint