MOM_MEKE module reference

Implements the Mesoscale Eddy Kinetic Energy framework with topographic beta effect included in computing beta in Rhines scale

Data Types

MEKE_CS

Infer EKE using a neural network

Functions/Subroutines

step_forward_MEKE

Integrates forward-in-time the MEKE eddy energy equation. See MEKE equations.

MEKE_equilibrium

Calculates the equilibrium solution where the source depends only on MEKE diffusivity and there is no lateral diffusion of MEKE. Results is in MEKE%MEKE.

MEKE_equilibrium_restoring

This subroutine calculates a new equilibrium value for MEKE at each time step. This is not copied into MEKE%MEKE; rather, it is used as a restoring term to nudge MEKE%MEKE back to an equilibrium value

MEKE_lengthScales

Calculates the eddy mixing length scale and \(\gamma_b\) and \(\gamma_t\) functions that are ratios of either bottom or barotropic eddy energy to the column eddy energy, respectively. See MEKE equations.

MEKE_lengthScales_0d

Calculates the eddy mixing length scale and \(\gamma_b\) and \(\gamma_t\) functions that are ratios of either bottom or barotropic eddy energy to the column eddy energy, respectively. See MEKE equations.

MEKE_init

Initializes the MOM_MEKE module and reads parameters. Returns True if module is to be used, otherwise returns False.

ML_MEKE_init

Initializer for the variant of MEKE that uses ML to predict eddy kinetic energy

ML_MEKE_calculate_features

Calculate the various features used for the machine learning prediction

predict_MEKE

Use the machine learning interface to predict EKE

vertical_average_interface

Compute average of interface quantities weighted by the thickness of the surrounding layers [arbitrary]

MEKE_alloc_register_restart

Allocates memory and register restart fields for the MOM_MEKE module.

MEKE_end

Deallocates any variables allocated in MEKE_alloc_register_restart.

Detailed Description

The Mesoscale Eddy Kinetic Energy (MEKE) framework

The MEKE framework accounts for the mean potential energy removed by the first order closures used to parameterize mesoscale eddies. It requires closure at the second order, namely dissipation and transport of eddy energy.

Monitoring the sub-grid scale eddy energy budget provides a means to predict a sub-grid eddy-velocity scale which can be used in the lower order closures.

MEKE equations

The eddy kinetic energy equation is:

\begin{equation*} \partial_{\tilde{t}} E = \overbrace{ \dot{E}_b + \gamma_\eta \dot{E}_\eta + \gamma_v \dot{E}_v }^\text{sources} - \overbrace{ ( \lambda + C_d | U_d | \gamma_b^2 ) E }^\text{local dissipation} + \overbrace{ \nabla \cdot ( ( \kappa_E + \gamma_M \kappa_M ) \nabla E - \kappa_4 \nabla^3 E ) }^\text{smoothing} \end{equation*}

where \(E\) is the eddy kinetic energy (variable MEKE) with units of m:sup:2`s:sup:-2`, and \(\tilde{t} = a t\) is a scaled time. The non-dimensional factor \(a\geq 1\) is used to accelerate towards equilibrium.

The MEKE equation is two-dimensional and obtained by depth averaging the the three-dimensional eddy energy equation. In the following expressions \(\left< \phi \right> = \frac{1}{H} \int^\eta_{-D} \phi \, dz\) maps three dimensional terms into the two-dimensional quantities needed.

MEKE source terms

The source term \(\dot{E}_b\) is a constant background source of energy intended to avoid the limit \(E\rightarrow 0\).

The "GM" source term

\begin{equation*} \dot{E}_\eta = - \left< \overline{w^\prime b^\prime} \right> = \left< \kappa_h N^2S^2 \right> \approx \left< \kappa_h g\prime |\nabla_\sigma \eta|^2 \right> \end{equation*}

equals the mean potential energy removed by the Gent-McWilliams closure, and is excluded/included in the MEKE budget by the efficiency parameter \(\gamma_\eta \in [0,1]\).

The "frictional" source term

\begin{equation*} \dot{E}_{v} = \left< \partial_i u_j \tau_{ij} \right> \end{equation*}

equals the mean kinetic energy removed by lateral viscous fluxes, and is excluded/included in the MEKE budget by the efficiency parameter \(\gamma_v \in [0,1]\).

MEKE dissipation terms

The local dissipation of \(E\) is parameterized through a linear damping, \(\lambda\), and bottom drag, \(C_d | U_d | \gamma_b^2\). The \(\gamma_b\) accounts for the weak projection of the column-mean eddy velocity to the bottom. In other words, the bottom velocity is estimated as \(\gamma_b U_e\). The bottom drag coefficient, \(C_d\) is the same as that used in the bottom friction in the mean model equations.

The bottom drag velocity scale, \(U_d\), has contributions from the resolved state and \(E\):

\begin{equation*} U_d = \sqrt{ U_b^2 + |u|^2_{z=-D} + |\gamma_b U_e|^2 } . \end{equation*}

where the eddy velocity scale, \(U_e\), is given by:

\begin{equation*} U_e = \sqrt{ 2 E } . \end{equation*}

\(U_b\) is a constant background bottom velocity scale and is typically not used (i.e. set to zero).

Following [47], the projection of eddy energy on to the bottom is given by the ratio of bottom energy to column mean energy:

\begin{equation*} \gamma_b^2 = \frac{E_b}{E} = \gamma_{d0} + \left( 1 + c_{b} \frac{L_d}{L_f} \right)^{-\frac{4}{5}} , \end{equation*}
\begin{equation*} \gamma_b^2 \leftarrow \max{\left( \gamma_b^2, \gamma_{min}^2 \right)} . \end{equation*}

