pyshqg.core.dissipation module
Submodule dedicated to dissipation processes.
- class pyshqg.core.dissipation.QGEkmanDissipation(backend, spectral_transformations, orography, tau, weight_land_sea_mask, weight_orography, orography_scale)
Bases:
objectClass for the Ekman dissipation processes.
The Ekman dissipation term is defined as…
- backend
The backend.
- Type:
pyshqg.backend.Backend object
- mu
Friction coefficient $mu$ defined on the grid.
- Type:
backend array, shape (Nlat, Nlon)
- dmu_dphi
Gradient of $mu$ with respect to longitude ($phi$).
- Type:
backend array, shape (Nlat, Nlon)
- dmu_dtheta
Gradient of $mu$ with respect to latitude ($theta$).
- Type:
backend array, shape (Nlat, Nlon)
- __init__(backend, spectral_transformations, orography, tau, weight_land_sea_mask, weight_orography, orography_scale)
Constructor for the Ekman dissipation.
First, the orography object is used to pre-compute the friction coefficient $mu$ in the grid. Then, the spectral_transformations object is used to pre-compute the spatial gradients of $mu$ in the grid.
- Parameters:
backend (pyshqg.backend.Backend object) – The backend.
spectral_transformations (pyshqg.core.spectral_transformations.SpectralTransformations) – The object encapsulating the spectral transformations.
orography (pyshqg.preprocessing.orography.Orography) – The object encapsulating the orography in the grid.
tau (float) – The parameter $tau$ of the friction coefficient $mu$.
weight_land_sea_mask (float) – The weight of the land/sea mask contribution in $mu$.
weight_orography (float) – The weight of the orography contribution in $mu$.
orography_scale (float) – The vertical length scale for the orography in $mu$.
- compute_ekman_dissipation(zeta, dpsi_dtheta, dpsi_dphi)
Computes the Ekman dissipation term in the QG model tendencies.
The Ekman dissipation term is computed in the grid, at the lowest level (indexed by -1). The output is padded with zeros to get a contribution for all levels.
- Parameters:
zeta (backend array, shape (..., Nlat, Nlon)) – The drag $zeta$ in grid space.
dpsi_dtheta (backend array, shape (..., Nlevel, Nlat, Nlon)) – The gradient of the stream function $psi$ with respect to latitude ($theta$) in grid space.
dpsi_dphi (backend array, shape (..., Nlevel, Nlat, Nlon)) – The gradient of the stream function $psi$ with respect to longitude ($phi$) in grid space.
- Returns:
ekman – The Ekman dissipation term in the grid.
- Return type:
backend array, shape (…, Nlevel, Nlat, Nlon)
- class pyshqg.core.dissipation.QGSelectiveDissipation(backend, spectral_transformations, tau)
Bases:
objectClass for the selective dissipation processes.
The selective dissipation term is defined as…
- backend
The backend.
- Type:
pyshqg.backend.Backend object
- spectrum
Eignen spectrum in spectral space, with respect to l (the first spectral index), of the selective dissipation.
- Type:
backend array, shape (T+1,)
- __init__(backend, spectral_transformations, tau)
Constructor for the selective dissipation.
The Eigen spectrum of the Laplacian operator, defined in the spectral_transformations object is used to pre-compute the Eigen spectrum of the selective dissipation.
- Parameters:
backend (pyshqg.backend.Backend object) – The backend.
spectral_transformations (pyshqg.core.spectral_transformations.SpectralTransformations) – The object encapsulating the spectral transformations.
tau (float) – The parameter $tau$ of the selective dissipation.
- compute_selective_dissipation(spec_total_q)
Computes the selective dissipation term in the QG model tendencies.
The selective dissipation term is computed in spectral space, using the Eigen spectrum.
- Parameters:
spec_total_q (backend array, shape (..., Nlevel, 2, T+1, T+1)) – The total vorticity in spectral space $hat{q}^{mathsf{t}}$.
- Returns:
selective – The selective dissipation term in spectral space.
- Return type:
backend array, shape (…, Nlevel, 2, T+1, T+1)
- class pyshqg.core.dissipation.QGThermalDissipation(backend, vertical_parametrisation, tau)
Bases:
objectClass for the thermal dissipation processes.
The thermal dissipation term is defined as…
- backend
The backend.
- Type:
pyshqg.backend.Backend object
- thermal_coupling
Vertical coupling matrix for the thermal dissipation.
- Type:
backend array, shape (Nlevel, Nlevel)
- __init__(backend, vertical_parametrisation, tau)
Constructor for the thermal dissipation.
The vertical coupling matrix is pre-computed using the vertical_parametrisation object.
- Parameters:
backend (pyshqg.backend.Backend object) – The backend.
vertical_parametrisation (pyshqg.preprocessing.vertical_parametrisation.VerticalParametrisation) – The object encapsulating the vertical parametrisation.
tau (float) – The parameter $tau$ of the thermal dissipation.
- compute_thermal_dissipation(spec_psi)
Computes the thermal dissipation term in the QG model tendencies.
The thermal dissipation term is computed in spectral space, using a coupling matrix between vertical levels.
- Parameters:
spec_psi (backend array, shape (..., Nlevel, 2, T+1, T+1)) – The stream function in spectral space $hat{psi}$.
- Returns:
thermal – The thermal dissipation term in spectral space.
- Return type:
backend array, shape (…, Nlevel, 2, T+1, T+1)
- class pyshqg.core.dissipation.QGDissipation(ekman: pyshqg.core.dissipation.QGEkmanDissipation, selective: pyshqg.core.dissipation.QGSelectiveDissipation, thermal: pyshqg.core.dissipation.QGThermalDissipation)
Bases:
objectContainer class for all dissipation processes.
- Parameters:
ekman (pyshqg.core.dissipation.QGEkmanDissipation) – The Ekman dissipation object.
selective (pyshqg.core.dissipation.QGSelectiveDissipation) – The selective dissipation object.
thermal (pyshqg.core.dissipation.QGThermalDissipation) – The thermal dissipation object.