psychrolib Module

Module overview Contains functions for calculating thermodynamic properties of gas-vapor mixtures and standard atmosphere suitable for most engineering, physical, and meteorological applications.

Most of the functions are an implementation of the formulae found in the 2017 ASHRAE Handbook - Fundamentals, in both International System (SI), and Imperial (IP) units. Please refer to the information included in each function for their respective reference.

Example use psychrolib, only: GetTDewPointFromRelHum, SetUnitSystem, SI ! Set the unit system, for example to SI (can be either 'SI' or 'IP') call SetUnitSystem(SI) ! Calculate the dew point temperature for a dry bulb temperature of 25 C and a relative humidity of 80% print *, GetTDewPointFromRelHum(25.0, 0.80) 21.3094

Copyright - For the current library implementation Copyright (c) 2018 D. Thevenard and D. Meyer. - For equations and coefficients published ASHRAE Handbook — Fundamentals, Chapter 1 Copyright (c) 2017 ASHRAE Handbook — Fundamentals (https://www.ashrae.org)

License MIT (https://github.com/psychrometrics/psychrolib/LICENSE.txt)

Note from the Authors We have made every effort to ensure that the code is adequate, however, we make no representation with respect to its accuracy. Use at your own risk. Should you notice an error, or if you have a suggestion, please notify us through GitHub at https://github.com/psychrometrics/psychrolib/issues.


Used by

  • module~~psychrolib~~UsedByGraph module~psychrolib psychrolib module~psychrowrapper PsychroWrapper module~psychrowrapper->module~psychrolib proc~psytsatfnhpb PsyTsatFnHPb proc~psytsatfnhpb->module~psychrolib proc~calcminimaldxcooling CalcMinimalDXCooling proc~calcminimaldxcooling->module~psychrowrapper proc~calcminimaldxheating CalcMinimalDXHeating proc~calcminimaldxheating->module~psychrowrapper

Contents


Variables

TypeVisibility AttributesNameInitial
real, private, parameter:: R_DA_IP =53.350

Universal gas constant for dry air (IP version) in ft lb_Force lb_DryAir⁻¹ R⁻¹ Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1

real, private, parameter:: R_DA_SI =287.042

Universal gas constant for dry air (SI version) in J kg_DryAir⁻¹ K⁻¹ Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1

integer, public, parameter:: IP =1
integer, public, parameter:: SI =2
integer, private :: PSYCHROLIB_UNITS =0

Unit system to use.

real, private :: PSYCHROLIB_TOLERANCE =1.0

Tolerance of temperature calculations.

integer, private, parameter:: MAX_ITER_COUNT =100

Maximum number of iterations before exiting while loops.

real, private, parameter:: MIN_HUM_RATIO =1e-7

Minimum acceptable humidity ratio used/returned by any functions. Any value above 0 or below the MIN_HUM_RATIO will be reset to this value.


Functions

public function GetUnitSystem() result(UnitSystem)

Return the system of units in use.

Arguments

None

Return Value integer

public function isIP()

Check whether the system in use is IP or SI

Arguments

None

Return Value logical

public function GetTRankineFromTFahrenheit(TFahrenheit) result(TRankine)

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TFahrenheit

Temperature in degree Fahrenheit

Return Value real

Temperature in degree Rankine

public function GetTKelvinFromTCelsius(TCelsius) result(TKelvin)

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TCelsius

Temperature in degree Celsius

Return Value real

Tempearatyre in Kelvin

public 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

Arguments

Type IntentOptional AttributesName
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]

Return Value real

Wet-bulb temperature in °F [IP] or °C [SI]

public function GetTWetBulbFromRelHum(TDryBulb, RelHum, Pressure) result(TWetBulb)

Return wet-bulb temperature given dry-bulb temperature, relative humidity, and pressure. References: ASHRAE Handbook - Fundamentals (2017) ch. 1

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: RelHum

Relative humidity in range [0, 1]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Wet-bulb temperature in °F [IP] or °C [SI]

public function GetRelHumFromTDewPoint(TDryBulb, TDewPoint) result(RelHum)

Return relative humidity given dry-bulb temperature and dew-point temperature. References: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 22

Arguments

Type IntentOptional AttributesName
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]