MEKE smoothing terms

\(E\) is laterally diffused by a diffusivity \(\kappa_E + \gamma_M \kappa_M\) where \(\kappa_E\) is a constant diffusivity and the term \(\gamma_M \kappa_M\) is a "self diffusion" using the diffusivity calculated in the section Diffusivity derived from MEKE. \(\kappa_4\) is a constant bi-harmonic diffusivity.

Diffusivity derived from MEKE

The predicted eddy velocity scale, \(U_e\), can be combined with a mixing length scale to form a diffusivity. The primary use of a MEKE derived diffusivity is for use in thickness diffusion (module mom_thickness_diffuse) and optionally in along isopycnal mixing of tracers (module mom_tracer_hor_diff). The original form used (enabled with MEKE_OLD_LSCALE=True):

\begin{equation*} \kappa_M = \gamma_\kappa \sqrt{ \gamma_t^2 U_e^2 A_\Delta } \end{equation*}

where \(A_\Delta\) is the area of the grid cell. Following [47], we now use

\begin{equation*} \kappa_M = \gamma_\kappa l_M \sqrt{ \gamma_t^2 U_e^2 } \end{equation*}

where \(\gamma_\kappa \in [0,1]\) is a non-dimensional factor and, following [47], \(\gamma_t^2\) is the ratio of barotropic eddy energy to column mean eddy energy given by

\begin{equation*} \gamma_t^2 = \frac{E_t}{E} = \left( 1 + c_{t} \frac{L_d}{L_f} \right)^{-\frac{1}{4}} , \end{equation*}
\begin{equation*} \gamma_t^2 \leftarrow \max{\left( \gamma_t^2, \gamma_{min}^2 \right)} . \end{equation*}

The length-scale is a configurable combination of multiple length scales:

\begin{equation*} l_M = \left( \frac{\alpha_d}{L_d} + \frac{\alpha_f}{L_f} + \frac{\alpha_R}{L_R} + \frac{\alpha_e}{L_e} + \frac{\alpha_\Delta}{L_\Delta} + \frac{\delta[L_c]}{L_c} \right)^{-1} \end{equation*}

where

\begin{equation*} \begin{aligned} L_d &= \sqrt{\frac{c_g^2}{f^2+2\beta c_g}} \sim \frac{ c_g }{f} \\ L_R &= \sqrt{\frac{U_e}{\beta^*}} \\ L_e &= \frac{U_e}{|S| N} \\ L_f &= \frac{H}{c_d} \\ L_\Delta &= \sqrt{A_\Delta} . \end{aligned} \end{equation*}

\(L_c\) is a constant and \(\delta[L_c]\) is the impulse function so that the term \(\frac{\delta[L_c]}{L_c}\) evaluates to \(\frac{1}{L_c}\) when \(L_c\) is non-zero but is dropped if \(L_c=0\).

\(\beta^*\) is the effective \(\beta\) that combines both the planetary vorticity gradient (i.e. \(\beta=\nabla f\)) and the topographic \(\beta\) effect, with the latter weighed by a weighting constant, \(c_\beta\), that varies from 0 to 1, so that \(c_\beta=0\) means the topographic \(\beta\) effect is ignored, while \(c_\beta=1\) means it is fully considered. The new \(\beta^*\) therefore takes the form of

\begin{equation*} \beta^* = \sqrt{( \partial_xf - c_\beta\frac{f}{D}\partial_xD )^2 + ( \partial_yf - c_\beta\frac{f}{D}\partial_yD )^2} \end{equation*}

where \(D\) is water column depth at T points.

Viscosity derived from MEKE

As for \(\kappa_M\), the predicted eddy velocity scale can be used to form a harmonic eddy viscosity,

\begin{equation*} \kappa_u = \gamma_u \sqrt{ U_e^2 A_\Delta } \end{equation*}

as well as a biharmonic eddy viscosity,

\begin{equation*} \kappa_4 = \gamma_4 \sqrt{ U_e^2 A_\Delta^3 } \end{equation*}

Limit cases for local source-dissipative balance

Note that in steady-state (or when \(a>>1\)) and there is no diffusion of \(E\) then

\begin{equation*} \overline{E} \approx \frac{ \dot{E}_b + \gamma_\eta \dot{E}_\eta + \gamma_v \dot{E}_v }{ \lambda + C_d|U_d|\gamma_b^2 } . \end{equation*}

In the linear drag limit, where \(U_e << \min(U_b, |u|_{z=-D}, C_d^{-1}\lambda)\), the equilibrium becomes \(\overline{E} \approx \frac{ \dot{E}_b + \gamma_\eta \dot{E}_\eta + \gamma_v \dot{E}_v }{ \lambda + C_d \sqrt{ U_b^2 + |u|^2_{z=-D} } }\).

In the nonlinear drag limit, where \(U_e >> \max(U_b, |u|_{z=-D}, C_d^{-1}\lambda)\), the equilibrium becomes \(\overline{E} \approx \left( \frac{ \dot{E}_b + \gamma_\eta \dot{E}_\eta + \gamma_v \dot{E}_v }{ \sqrt{2} C_d \gamma_b^3 } \right)^\frac{2}{3}\).

MEKE module parameters

Symbol

Module parameter

-

USE_MEKE

\(a\)

MEKE_DTSCALE

\(\dot{E}_b\)

MEKE_BGSRC

\(\gamma_\eta\)

MEKE_GMCOEFF

\(\gamma_v\)

MEKE_FrCOEFF

\(\lambda\)

MEKE_DAMPING

\(U_b\)

MEKE_USCALE

\(\gamma_{d0}\)

MEKE_CD_SCALE

\(c_{b}\)

MEKE_CB

\(c_{t}\)

