namespace mom_wave_structure

Overview

Vertical structure functions for first baroclinic mode wave speed. More…

namespace mom_wave_structure {

// global functions

subroutine, public wave_structure(
    h h,
    tv tv,
    G G,
    GV GV,
    US US,
    cn cn,
    ModeNum ModeNum,
    freq freq,
    CS CS,
    En En,
    full_halos full_halos
    );

subroutine, public wave_structure_init(Time Time, G G, param_file param_file, diag diag, CS CS);

} // namespace mom_wave_structure

Detailed Documentation

Vertical structure functions for first baroclinic mode wave speed.

Global Functions

subroutine, public wave_structure(
    h h,
    tv tv,
    G G,
    GV GV,
    US US,
    cn cn,
    ModeNum ModeNum,
    freq freq,
    CS CS,
    En En,
    full_halos 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

The ocean’s grid structure.

gv

The ocean’s vertical grid structure.

us

A dimensional unit scaling type

h

Layer thicknesses [H ~> m or kg m-2]

tv

A structure pointing to various thermodynamic variables.

cn

The (non-rotational) mode internal gravity wave speed [L T-1 ~> m s-1].

modenum

Mode number

freq

Intrinsic wave frequency [T-1 ~> s-1].

cs

The control structure returned by a previous call to wave_structure_init.

en

Internal wave energy density [J m-2].

full_halos

If true, do the calculation over the entire computational domain.

subroutine, public wave_structure_init(
    Time Time,
    G G,
    param_file param_file,
    diag diag,
    CS CS
    )

Allocate memory associated with the wave structure module and read parameters.

Parameters:

time

The current model time.

g

The ocean’s grid structure.

param_file

A structure to parse for run-time parameters.

diag

A structure that is used to regulate diagnostic output.

cs

A pointer that is set to point to the control structure for this module.