MOM_wave_speed module reference

Routines for calculating baroclinic wave speeds

Data Types

wave_speed_CS

Control structure for MOM_wave_speed

Functions/Subroutines

wave_speed

Calculates the wave speed of the first baroclinic mode.

tdma6

Solve a non-symmetric tridiagonal problem with the sum of the upper and lower diagonals minus a scalar contribution as the leading diagonal. This uses the Thomas algorithm rather than the Hallberg algorithm since the matrix is not symmetric.

wave_speeds

Calculates the wave speeds for the first few barolinic modes.

tridiag_det

Calculate the determinant of a tridiagonal matrix with diagonals a,b-lam,c and its derivative with lam, where lam is constant across rows. Only the ratio of det to its derivative and their signs are typically used, so internal rescaling by consistent factors are used to avoid over- or underflow.

wave_speed_init

Initialize control structure for MOM_wave_speed

wave_speed_set_param

Sets internal parameters for MOM_wave_speed

Detailed Description

Subroutine wave_speed() solves for the first baroclinic mode wave speed. (It could solve for all the wave speeds, but the iterative approach taken here means that this is not particularly efficient.)

If e(k) is the perturbation interface height, this means solving for the smallest eigenvalue (lam = 1/c^2) of the system

-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

Here

Igl(k) = 1.0/(gprime(K)*h(k)) ; Igu(k) = 1.0/(gprime(K)*h(k-1))

Alternately, these same eigenvalues can be found from the second smallest eigenvalue of the Montgomery potential (M(k)) calculation:

-Igl(k)*M(k-1) + (Igl(k)+Igu(k+1)-lam)*M(k) - Igu(k+1)*M(k+1) = 0.0

with rigid lid and flat bottom boundary conditions

(Igu(2)-lam)*M(1) - Igu(2)*M(2) = 0.0
-Igl(nz)*M(nz-1) + (Igl(nz)-lam)*M(nz) = 0.0

Note that the barotropic mode has been eliminated from the rigid lid interface height equations, hence the matrix is one row smaller. Without the rigid lid, the top boundary condition is simpler to implement with the M equations.

Type Documentation

type, public :: wave_speed_CS

Control structure for MOM_wave_speed

Parameters
  • initialized

    True if this control structure has been initialized.

  • use_ebt_mode

    If true, calculate the equivalent barotropic wave speed instead of the first baroclinic wave speed. This parameter controls the default behavior of wave_speed() which can be overridden by optional arguments.

  • better_cg1_est

    If true, use an improved estimate of the first mode internal wave speed.

  • mono_N2_column_fraction

    The lower fraction of water column over which N2 is limited as monotonic for the purposes of calculating the equivalent barotropic wave speed [nondim]. This parameter controls the default behavior of wave_speed() which can be overridden by optional arguments.

  • mono_N2_depth

    The depth below which N2 is limited as monotonic for the purposes of calculating the equivalent barotropic wave speed [H ~> m or kg m-2]. If this parameter is negative, this limiting does not occur. This parameter controls the default behavior of wave_speed() which can be overridden by optional arguments.

  • min_speed2

    The minimum mode 1 internal wave speed squared [L2 T-2 ~> m2 s-2]

  • wave_speed_tol

    The fractional tolerance with which to solve for the wave speeds [nondim]

  • c1_thresh

    A minimal value of the first mode internal wave speed below which all higher mode speeds are not calculated but are simply reported as 0 [L T-1 ~> m s-1]. A non-negative value must be specified via a call to wave_speed_init for the subroutine wave_speeds to be used (but not wave_speed).

  • remap_2018_CS

    Used for vertical remapping when calculating equivalent barotropic mode structure for answer dates below 20190101.

  • remap_CS

    Used for vertical remapping when calculating equivalent barotropic mode structure.

  • remap_answer_date

    The vintage of the order of arithmetic and expressions to use for remapping. Values below 20190101 recover the remapping answers from 2018, while higher values use more robust forms of the same remapping expressions.

  • diag

    Diagnostics control structure

Functions/Subroutine Documentation

subroutine wave_speed(h, tv, G, GV, US, cg1, CS, halo_size, use_ebt_mode, mono_N2_column_fraction, mono_N2_depth, modal_structure)

Calculates the wave speed of the first baroclinic mode.

Parameters
  • G [in]

    Ocean grid structure

  • GV [in]

    Vertical grid structure

  • US [in]

    A dimensional unit scaling type

  • h [in]

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

  • tv [in]

    Thermodynamic variables

  • cg1 [out]

    First mode internal wave speed [L T-1 ~> m s-1]

  • CS [in]

    Wave speed control struct

  • halo_size [in]

    Width of halo within which to calculate wave speeds

  • use_ebt_mode [in]

    If true, use the equivalent barotropic mode instead of the first baroclinic mode.

  • mono_N2_column_fraction [in]

    The lower fraction of water column over which N2 is limited as monotonic for the purposes of calculating vertical modal structure [nondim].

  • mono_N2_depth [in]

    A depth below which N2 is limited as monotonic for the purposes of calculating vertical modal structure [H ~> m or kg m-2].

  • modal_structure [out]

    Normalized model structure [nondim]