MEKE_CT

\(\kappa_E\)

MEKE_KH

\(\kappa_4\)

MEKE_K4

\(\gamma_\kappa\)

MEKE_KHCOEFF

\(\gamma_M\)

MEKE_KHMEKE_FAC

\(\gamma_u\)

MEKE_VISCOSITY_COEFF_KU

\(\gamma_4\)

MEKE_VISCOSITY_COEFF_AU

\(\gamma_{min}^2\)

MEKE_MIN_GAMMA2

\(\alpha_d\)

MEKE_ALPHA_DEFORM

\(\alpha_f\)

MEKE_ALPHA_FRICT

\(\alpha_R\)

MEKE_ALPHA_RHINES

\(\alpha_e\)

MEKE_ALPHA_EADY

\(\alpha_\Delta\)

MEKE_ALPHA_GRID

\(L_c\)

MEKE_FIXED_MIXING_LENGTH

\(c_\beta\)

MEKE_TOPOGRAPHIC_BETA

-

MEKE_KHTH_FAC

-

MEKE_KHTR_FAC

Symbol

Model parameter

\(C_d\)

CDRAG

References

Jansen, M. F., A. J. Adcroft, R. Hallberg, and I. M. Held, 2015: Parameterization of eddy fluxes based on a mesoscale energy budget. Ocean Modelling, 92, 28--41, http://doi.org/10.1016/j.ocemod.2015.05.007 .

Marshall, D. P., and A. J. Adcroft, 2010: Parameterization of ocean eddies: Potential vorticity mixing, energetics and Arnold first stability theorem. Ocean Modelling, 32, 188--204, http://doi.org/10.1016/j.ocemod.2010.02.001 .

Type Documentation

type, public :: MEKE_CS

Infer EKE using a neural network

Control structure that contains MEKE parameters and diagnostics handles

