4. Inner products module¶
Inner products between the truncated set of basis functions for the ocean and atmosphere streamfunction fields.
Note
These are calculated using the analytical expressions from De Cruz, L., Demaeyer, J. and Vannitsem, S.: A modular arbitrary-order ocean-atmosphere model: MAOOAM v1.0, Geosci. Model Dev. Discuss. and from Cehelsky, P., & Tung, K. K. : Theories of multiple equilibria and weather regimes-A critical reexamination. Part II: Baroclinic two-layer models. Journal of the atmospheric sciences, 44(21), 3282-3303, 1987.
Note
The python code is available here : inprod_analytic.py .
Example: |
---|
>>> from inprod_analytic import init_inprod
>>> init_inprod()
4.1. Global variables¶
>>> awavenum = np.empty(natm, dtype=object)
>>> owavenum = np.empty(noc, dtype=object)
>>> atmos = atm_tensors(natm)
>>> ocean = ocean_tensors(noc)
4.2. Dependencies¶
it uses the modules :
>>> import numpy as np
>>> from scipy.sparse import csr_matrix
>>> from params_maooam import nbatm
>>> from params_maooam import nboc
>>> from params_maooam import natm
>>> from params_maooam import noc
>>> from params_maooam import n
>>> from params_maooam import oms
>>> from params_maooam import ams
>>> from params_maooam import pi
4.3. Classes¶
- atm_wavenum(typ,P,N,H,Nx,Ny)
- ocean_wavenum(P,H,Nx,Ny)
- atm_tensors(natm)
- ocean_tensors(noc)
-
class
inprod_analytic.
atm_tensors
(natm)[source]¶ Class which contains all the coefficients a,c,d,s,b,g needed for the tensor computation :
Attributes :
- \(a_{i, j}\)
- \(c_{i, j}\)
- \(d_{i, j}\)
- \(s_{i, j}\)
- \(b_{i, j, k}\)
- \(g_{i, j, k}\)
Return :
- The object will be name atmos.
-
calculate_a
()[source]¶ - \[a_{i, j} = (F_i, {\nabla}^2 F_j)\]
Note
Eigenvalues of the Laplacian (atmospheric)
-
calculate_b
()[source]¶ - \[b_{i, j, k} = (F_i, J(F_j, \nabla^2 F_k))\]
Note
Atmospheric g and a tensors must be computed before calling this routine.
-
calculate_c_atm
()[source]¶ - \[c_{i,j} = (F_i, \partial_x F_j)\]
Note
Beta term for the atmosphere Strict function !! Only accepts KL type. For any other combination, it will not calculate anything.
-
calculate_d
(ocean)[source]¶ - \[d_{i,j} = (F_i, \nabla^2 \eta_j)\]
Note
Forcing of the ocean on the atmosphere. Atmospheric s tensor and oceanic M tensor must be computed before calling this routine !
-
class
inprod_analytic.
atm_wavenum
(typ, P, M, H, Nx, Ny)[source]¶ Class to define atmosphere wavenumbers.
Attributes :
- typ (char) = ‘A’,’K’ or ‘L’.
- M (int)
- P (int)
- H (int)
- Nx (int)
- Ny (int)
-
class
inprod_analytic.
ocean_tensors
(noc)[source]¶ Class which contains all the coefficients k,m,n,w,o,c needed for the tensor computation :
Attributes :
- \(K_{i,j}\)
- \(M_{i,j}\)
- \(N_{i,j}\)
- \(W_{i,j}\)
- \(O_{i,j,k}\)
- \(C_{i,j,k}\)
Return :
- The object will be name ocean
-
calculate_C_oc
()[source]¶ - \[C_{i,j,k} = (\eta_i, J(\eta_j,\nabla^2 \eta_k))\]
Note
Requires \(O_{i,j,k}\)
and \(M_{i,j}\) to be calculated beforehand.
-
calculate_K
(atmos)[source]¶ Forcing of the atmosphere on the ocean.
\[K_{i,j} = (\eta_i, \nabla^2 F_j)\]Note
atmospheric a and s tensors must be computed before calling this function !
-
calculate_M
()[source]¶ Forcing of the ocean fields on the ocean.
\[M_{i,j} = (\eta_i, \nabla^2 \eta_j)\]