Return relative humidity given dry-bulb temperature and vapor pressure. References: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 12, 22
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in) | :: | TDryBulb | Dry-bulb temperature in °F [IP] or °C [SI] |
||
real, | intent(in) | :: | VapPres | Partial pressure of water vapor in moist air in Psi [IP] or Pa [SI] |
Relative humidity in range [0, 1]
function GetRelHumFromVapPres(TDryBulb, VapPres) result(RelHum)
!+ Return relative humidity given dry-bulb temperature and vapor pressure.
!+ References:
!+ ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 12, 22
real, intent(in) :: TDryBulb
!+ Dry-bulb temperature in °F [IP] or °C [SI]
real, intent(in) :: VapPres
!+ Partial pressure of water vapor in moist air in Psi [IP] or Pa [SI]
real :: RelHum
!+ Relative humidity in range [0, 1]
if (VapPres < 0.0) then
error stop "Error: partial pressure of water vapor in moist air cannot be negative"
end if
RelHum = VapPres / GetSatVapPres(TDryBulb)
end function GetRelHumFromVapPres