Parameters
  • initialized

    True if this control structure has been initialized.

  • MEKE_FrCoeff

    Efficiency of conversion of ME into MEKE [nondim]

  • MEKE_bhFrCoeff

    Efficiency of conversion of ME into MEKE by the biharmonic dissipation [nondim]

  • MEKE_GMcoeff

    Efficiency of conversion of PE into MEKE [nondim]

  • MEKE_GMECoeff

    Efficiency of conversion of MEKE into ME by GME [nondim]

  • MEKE_damping

    Local depth-independent MEKE dissipation rate [T-1 ~> s-1].

  • MEKE_Cd_scale

    The ratio of the bottom eddy velocity to the column mean eddy velocity, i.e. sqrt(2*MEKE), [nondim]. This should be less than 1 to account for the surface intensification of MEKE.

  • MEKE_Cb

    Coefficient in the \(\gamma_{bot}\) expression [nondim]

  • MEKE_min_gamma

    Minimum value of gamma_b^2 allowed [nondim]

  • MEKE_Ct

    Coefficient in the \(\gamma_{bt}\) expression [nondim]

  • visc_drag

    If true use the vertvisc_type to calculate bottom drag.

  • MEKE_GEOMETRIC

    If true, uses the GM coefficient formulation from the GEOMETRIC framework (Marshall et al., 2012)

  • MEKE_GEOMETRIC_alpha

    The nondimensional coefficient governing the efficiency of the GEOMETRIC thickness diffusion [nondim].

  • MEKE_equilibrium_alt

    If true, use an alternative calculation for the equilibrium value of MEKE.

  • MEKE_equilibrium_restoring

    If true, restore MEKE back to its equilibrium value, which is calculated at each time step.

  • GM_src_alt

    If true, use the GM energy conversion form S^2*N^2*kappa rather than the streamfunction for the MEKE GM source term.

  • MEKE_min_depth_tot

    The minimum total thickness over which to distribute MEKE energy sources from GM energy conversion [H ~> m or kg m-2]. When the total thickness is less than this, the sources are scaled away.

  • Rd_as_max_scale

    If true the length scale can not exceed the first baroclinic deformation radius.

  • use_old_lscale

    Use the old formula for mixing length scale.

  • use_min_lscale

    Use simple minimum for mixing length scale.

  • MEKE_positive

    If true, it guarantees that MEKE will always be >= 0.

  • lscale_maxval

    The ceiling on the MEKE mixing length scale when use_min_lscale is true [L ~> m].

  • cdrag

    The bottom drag coefficient for MEKE, times rescaling factors [H L-1 ~> nondim or kg m-3]

  • MEKE_BGsrc

    Background energy source for MEKE [L2 T-3 ~> W kg-1] (= m2 s-3).

  • MEKE_dtScale

    Scale factor to accelerate time-stepping [nondim]

  • MEKE_KhCoeff

    Scaling factor to convert MEKE into Kh [nondim]

  • MEKE_Uscale

    MEKE velocity scale for bottom drag [L T-1 ~> m s-1]

  • MEKE_KH

    Background lateral diffusion of MEKE [L2 T-1 ~> m2 s-1]

  • MEKE_K4

    Background bi-harmonic diffusivity (of MEKE) [L4 T-1 ~> m4 s-1]

  • KhMEKE_Fac

    A factor relating MEKE%Kh to the diffusivity used for MEKE itself [nondim].

  • viscosity_coeff_Ku

    The scaling coefficient in the expression for viscosity used to parameterize lateral harmonic momentum mixing by unresolved eddies represented by MEKE [nondim].

  • viscosity_coeff_Au

    The scaling coefficient in the expression for viscosity used to parameterize lateral biharmonic momentum mixing by unresolved eddies represented by MEKE [nondim].

  • Lfixed

    Fixed mixing length scale [L ~> m].

  • aDeform

    Weighting towards deformation scale of mixing length [nondim]

  • aRhines

    Weighting towards Rhines scale of mixing length [nondim]

  • aFrict

    Weighting towards frictional arrest scale of mixing length [nondim]

  • aEady

    Weighting towards Eady scale of mixing length [nondim]

  • aGrid

    Weighting towards grid scale of mixing length [nondim]

  • MEKE_advection_factor

    A scaling in front of the advection of MEKE [nondim]

  • MEKE_topographic_beta

    Weight for how much topographic beta is considered when computing beta in Rhines scale [nondim]

  • MEKE_restoring_rate

    Inverse of the timescale used to nudge MEKE toward its equilibrium value [T-1 ~> s-1].

  • MEKE_advection_bug

    If true, recover a bug in the calculation of the barotropic transport for the advection of MEKE, wherein only the transports in the deepest layer are used.

  • fixed_total_depth

    If true, use the nominal bathymetric depth as the estimate of the time-varying ocean depth. Otherwise base the depth on the total ocean mass per unit area.

  • rho_fixed_total_depth

    A density used to translate the nominal bathymetric depth into an estimate of the total ocean mass per unit area when MEKE_FIXED_TOTAL_DEPTH is true [R ~> kg m-3]

  • kh_flux_enabled

    If true, lateral diffusive MEKE flux is enabled.

  • initialize

    If True, invokes a steady state solver to calculate MEKE.

  • debug

    If true, write out checksums of data for debugging

  • eke_src

    Enum specifying whether EKE is stepped forward prognostically (default), read in from a file, or inferred via a neural network

  • sqg_use_MEKE

    If True, use MEKE%Le for the SQG vertical structure.

  • id_MEKE

    Diagnostic handles

  • id_Ue

    Diagnostic handles

  • id_Kh

    Diagnostic handles

  • id_src

    Diagnostic handles

  • id_src_adv

    Diagnostic handles

  • id_src_mom_K4

    Diagnostic handles

  • id_src_btm_drag

    Diagnostic handles

  • id_src_GM

    Diagnostic handles

  • id_src_mom_lp

    Diagnostic handles

  • id_src_mom_bh

    Diagnostic handles

  • id_Ub

    Diagnostic handles

  • id_Ut

    Diagnostic handles

  • id_GM_src

    Diagnostic handles

  • id_mom_src

    Diagnostic handles

  • id_mom_src_bh

    Diagnostic handles

  • id_GME_snk

    Diagnostic handles

  • id_decay

    Diagnostic handles

  • id_KhMEKE_u

    Diagnostic handles

  • id_KhMEKE_v

    Diagnostic handles

  • id_Ku

    Diagnostic handles

  • id_Au

    Diagnostic handles

  • id_Le

    Diagnostic handles

  • id_gamma_b

    Diagnostic handles

  • id_gamma_t

    Diagnostic handles

  • id_Lrhines

    Diagnostic handles

  • id_Leady

    Diagnostic handles

  • id_MEKE_equilibrium

    Diagnostic handles

  • eke_handle

    Handle for reading in EKE from a file

  • id_clock_pass

    Clock for group pass calls

  • pass_MEKE

    Group halo pass handle for MEKE%MEKE and maybe MEKE%Kh_diff

  • pass_Kh

    Group halo pass handle for MEKE%Kh, MEKE%Ku, and/or MEKE%Au

  • client

    Pointer to the database client

  • online_analysis

    If true, post the EKE used in MOM6 at every timestep

  • model_key

    Key where the ML-model is stored

  • key_suffix

    Suffix appended to every key sent to Redis

  • eke_max

    The maximum value of EKE considered physically reasonable [L2 T-2 ~> m2 s-2]

  • id_client_init

    Clock id to time initialization of the client

  • id_put_tensor

    Clock id to time put_tensor routine

  • id_run_model

    Clock id to time running of the ML model

  • id_unpack_tensor

    Clock id to time retrieval of EKE prediction

  • id_mke

    Diagnostic id for surface mean kinetic energy

  • id_slope_z

    Diagnostic id for vertically averaged horizontal slope magnitude

  • id_slope_x

    Diagnostic id for isopycnal slope in the x-direction

  • id_slope_y

    Diagnostic id for isopycnal slope in the y-direction

  • id_rv

    Diagnostic id for surface relative vorticity

Functions/Subroutine Documentation

subroutine step_forward_MEKE(MEKE, h, SN_u, SN_v, visc, dt, G, GV, US, CS, hu, hv, u, v, tv, Time)

Integrates forward-in-time the MEKE eddy energy equation. See MEKE equations.

Parameters
  • MEKE [inout]

    MEKE data.

  • G [inout]

    Ocean grid.

  • GV [in]

    Ocean vertical grid structure.

  • US [in]

    A dimensional unit scaling type

  • h [in]

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

  • SN_u [in]

    Eady growth rate at u-points [T-1 ~> s-1].

  • SN_v [in]

    Eady growth rate at v-points [T-1 ~> s-1].

  • visc [in]

    The vertical viscosity type.

  • dt [in]

    Model(baroclinic) time-step [T ~> s].

  • CS [inout]

    MEKE control structure.

  • hu [in]

    Accumulated zonal mass flux [H L2 ~> m3 or kg].

  • hv [in]

    Accumulated meridional mass flux [H L2 ~> m3 or kg]

  • u [inout]

    Zonal velocity [L T-1 ~> m s-1]

  • v [inout]

    Meridional velocity [L T-1 ~> m s-1]

  • tv [in]

    Type containing thermodynamic variables

  • Time [in]

    The time used for interpolating EKE

