mom_wave_structure module reference¶
Vertical structure functions for first baroclinic mode wave speed.
Data Types¶
The control structure for the MOM_wave_structure module. |
Functions/Subroutines¶
This subroutine determines the internal wave velocity structure for any mode. |
|
Solves a tri-diagonal system Ax=y using either the standard Thomas algorithm (TDMA_T) or its more stable variant that invokes the “Hallberg substitution” (TDMA_H). |
|
Allocate memory associated with the wave structure module and read parameters. |
Detailed Description¶
Vertical structure functions for first baroclinic mode wave speed.
Type Documentation¶
-
type
mom_wave_structure/
wave_structure_cs
¶ The control structure for the MOM_wave_structure module.
- Type fields
%
diag
[type(diag_ctrl),pointer] :: A structure that is used to regulate the timing of diagnostic output.%
w_strct
[real(:,:,:),allocatable] :: Vertical structure of vertical velocity (normalized) [m s-1].%
u_strct
[real(:,:,:),allocatable] :: Vertical structure of horizontal velocity (normalized) [m s-1].%
w_profile
[real(:,:,:),allocatable] :: Vertical profile of w_hat(z), where w(x,y,z,t) = w_hat(z)*exp(i(kx+ly-freq*t)) is the full time- varying vertical velocity with w_hat(z) = W0*w_strct(z) [Z T-1 ~> m s-1].%
uavg_profile
[real(:,:,:),allocatable] :: Vertical profile of the magnitude of horizontal velocity, (u^2+v^2)^0.5, averaged over a period [L T-1 ~> m s-1].%
z_depths
[real(:,:,:),allocatable] :: Depths of layer interfaces [m].%
n2
[real(:,:,:),allocatable] :: Squared buoyancy frequency at each interface [s-2].%
num_intfaces
[integer(:,:),allocatable] :: Number of layer interfaces (including surface and bottom)%
int_tide_source_x
[real] :: X Location of generation site for internal tide for testing (BDM)%
int_tide_source_y
[real] :: Y Location of generation site for internal tide for testing (BDM)
Function/Subroutine Documentation¶
-
subroutine
mom_wave_structure/
wave_structure
(h, tv, G, GV, US, cn, ModeNum, freq, CS, En, full_halos)¶ This subroutine determines the internal wave velocity structure for any mode.
This subroutine solves for the eigen vector [vertical structure, e(k)] associated with the first baroclinic mode speed [i.e., smallest eigen value (lam = 1/c^2)] of the system d2e/dz2 = -(N2/cn2)e, or (A-lam*I)e = 0, where A = -(1/N2)(d2/dz2), lam = 1/c^2, and I is the identity matrix. 2nd order discretization in the vertical lets this system be represented as
-Igu(k)*e(k-1) + (Igu(k)+Igl(k)-lam)*e(k) - Igl(k)*e(k+1) = 0.0
with rigid lid boundary conditions e(1) = e(nz+1) = 0.0 giving
(Igu(2)+Igl(2)-lam)*e(2) - Igl(2)*e(3) = 0.0 -Igu(nz)*e(nz-1) + (Igu(nz)+Igl(nz)-lam)*e(nz) = 0.0
where, upon noting N2 = reduced gravity/layer thickness, we get Igl(k) = 1.0/(gprime(k)*H(k)) ; Igu(k) = 1.0/(gprime(k)*H(k-1))
The eigen value for this system is approximated using “wave_speed.” This subroutine uses these eigen values (mode speeds) to estimate the corresponding eigen vectors (velocity structure) using the “inverse iteration with shift” method. The algorithm is
Pick a starting vector reasonably close to mode structure and with unit magnitude, b_guess For n=1,2,3,… Solve (A-lam*I)e = e_guess for e Set e_guess=e/|e| and repeat, with each iteration refining the estimate of e
- Parameters
g :: [in] The ocean’s grid structure.
gv :: [in] The ocean’s vertical grid structure.
us :: [in] A dimensional unit scaling type
h :: [in] Layer thicknesses [H ~> m or kg m-2]
tv :: [in] A structure pointing to various thermodynamic variables.
cn :: [in] The (non-rotational) mode internal gravity wave speed [L T-1 ~> m s-1].
modenum :: [in] Mode number
freq :: [in] Intrinsic wave frequency [T-1 ~> s-1].
cs :: The control structure returned by a previous call to wave_structure_init.
en :: [in] Internal wave energy density [R Z3 T-2 ~> J m-2]
full_halos :: [in] If true, do the calculation over the entire computational domain.
- Call to
- Called from
-
subroutine
mom_wave_structure/
tridiag_solver
(a, b, c, h, y, method, x)¶ Solves a tri-diagonal system Ax=y using either the standard Thomas algorithm (TDMA_T) or its more stable variant that invokes the “Hallberg substitution” (TDMA_H).
- Parameters
a :: [in] lower diagonal with first entry equal to zero.
b :: [in] middle diagonal.
c :: [in] upper diagonal with last entry equal to zero.
h :: [in] vector of values that have already been added to b; used for systems of the form (e.g. average layer thickness in vertical diffusion case): [ -alpha(k-1/2) ] * e(k-1) + [ alpha(k-1/2) + alpha(k+1/2) + h(k) ] * e(k) + [ -alpha(k+1/2) ] * e(k+1) = y(k) where a(k)=[-alpha(k-1/2)], b(k)=[alpha(k-1/2)+alpha(k+1/2) + h(k)], and c(k)=[-alpha(k+1/2)]. Only used with TDMA_H method.
y :: [in] vector of known values on right hand side.
method :: [in] A string describing the algorithm to use
x :: [out] vector of unknown values to solve for.
- Call to
- Called from
-
subroutine
mom_wave_structure/
wave_structure_init
(Time, G, param_file, diag, CS)¶ Allocate memory associated with the wave structure module and read parameters.
- Parameters
time :: [in] The current model time.
g :: [in] The ocean’s grid structure.
param_file :: [in] A structure to parse for run-time parameters.
diag :: [in] A structure that is used to regulate diagnostic output.
cs :: A pointer that is set to point to the control structure for this module.
- Call to
- Called from