pygetm.airsea module

class pygetm.airsea.Base[source]

Bases: object

Base class that provides air-water fluxes of heat, momentum, freshwater, as well as surface air pressure.

__call__(time: datetime, sst: Array, ssu: Array, ssv: Array, calculate_heat_flux: bool) None[source]

Update surface fluxes. Stresses and air pressure are always updated, but heat, shortwave and freshwater fluxes only if calculate_heat_flux if set.

Parameters:
  • time – date and time

  • sst – temperature of the water surface (°C)

  • ssu – surface water velocity in x-direction (m s-1) (model-centric, not rotated to be geocentric)

  • ssv – surface water velocity in y-direction (m s-1) (model-centric, not rotated to be geocentric)

  • calculate_heat_flux – update the surface heat flux (shf), net downwelling shortwave flux (swr) and net freshwater flux (pe)

initialize(grid: Grid, logger: Logger)[source]
pygetm.airsea.CPA = 1008.0

specific heat capacity of air (J kg-1 K-1)

class pygetm.airsea.Fluxes(taux: float = 0.0, tauy: float = 0.0, sp: float = 101325.0, shf: float = 0.0, swr: float = 0.0, pe: float = 0.0)[source]

Bases: Base

Prescribed surface fluxes: stresses taux and tauy, surface heat flux shf, air pressure sp, net downwelling shortwave radiation swr and the net freshwater flux pe) are prescribed, not calculated from meteorological conditions.

Parameters:
  • taux – wind stress in x-direction (Pa)

  • tauy – wind stress in y-direction (Pa)

  • sp – surface air pressure (Pa)

  • shf – surface heat flux (W m-2)

  • swr – surface net downwelling shortwave radiation (W m-2)

  • pe – net freshwater flux due to precipitation, condensation, and evaporation (m s-1)

initialize(grid: Grid, logger: Logger)[source]
class pygetm.airsea.FluxesFromMeteo(shortwave_method: ShortwaveMethod | int = ShortwaveMethod.ROSATI_MIYAKODA, longwave_method: LongwaveMethod | int = LongwaveMethod.CLARK, albedo_method: AlbedoMethod = AlbedoMethod.PAYNE, humidity_measure: HumidityMeasure = HumidityMeasure.DEW_POINT_TEMPERATURE, calculate_evaporation: bool = False)[source]

Bases: Fluxes

Calculate air-water fluxes of heat and momentum, as well as surface air pressure, using the awex library. The heat flux is the sum of the sensible heat flux, the latent heat flux, and net downwelling longwave radiation.

Parameters:
  • shortwave_method

    method used to obtain surface shortwave radiation. NET_FLUX: specify directly via pygetm.core.Array.set() on swr DOWNWARD_FLUX: specify downwards shortwave radiation via pygetm.core.Array.set()

    on swr_downwards. Albedo correction will be applied.

    ShortwaveMethod.ROSATI_MIYAKODA: calculate the shortwave radiation based on position, time and cloudcover and apply albedo

  • longwave_method – method used to obtain net longwave radiation NET_FLUX: specify directly via pygetm.core.Array.set() on ql DOWNWARD_FLUX: specify downwards longwave radiation via pygetm.core.Array.set() on ql_downwards LongwaveMethod.{CLARK, HASTENRATH_LAMB, BIGNAMI, BERLIAND_BERLIAND, JOSEY1, JOSEY2}: Bulk formula expressions

  • albedo_method – method used to calculate surface albedo

  • humidity_measure – the units in which air humidity will be provided

  • calculate_evaporation – whether to calculate evaporation from the latent heat flux. If this is True, precipitation should be prescribed to ensure the net freshwater budget is correct. This can be done by by calling pygetm.core.Array.set() on tp. If calculate_evaporation is False, the net surface freshwater flux defaults to 0. This flux can be then manually specified by calling pygetm.core.Array.set() on pe.

__call__(time: datetime, sst: Array, ssu: Array, ssv: Array, calculate_heat_flux: bool) None[source]

Update surface fluxes. Stresses and air pressure are always updated, but heat, shortwave and freshwater fluxes only if calculate_heat_flux if set.

Parameters:
  • time – date and time

  • sst – temperature of the water surface (°C)

  • ssu – surface water velocity in x-direction (m s-1) (model-centric, not rotated to be geocentric)

  • ssv – surface water velocity in y-direction (m s-1) (model-centric, not rotated to be geocentric)

  • calculate_heat_flux – update the surface heat flux (shf), net downwelling shortwave flux (swr) and net freshwater flux (pe)

initialize(grid: Grid, logger: Logger)[source]
update_humidity(sst: Array)[source]

Update humidity metrics: saturation vapor pressure es, actual vapor pressure ea, saturation specific humidity qs, actual specific humidity qa and air density rhoa

Parameters:

sst – temperature of the water surface (°C)

update_longwave_radiation(sst: Array)[source]

Update net downwelling longwave radiation ql

Parameters:

sst – temperature of the water surface (°C)

update_shortwave_radiation(time: datetime)[source]

Update net downwelling shortwave radiation swr. This represents the value just below the water surface (i.e., what is left after reflection).

Parameters:

time – date and time

update_transfer_coefficients(sst: Array)[source]

Update transfer coefficients for momentum (cd_mom), latent heat (cd_latent) and sensible heat (cd_sensible)

Parameters:

sst – temperature of the water surface (°C)

class pygetm.airsea.ShortwaveMethod(*values)[source]

Bases: IntEnum

Method used to calculate shortwave radiation

ROSATI_MIYAKODA = 1

Rosati & Miyakodi (1988)