improver.temperature.virtual_temperature module#
Calculate the virtual temperature.
- class VirtualTemperature[source]#
Bases:
BasePluginPlugin class to handle virtual temperature calculations from humidity mixing ratio.
- _abc_impl = <_abc._abc_data object>#
- class VirtualTemperatureFromSpecificHumidity[source]#
Bases:
BasePluginPlugin class to handle virtual temperature calculations from specific humidity.
This calculates virtual temperature using the specific humidity output from StaGE as an input, which is desirable in the calculation of Air Density.
This virtual temperature (Tv) calculation also uses condensates, if provided.
Condensed water (rain, snow and liquid cloud droplets) add weight to a volume of air without contributing to the pressure. Their effect can be included in the calculation of virtual temperature.
The data on the mixing ratios of liquid water (qcl) and ice (qcf) are available so a slightly improved estimate of Tv, accounting for this weight, is:
Tv = T [(q / epsilon) + (1 - q - qcl - qcf - qR) ].
This is only significant lower down in the atmosphere, and where there is cloud, and in most cases a very small adjustment. Given the densest clouds have condensate specific humidities typically no higher than 5 g kg-1, the adjustment is unlikely to ever be more than 0.5%.
- _abc_impl = <_abc._abc_data object>#
- static get_virtual_temperature_specific_humidity(temperature, specific_humidity, cloud_water_mixing_ratio=None, cloud_ice_mixing_ratio=None)[source]#
Calculate the virtual temperature from temperature, specific humidity and condensates, if provided.
- Parameters:
Required –
- air_temperature:
Cube of temperature.
- specific_humidity:
Cube of specific humidity on pressure levels.
Optional –
- cloud_water_mixing_ratio_on_pressure_levels:
Cube of cloud water mixing ratio on pressure levels.
- cloud_ice_mixing_ratio_on_pressure_levels:
Cube of cloud ice mixing ratio on pressure levels.
- Returns:
Cube of virtual_temperature (K).
- process(*cubes)[source]#
Main entry point for this class. Use Specific Humidity and optional condensate cubes to calculate
the Virtual Temperature cube.
- Parameters:
Required –
- cube:
air_temperature
- cube:
specific_humidity
Optional –
- cube:
cloud_liquid_water_mixing_ratio
- cube:
cloud_ice_mixing_ratio
- Returns:
virtual_temperature (K).
- Return type:
Cube