Callees call graph
Callees of mom_meke::step_forward_meke calls cluster_mom_checksums MOM_checksums cluster_mom_cpu_clock_infra MOM_cpu_clock_infra cluster_mom_diag_mediator MOM_diag_mediator cluster_mom_domain_infra MOM_domain_infra cluster_mom_error_handler MOM_error_handler cluster_mom_interpolate MOM_interpolate cluster_mom_meke MOM_MEKE mom_checksums::interface::hchksum hchksum (interface) mom_checksums::interface::uvchksum uvchksum (interface) mom_cpu_clock_infra::cpu_clock_begin cpu_clock_begin mom_cpu_clock_infra::cpu_clock_end cpu_clock_end mom_diag_mediator::interface::post_data post_data (interface) mom_domain_infra::do_group_pass do_group_pass mom_domain_infra::interface::pass_vector pass_vector (interface) mom_error_handler::mom_error MOM_error mom_interpolate::interface::time_interp_external time_interp_external (interface) mom_meke::meke_equilibrium MEKE_equilibrium [private/internal] mom_meke::meke_equilibrium_restoring MEKE_equilibrium_restoring [private/internal] mom_meke::meke_lengthscales MEKE_lengthScales [private/internal] mom_meke::ml_meke_calculate_features ML_MEKE_calculate_features [private/internal] mom_meke::predict_meke predict_MEKE [private/internal] mom_meke::step_forward_meke step_forward_MEKE mom_meke::step_forward_meke->mom_checksums::interface::hchksum mom_meke::step_forward_meke->mom_checksums::interface::uvchksum mom_meke::step_forward_meke->mom_cpu_clock_infra::cpu_clock_begin mom_meke::step_forward_meke->mom_cpu_clock_infra::cpu_clock_end mom_meke::step_forward_meke->mom_diag_mediator::interface::post_data mom_meke::step_forward_meke->mom_domain_infra::do_group_pass mom_meke::step_forward_meke->mom_domain_infra::interface::pass_vector mom_meke::step_forward_meke->mom_error_handler::mom_error mom_meke::step_forward_meke->mom_interpolate::interface::time_interp_external mom_meke::step_forward_meke->mom_meke::meke_equilibrium mom_meke::step_forward_meke->mom_meke::meke_equilibrium_restoring mom_meke::step_forward_meke->mom_meke::meke_lengthscales mom_meke::step_forward_meke->mom_meke::ml_meke_calculate_features mom_meke::step_forward_meke->mom_meke::predict_meke
Text view
Callers call graph
Callers of mom_meke::step_forward_meke calls cluster_mom MOM cluster_mom_meke MOM_MEKE mom::step_mom_dynamics step_MOM_dynamics [private/internal] mom_meke::step_forward_meke step_forward_MEKE mom::step_mom_dynamics->mom_meke::step_forward_meke mom::step_mom_tracer_dyn step_MOM_tracer_dyn [private/internal] mom::step_mom_tracer_dyn->mom_meke::step_forward_meke
Text view
subroutine MEKE_equilibrium(CS, MEKE, G, GV, US, SN_u, SN_v, drag_rate_visc, I_mass, depth_tot)

Calculates the equilibrium solution where the source depends only on MEKE diffusivity and there is no lateral diffusion of MEKE. Results is in MEKE%MEKE.

Parameters
  • G [inout]

    Ocean grid.

  • GV [in]

    Ocean vertical grid structure.

  • US [in]

    A dimensional unit scaling type

  • CS [in]

    MEKE control structure.

  • MEKE [inout]

    MEKE fields

  • SN_u [in]

    Eady growth rate at u-points [T-1 ~> s-1].

  • SN_v [in]

    Eady growth rate at v-points [T-1 ~> s-1].

  • drag_rate_visc [in]

    Mean flow velocity contribution to the MEKE drag rate [H T-1 ~> m s-1 or kg m-2 s-1]

  • I_mass [in]

    Inverse of column mass [R-1 Z-1 ~> m2 kg-1].

  • depth_tot [in]

    The thickness of the water column [H ~> m or kg m-2].

Callees call graph
Callees of mom_meke::meke_equilibrium calls cluster_mom_meke MOM_MEKE mom_meke::meke_equilibrium MEKE_equilibrium [private/internal] mom_meke::meke_lengthscales_0d MEKE_lengthScales_0d [private/internal] mom_meke::meke_equilibrium->mom_meke::meke_lengthscales_0d
Text view
Callers call graph
Callers of mom_meke::meke_equilibrium calls cluster_mom_meke MOM_MEKE mom_meke::meke_equilibrium MEKE_equilibrium [private/internal] mom_meke::step_forward_meke step_forward_MEKE mom_meke::step_forward_meke->mom_meke::meke_equilibrium
Text view
subroutine MEKE_equilibrium_restoring(CS, G, GV, US, SN_u, SN_v, depth_tot, equilibrium_value)

This subroutine calculates a new equilibrium value for MEKE at each time step. This is not copied into MEKE%MEKE; rather, it is used as a restoring term to nudge MEKE%MEKE back to an equilibrium value

Parameters
  • G [inout]

    Ocean grid.

  • GV [in]

    Ocean vertical grid structure.

  • US [in]

    A dimensional unit scaling type.

  • CS [in]

    MEKE control structure.

  • SN_u [in]

    Eady growth rate at u-points [T-1 ~> s-1].

  • SN_v [in]

    Eady growth rate at v-points [T-1 ~> s-1].

  • depth_tot [in]

    The thickness of the water column [H ~> m or kg m-2].

  • equilibrium_value [out]

    Equilbrium value of MEKE to be calculated at each time step [L2 T-2 ~> m2 s-2]