Callees call graph
Callees of mom_wave_speed::wave_speed calls cluster_mom_eos MOM_EOS cluster_mom_error_handler MOM_error_handler cluster_mom_remapping MOM_remapping cluster_mom_wave_speed MOM_wave_speed mom_eos::interface::calculate_density_derivs calculate_density_derivs (interface) mom_eos::interface::calculate_specific_vol_derivs calculate_specific_vol_derivs (interface) mom_error_handler::mom_error MOM_error mom_remapping::remapping_core_h remapping_core_h mom_wave_speed::tdma6 tdma6 [private/internal] mom_wave_speed::tridiag_det tridiag_det [private/internal] mom_wave_speed::wave_speed wave_speed mom_wave_speed::wave_speed->mom_eos::interface::calculate_density_derivs mom_wave_speed::wave_speed->mom_eos::interface::calculate_specific_vol_derivs mom_wave_speed::wave_speed->mom_error_handler::mom_error mom_wave_speed::wave_speed->mom_remapping::remapping_core_h mom_wave_speed::wave_speed->mom_wave_speed::tdma6 mom_wave_speed::wave_speed->mom_wave_speed::tridiag_det
Text view
Callers call graph
Callers of mom_wave_speed::wave_speed calls cluster_mom_diagnostics MOM_diagnostics cluster_mom_lateral_mixing_coeffs MOM_lateral_mixing_coeffs cluster_mom_wave_speed MOM_wave_speed mom_diagnostics::calculate_diagnostic_fields calculate_diagnostic_fields mom_wave_speed::wave_speed wave_speed mom_diagnostics::calculate_diagnostic_fields->mom_wave_speed::wave_speed mom_lateral_mixing_coeffs::calc_resoln_function calc_resoln_function mom_lateral_mixing_coeffs::calc_resoln_function->mom_wave_speed::wave_speed
Text view
subroutine tdma6(n, a, c, lam, y)

Solve a non-symmetric tridiagonal problem with the sum of the upper and lower diagonals minus a scalar contribution as the leading diagonal. This uses the Thomas algorithm rather than the Hallberg algorithm since the matrix is not symmetric.

Parameters
  • n [in]

    Number of rows of matrix

  • a [in]

    Lower diagonal [T2 L-2 ~> s2 m-2]

  • c [in]

    Upper diagonal [T2 L-2 ~> s2 m-2]

  • lam [in]

    Scalar subtracted from leading diagonal [T2 L-2 ~> s2 m-2]

  • y [inout]

    RHS on entry [A ~> a], result on exit [A L2 T-2 ~> a m2 s-2]

Callers call graph
Callers of mom_wave_speed::tdma6 calls cluster_mom_wave_speed MOM_wave_speed mom_wave_speed::tdma6 tdma6 [private/internal] mom_wave_speed::wave_speed wave_speed mom_wave_speed::wave_speed->mom_wave_speed::tdma6 mom_wave_speed::wave_speeds wave_speeds mom_wave_speed::wave_speeds->mom_wave_speed::tdma6
Text view
subroutine wave_speeds(h, tv, G, GV, US, nmodes, cn, CS, w_struct, u_struct, u_struct_max, u_struct_bot, Nb, int_w2, int_U2, int_N2w2, halo_size)

Calculates the wave speeds for the first few barolinic modes.

Parameters
  • G [in]

    Ocean grid structure

  • GV [in]

    Vertical grid structure

  • US [in]

    A dimensional unit scaling type

  • h [in]

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

  • tv [in]

    Thermodynamic variables

  • nmodes [in]

    Number of modes

  • CS [in]

    Wave speed control struct

  • w_struct [out]

    Wave vertical velocity profile [nondim]

  • u_struct [out]

    Wave horizontal velocity profile [Z-1 ~> m-1]

  • cn [out]

    Waves speeds [L T-1 ~> m s-1]

  • u_struct_max [out]

    Maximum of wave horizontal velocity profile [Z-1 ~> m-1]

  • u_struct_bot [out]

    Bottom value of wave horizontal velocity profile [Z-1 ~> m-1]

  • Nb [out]

    Bottom value of buoyancy freqency [T-1 ~> s-1]

  • int_w2 [out]

    depth-integrated vertical velocity profile squared [H ~> m or kg m-2]

  • int_U2 [out]

    depth-integrated horizontal velocity profile squared [H Z-2 ~> m-1 or kg m-4]

  • int_N2w2 [out]

    depth-integrated buoyancy frequency times vertical velocity profile squared [H T-2 ~> m s-2 or kg m-2 s-2]

  • halo_size [in]

    Width of halo within which to calculate wave speeds

  • modal_structure

    Normalized model structure [nondim]

  • modal_structure_fder

    Normalized model structure [Z-1 ~> m-1]

