Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Computes the Lifted Condensation Level of a parcel ascending from a given temperature, dewpoint and pressure, where

    • t: the start temperature (°CK)
    • td: the start dewpoint (°CK)
    • p: the start pressure (hPaPa)

The LCL is the level where the parcel becomes saturated and it is computed with an iterative method along the dry adiabat of the ascending parcel.

The result is a definition with two members: t and p, containing the temperature and pressure of the LCL, in K and Pa units, respectively. On error or if the LCL does not exist nil is returned.


number mixing_ratio(number q)

Computes the mixing ratio from the given specific humidity, where

    • q: specific humidity (kg/kg)

The result is the mixing ratio in kg/kg units. On error  nil is returned. The computation is based on the following well known formula:

Mathdisplay
\w = \frac{q}{1 - q}


number mixing_ratio_from_vapour_pressure(number p, number e)

Computes the mixing ratio from the given (total) pressure and vapour pressure, where

    • p: pressure (Pa)
    • e: vapour pressure (Pa)

The result is the mixing ratio in kg/kg units. On error  nil is returned. The computation is based on the following formula:

Mathdisplay
\w = \epsilon \frac{e}{p - e}


number potential_temperature(number t, number p)

Computes the potential temperature for a given temperature and pressure, where

    • t: the temperature (°CK)
    • p: the pressure (hPaPa)

The result is the potential temperature in °C K units. On error  nil is returned.

...

Computes the saturation mixing ratio for a given temperature and pressure, where

    • t: the temperature (°CK)
    • p: the pressure (hPaPa)

The result is the saturation mixing ratio in kg/kg units. On error  error nil is returned.


number saturation_vapour_pressure(number t)

...

    • path: the path of the parcel. It is itself a definition with two members: t and p, each containing a list of values.
    • area: the positive and negative buoyancy areas between the parcel path and the profile. It is a list of definitions describing the areas.
    • cape: the value of the CAPE (Convective Available Potential Energy)  (J/kg)
    • cin: value the CIN (Convective Inhibition) (J/kg)
    • lcl: the Lifted Condensation Level. It is a definition with two members: t and p. If no LCL exists it is set to nil.
    • lfc: the Level of Free Convention. It is a definition with two members: t and p. If no LFC exists it is set to nil.
    • el: the Equilibrium Level. It is a definition with two members: t and p. If no EL exists it is set to nil.
    • top: the Cloud Top Level. It is a definition with two members: t and p. If no TOP exists it is set to nil.
    • start: the start conditions of the parcel with four members: mode, t, td and p.


number vapour_pressure(number q, number p)

Computes the vapour pressure for a given specific humidity and pressure, where

    • q: specific humidity (kg/kg)
    • p: pressure (Pa)

The result is the vapour pressure in Pa units. On error  nil is returned. The computation is based on the following formula:

Mathdisplay
\frac{p\;q}{\epsilon\; (1 + q(\frac{1}{\epsilon} -1 )}

where 

Mathdisplay
\epsilon = \frac{R_{dry}}{R_{vapour}} = 0.621981