Callees call graph
Callees of mom_meke::meke_equilibrium_restoring calls cluster_mom_diag_mediator MOM_diag_mediator cluster_mom_meke MOM_MEKE mom_diag_mediator::interface::post_data post_data (interface) mom_meke::meke_equilibrium_restoring MEKE_equilibrium_restoring [private/internal] mom_meke::meke_equilibrium_restoring->mom_diag_mediator::interface::post_data
Text view
Callers call graph
Callers of mom_meke::meke_equilibrium_restoring calls cluster_mom_meke MOM_MEKE mom_meke::meke_equilibrium_restoring MEKE_equilibrium_restoring [private/internal] mom_meke::step_forward_meke step_forward_MEKE mom_meke::step_forward_meke->mom_meke::meke_equilibrium_restoring
Text view
subroutine MEKE_lengthScales(CS, MEKE, G, GV, US, SN_u, SN_v, EKE, depth_tot, bottomFac2, barotrFac2, LmixScale)

Calculates the eddy mixing length scale and \(\gamma_b\) and \(\gamma_t\) functions that are ratios of either bottom or barotropic eddy energy to the column eddy energy, respectively. See MEKE equations.

Parameters
  • CS [in]

    MEKE control structure.

  • MEKE [in]

    MEKE field

  • G [inout]

    Ocean grid.

  • GV [in]

    Ocean vertical grid structure.

  • US [in]

    A dimensional unit scaling type

  • SN_u [in]

    Eady growth rate at u-points [T-1 ~> s-1].

  • SN_v [in]

    Eady growth rate at v-points [T-1 ~> s-1].

  • EKE [in]

    Eddy kinetic energy [L2 T-2 ~> m2 s-2].

  • depth_tot [in]

    The thickness of the water column [H ~> m or kg m-2].

  • bottomFac2 [out]

    gamma_b^2 [nondim]

  • barotrFac2 [out]

    gamma_t^2 [nondim]

  • LmixScale [out]

    Eddy mixing length [L ~> m].

Callees call graph
Callees of mom_meke::meke_lengthscales calls cluster_mom_diag_mediator MOM_diag_mediator cluster_mom_meke MOM_MEKE mom_diag_mediator::interface::post_data post_data (interface) mom_meke::meke_lengthscales MEKE_lengthScales [private/internal] mom_meke::meke_lengthscales->mom_diag_mediator::interface::post_data mom_meke::meke_lengthscales_0d MEKE_lengthScales_0d [private/internal] mom_meke::meke_lengthscales->mom_meke::meke_lengthscales_0d
Text view
Callers call graph
Callers of mom_meke::meke_lengthscales calls cluster_mom_meke MOM_MEKE mom_meke::meke_lengthscales MEKE_lengthScales [private/internal] mom_meke::step_forward_meke step_forward_MEKE mom_meke::step_forward_meke->mom_meke::meke_lengthscales
Text view
subroutine MEKE_lengthScales_0d(CS, US, area, beta, depth_tot, Rd_dx, SN, EKE, bottomFac2, barotrFac2, LmixScale, Lrhines, Leady)

Calculates the eddy mixing length scale and \(\gamma_b\) and \(\gamma_t\) functions that are ratios of either bottom or barotropic eddy energy to the column eddy energy, respectively. See MEKE equations.

Parameters
  • CS [in]

    MEKE control structure.

  • US [in]

    A dimensional unit scaling type

  • area [in]

    Grid cell area [L2 ~> m2]

  • beta [in]

    Planetary beta = \(\nabla f\) [T-1 L-1 ~> s-1 m-1]

  • depth_tot [in]

    The total thickness of the water column [H ~> m or kg m-2]

  • Rd_dx [in]

    Resolution Ld/dx [nondim].

  • SN [in]

    Eady growth rate [T-1 ~> s-1].

  • EKE [in]

    Eddy kinetic energy [L2 T-2 ~> m2 s-2].

  • bottomFac2 [out]

    gamma_b^2 [nondim]

  • barotrFac2 [out]

    gamma_t^2 [nondim]

  • LmixScale [out]

    Eddy mixing length [L ~> m].

  • Lrhines [out]

    Rhines length scale [L ~> m].

  • Leady [out]

    Eady length scale [L ~> m].

Callers call graph
Callers of mom_meke::meke_lengthscales_0d calls cluster_mom_meke MOM_MEKE mom_meke::meke_equilibrium MEKE_equilibrium [private/internal] mom_meke::meke_lengthscales_0d MEKE_lengthScales_0d [private/internal] mom_meke::meke_equilibrium->mom_meke::meke_lengthscales_0d mom_meke::meke_lengthscales MEKE_lengthScales [private/internal] mom_meke::meke_lengthscales->mom_meke::meke_lengthscales_0d
Text view
logical function MEKE_init(Time, G, GV, US, param_file, diag, dbcomms_CS, CS, MEKE, restart_CS, meke_in_dynamics)

Initializes the MOM_MEKE module and reads parameters. Returns True if module is to be used, otherwise returns False.

Parameters
  • Time [in]

    The current model time.

  • G [inout]

    The ocean's grid structure.

  • GV [in]

    Ocean vertical grid structure.

  • US [in]

    A dimensional unit scaling type

  • param_file [in]

    Parameter file parser structure.

  • dbcomms_CS [in]

    Database communications control structure

  • diag [inout]

    Diagnostics structure.

  • CS [inout]

    MEKE control structure.

  • MEKE [inout]

    MEKE fields

  • restart_CS [in]

    MOM restart control structure

  • meke_in_dynamics [out]

    If true, MEKE is stepped forward in dynamics otherwise in tracer dynamics