Callees call graph
Callees of mom_wave_speed::wave_speeds calls cluster_mom_eos MOM_EOS cluster_mom_error_handler MOM_error_handler cluster_mom_interface_heights MOM_interface_heights cluster_mom_remapping MOM_remapping cluster_mom_wave_speed MOM_wave_speed mom_eos::interface::calculate_density_derivs calculate_density_derivs (interface) mom_eos::interface::calculate_specific_vol_derivs calculate_specific_vol_derivs (interface) mom_error_handler::mom_error MOM_error mom_interface_heights::interface::thickness_to_dz thickness_to_dz (interface) mom_remapping::interpolate_column interpolate_column mom_remapping::remapping_core_h remapping_core_h mom_wave_speed::tdma6 tdma6 [private/internal] mom_wave_speed::tridiag_det tridiag_det [private/internal] mom_wave_speed::wave_speeds wave_speeds mom_wave_speed::wave_speeds->mom_eos::interface::calculate_density_derivs mom_wave_speed::wave_speeds->mom_eos::interface::calculate_specific_vol_derivs mom_wave_speed::wave_speeds->mom_error_handler::mom_error mom_wave_speed::wave_speeds->mom_interface_heights::interface::thickness_to_dz mom_wave_speed::wave_speeds->mom_remapping::interpolate_column mom_wave_speed::wave_speeds->mom_remapping::remapping_core_h mom_wave_speed::wave_speeds->mom_wave_speed::tdma6 mom_wave_speed::wave_speeds->mom_wave_speed::tridiag_det
Text view
Callers call graph
Callers of mom_wave_speed::wave_speeds calls cluster_mom_internal_tides MOM_internal_tides cluster_mom_wave_speed MOM_wave_speed mom_internal_tides::propagate_int_tide propagate_int_tide mom_wave_speed::wave_speeds wave_speeds mom_internal_tides::propagate_int_tide->mom_wave_speed::wave_speeds
Text view
subroutine tridiag_det(a, c, ks, ke, lam, det, ddet, row_scale)

Calculate the determinant of a tridiagonal matrix with diagonals a,b-lam,c and its derivative with lam, where lam is constant across rows. Only the ratio of det to its derivative and their signs are typically used, so internal rescaling by consistent factors are used to avoid over- or underflow.

Parameters
  • a [in]

    Lower diagonal of matrix (first entry unused) [T2 L-2 ~> s2 m-2]

  • c [in]

    Upper diagonal of matrix (last entry unused) [T2 L-2 ~> s2 m-2]

  • ks [in]

    Starting index to use in determinant

  • ke [in]

    Ending index to use in determinant

  • lam [in]

    Value subtracted from b [T2 L-2 ~> s2 m-2]

  • det [out]

    Determinant of the matrix in dynamically rescaled units that depend on the number of rows and the cumulative magnitude of det and are therefore difficult to interpret, but the units of det/ddet are always in [T2 L-2 ~> s2 m-2]

  • ddet [out]

    Derivative of determinant with lam in units that are dynamically rescaled along with those of det, such that the units of det/ddet are always in [T2 L-2 ~> s2 m-2]

  • row_scale [in]

    A scaling factor of the rows of the matrix to limit the growth of the determinant [L2 s2 T-2 m-2 ~> 1]

Callers call graph
Callers of mom_wave_speed::tridiag_det calls cluster_mom_wave_speed MOM_wave_speed mom_wave_speed::tridiag_det tridiag_det [private/internal] mom_wave_speed::wave_speed wave_speed mom_wave_speed::wave_speed->mom_wave_speed::tridiag_det mom_wave_speed::wave_speeds wave_speeds mom_wave_speed::wave_speeds->mom_wave_speed::tridiag_det
Text view
subroutine wave_speed_init(CS, GV, use_ebt_mode, mono_N2_column_fraction, mono_N2_depth, remap_answers_2018, remap_answer_date, better_speed_est, om4_remap_via_sub_cells, min_speed, wave_speed_tol, c1_thresh)

Initialize control structure for MOM_wave_speed