Return Value real

Relative humidity in range [0, 1]

public function GetRelHumFromTWetBulb(TDryBulb, TWetBulb, Pressure) result(RelHum)

Return relative humidity given dry-bulb temperature, wet bulb temperature and pressure. References: ASHRAE Handbook - Fundamentals (2017) ch. 1

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: TWetBulb

Wet-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Relative humidity in range [0, 1]

public function GetTDewPointFromRelHum(TDryBulb, RelHum) result(TDewPoint)

Return dew-point temperature given dry-bulb temperature and relative humidity. References: ASHRAE Handbook - Fundamentals (2017) ch. 1

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: RelHum

Relative humidity in range [0, 1]

Return Value real

Dew-point temperature in °F [IP] or °C [SI]

public function GetTDewPointFromTWetBulb(TDryBulb, TWetBulb, Pressure) result(TDewPoint)

Return dew-point temperature given dry-bulb temperature, wet-bulb temperature, and pressure. References: ASHRAE Handbook - Fundamentals (2017) ch. 1

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: TWetBulb

Wet-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Dew-point temperature in °F [IP] or °C [SI]

public function GetVapPresFromRelHum(TDryBulb, RelHum) result(VapPres)

Return partial pressure of water vapor as a function of relative humidity and temperature. References: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 12, 22

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: RelHum

Relative humidity in range [0, 1]

Return Value real

Partial pressure of water vapor in moist air in Psi [IP] or Pa [SI]

public 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

Arguments

Type IntentOptional AttributesName
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]

Return Value real

Relative humidity in range [0, 1]

public function dLnPws_(TDryBulb) result(dLnPws)

Helper function returning the derivative of the natural log of the saturation vapor pressure as a function of dry-bulb temperature. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 5

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

Return Value real

Derivative of natural log of vapor pressure of saturated air in Psi [IP] or Pa [SI]

public function GetTDewPointFromVapPres(TDryBulb, VapPres) result(TDewPoint)

Return dew-point temperature given dry-bulb temperature and vapor pressure. References: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn. 5 and 6 Notes: The dew point temperature is solved by inverting the equation giving water vapor pressure at saturation from temperature rather than using the regressions provided by ASHRAE (eqn. 37 and 38) which are much less accurate and have a narrower range of validity. The Newton-Raphson (NR) method is used on the logarithm of water vapour pressure as a function of temperature, which is a very smooth function Convergence is usually achieved in 3 to 5 iterations. TDryBulb is not really needed here, just used for convenience.

Arguments

Type IntentOptional AttributesName
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]

Return Value real

Dew-point temperature in °F [IP] or °C [SI]

public function GetVapPresFromTDewPoint(TDewPoint) result(VapPres)

Return vapor pressure given dew point temperature. References: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 36

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDewPoint

Dew-point temperature in °F [IP] or °C [SI]

Return Value real

Partial pressure of water vapor in moist air in Psi [IP] or Pa [SI]

public function GetTWetBulbFromHumRatio(TDryBulb, HumRatio, Pressure) result(TWetBulb)

Return wet-bulb temperature given dry-bulb temperature, humidity ratio, and pressure. References: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 33 and 35 solved for Tstar

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Wet-bulb temperature in °F [IP] or °C [SI]

public function GetHumRatioFromTWetBulb(TDryBulb, TWetBulb, Pressure) result(HumRatio)

Return humidity ratio given dry-bulb temperature, wet-bulb temperature, and pressure. References: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 33 and 35

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: TWetBulb

Wet-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

public function GetHumRatioFromRelHum(TDryBulb, RelHum, Pressure) result(HumRatio)

Return humidity ratio given dry-bulb temperature, relative humidity, and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: RelHum

Relative humidity in range [0, 1]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

public function GetRelHumFromHumRatio(TDryBulb, HumRatio, Pressure) result(RelHum)

Return relative humidity given dry-bulb temperature, humidity ratio, and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Relative humidity in range [0, 1]

public function GetHumRatioFromTDewPoint(TDewPoint, Pressure) result(HumRatio)

Return humidity ratio given dew-point temperature and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1

Arguments