Callees call graph
Callees of mom_meke::meke_init calls cluster_mom_cpu_clock_infra MOM_cpu_clock_infra cluster_mom_diag_mediator MOM_diag_mediator cluster_mom_domain_infra MOM_domain_infra cluster_mom_error_handler MOM_error_handler cluster_mom_file_parser MOM_file_parser cluster_mom_interp_infra MOM_interp_infra cluster_mom_meke MOM_MEKE cluster_mom_restart MOM_restart cluster_mom_string_functions MOM_string_functions mom_cpu_clock_infra::cpu_clock_id cpu_clock_id mom_diag_mediator::register_diag_field register_diag_field mom_domain_infra::do_group_pass do_group_pass mom_domain_infra::interface::create_group_pass create_group_pass (interface) mom_error_handler::mom_error MOM_error mom_error_handler::mom_mesg MOM_mesg mom_file_parser::interface::get_param get_param (interface) mom_file_parser::interface::log_version log_version (interface) mom_interp_infra::init_extern_field init_extern_field mom_meke::meke_init MEKE_init mom_meke::meke_init->mom_cpu_clock_infra::cpu_clock_id mom_meke::meke_init->mom_diag_mediator::register_diag_field mom_meke::meke_init->mom_domain_infra::do_group_pass mom_meke::meke_init->mom_domain_infra::interface::create_group_pass mom_meke::meke_init->mom_error_handler::mom_error mom_meke::meke_init->mom_error_handler::mom_mesg mom_meke::meke_init->mom_file_parser::interface::get_param mom_meke::meke_init->mom_file_parser::interface::log_version mom_meke::meke_init->mom_interp_infra::init_extern_field mom_meke::ml_meke_init ML_MEKE_init [private/internal] mom_meke::meke_init->mom_meke::ml_meke_init mom_restart::interface::query_initialized query_initialized (interface) mom_meke::meke_init->mom_restart::interface::query_initialized mom_string_functions::lowercase lowercase mom_meke::meke_init->mom_string_functions::lowercase mom_string_functions::slasher slasher mom_meke::meke_init->mom_string_functions::slasher
Text view
Callers call graph
Callers of mom_meke::meke_init calls cluster_mom MOM cluster_mom_meke MOM_MEKE mom::initialize_mom initialize_MOM mom_meke::meke_init MEKE_init mom::initialize_mom->mom_meke::meke_init
Text view
subroutine ML_MEKE_init(diag, G, US, Time, param_file, dbcomms_CS, CS)

Initializer for the variant of MEKE that uses ML to predict eddy kinetic energy

Parameters
  • diag [inout]

    Diagnostics structure.

  • G [inout]

    The ocean's grid structure.

  • US [in]

    A dimensional unit scaling type

  • Time [in]

    The current model time.

  • param_file [in]

    Parameter file parser structure.

  • dbcomms_CS [in]

    Control structure for database communication

  • CS [inout]

    Control structure for this module

Callees call graph
Callees of mom_meke::ml_meke_init calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_cpu_clock_infra MOM_cpu_clock_infra cluster_mom_diag_mediator MOM_diag_mediator cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_file_parser MOM_file_parser cluster_mom_meke MOM_MEKE cluster_mom_string_functions MOM_string_functions mom_coms_infra::pe_here PE_here mom_cpu_clock_infra::cpu_clock_id cpu_clock_id mom_diag_mediator::register_diag_field register_diag_field mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_file_parser::interface::get_param get_param (interface) mom_file_parser::interface::read_param read_param (interface) mom_meke::ml_meke_init ML_MEKE_init [private/internal] mom_meke::ml_meke_init->mom_coms_infra::pe_here mom_meke::ml_meke_init->mom_cpu_clock_infra::cpu_clock_id mom_meke::ml_meke_init->mom_diag_mediator::register_diag_field mom_meke::ml_meke_init->mom_error_handler::mom_error mom_meke::ml_meke_init->mom_error_infra::is_root_pe mom_meke::ml_meke_init->mom_file_parser::interface::get_param mom_meke::ml_meke_init->mom_file_parser::interface::read_param mom_string_functions::slasher slasher mom_meke::ml_meke_init->mom_string_functions::slasher
Text view
Callers call graph
Callers of mom_meke::ml_meke_init calls cluster_mom_meke MOM_MEKE mom_meke::meke_init MEKE_init mom_meke::ml_meke_init ML_MEKE_init [private/internal] mom_meke::meke_init->mom_meke::ml_meke_init
Text view
subroutine ML_MEKE_calculate_features(G, GV, US, CS, Rd_dx_h, u, v, tv, h, dt, features_array)

Calculate the various features used for the machine learning prediction

Parameters
  • G [inout]

    Ocean grid

  • GV [in]

    Ocean vertical grid structure

  • US [in]

    A dimensional unit scaling type

  • CS [in]

    Control structure for MEKE

  • Rd_dx_h [in]

    Rossby radius of deformation over the grid length scale [nondim]

  • u [in]

    Zonal velocity [L T-1 ~> m s-1]

  • v [in]

    Meridional velocity [L T-1 ~> m s-1]

  • tv [in]

    Type containing thermodynamic variables

  • h [in]

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

  • dt [in]

    Model(baroclinic) time-step [T ~> s].

  • features_array [out]

    The array of features needed for machine learning inference, with different units for the various subarrays [various]