Parameters
  • CS [inout]

    Wave speed control struct

  • GV [in]

    Vertical grid structure

  • use_ebt_mode [in]

    If true, use the equivalent barotropic mode instead of the first baroclinic mode.

  • mono_N2_column_fraction [in]

    The lower fraction of water column over which N2 is limited as monotonic for the purposes of calculating the vertical modal structure [nondim].

  • mono_N2_depth [in]

    The depth below which N2 is limited as monotonic for the purposes of calculating the vertical modal structure [H ~> m or kg m-2].

  • remap_answers_2018 [in]

    If true, use the order of arithmetic and expressions that recover the remapping answers from 2018. Otherwise use more robust but mathematically equivalent expressions.

  • remap_answer_date [in]

    The vintage of the order of arithmetic and expressions to use for remapping. Values below 20190101 recover the remapping answers from 2018, while higher values use more robust forms of the same remapping expressions.

  • better_speed_est [in]

    If true, use a more robust estimate of the first mode speed as the starting point for iterations.

  • om4_remap_via_sub_cells [in]

    Use the OM4-era ramap_via_sub_cells for calculating the EBT structure

  • min_speed [in]

    If present, set a floor in the first mode speed below which 0 is returned [L T-1 ~> m s-1].

  • wave_speed_tol [in]

    The fractional tolerance for finding the wave speeds [nondim]

  • c1_thresh [in]

    A minimal value of the first mode internal wave speed below which all higher mode speeds are not calculated but are simply reported as 0 [L T-1 ~> m s-1]. A non-negative value must be specified for wave_speeds to be used (but not wave_speed).

Callees call graph
Callees of mom_wave_speed::wave_speed_init calls cluster_mom_file_parser MOM_file_parser cluster_mom_remapping MOM_remapping cluster_mom_wave_speed MOM_wave_speed mom_file_parser::interface::log_version log_version (interface) mom_remapping::initialize_remapping initialize_remapping mom_wave_speed::wave_speed_init wave_speed_init mom_wave_speed::wave_speed_init->mom_file_parser::interface::log_version mom_wave_speed::wave_speed_init->mom_remapping::initialize_remapping mom_wave_speed::wave_speed_set_param wave_speed_set_param mom_wave_speed::wave_speed_init->mom_wave_speed::wave_speed_set_param
Text view
Callers call graph
Callers of mom_wave_speed::wave_speed_init calls cluster_mom_diagnostics MOM_diagnostics cluster_mom_internal_tides MOM_internal_tides cluster_mom_lateral_mixing_coeffs MOM_lateral_mixing_coeffs cluster_mom_wave_speed MOM_wave_speed mom_diagnostics::mom_diagnostics_init MOM_diagnostics_init mom_wave_speed::wave_speed_init wave_speed_init mom_diagnostics::mom_diagnostics_init->mom_wave_speed::wave_speed_init mom_internal_tides::internal_tides_init internal_tides_init mom_internal_tides::internal_tides_init->mom_wave_speed::wave_speed_init mom_lateral_mixing_coeffs::varmix_init VarMix_init mom_lateral_mixing_coeffs::varmix_init->mom_wave_speed::wave_speed_init
Text view
subroutine wave_speed_set_param(CS, use_ebt_mode, mono_N2_column_fraction, mono_N2_depth, remap_answers_2018, remap_answer_date, better_speed_est, min_speed, wave_speed_tol, c1_thresh)

Sets internal parameters for MOM_wave_speed

Parameters
  • CS [inout]

    Control structure for MOM_wave_speed

  • use_ebt_mode [in]

    If true, use the equivalent barotropic mode instead of the first baroclinic mode.

  • mono_N2_column_fraction [in]

    The lower fraction of water column over which N2 is limited as monotonic for the purposes of calculating the vertical modal structure [nondim].

  • mono_N2_depth [in]

    The depth below which N2 is limited as monotonic for the purposes of calculating the vertical modal structure [H ~> m or kg m-2].

  • remap_answers_2018 [in]

    If true, use the order of arithmetic and expressions that recover the remapping answers from 2018. Otherwise use more robust but mathematically equivalent expressions.

  • remap_answer_date [in]

    The vintage of the order of arithmetic and expressions to use for remapping. Values below 20190101 recover the remapping answers from 2018, while higher values use more robust forms of the same remapping expressions.

  • better_speed_est [in]

    If true, use a more robust estimate of the first mode speed as the starting point for iterations.

  • min_speed [in]

    If present, set a floor in the first mode speed below which 0 is returned [L T-1 ~> m s-1].

  • wave_speed_tol [in]

    The fractional tolerance for finding the wave speeds [nondim]

  • c1_thresh [in]

    A minimal value of the first mode internal wave speed below which all higher mode speeds are not calculated but are simply reported as 0 [L T-1 ~> m s-1]. A non-negative value must be specified for wave_speeds to be used (but not wave_speed).

Callers call graph
Callers of mom_wave_speed::wave_speed_set_param calls cluster_mom_wave_speed MOM_wave_speed mom_wave_speed::wave_speed_init wave_speed_init mom_wave_speed::wave_speed_set_param wave_speed_set_param mom_wave_speed::wave_speed_init->mom_wave_speed::wave_speed_set_param
Text view
API generated with Flint · Rendered from reStructuredText