API for the abiotic_tools module

The models.abiotic.abiotic_tools module contains a set of general functions that are shared across submodules in the abiotic_model model.

TODO cross-check with pyrealm for duplication/ different implementation TODO change temperatures to Kelvin

Functions:

calculate_latent_heat_vapourisation(...)

Calculate latent heat of vapourisation.

calculate_molar_density_air(temperature, ...)

Calculate temperature-dependent molar density of air.

calculate_specific_heat_air(temperature, ...)

Calculate temperature-dependent specific heat of air.

find_last_valid_row(array)

Find last valid value in array for each column.

virtual_ecosystem.models.abiotic.abiotic_tools.calculate_latent_heat_vapourisation(temperature: ndarray[Any, dtype[float32]], celsius_to_kelvin: float, latent_heat_vap_equ_factors: list[float]) ndarray[Any, dtype[float32]]

Calculate latent heat of vapourisation.

Implementation after Eq. 8, Henderson-Sellers (1984).

Parameters:
  • temperature – Air temperature, [C]

  • celsius_to_kelvin – Factor to convert temperature in Celsius to absolute temperature in Kelvin

  • latent_heat_vap_equ_factors – Factors in calculation of latent heat of vapourisation

Returns:

latent heat of vapourisation, [kJ kg-1]

virtual_ecosystem.models.abiotic.abiotic_tools.calculate_molar_density_air(temperature: ndarray[Any, dtype[float32]], atmospheric_pressure: ndarray[Any, dtype[float32]], standard_mole: float, standard_pressure: float, celsius_to_kelvin: float) ndarray[Any, dtype[float32]]

Calculate temperature-dependent molar density of air.

Implementation after Maclean and Klinges (2021).

Parameters:
  • temperature – Air temperature, [C]

  • atmospheric_pressure – Atmospheric pressure, [kPa]

  • standard_mole – Moles of ideal gas in 1 m^3 air at standard atmosphere

  • standard_pressure – Standard atmospheric pressure, [kPa]

  • celsius_to_kelvin – Factor to convert temperature in Celsius to absolute temperature in Kelvin

Returns:

molar density of air, [mol m-3]

virtual_ecosystem.models.abiotic.abiotic_tools.calculate_specific_heat_air(temperature: ndarray[Any, dtype[float32]], molar_heat_capacity_air: float, specific_heat_equ_factors: list[float]) ndarray[Any, dtype[float32]]

Calculate temperature-dependent specific heat of air.

Implementation after Maclean and Klinges (2021).

Parameters:
  • temperature – Air temperature, [C]

  • molar_heat_capacity_air – Molar heat capacity of air, [J mol-1 C-1]

  • specific_heat_equ_factors – Factors in calculation of molar specific heat of air

Returns:

specific heat of air at constant pressure, [J mol-1 K-1]

virtual_ecosystem.models.abiotic.abiotic_tools.find_last_valid_row(array: ndarray[Any, dtype[float32]]) ndarray[Any, dtype[float32]]

Find last valid value in array for each column.

This function looks for the last valid value in each column of a 2-dimensional array. If the previous value is nan, it moved up the array. If all values are nan, the value is set to nan, too.

Parameters:

array – Two-dimesional array for which last valid values should be found

Returns:

Array that contains last valid values