Callees call graph
Callees of mom_meke::ml_meke_calculate_features calls cluster_mom_diag_mediator MOM_diag_mediator cluster_mom_domain_infra MOM_domain_infra cluster_mom_interface_heights MOM_interface_heights cluster_mom_isopycnal_slopes MOM_isopycnal_slopes cluster_mom_meke MOM_MEKE mom_diag_mediator::interface::post_data post_data (interface) mom_domain_infra::interface::pass_var pass_var (interface) mom_domain_infra::interface::pass_vector pass_vector (interface) mom_interface_heights::interface::find_eta find_eta (interface) mom_isopycnal_slopes::calc_isoneutral_slopes calc_isoneutral_slopes mom_meke::ml_meke_calculate_features ML_MEKE_calculate_features [private/internal] mom_meke::ml_meke_calculate_features->mom_diag_mediator::interface::post_data mom_meke::ml_meke_calculate_features->mom_domain_infra::interface::pass_var mom_meke::ml_meke_calculate_features->mom_domain_infra::interface::pass_vector mom_meke::ml_meke_calculate_features->mom_interface_heights::interface::find_eta mom_meke::ml_meke_calculate_features->mom_isopycnal_slopes::calc_isoneutral_slopes mom_meke::vertical_average_interface vertical_average_interface [private/internal] mom_meke::ml_meke_calculate_features->mom_meke::vertical_average_interface
Text view
Callers call graph
Callers of mom_meke::ml_meke_calculate_features calls cluster_mom_meke MOM_MEKE mom_meke::ml_meke_calculate_features ML_MEKE_calculate_features [private/internal] mom_meke::step_forward_meke step_forward_MEKE mom_meke::step_forward_meke->mom_meke::ml_meke_calculate_features
Text view
subroutine predict_MEKE(G, US, CS, npts, Time, features_array, MEKE)

Use the machine learning interface to predict EKE

Parameters
  • G [inout]

    Ocean grid

  • US [in]

    A dimensional unit scaling type

  • CS [in]

    Control structure for MEKE

  • npts [in]

    Number of T-grid cells on the local domain

  • Time [in]

    The current model time

  • features_array [in]

    The array of features needed for machine learning inference, with different units for the various subarrays [various]

  • MEKE [out]

    Eddy kinetic energy [L2 T-2 ~> m2 s-2]

Callees call graph
Callees of mom_meke::predict_meke calls cluster_mom_cpu_clock_infra MOM_cpu_clock_infra cluster_mom_domain_infra MOM_domain_infra cluster_mom_error_handler MOM_error_handler cluster_mom_meke MOM_MEKE mom_cpu_clock_infra::cpu_clock_begin cpu_clock_begin mom_cpu_clock_infra::cpu_clock_end cpu_clock_end mom_domain_infra::interface::pass_var pass_var (interface) mom_error_handler::mom_error MOM_error mom_meke::predict_meke predict_MEKE [private/internal] mom_meke::predict_meke->mom_cpu_clock_infra::cpu_clock_begin mom_meke::predict_meke->mom_cpu_clock_infra::cpu_clock_end mom_meke::predict_meke->mom_domain_infra::interface::pass_var mom_meke::predict_meke->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_meke::predict_meke calls cluster_mom_meke MOM_MEKE mom_meke::predict_meke predict_MEKE [private/internal] mom_meke::step_forward_meke step_forward_MEKE mom_meke::step_forward_meke->mom_meke::predict_meke
Text view

External calls

time_manager_mod
  • time_type_to_real (time_manager_mod::time_type_to_real)

real function vertical_average_interface(h, w, h_min)

Compute average of interface quantities weighted by the thickness of the surrounding layers [arbitrary]

Parameters
  • h [in]

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

  • w [in]

    Quantity to average [arbitrary]

  • h_min [in]

    The vanishingly small layer thickness [H ~> m or kg m-2]

Callers call graph
Callers of mom_meke::vertical_average_interface calls cluster_mom_meke MOM_MEKE mom_meke::ml_meke_calculate_features ML_MEKE_calculate_features [private/internal] mom_meke::vertical_average_interface vertical_average_interface [private/internal] mom_meke::ml_meke_calculate_features->mom_meke::vertical_average_interface
Text view
subroutine MEKE_alloc_register_restart(HI, US, param_file, MEKE, restart_CS)

Allocates memory and register restart fields for the MOM_MEKE module.

Parameters
  • HI [in]

    Horizontal index structure

  • US [in]

    A dimensional unit scaling type

  • param_file [in]

    Parameter file parser structure.

  • MEKE [inout]

    MEKE fields

  • restart_CS [inout]

    MOM restart control struct

Callees call graph
Callees of mom_meke::meke_alloc_register_restart calls cluster_mom_error_handler MOM_error_handler cluster_mom_file_parser MOM_file_parser cluster_mom_meke MOM_MEKE cluster_mom_restart MOM_restart mom_error_handler::mom_mesg MOM_mesg mom_file_parser::interface::read_param read_param (interface) mom_meke::meke_alloc_register_restart MEKE_alloc_register_restart mom_meke::meke_alloc_register_restart->mom_error_handler::mom_mesg mom_meke::meke_alloc_register_restart->mom_file_parser::interface::read_param mom_restart::interface::register_restart_field register_restart_field (interface) mom_meke::meke_alloc_register_restart->mom_restart::interface::register_restart_field
Text view
Callers call graph
Callers of mom_meke::meke_alloc_register_restart calls cluster_mom MOM cluster_mom_meke MOM_MEKE mom::initialize_mom initialize_MOM mom_meke::meke_alloc_register_restart MEKE_alloc_register_restart mom::initialize_mom->mom_meke::meke_alloc_register_restart
Text view
subroutine MEKE_end(MEKE)

Deallocates any variables allocated in MEKE_alloc_register_restart.

Parameters
  • MEKE [inout]

    A structure with MEKE-related fields.

Callers call graph
Callers of mom_meke::meke_end calls cluster_mom MOM cluster_mom_meke MOM_MEKE mom::mom_end MOM_end mom_meke::meke_end MEKE_end mom::mom_end->mom_meke::meke_end
Text view
API generated with Flint · Rendered from reStructuredText