Type IntentOptional AttributesName
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]

Return Value real

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

public function GetTDewPointFromHumRatio(TDryBulb, HumRatio, Pressure) result(TDewPoint)

Return dew-point temperature given dry-bulb temperature, humidity ratio, and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Dew-point temperature in °F [IP] or °C [SI]

public function GetHumRatioFromVapPres(VapPres, Pressure) result(HumRatio)

Return humidity ratio given water vapor pressure and atmospheric pressure. Reference: ASHRAE Fundamentals (2005) ch. 6 eqn. 22; ASHRAE Fundamentals (2009) ch. 1 eqn. 22.

Arguments

Type IntentOptional AttributesName
real, intent(in) :: VapPres

Partial pressure of water vapor in moist air in Psi [IP] or Pa [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

public function GetVapPresFromHumRatio(HumRatio, Pressure) result(VapPres)

Return vapor pressure given humidity ratio and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 20 solved for pw

Arguments

Type IntentOptional AttributesName
real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Partial pressure of water vapor in moist air in Psi [IP] or Pa [SI]

public function GetSpecificHumFromHumRatio(HumRatio) result(SpecificHum)

Return the specific humidity from humidity ratio (aka mixing ratio). Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 9b

Arguments

Type IntentOptional AttributesName
real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Dry_Air⁻¹ [IP] or kg_H₂O kg_Dry_Air⁻¹ [SI]

Return Value real

Specific humidity in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

public function GetHumRatioFromSpecificHum(SpecificHum) result(HumRatio)

Return the humidity ratio (aka mixing ratio) from specific humidity. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 9b (solved for humidity ratio)

Arguments

Type IntentOptional AttributesName
real, intent(in) :: SpecificHum

Specific humidity in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

Return Value real

Humidity ratio in lb_H₂O lb_Dry_Air⁻¹ [IP] or kg_H₂O kg_Dry_Air⁻¹ [SI]

public function GetDryAirEnthalpy(TDryBulb) result(DryAirEnthalpy)

Return dry-air enthalpy given dry-bulb temperature. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 28

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

Return Value real

Dry air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹ [SI]

public function GetDryAirDensity(TDryBulb, Pressure) result(DryAirDensity)

Return dry-air density given dry-bulb temperature and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 Notes: Eqn 14 for the perfect gas relationship for dry air. Eqn 1 for the universal gas constant. The factor 144 in IP is for the conversion of Psi = lb in⁻² to lb ft⁻².

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Dry air density in lb ft⁻³ [IP] or kg m⁻³ [SI]

public function GetDryAirVolume(TDryBulb, Pressure) result(DryAirVolume)

Return dry-air volume given dry-bulb temperature and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 Notes: Eqn 14 for the perfect gas relationship for dry air. Eqn 1 for the universal gas constant. The factor 144 in IP is for the conversion of Psi = lb in⁻² to lb ft⁻².

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Dry air volume in ft³ lb⁻¹ [IP] or in m³ kg⁻¹ [SI]

public function GetTDryBulbFromEnthalpyAndHumRatio(MoistAirEnthalpy, HumRatio) result(TDryBulb)

Return dry bulb temperature from enthalpy and humidity ratio. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30 Notes: Based on the GetMoistAirEnthalpy function, rearranged for temperature.

Arguments

Type IntentOptional AttributesName
real, intent(in) :: MoistAirEnthalpy

Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹

real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

Return Value real

Dry-bulb temperature in °F [IP] or °C [SI]

public function GetHumRatioFromEnthalpyAndTDryBulb(MoistAirEnthalpy, TDryBulb) result(HumRatio)

Return humidity ratio from enthalpy and dry-bulb temperature. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30 Notes: Based on the GetMoistAirEnthalpy function, rearranged for humidity ratio.

Arguments

Type IntentOptional AttributesName
real, intent(in) :: MoistAirEnthalpy

Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹

real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

Return Value real

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

public function GetSatVapPres(TDryBulb) result(SatVapPres)

Return saturation vapor pressure given dry-bulb temperature. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 5

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

Return Value real

Vapor pressure of saturated air in Psi [IP] or Pa [SI]

public function GetSatHumRatio(TDryBulb, Pressure) result(SatHumRatio)

Return humidity ratio of saturated air given dry-bulb temperature and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 36, solved for W

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Humidity ratio of saturated air in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

public function GetSatAirEnthalpy(TDryBulb, Pressure) result(SatAirEnthalpy)

Return saturated air enthalpy given dry-bulb temperature and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Saturated air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹ [SI]

public function GetVaporPressureDeficit(TDryBulb, HumRatio, Pressure) result(VaporPressureDeficit)

Return Vapor pressure deficit given dry-bulb temperature, humidity ratio, and pressure. Reference: Oke (1987) eqn 2.13a

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Vapor pressure deficit in Psi [IP] or Pa [SI]

public function GetDegreeOfSaturation(TDryBulb, HumRatio, Pressure) result(DegreeOfSaturation)

Return the degree of saturation (i.e humidity ratio of the air / humidity ratio of the air at saturation at the same temperature and pressure) given dry-bulb temperature, humidity ratio, and atmospheric pressure. Reference: ASHRAE Handbook - Fundamentals (2009) ch. 1 eqn 12 Notes: This definition is absent from the 2017 Handbook. Using 2009 version instead.

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Degree of saturation in arbitrary unit

public function GetMoistAirEnthalpy(TDryBulb, HumRatio) result(MoistAirEnthalpy)

Return moist air enthalpy given dry-bulb temperature and humidity ratio. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

Return Value real

Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹

public function GetMoistAirVolume(TDryBulb, HumRatio, Pressure) result(MoistAirVolume)

Return moist air specific volume given dry-bulb temperature, humidity ratio, and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 26 Notes: In IP units, R_DA_IP / 144 equals 0.370486 which is the coefficient appearing in eqn 26 The factor 144 is for the conversion of Psi = lb in⁻² to lb ft⁻².

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Specific volume of moist air in ft³ lb⁻¹ of dry air [IP] or in m³ kg⁻¹ of dry air [SI]

public function GetMoistAirDensity(TDryBulb, HumRatio, Pressure) result(MoistAirDensity)

Return moist air density given humidity ratio, dry bulb temperature, and pressure. Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 11

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

Return Value real

Moist air density in lb ft⁻³ [IP] or kg m⁻³ [SI]

public function GetStandardAtmPressure(Altitude) result(StandardAtmPressure)

Return standard atmosphere barometric pressure, given the elevation (altitude). Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 3

Arguments

Type IntentOptional AttributesName
real, intent(in) :: Altitude

Altitude in ft [IP] or m [SI]

Return Value real

Standard atmosphere barometric pressure in Psi [IP] or Pa [SI]

public function GetStandardAtmTemperature(Altitude) result(StandardAtmTemperature)

Return standard atmosphere temperature, given the elevation (altitude). Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 4

Arguments

Type IntentOptional AttributesName
real, intent(in) :: Altitude

Altitude in ft [IP] or m [SI]

Return Value real

Standard atmosphere dry-bulb temperature in °F [IP] or °C [SI]

public function GetSeaLevelPressure(StnPressure, Altitude, TDryBulb) result(SeaLevelPressure)

Return sea level pressure given dry-bulb temperature, altitude above sea level and pressure. Reference: Hess SL, Introduction to theoretical meteorology, Holt Rinehart and Winston, NY 1959, ch. 6.5; Stull RB, Meteorology for scientists and engineers, 2nd edition, Brooks/Cole 2000, ch. 1. Notes: The standard procedure for the US is to use for TDryBulb the average of the current station temperature and the station temperature from 12 hours ago.

Arguments

Type IntentOptional AttributesName
real, intent(in) :: StnPressure

Observed station pressure in Psi [IP] or Pa [SI]

real, intent(in) :: Altitude

Altitude in ft [IP] or m [SI]

real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

Return Value real

Sea level barometric pressure in Psi [IP] or Pa [SI]

public function GetStationPressure(SeaLevelPressure, Altitude, TDryBulb) result(StationPressure)

Return station pressure from sea level pressure. Reference: See 'GetSeaLevelPressure' Notes: This function is just the inverse of 'GetSeaLevelPressure'.

Arguments

Type IntentOptional AttributesName
real, intent(in) :: SeaLevelPressure

Sea level barometric pressure in Psi [IP] or Pa [SI]

real, intent(in) :: Altitude

Altitude in ft [IP] or m [SI]

real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

Return Value real

Station pressure in Psi [IP] or Pa [SI]


Subroutines

public subroutine SetUnitSystem(UnitSystem)

Set the system of units to use (SI or IP). Notes: this function HAS TO BE CALLED before the library can be used

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: UnitSystem

public subroutine CalcPsychrometricsFromTWetBulb(TDryBulb, TWetBulb, Pressure, HumRatio, TDewPoint, RelHum, VapPres, MoistAirEnthalpy, MoistAirVolume, DegreeOfSaturation)

Utility function to calculate humidity ratio, dew-point temperature, relative humidity, vapour pressure, moist air enthalpy, moist air volume, and degree of saturation of air given dry-bulb temperature, wet-bulb temperature, and pressure.

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: TWetBulb

Wet-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

real, intent(out) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(out) :: TDewPoint

Dew-point temperature in °F [IP] or °C [SI]

real, intent(out) :: RelHum

Relative humidity in range [0, 1]

real, intent(out) :: VapPres

Partial pressure of water vapor in moist air in Psi [IP] or Pa [SI]

real, intent(out) :: MoistAirEnthalpy

Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹ [SI]

real, intent(out) :: MoistAirVolume

Specific volume of moist air in ft³ lb⁻¹ [IP] or in m³ kg⁻¹ [SI]

real, intent(out) :: DegreeOfSaturation

Degree of saturation [unitless]

public subroutine CalcPsychrometricsFromTDewPoint(TDryBulb, TDewPoint, Pressure, HumRatio, TWetBulb, RelHum, VapPres, MoistAirEnthalpy, MoistAirVolume, DegreeOfSaturation)

Utility function to calculate humidity ratio, wet-bulb temperature, relative humidity, vapour pressure, moist air enthalpy, moist air volume, and degree of saturation of air given dry-bulb temperature, dew-point temperature, and pressure.

Arguments

Type IntentOptional AttributesName
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, intent(out) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(out) :: TWetBulb

Wet-bulb temperature in °F [IP] or °C [SI]

real, intent(out) :: RelHum

Relative humidity in range [0, 1]

real, intent(out) :: VapPres

Partial pressure of water vapor in moist air in Psi [IP] or Pa [SI]

real, intent(out) :: MoistAirEnthalpy

Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹ [SI]

real, intent(out) :: MoistAirVolume

Specific volume of moist air in ft³ lb⁻¹ [IP] or in m³ kg⁻¹ [SI]

real, intent(out) :: DegreeOfSaturation

Degree of saturation [unitless]

public subroutine CalcPsychrometricsFromRelHum(TDryBulb, RelHum, Pressure, HumRatio, TWetBulb, TDewPoint, VapPres, MoistAirEnthalpy, MoistAirVolume, DegreeOfSaturation)

Utility function to calculate humidity ratio, wet-bulb temperature, dew-point temperature, vapour pressure, moist air enthalpy, moist air volume, and degree of saturation of air given dry-bulb temperature, relative humidity and pressure.

Arguments

Type IntentOptional AttributesName
real, intent(in) :: TDryBulb

Dry-bulb temperature in °F [IP] or °C [SI]

real, intent(in) :: RelHum

Relative humidity in range [0, 1]

real, intent(in) :: Pressure

Atmospheric pressure in Psi [IP] or Pa [SI]

real, intent(out) :: HumRatio

Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]

real, intent(out) :: TWetBulb

Wet-bulb temperature in °F [IP] or °C [SI]

real, intent(out) :: TDewPoint

Dew-point temperature in °F [IP] or °C [SI]

real, intent(out) :: VapPres

Partial pressure of water vapor in moist air in Psi [IP] or Pa [SI]

real, intent(out) :: MoistAirEnthalpy

Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹ [SI]

real, intent(out) :: MoistAirVolume

Specific volume of moist air in ft³ lb⁻¹ [IP] or in m³ kg⁻¹ [SI]

real, intent(out) :: DegreeOfSaturation

Degree of saturation [unitless]