%% Generated by Sphinx.
\def\sphinxdocclass{report}
\documentclass[letterpaper,10pt,english]{sphinxmanual}
\ifdefined\pdfpxdimen
   \let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
\fi \sphinxpxdimen=.75bp\relax

\PassOptionsToPackage{warn}{textcomp}
\usepackage[utf8]{inputenc}
\ifdefined\DeclareUnicodeCharacter
% support both utf8 and utf8x syntaxes
  \ifdefined\DeclareUnicodeCharacterAsOptional
    \def\sphinxDUC#1{\DeclareUnicodeCharacter{"#1}}
  \else
    \let\sphinxDUC\DeclareUnicodeCharacter
  \fi
  \sphinxDUC{00A0}{\nobreakspace}
  \sphinxDUC{2500}{\sphinxunichar{2500}}
  \sphinxDUC{2502}{\sphinxunichar{2502}}
  \sphinxDUC{2514}{\sphinxunichar{2514}}
  \sphinxDUC{251C}{\sphinxunichar{251C}}
  \sphinxDUC{2572}{\textbackslash}
\fi
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amstext}
\usepackage{babel}



\usepackage{times}
\expandafter\ifx\csname T@LGR\endcsname\relax
\else
% LGR was declared as font encoding
  \substitutefont{LGR}{\rmdefault}{cmr}
  \substitutefont{LGR}{\sfdefault}{cmss}
  \substitutefont{LGR}{\ttdefault}{cmtt}
\fi
\expandafter\ifx\csname T@X2\endcsname\relax
  \expandafter\ifx\csname T@T2A\endcsname\relax
  \else
  % T2A was declared as font encoding
    \substitutefont{T2A}{\rmdefault}{cmr}
    \substitutefont{T2A}{\sfdefault}{cmss}
    \substitutefont{T2A}{\ttdefault}{cmtt}
  \fi
\else
% X2 was declared as font encoding
  \substitutefont{X2}{\rmdefault}{cmr}
  \substitutefont{X2}{\sfdefault}{cmss}
  \substitutefont{X2}{\ttdefault}{cmtt}
\fi


\usepackage[Bjarne]{fncychap}
\usepackage{sphinx}

\fvset{fontsize=\small}
\usepackage{geometry}


% Include hyperref last.
\usepackage{hyperref}
% Fix anchor placement for figures with captions.
\usepackage{hypcap}% it must be loaded after hyperref.
% Set up styles of URL: it should be placed after hyperref.
\urlstyle{same}


\usepackage{sphinxmessages}
\setcounter{tocdepth}{1}



\title{MOM6 Documentation}
\date{Oct 30, 2020}
\release{0.2a3}
\author{Alistair Adcroft\and Robert Hallberg\and Stephen Griffies\and Matthew Harrison\and Brandon Reichl\and Niki Zadeh\and John Krasting\and Nic Hannah}
\newcommand{\sphinxlogo}{\vbox{}}
\renewcommand{\releasename}{Release}
\makeindex
\begin{document}

\pagestyle{empty}
\sphinxmaketitle
\pagestyle{plain}
\sphinxtableofcontents
\pagestyle{normal}
\phantomsection\label{\detokenize{index::doc}}


Contents:


\chapter{About this documentation}
\label{\detokenize{about:about-this-documentation}}\label{\detokenize{about::doc}}
This readthedocs site hosts the nascent MOM6 user documentation.
MOM6 documentation is distributed over several formats and locations with each site serving a different purpose.

Here is where to find particular documentation:
\begin{description}
\item[{Download, compile and run}] \leavevmode
Installation documentation is in the form of user\sphinxhyphen{}driven (editable) wiki attached to the MOM6\sphinxhyphen{}examples GitHub repository.
Goto \sphinxurl{https://github.com/NOAA-GFDL/MOM6-examples/wiki} and look at “Getting Started”.

Installation, compilation and running are platform specific operations for which we can only provide templates (as is
done in on the wiki) but for which MOM6 developers cannot possibly support since every platform is different. Normally
a user needs to know where libraries (such as netcdf and MPI) and compilers are on their system but once these have
been established the documented compile process can be adpated to the local system.

\item[{User guide}] \leavevmode
\sphinxhref{http://mom6.readthedocs.org}{This site} provides a high\sphinxhyphen{}level overview of the model as well as the API reference (documentation
of source code).

The user guide is written in reStructuredText (.rst files) that reside in \sphinxcode{\sphinxupquote{docs/}} of the \sphinxhref{http://github.com/NOAA-GFDL/MOM6}{MOM6 source code}.
The rst files are processed by sphinx and hosted on \sphinxhref{http://mom6.readthedocs.org}{readthedocs}.

The API reference is generated documentation \sphinxhyphen{} we use doxygen for
in\sphinxhyphen{}code documentation. The Fortran doxygen format is rather cumbersome for
writing and we therefore use the C++ .dox files for much of this
documentation.

\item[{Repository policies}] \leavevmode
Policies governing how to the repositories are organized and operated live at \sphinxurl{https://github.com/NOAA-GFDL/MOM6-examples/wiki/MOM6-repository-policies}.

\item[{Developer guide}] \leavevmode
Beyond the API reference above, developer specific wiki pages are attached to the \sphinxtitleref{MOM6 code repository \textless{}https://github.com/NOAA\sphinxhyphen{}GFDL/MOM6/wiki\textgreater{}}.

\end{description}


\chapter{Equations}
\label{\detokenize{equations:equations}}\label{\detokenize{equations::doc}}
The model equations are the layer\sphinxhyphen{}integrated vector\sphinxhyphen{}invariant form of the
hydrostatic primitive equations (either Boussinesq or non\sphinxhyphen{}Boussinesq).

We present the equations starting from the hydrostatic Boussinesq equation in
height coordinates and progress through vector\sphinxhyphen{}invariant and
general\sphinxhyphen{}coordinate equations to the final equations used in the A.L.E.
algorithm, taken from \sphinxcite{zzbibliography:adcroft2019}.


\section{Notation for equations}
\label{\detokenize{api/generated/pages/Notation:notation-for-equations}}\label{\detokenize{api/generated/pages/Notation:notation}}\label{\detokenize{api/generated/pages/Notation::doc}}

\subsection{Symbols for variables}
\label{\detokenize{api/generated/pages/Notation:symbols-for-variables}}\label{\detokenize{api/generated/pages/Notation:notation-1symbols}}
\(z\) refers to elevation (or height), increasing upward so that for much of the ocean \(z\) is negative.

\(x\) and \(y\) are the Cartesian horizontal coordinates.

\(\lambda\) and \(\phi\) are the geographic coordinates on a sphere (longitude and latitude respectively).

Horizontal components of velocity are indicated by
\(u\) and \(v\) and vertical component by \(w\) .

\(p\) is pressure and \(\Phi\) is geo\sphinxhyphen{}potential:
\begin{equation*}
\begin{split}\Phi = g z .\end{split}
\end{equation*}
The thermodynamic state variables are usually salinity,
\(S\) , and potential temperature, \(\theta\) or the absolute salinity and conservative temperature, depending on the equation of state. \(\rho\) is in\sphinxhyphen{}situ density.


\subsection{Vector notation}
\label{\detokenize{api/generated/pages/Notation:vector-notation}}\label{\detokenize{api/generated/pages/Notation:notation-1vector-notation}}
The three\sphinxhyphen{}dimensional velocity vector is denoted
\(\boldsymbol{v}\)
\begin{equation*}
\begin{split}\boldsymbol{v} = \boldsymbol{u} + \widehat{\boldsymbol{k}} w ,\end{split}
\end{equation*}
where
\(\widehat{\boldsymbol{k}}\) is the unit vector pointed in the upward vertical direction and \(\boldsymbol{u} = (u, v, 0)\) is the horizontal component of velocity normal to the vertical.

The gradient operator without a suffix is three dimensional:
\begin{equation*}
\begin{split}\boldsymbol{\nabla} = ( \boldsymbol{\nabla}_z, \partial_z ) .\end{split}
\end{equation*}
but a suffix indicates a lateral gradient along a surface of constant property indicated by the suffix:
\begin{equation*}
\begin{split}\boldsymbol{\nabla}_z = \left( \left. \partial_x \right|_z, \left. \partial_y \right|_z, 0 \right) .\end{split}
\end{equation*}

\section{Governing Equations}
\label{\detokenize{api/generated/pages/Governing_Equations:governing-equations}}\label{\detokenize{api/generated/pages/Governing_Equations:id1}}\label{\detokenize{api/generated/pages/Governing_Equations::doc}}
The Boussinesq hydrostatic equations of motion in height coordinates are

\begin{eqnarray} D_t \boldsymbol{u} + f \widehat{\boldsymbol{k}} \times \boldsymbol{u} + \frac{\rho}{\rho_o} \boldsymbol{\nabla}_z \Phi + \frac{1}{\rho_o} \boldsymbol{\nabla}_z p &= \boldsymbol{\mathcal{F}} &\mbox{ momentum} \\ \rho \, \frac{\partial \Phi}{\partial z} + \frac{\partial p}{\partial z} &= 0 &\mbox{ hydrostatic} \\ \boldsymbol{\nabla}_z \cdotp \boldsymbol{u} + \frac{\partial w}{\partial z} &= 0 &\mbox{ thickness} \\ D_t \theta &= \boldsymbol{\mathcal{N}}_\theta^\gamma - \frac{\partial J_\theta^{(z)}}{\partial z} &\mbox{ potential temp} \\ D_t S &= \boldsymbol{\mathcal{N}}_S^\gamma - \frac{\partial J_S^{(z)}}{\partial z} &\mbox{ salinity} \\ \rho &= \rho(S, \theta, z) &\mbox{ equation of state.} \end{eqnarray}

where notation is described in {\hyperref[\detokenize{api/generated/pages/Notation:notation}]{\sphinxcrossref{\DUrole{std,std-ref}{Notation for equations}}}}
, \(\boldsymbol{\mathcal{F}}\) represents the accelerations due to the divergence of stresses including those provided through boundary interactions.

The prognostic thermodynamic variables are potential temperature,
\(\theta\) , and salinity \(S\) , which are related to \sphinxstyleemphasis{in situ} density \(\rho\) through the \sphinxcite{zzbibliography:wright1997} equation of state. In the potential temperature and salinity equations, fluxes due to diabatic, vertically oriented processes are indicated by \(J^{(z)}\) . The tendency due to the convergence of fluxes oriented along neutral directions is indicated by \(\boldsymbol{\mathcal{N}}^\gamma\) . Our implementation of this \sphinxstyleemphasis{neutral diffusion} parameterization is detailed in Shao et al. (personal comm.)

The total derivative is

\begin{eqnarray} D_t & \equiv \frac{\partial}{\partial t} + \boldsymbol{v} \cdotp \boldsymbol{\nabla} \\ &= \frac{\partial}{\partial t} + \boldsymbol{u} \cdotp \boldsymbol{\nabla}_z + w \frac{\partial}{\partial z}. \end{eqnarray}

The non\sphinxhyphen{}divergence of flow allows a total derivative to be re\sphinxhyphen{}written in flux form:

\begin{eqnarray} D_t \theta &= \frac{\partial}{\partial t} + \boldsymbol{\nabla} \cdotp ( \boldsymbol{v} \theta ) \\ &= \frac{\partial}{\partial t} + \boldsymbol{\nabla}_z \cdotp ( \boldsymbol{u} \theta ) + \frac{\partial ( w \theta )}{\partial z}. \end{eqnarray}

The above equations of motion can thus be written as:

\begin{eqnarray} D_t \boldsymbol{u} + f \widehat{\boldsymbol{k}} \times \boldsymbol{u} + \frac{\rho}{\rho_o}\boldsymbol{\nabla}_z \Phi + \frac{1}{\rho_o} \boldsymbol{\nabla}_z p &= \boldsymbol{\mathcal{F}} &\mbox{ momentum}\\ \rho \, \frac{\partial \Phi}{\partial z} + \frac{\partial p}{\partial z} &= 0 &\mbox{ hydrostatic} \\ \boldsymbol{\nabla}_z \cdotp \boldsymbol{u} + \frac{\partial w}{\partial z} &= 0 &\mbox{ thickness} \\ \frac{\partial \theta}{\partial t} + \boldsymbol{\nabla}_z \cdotp ( \boldsymbol{u} \theta ) + \frac{\partial ( w \theta )}{\partial z} &= \boldsymbol{\mathcal{N}}_\theta^\gamma - \frac{\partial J_\theta^{(z)}}{\partial z} &\mbox{ potential temp} \\ \frac{\partial S}{\partial t} + \boldsymbol{\nabla}_z \cdotp ( \boldsymbol{u} S ) + \frac{\partial ( w S )}{\partial z} &= \boldsymbol{\mathcal{N}}_S^\gamma - \frac{\partial J_S^{(z)}}{\partial z} &\mbox{ salinity} \\ \rho &= \rho(S, \theta, z) &\mbox{ equation of state.} \end{eqnarray}


\subsection{Vector Invariant Equations}
\label{\detokenize{api/generated/pages/Governing_Equations:vector-invariant-equations}}\label{\detokenize{api/generated/pages/Governing_Equations:governing-equations-1vector-invariant-eqns}}
MOM6 solves the momentum equations written in vector\sphinxhyphen{}invariant form.

A vector identity allows the total derivative of velocity to be written in the vector\sphinxhyphen{}invariant form:

\begin{eqnarray} D_t \boldsymbol{u} &= \partial_t \boldsymbol{u} + \boldsymbol{v} \cdotp \boldsymbol{\nabla} \boldsymbol{u} \\ &= \partial_t \boldsymbol{u} + \boldsymbol{u} \cdotp \boldsymbol{\nabla}_z \boldsymbol{u} + w \partial_z \boldsymbol{u} \\ &= \partial_t \boldsymbol{u} + \left( \boldsymbol{\nabla} \times \boldsymbol{u} \right) \times \boldsymbol{v} + \boldsymbol{\nabla} \underbrace{\frac{1}{2} \left|\boldsymbol{u}\right|^2}_{\equiv K} . \end{eqnarray}

The flux\sphinxhyphen{}form equations of motion in height coordinates can thus be written succinctly as:

\begin{eqnarray} \partial_t \boldsymbol{u} + \left( f \widehat{\boldsymbol{k}} + \boldsymbol{\nabla} \times \boldsymbol{u} \right) \times \boldsymbol{v} + \boldsymbol{\nabla} K + \frac{\rho}{\rho_o} \boldsymbol{\nabla} \Phi + \frac{1}{\rho_o} \boldsymbol{\nabla} p &= \boldsymbol{\mathcal{F}} &\mbox{ momentum} \\ \boldsymbol{\nabla}_z \cdotp \boldsymbol{u} + \partial_z w &= 0 &\mbox{ thickness} \\ \partial_t \theta + \boldsymbol{\nabla}_z \cdotp ( \boldsymbol{u} \theta ) + \partial_z ( w \theta ) &= \boldsymbol{\mathcal{N}}_\theta^\gamma - \frac{\partial J_\theta^{(z)}}{\partial z} &\mbox{ potential temp} \\ \partial_t S + \boldsymbol{\nabla}_z \cdotp ( \boldsymbol{u} S ) + \partial_z ( w S ) &= \boldsymbol{\mathcal{N}}_S^\gamma - \frac{\partial J_S^{(z)}}{\partial z} &\mbox{ salinity} \\ \rho &= \rho(S, \theta, z) &\mbox{ equation of state} \end{eqnarray}

where the horizontal momentum equations and vertical hydrostatic balance equation have been written as a single three\sphinxhyphen{}dimensional equation.


\section{General coordinate equations}
\label{\detokenize{api/generated/pages/General_Coordinate:general-coordinate-equations}}\label{\detokenize{api/generated/pages/General_Coordinate:general-coordinate}}\label{\detokenize{api/generated/pages/General_Coordinate::doc}}
General coordinate equations

Transforming to a vertical coordinate
\(r(z,x,y,t)\) , with \(\dot{r} = \frac{\partial r}{\partial t}\) …

The Boussinesq hydrostatic equations of motion in general\sphinxhyphen{}coordinate
\(r\) are:

\begin{eqnarray} \rho_0 \left( \frac{\partial \mathbf{u}}{\partial t} + ( f + \zeta ) \, \hat{\mathbf{z}} \times \mathbf{u} + \dot{r} \, \frac{\partial \mathbf{u}}{\partial r} + \nabla_r \, K \right) &= -\nabla_r \, p - \rho \nabla_r \, \Phi + \boldsymbol{\mathcal{F}} &\mbox{momentum} \label{eq:r-horz-momentum} \\ \rho \, \frac{\partial \Phi}{\partial r} + \frac{\partial p}{\partial r} &= 0 &\mbox{hydrostatic} \label{eq:r-hydrostatic-equation} \\ \frac{\partial z_r }{\partial t} + \nabla_r \cdot \, \left( z_r \, \mathbf{u} \right) + \frac{\partial ( z_r \, \dot{r} ) }{\partial r} &= 0 &\mbox{thickness} \label{eq:r-non-divergence} \\ \frac{\partial ( \theta \, z_r ) }{\partial t} + \nabla_r \cdot \left( \theta z_r \, \mathbf{u} \right) + \frac{\partial ( \theta \, z_r \, \dot{r} )}{\partial r} &= z_r \boldsymbol{\mathcal{N}}_\theta^\gamma - \frac{\partial J_\theta^{(z)}}{\partial r} &\mbox{potential temp} \label{eq:r-temperature-equation} \\ \frac{\partial ( S \, z_r) }{\partial t} + \nabla_r \cdot \left( S \, z_r \, \mathbf{u} \right) + \frac{\partial ( S \, z_r \, \dot{r} )}{\partial r} &= z_r \boldsymbol{\mathcal{N}}_S^\gamma - \frac{\partial J_S^{(z)}}{\partial r} &\mbox{salinity} \label{eq:r-salinity-equation} \\ \rho &= \rho\left( S, \theta, -g \rho_0 z(r) \right) &\mbox{equation of state.} \end{eqnarray}

The time derivatives are now computed with the generalized vertical coordinate fixed rather than the geopotential. We introduced the specific thickness,
\(z_r = \partial z/\partial r\) , which measures the inverse vertical stratification of the vertical coordinate surfaces.

Similar to \sphinxcite{zzbibliography:bleck2002}
, MOM6 is discretized in the vertical by integrating between surfaces of \(r\) to yield layer equations where the layer thickness is \(h = \int z_r dr\) and variables are treated as finite volume averages over each layer:

\begin{eqnarray} \rho_0 \left( \frac{\partial \mathbf{u}}{\partial t} + \frac{( f + \zeta )}{h} \, \hat{\mathbf{z}} \times h \, \mathbf{u} + \underbrace{ \dot{r} \, \frac{\partial \mathbf{u}}{\partial r} } + \nabla_r K \right) &= -\nabla_r \, p - \rho \nabla_r \, \Phi + \boldsymbol{\mathcal{F}} &\mbox{momentum} \label{eq:h-horz-momentum} \\ \rho \, \delta_r \Phi + \delta_r p &= 0 &\mbox{hydrostatic} \label{eq:h-hydrostatic-equation} \\ \frac{\partial h}{\partial t} + \nabla_r \cdot \left( h \, \mathbf{u} \right) + \underbrace{ \delta_r ( z_r \dot{r} ) } &= 0 &\mbox{thickness} \label{eq:h-thickness-equation} \\ \frac{\partial ( \theta \, h )}{\partial t} + \nabla_r \cdot \left( \theta h \, \mathbf{u} \right) + \underbrace{ \delta_r ( \theta \, z_r \dot{r} ) } &= h \boldsymbol{\mathcal{N}}_\theta^\gamma - \delta_r J_\theta^{(z)} &\mbox{potential temp} \label{eq:h-temperature-equation} \\ \frac{\partial ( S \, h )}{\partial t} + \nabla_r \cdot \left( S \, h \, \mathbf{u} \right) + \underbrace{ \delta_r ( S \, z_r \dot{r} ) } &= h \boldsymbol{\mathcal{N}}_S^\gamma - \delta_r J_S^{(z)} &\mbox{salinity} \label{eq:h-salinity-equation} \\ \rho &= \rho\left( S, \theta, -g \rho_0 z(r) \right) &\mbox{equation of state,} \label{eq:h-equation-of-state} \end{eqnarray}

where
\(\delta_{r} = \mathrm{d}r \, (\partial/\partial r)\) is the discrete vertical difference operator. The pressure gradient accelerations in the momentum equation are written in continuous\sphinxhyphen{}in\sphinxhyphen{}the\sphinxhyphen{}vertical form for brevity; the exact discretization is detailed in \sphinxcite{zzbibliography:adcroft2008} . The MOM6 time\sphinxhyphen{}stepping algorithm integrates the above layer\sphinxhyphen{}averaged equations forward allowing the vertical grid to follow the motion, i.e. \(\dot{r}=0\) , so that the underbraced terms are dropped. This approach is generally known as the Lagrangian method but here the Lagrangian method is used only in the vertical direction. After each Lagrangian step, a remap step is applied that generates a new vertical grid of the user’s choosing. The ocean state is then mapped from the old to the new grid. The physical state is not meant to change during the remap step, yet truncation errors make remapping imperfect. We employ high\sphinxhyphen{}order accurate reconstructions to minimize errors introduced during the remap step (\sphinxcite{zzbibliography:white2008} , \sphinxcite{zzbibliography:white2009} ). The connection between time\sphinxhyphen{}stepping and remapping is described in section {\hyperref[\detokenize{api/generated/pages/ALE_Timestep:ale-timestep}]{\sphinxcrossref{\DUrole{std,std-ref}{ALE Timestep}}}} .


\section{Specifics}
\label{\detokenize{api/generated/pages/Specifics:specifics}}\label{\detokenize{api/generated/pages/Specifics:id1}}\label{\detokenize{api/generated/pages/Specifics::doc}}
Specifics of the Ocean Model Equations

We here provide more details of the terms appearing in the ocean model equations described in {\hyperref[\detokenize{api/generated/pages/General_Coordinate:general-coordinate}]{\sphinxcrossref{\DUrole{std,std-ref}{General coordinate equations}}}}
.


\subsection{Horizontal Momentum Equation}
\label{\detokenize{api/generated/pages/Specifics:horizontal-momentum-equation}}\label{\detokenize{api/generated/pages/Specifics:specifics-1horiz-mom-eq}}
Equation is the horizontal momentum equation written in its vector\sphinxhyphen{}invariant advective form with
\(\mathbf{u} = \hat{\mathbf{x}} \, u + \hat{\mathbf{y}} \, v\) the horizontal velocity, \(p\) the hydrostatic pressure, \(f\) the Coriolis parameter, and
\begin{equation*}
\begin{split}\zeta^{(r)} = \hat{\bf z} \cdot (\nabla_{r}\times \mathbf{u})\end{split}
\end{equation*}
the vertical component of the vorticity using \(\nabla_{r}\) for the curl operator. The discretization of the Coriolis term is the enstrophy conserving scheme of \sphinxcite{zzbibliography:sadourny1975} . The geopotential coordinate, \(z\) , has a value \(z=0\) at a resting ocean surface, \(z=\eta(x,y,t)\) at the ocean free surface, and \(z=-H(x,y)\) at the ocean bottom. We use the Boussinesq approximation (volume conserving kinematics) with \(\rho_{0} = 1035~\mbox{kg}~\mbox{m}^{-3}\) the reference density. Time and horizontal derivatives are computed holding the generalized vertical coordinate fixed rather than the geopotential
\begin{equation*}
\begin{split}\frac{\partial}{\partial t} = \left[ \frac{\partial}{\partial t} \right]_{r} \qquad \nabla_{r} = \hat{\mathbf{x}} \left[ \frac{\partial}{\partial x} \right]_{r} + \hat{\mathbf{y}} \left[ \frac{\partial}{\partial y} \right]_{r}.\end{split}
\end{equation*}
The transport of seawater crossing surfaces of constant
\(r\) is measured by the dia\sphinxhyphen{}surface velocity component (see section 6.7 of \sphinxcite{zzbibliography:smgbook} )
\begin{equation*}
\begin{split}\frac{\partial z}{\partial r} \, \frac{\mathrm{D}r}{\mathrm{D}t} = z_{r} \, \dot{r},\end{split}
\end{equation*}
with \(z_{r}\) the specific thickness that is assumed one\sphinxhyphen{}signed throughout the ocean, and \(\mathrm{D}/\mathrm{D}t\) the material time derivative operator. In the ocean interior where \(r\) is aligned with isopycnals, the dia\sphinxhyphen{}surface velocity becomes the diapycnal velocity whose value is directly related to irreversible processes such as mixing that act on potential temperature and salinity. In the unstratified mixed layers, \(r =z^{*}\) so that \(z_{r} \dot{r} = (\partial z/\partial z^{*}) \, \mathrm{D}z^{*}/\mathrm{D}t\) , which is close to the familiar vertical velocity component \(\mathrm{D}z/\mathrm{D}t\) .

Viscous dissipation (Laplacian and biharmonic friction following \sphinxcite{zzbibliography:griffies2000}
) and mechanical boundary forces (winds, bottom stress) contribute to the divergence of the deviatoric (symmetric and trace\sphinxhyphen{}free) stress tensor, \(\boldsymbol{\mathcal{F}} = \nabla \cdot \mathbf{\tau}\) . MOM6 and the real ocean have no vertical sidewalls, and MOM6 treats all solid\sphinxhyphen{}earth boundaries with bottom stress parameterized as a quadratic drag.


\subsection{Hydrostatic balance}
\label{\detokenize{api/generated/pages/Specifics:hydrostatic-balance}}\label{\detokenize{api/generated/pages/Specifics:specifics-1hydrostatic-balance}}
Equation is the discrete version of the hydrostatic balance. The horizontal pressure gradient force is implemented as a contact force following the method of \sphinxcite{zzbibliography:adcroft2008}
. These equations differ from \sphinxcite{zzbibliography:bleck2002} who uses the Montgomery potential to calculate pressure gradient accelerations.


\subsection{Thickness and tracer equations}
\label{\detokenize{api/generated/pages/Specifics:thickness-and-tracer-equations}}\label{\detokenize{api/generated/pages/Specifics:specifics-1thickness-and-tracer}}
Volume conservation appears in the form of a prognostic flux\sphinxhyphen{}form layer thickness equation, with the non\sphinxhyphen{}negative layer thickness given by
\begin{equation*}
\begin{split}h = \frac{\partial z}{\partial r} \, \mathrm{d}r,\end{split}
\end{equation*}
where \(\mathrm{d}r\) is the thickness of a layer in \(r\) \sphinxhyphen{}space (e.g., the density difference between target density classes or the thickness between target depths). The layer thickness increases where horizontal thickness fluxes converge, \(\nabla_r \cdot \left( h_k \, \mathbf{u} \right) < 0\) , and where dia\sphinxhyphen{}surface flow converges, \(\delta_r (z_{r} \, \dot{r} ) < 0\) . The volume flux \(h_k \mathbf{u}\) is computed using the quasi\sphinxhyphen{}third order PPM scheme (\sphinxcite{zzbibliography:colella1984} ) using a positive\sphinxhyphen{}definite limiter rather than the monotonic limiter. This last choice avoids limiting of positive extrema and thus retains third\sphinxhyphen{}order accuracy everywhere except near vanishing layers.

Transport in the thickness equation is discretized compatibly with that in the flux\sphinxhyphen{}form potential temperature and salinity equations and . Compatibility is required to maintain global and layer integrated conservation properties for volume, heat, and salt. Tracer reconstruction for transport uses PPM with monotonic limiters but using third order interpolation for edge values. This reduces the size of the stencil which helps the computational efficiency of the transport scheme. The flux convergences,
\(\boldsymbol{\mathcal{N}}_\theta^\gamma\) and \(\boldsymbol{\mathcal{N}}_S^\gamma\) , provide subgrid scale neutral diffusion for the potential temperature and salinity, whereas \(\delta_{r}J_{\theta}^{(z)}\) and \(\delta_{r}J_{S}^{(z)}\) provide subgrid scale vertical diffusion as well as boundary fluxes. In the interior, both subgrid fluxes vanish when their respective tracers are spatially uniform, thus ensuring that the tracer equation reduces to the thickness equation when the tracer is uniform.

Parameterized subgrid scale advection from the submesoscale (\sphinxcite{zzbibliography:fox-kemper2011}
) and mesoscale (\sphinxcite{zzbibliography:gent1995} ) parameterizations are combined with the lateral advection of thickness and tracer, thus providing a residual mean advective transport for the scalar fields. Furthermore, we implement subgrid advective terms solely as lateral transports, thus interpreting them as layer bolus transport as appropriate for vertical Lagrangian models rather than a three\sphinxhyphen{}dimensional eddy\sphinxhyphen{}induced advection as appropriate for vertical Eulerian models (see \sphinxcite{zzbibliography:mcdougall2001} for details).


\subsection{Equation of state}
\label{\detokenize{api/generated/pages/Specifics:equation-of-state}}\label{\detokenize{api/generated/pages/Specifics:specifics-1eos}}
The equation of state,, determines
\sphinxstyleemphasis{in situ}
density as a function of potential temperature, salinity, and pressure. We evaluate the pressure in the equation of state according to \(- g \, \rho_{0} \, z\) . Doing so maintains energetic consistency for the Boussinesq fluid according to section 2.4.3 of \sphinxcite{zzbibliography:gvbook} . We make use of the \sphinxcite{zzbibliography:wright1997} equation of state so that \(\theta\) is potential temperature and \(S\) is the practical salinity. Although MOM6 has the more updated equation of state from \sphinxcite{zzbibliography:teos2010} , the required changes for thermodynamic variables were implemented only after the basic model configuration was developed. Time constraints on model development prompted us to retain usage of \sphinxcite{zzbibliography:wright1997} for OM4.

The freezing point of seawater is approximated as
\begin{equation*}
\begin{split}T_f = -0.054 S - 7.75\times10^{-08} p,\end{split}
\end{equation*}
where \(p\) is in units of Pascals and \(S\) is in units of \(1\times10^{-3}\) . When the local temperature anywhere in the ocean column falls below the freezing point, the water\sphinxhyphen{}equivalent volume of ice is calculated and the fusion heat locally added back to the ocean to raise the liquid seawater temperature back to the freezing point. The frozen water and salt are sent to the sea\sphinxhyphen{}ice model.


\section{ALE}
\label{\detokenize{api/generated/pages/ALE:ale}}\label{\detokenize{api/generated/pages/ALE:id1}}\label{\detokenize{api/generated/pages/ALE::doc}}
Basics of the Vertical Lagrangian\sphinxhyphen{}Remap Method in MOM6

As discussed by \sphinxcite{zzbibliography:adcroft2006}
, there are two general classes of algorithms that frame how hydrostatic ocean models are formulated. The two classes differ in how they treat the vertical direction. Quasi\sphinxhyphen{}Eulerian methods follow the approach traditionally used in geopotential coordinate models, whereby vertical motion is diagnosed via the continuity equation. Quasi\sphinxhyphen{}Lagrangian methods are traditionally used by layered isopycnal models, with the Lagrangian approach specifying motion that crosses coordinate surfaces. Indeed, such dia\sphinxhyphen{}surface flow can be set to zero using Lagrangian methods for studies of adiabatic dynamics. MOM6 makes use of the vertical Lagrangian remap method, as pioneered for ocean modeling by \sphinxcite{zzbibliography:bleck2002} , which is a limit case of the Arbitrary\sphinxhyphen{}Lagrangian\sphinxhyphen{}Eulerian method (\sphinxcite{zzbibliography:hirt1997} ). Dia\sphinxhyphen{}surface transport is implemented via a remapping so that the method can be summarized as the Lagrangian plus remap approach and is essentially a one\sphinxhyphen{}dimensional version of the incremental remapping of \sphinxcite{zzbibliography:dukowicz2000} .

The MOM6 implementation of the vertical Lagrangian\sphinxhyphen{}remap method makes use of two general steps. The first evolves the ocean state forward in time according to a vertical Lagrangian limit with
\(\dot{r}=0\) . Hence, the horizontal momentum, thickness, and tracers are time stepped with the red terms removed in equations, ,, and. All advective transport thus occurs within a layer as defined by constant \(r\) \sphinxhyphen{}surfaces so that the volume within each layer is fixed. All other terms are retained in their full form, including subgrid scale terms that contribute to the transfer of tracer and momentum into distinct \(r\) layers (e.g., dia\sphinxhyphen{}surface diffusion of tracer and velocity). Maintaining constant volume within a layer yet allowing for tracers to move between layers engenders no inconsistency between tracer and thickness evolution. The reason is that tracer diffusion, even dia\sphinxhyphen{}surface diffusion, does not transfer volume.

The second step in the algorithm comprises the generation of a new vertical grid following a prescription, such as whether the grid should align with isopcynals or constant
\(z^{*}\) or a combination. The ocean state is then vertically remapped to the newly generated vertical grid. The remapping step incorporates dia\sphinxhyphen{}surface transfer of properties, with such transfer depending on the prescription given for the vertical grid generation. To minimize discretization errors and the associated spurious mixing, the remapping step makes use of the high order accurate methods developed by \sphinxcite{zzbibliography:white2008} and \sphinxcite{zzbibliography:white2009} .

The underlying algorithm for treatment of the vertical can be related to operator\sphinxhyphen{}splitting of the red terms in equations
. If we consider, for simplicity, an Euler\sphinxhyphen{}forward update for a time\sphinxhyphen{}step \(\Delta t\) , the time\sphinxhyphen{}stepping for the continuity and temperature equation can be summarized as

\begin{eqnarray} h^\dagger &= h^{(n)} - \Delta t \left[ \nabla_r \cdot \left( h \, \mathbf{u} \right) \right] &\mbox{thickness} \label{eq:ale-thickness-equation} \\ \theta^\dagger \, h^\dagger &= \theta^{(n)} \, h^{(n)} - \Delta t \left[ \nabla_r \cdot \left( \theta h \, \mathbf{u} \right) - h \boldsymbol{\mathcal{N}}_\theta^\gamma + \delta_r J_\theta^{(z)} \right] &\;\;\;\;\mbox{potential temp} \label{eq:ale-temperature-equation} \\ h^{(n+1)} &= h^\dagger - \Delta t \, \delta_r \left( z_r \dot{r} \right) &\mbox{move grid} \label{eq:ale-new-grid} \\ \theta^{(n+1)} h^{(n+1)} &= \theta^\dagger h^\dagger - \Delta t \, \delta_r \left( z_r \dot{r} \, \theta^\dagger \right) &\mbox{remap temperature.} \label{eq:ale-remap-temperature} \end{eqnarray}

Substituting into recovers a time\sphinxhyphen{}discrete form of. The intermediate quantities indicated by
\(^\dagger\) \sphinxhyphen{}symbols are the result of the vertical Lagrangian step of the algorithm. What were the red terms in the continuous\sphinxhyphen{}in\sphinxhyphen{}time equations are used to evolve the the intermediate quantities to the final updated quantities each step. In MOM6, equation  is essentially used to define the dia\sphinxhyphen{}surface transport \(z_r \dot{r}\) by prescribing \(h^{(n+1)}\) . For example, to recover a z\sphinxhyphen{}coordinate model, \(h^{(n+1)}=\Delta z\) , and \(z_r \dot{r}\) becomes the Eulerian vertical velocity, \(w\) .

Within the above framework for evolving the ocean state, we make use of a standard split\sphinxhyphen{}explicit time stepping method by decomposing the horizontal momentum equation into its fast (depth integrated) and slow (deviation from depth integrated) components. Furthermore, we follow the methods of \sphinxcite{zzbibliography:hallberg2009}
to ensure that the free surface resulting from time stepping the depth integrated thickness equation (i.e., the free surface equation) is consistent with the sum of the thicknesses that result from time stepping the layer thickness equations for each of the discretized layers; i.e., \(\sum_{k} h = H + \eta\) .


\chapter{Spatial Discretization}
\label{\detokenize{discrete_space:spatial-discretization}}\label{\detokenize{discrete_space::doc}}
The model equations are the layer\sphinxhyphen{}integrated vector\sphinxhyphen{}invariant form of the
hydrostatic primitive equations (either Boussinesq or non\sphinxhyphen{}Boussinesq).

We present the equations starting from the hydrostatic Boussinesq equation in
height coordinates and progress through vector\sphinxhyphen{}invariant and
general\sphinxhyphen{}coordinate equations to the final equations used in the A.L.E.
algorithm.


\section{Discrete Horizontal and Vertical Grids}
\label{\detokenize{api/generated/pages/Discrete_Grids:discrete-horizontal-and-vertical-grids}}\label{\detokenize{api/generated/pages/Discrete_Grids:discrete-grids}}\label{\detokenize{api/generated/pages/Discrete_Grids::doc}}
Discrete Horizontal and Vertical Grids


\subsection{Horizontal grids}
\label{\detokenize{api/generated/pages/Discrete_Grids:horizontal-grids}}\label{\detokenize{api/generated/pages/Discrete_Grids:discrete-grids-1horizontal-grids}}
The placement of model variables on the horizontal C\sphinxhyphen{}grid is illustrated here:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{Arakawa_C_grid}.png}
\caption{MOM6 uses an Arakawa C grid staggering of variables with a North\sphinxhyphen{}East indexing convention.}\label{\detokenize{api/generated/pages/Discrete_Grids:id1}}\end{figure}

Scalars are located at the \(h\) \sphinxhyphen{}points, velocities are staggered such that \(u\) \sphinxhyphen{}points and \(v\) \sphinxhyphen{}points are not co\sphinxhyphen{}located, and vorticities are located at \(q\) \sphinxhyphen{}points. The indexing for points ( \(i,j\) ) in the logically\sphinxhyphen{}rectangular domain is such that \(i\) increases in the \(x\) direction (eastward for spherical polar coordinates), and \(j\) increases in the \(y\) direction (northward for spherical polar coordinates). A \(q\) \sphinxhyphen{}point with indices ( \(i,j\) ) lies to the upper right (northeast) of the \(h\) \sphinxhyphen{}point with the same indices. The index for the vertical dimension \(k\) increases with depth, although the vertical coordinate \(z\) , measured from the mean surface level \(z = 0\) , decreases with depth.

When the horizontal grid is generated, it is actually computed on the “supergrid” at twice the nominal resolution of the model. The grid file contains the grid metrics and the areas of this fine grid. The model then decomposes it into the four staggered grids, along with computing the grid metrics as shown here:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{Grid_metrics}.png}
\caption{The grid metrics around both \$h\$\sphinxhyphen{}points and \$q\$\sphinxhyphen{}points.}\label{\detokenize{api/generated/pages/Discrete_Grids:id2}}\end{figure}

The model carries both the metrics as well as their inverses, for instance, IdyT = 1/dyT. There are also the areas and the inverse areas for all four grid locations. areaT and areaBu are the sum of the four areas from the supergrid surrounding each h\sphinxhyphen{}point and each q\sphinxhyphen{}point, respectively. The velocity faces can be partially blocked and their areas are adjusted accordingly, where \(dy\_Cu\) and \(dx\_Cv\) are the blocked distances at \(u\) and \(v\) points, respectively.

\begin{eqnarray} \mbox{areaCu}_{i,j} &= dxCu_{i,j} * dy\_Cu_{i,j} \\ \mbox{areaCv}_{i,j} &= dx\_Cv_{i,j} * dyCv_{i,j} \\ \mbox{IareaCu}_{i,j} &= 1 / \mbox{areaCu}_{i,j} \\ \mbox{IareaCv}_{i,j} &= 1 / \mbox{areaCv}_{i,j} \end{eqnarray}

The horizontal grids can be spherical, tripole, regional, or cubed sphere. The default is for grids to be re\sphinxhyphen{}entrant in the
\(x\) \sphinxhyphen{}direction; this needs to be turned off for regional grids.


\subsection{Vertical grids}
\label{\detokenize{api/generated/pages/Discrete_Grids:vertical-grids}}\label{\detokenize{api/generated/pages/Discrete_Grids:discrete-grids-1vertical-grids}}
The placement of model variables in the vertical is illustrated here:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{cell_3d}.png}
\caption{The MOM6 interfaces are at vertical location \$e\$ which are separated by the layer thicknesses \$h\$.}\label{\detokenize{api/generated/pages/Discrete_Grids:id3}}\end{figure}

The vertical coordinate is Lagrangian in that the interfaces between the layers are free to move up and down with time. The interfaces have target depths or target densities, depeneding on the desired vertical coordinate system. They can even have target sigma values for terrain\sphinxhyphen{}following coordinates or you can design a hybrid coordinate in which different interfaces have differing behavior. In any case, the interfaces move with the fluid during the dynamic timesteps and then get reset during a remapping operation. See section {\hyperref[\detokenize{api/generated/pages/ALE_Timestep:ale-timestep}]{\sphinxcrossref{\DUrole{std,std-ref}{ALE Timestep}}}} for details.


\section{Finite Difference Operators}
\label{\detokenize{api/generated/pages/Finite_Difference_Operators:finite-difference-operators}}\label{\detokenize{api/generated/pages/Finite_Difference_Operators:id1}}\label{\detokenize{api/generated/pages/Finite_Difference_Operators::doc}}
Finite Difference Operators


\section{PPM Advection Scheme}
\label{\detokenize{api/generated/pages/PPM:ppm-advection-scheme}}\label{\detokenize{api/generated/pages/PPM:ppm}}\label{\detokenize{api/generated/pages/PPM::doc}}
PPM Advection Scheme

Following \sphinxcite{zzbibliography:colella1984}
and \sphinxcite{zzbibliography:carpenter1990} , we use the Piecewise Parabolic Method (PPM) to represent values within the model cells. Each cell is assumed to have a piecewise parabolic representation, which is uniquely prescribed by conservation and the two edge values. This method has the following features:
\begin{itemize}
\item {} 
The PPM approach is conservative.

\item {} 
The (unlimited) order of accuracy is determined by the estimates of the edge values.

\item {} 
Monotonicity is ensured by adjusting the edge values to flatten the profile.

\end{itemize}

An example is shown in this figure:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{ppm_arc}.png}
\caption{The parabolic representation of a field within a cell.}\label{\detokenize{api/generated/pages/PPM:id5}}\end{figure}
\begin{equation*}
\begin{split}x'_i \equiv \frac{x - x_{i-1/2}} {\Delta x_i}\end{split}
\end{equation*}\begin{equation*}
\begin{split}\Delta x_i \equiv x_{i + 1/2} - x_{i- 1/2}\end{split}
\end{equation*}\begin{equation*}
\begin{split}c \equiv u \Delta t / \Delta x_i\end{split}
\end{equation*}\begin{equation*}
\begin{split}A_i(x') = a_L + (a_R - a_L) x'_i + a_6 x'_i(1 - x'_i)\end{split}
\end{equation*}\begin{equation*}
\begin{split}a_6 = 6a_i - 3 (a_R + a_L)\end{split}
\end{equation*}
\begin{eqnarray} a_i &= \int_0^1 A_i(x'_i) dx'_i = \int_0^1 a_L + (a_R - a_L) x'_i + a_6 x'_i (1 - x'_i) dx'_i \\ &= \left[ a_L x'_i + \frac{1}{2} (a_R - a_L) x_i^{\prime 2} + a_6 \left( \frac{1}{2} x_i^{\prime 2} - \frac{1}{3} x_i^{\prime 3} \right) \right]_0^1 \\ &= \frac{1}{2} (a_R + a_L) + \frac{1}{6} a_6 \end{eqnarray}

\begin{eqnarray} F_{i+1/2} &= \frac{1}{\Delta t} \int_{x_{i + 1/2} - u \Delta t}^{x_{i + 1/2}} A_i^n(x) dx = \frac{\Delta x}{\Delta t} \int_{1-c}^1 A_i (x'_i) dx'_i \\ &= \frac{\Delta x}{\Delta t} \left[ a_L x'_i + \frac{1}{2} (a_R - a_L) x_i^{\prime 2} + a_6 \left( \frac{1}{2} x_i^{\prime 2} - \frac{1}{3} x_i^{\prime 3} \right) \right]_{1 - c}^1 \\ &= \frac{\Delta x}{\Delta t} \left[ a_L c + (a_R - a_L + a_6) \left( c - \frac{1}{2} c^2 \right) - a_6 \left( c - c^2 + \frac{1}{3} c^3 \right) \right] \\ &= u \left[ a_R + \frac{1}{2} (a_L - a_R) c + a_6 \left( \frac{1}{2} c - \frac{1}{3} c^2 \right) \right] \end{eqnarray}

The choice of
\(a_L\) and \(a_R\) is not unique, but can be done according to \sphinxcite{zzbibliography:colella1984} (CW84) or \sphinxcite{zzbibliography:huynh1997} (H3) as mentioned in {\hyperref[\detokenize{api/generated/pages/Tracer_Advection:tracer-advection}]{\sphinxcrossref{\DUrole{std,std-ref}{Tracer Advection}}}} .


\section{Discrete Coriolis Term}
\label{\detokenize{api/generated/pages/Discrete_Coriolis:discrete-coriolis-term}}\label{\detokenize{api/generated/pages/Discrete_Coriolis:discrete-coriolis}}\label{\detokenize{api/generated/pages/Discrete_Coriolis::doc}}

\subsection{Coriolis Term}
\label{\detokenize{api/generated/pages/Discrete_Coriolis:coriolis-term}}\label{\detokenize{api/generated/pages/Discrete_Coriolis:discrete-coriolis-1coriolis}}
In general, the discrete equations are written as simple difference equations based on the Arakawa C\sphinxhyphen{}grid as described in section {\hyperref[\detokenize{api/generated/pages/Discrete_Grids:discrete-grids-1horizontal-grids}]{\sphinxcrossref{\DUrole{std,std-ref}{Horizontal grids}}}}
. One of the more interesting exceptions is the Coriolis term. It is computed in the form shown in, or:
\begin{equation*}
\begin{split}\frac{( f + \zeta )}{h} \, \hat{\mathbf{z}} \times h \, \mathbf{u}\end{split}
\end{equation*}
This term needs to be evaluated at
\(u\) points for the \(v\) equation and vice versa, plus we need to keep the thickness, \(h\) , positive definite. MOM6 contains a number of options for how to compute this term.
\begin{itemize}
\item {} 
SADOURNY75\_ENERGY Sadourny \sphinxcite{zzbibliography:sadourny1975} figured out how to conserve energy or enstrophy but not both. This option is energy conserving. The term in the \(u\) equation becomes:

\end{itemize}
\begin{equation*}
\begin{split}\frac{1}{4 dx} \left( q_{i,j} (vh_{i+1,j} + vh_{i,j}) + q_{i,j-1} (vh_{i+1,j-1} + vh_{i,j-1}) \right)\end{split}
\end{equation*}
where \(q = \frac{f + \zeta}{h}\) and \(h\) is an area\sphinxhyphen{}weighted average of the four thicknesses surrounding the \(q\) point, such that it is guaranteed to be positive definite.

There is a variant on this scheme with the CORIOLIS\_EN\_DIS option. If true, two estimates of the thickness fluxes \(vh\) are used to estimate the Coriolis term, and the one that dissipates energy relative to the other one is used.
\begin{itemize}
\item {} 
SADOURNY75\_ENSTRO Also from \sphinxcite{zzbibliography:sadourny1975} , this option is enstrophy conserving.

\end{itemize}
\begin{equation*}
\begin{split}\frac{1}{8 dx} ( q_{i,j} + q_{i,j-1} ) ((vh_{i+1,j} + vh_{i,j}) + (vh_{i+1,j-1} + vh_{i,j-1}) )\end{split}
\end{equation*}\begin{itemize}
\item {} 
ARAKAWA\_LAMB81 From \sphinxcite{zzbibliography:arakawa1981} is a scheme which is both energy and enstrophy conserving. Its weaknesses are a large stencil and differing thickness stencils in the numerator and denominator. This scheme and several others (with differing values of \(a, b, c, d\) and \(ep\) ) are implemented as:

\end{itemize}

\begin{eqnarray} \frac{1}{dx} (a_{i,j} vh_{i+1,j} &+ b_{i,j} vh_{i,j} + d_{i,j} vh_{i+1,j-1} + c_{i,j} vh_{i,j-1} \\ &+ ep_{i,j}*uh_{i-1,j} - ep_{i+1,j}*uh_{i+1,j}) \label{eq:Coriolis_abcd} \end{eqnarray}

with

\begin{eqnarray} a_{i,j} &= \frac{1}{24} (2.0*(q_{i+1,j} + q_{i,j-1}) + (q_{i,j} + q_{i+1,j-1})) \\ b_{i,j} &= \frac{1}{24} ((q_{i,j} + q_{i-1,j-1}) + 2.0*(q_{i-1,j} + q_{i,j-1})) \\ c_{i,j} &= \frac{1}{24} (2.0*(q_{i,j} + q_{i-1,j-1}) + (q_{i-1,j} + q_{i,j-1})) \\ d_{i,j} &= \frac{1}{24} ((q_{i+1,j} + q_{i,j-1}) + 2.0*(q_{i,j} + q_{i+1,j-1})) \\ ep_{i,j} &= \frac{1}{24}((q_{i,j} - q_{i-1,j-1}) + (q_{i-1,j} - q_{i,j-1})) \end{eqnarray}
\begin{itemize}
\item {} 
ARAKAWA\_HSU90 From \sphinxcite{zzbibliography:arakawa1990} is a scheme which always conserves energy and conserves enstrophy in the limit of non\sphinxhyphen{}divergent flow. This one has a larger stencil than Sadourny’s energy scheme, but it’s much better behaved in terms of handling vanishing layers than Arakawa and Lamb. This scheme is implemented with:

\end{itemize}
\begin{equation*}
\begin{split}\frac{1}{dx} (a_{i,j} vh_{i+1,j} + b_{i,j} vh_{i,j} + d_{i,j} vh_{i+1,j-1} + c_{i,j} vh_{i,j-1})\end{split}
\end{equation*}
and

\begin{eqnarray} a_{i,j} &= \frac{1}{12} (q_{i,j} + (q_{i+1,j} + q_{i,j-1})) \\ b_{i,j} &= \frac{1}{12} (q_{i,j} + (q_{i-1,j} + q_{i,j-1})) \\ c_{i,j} &= \frac{1}{12} (q_{i,j} + (q_{i-1,j-1} + q_{i,j-1})) \\ d_{i,j} &= \frac{1}{12} (q_{i,j} + (q_{i+1,j-1} + q_{i,j-1})) \end{eqnarray}
\begin{itemize}
\item {} 
ARAKAWA\_LAMB\_BLEND This is a blending of Arakawa and Lamb, Arakawa and Hsu, and the Sadourny Energy scheme. There are weights CORIOLIS\_BLEND\_WT\_LIN and CORIOLIS\_BLEND\_F\_EFF\_MAX to control this scheme. The equation is the same as for Arakawa and Lamb, but the values of \(a, b, c, d\) and \(ep\) differ when the pure Arakawa and Lamb scheme breaks down due to thickness variations.

\item {} 
ROBUST\_ENSTRO An enstrophy\sphinxhyphen{}conserving scheme which is robust to vanishing layers.

\end{itemize}

Some of these options also support the BOUND\_CORIOLIS flag. If true, the Coriolis terms in the \(u\) equation are bounded by the four estimates of \(\frac{(f+\zeta)}{h}vh\) from the four neighboring \(v\) points, and similarly in the \(v\) equation. This option would have no effect on the SADOURNY75\_ENERGY scheme if it were possible to use centered difference thickness fluxes.


\subsubsection{Wall boundary conditions}
\label{\detokenize{api/generated/pages/Discrete_Coriolis:wall-boundary-conditions}}\label{\detokenize{api/generated/pages/Discrete_Coriolis:discrete-coriolis-1coriolis-bc}}
Two sets of boundary conditions have been coded in the definition of relative vorticity. These are written as:

NOSLIP defined (in spherical coordinates):

\begin{eqnarray} \mbox{relvort} &= dv/dx \mbox{ (east $\&$ west)}, \mbox{ with } v = 0. \\ \mbox{relvort} &= -\sec(\phi) * d(u \cos(\phi))/dy \mbox{ (north $\&$ south)}, \mbox{ with } u = 0. \end{eqnarray}

Free slip (NOSLIP not defined):
\begin{equation*}
\begin{split}\mbox{relvort} = 0 \mbox{ (all boundaries)}\end{split}
\end{equation*}
with
\(\phi\) defined as latitude. The free slip boundary condition is much more natural on a C\sphinxhyphen{}grid.


\section{Discrete Pressure Gradient Term}
\label{\detokenize{api/generated/pages/Discrete_PG:discrete-pressure-gradient-term}}\label{\detokenize{api/generated/pages/Discrete_PG:discrete-pg}}\label{\detokenize{api/generated/pages/Discrete_PG::doc}}

\subsection{Pressure Gradient Term}
\label{\detokenize{api/generated/pages/Discrete_PG:pressure-gradient-term}}\label{\detokenize{api/generated/pages/Discrete_PG:discrete-pg-1pg}}
Following \sphinxcite{zzbibliography:adcroft2008}
, the horizontal momentum equation in the general coordinate \(r\) can be written as:
\begin{equation*}
\begin{split}\frac{\partial \vec{u}}{\partial t} + \nabla_r \Phi + \alpha \nabla_r p = \cal{F}\end{split}
\end{equation*}
where the vector \(\cal{F}\) represents all the forcing terms other than the pressure gradient. Here, \(\vec{u}\) is the horizontal component of the velocity, \(\Phi\) is the geopotential:
\begin{equation*}
\begin{split}\Phi = gz\end{split}
\end{equation*}
\(\alpha = 1/\rho\) is the specific volume and \(p\) is the pressure. The gradient operator is a gradient along the coordinate surface \(r\) .

MOM6 offers two options, an older one using a Montgomery potential as described in hallberg1997 and \sphinxcite{zzbibliography:sun1999}
. However, it can have the instability described in \sphinxcite{zzbibliography:hallberg2005} . The version described here is that in \sphinxcite{zzbibliography:adcroft2008} and is the recommended option (ANALYTIC\_FV\_PGF = True). The paper describes the Boussinesq form while the code supports that and also a non\sphinxhyphen{}Boussinesq form.

In two dimensions (
\(x\) and \(p\) ), we can integrate the zonal component of the momentum equation above over a finite volume:

\begin{eqnarray} - \int dx \int dp \frac{\partial u}{\partial t} &= \int dx \int dp \left. \frac{\partial \Phi}{\partial x}\right|_p \\ &= \int_{p_{br}}^{p_{tr}} \Phi dp + \int_{p_{tr}}^{p_{tl}} \Phi dp + \int_{p_{tl}}^{p_{bl}} \Phi dp &+ \int_{p_{bl}}^{p_{br}} \Phi dp \label{eq:PG_loop} \end{eqnarray}

We convert to line integrals thanks to the Leibniz rule. See the figure for the location of the line integral ranges:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{PG_loop}.png}
\caption{Schematic of the finite volume used for integrating the \$u\$\sphinxhyphen{}component of momentum. The thermodynamic variables \$\$ and \$s\$ reside on the sides of the depicted volume and are considered uniform for the vertical extent of the volume but with linear variation in the horizontal. The volume is depicted in \$(x, p)\$ space so \$p\$ is linear around the volume but \$\$ can vary arbitrarily along the edges.}\label{\detokenize{api/generated/pages/Discrete_PG:id6}}\end{figure}

The only approximations made are (i) that the potential temperature \(\theta\) and the salinity \(s\) can be represented continuously in the vertical within each layer although discontinuities between layers are allowed and (ii) that \(\theta\) and \(s\) can be represented continuously along each layer. MOM6 has options for piecewise constant (PCM), piecewise linear (PLM), and piecewise parabolic (PPM) in the vertical.

If we use the Wright equation of state (\sphinxcite{zzbibliography:wright1997}
), we can integrate the above integrals analytically. This equation of state can be written as:
\begin{equation*}
\begin{split}\alpha(s, \theta, p) = A(s, \theta) + \frac{\lambda(s, \theta)}{P(s, \theta) + p}\end{split}
\end{equation*}
where
\(A, \lambda\) and \(P\) are functions only of \(s\) and \(\theta\) . The integral form of hydrostatic balance is:
\begin{equation*}
\begin{split}\Phi(p_t) - \Phi(p_b) = \int_{p_t}^{p_b} \alpha(s, \theta, p) dp\end{split}
\end{equation*}
Assuming piecewise constant values for
\(\theta\) and \(s\) and the above equation of state, we get:

\begin{eqnarray} \Phi(p_t) - \Phi(p_b) &= \int_{p_t}^{p_b} \alpha(s, \theta, p) dp \\ &= (p_b - p_t) A + \lambda \ln \left| \frac{P + p_b}{P + p_t} \right| \\ &= \Delta p \left( A + \frac{\lambda}{P + \overline{p}} \frac{1}{2 \epsilon} \ln \left| \frac{1 + \epsilon}{1 - \epsilon} \right| \right) \label{eq:PG_vert} \end{eqnarray}

which is the exact solution for the continuum only if \(\theta\) and \(s\) are uniform in the interval \(p_t\) to \(p_b\) . Here, we have introduced the variables:
\begin{equation*}
\begin{split}\Delta p = p_b - p_t\end{split}
\end{equation*}\begin{equation*}
\begin{split}\overline{p} = \frac{1}{2}(p_t + p_b)\end{split}
\end{equation*}
and
\begin{equation*}
\begin{split}\epsilon = \frac{\Delta p}{2 (P + \overline{p})}\end{split}
\end{equation*}
We will show later that \(\epsilon \ll 1\) . Note the series expansion:
\begin{equation*}
\begin{split}\frac{1}{2 \epsilon} \ln \left| \frac{1 + \epsilon}{1 - \epsilon} \right| = \sum_{n=1}^\infty \frac{\epsilon^{2n-2}}{2n - 1} = 1 + \frac{\epsilon^2}{3} + \frac{\epsilon^4}{5} + \cdots \forall |\epsilon | \leq 1\end{split}
\end{equation*}
Typical values for the deep ocean with 100 m layer thickness are
\(6 \times 10^8\) Pa and \(10^6\) Pa, respectively, yielding \(\epsilon \sim 8 \times 10^{-4}\) and a corresponding accuracy in the geopotential height calculation of \(\frac{\lambda \epsilon^3}{g} \sim 10^{-5}\) m. For this value of \(\epsilon\) , the series converges with just three terms. In MOM6, we use series rather than the intrinsic log function , since the log is machine dependent and insufficiently accurate. In extreme circumstances, \(\Delta p \sim 6 \times 10^7\) Pa (limited by the depth of the ocean) for which \(\epsilon \sim 0.04\) with geopotential height errors of order 1 m. In this case, the series converges to machine precision with six terms.

The finite volume acceleration is expression terms of four integrals around the volume,
\(\int \Phi dp\) . The side integrals can be calculated by direct integration of , which gives:

\begin{eqnarray} \int_{p_t}^{p_b} \Phi dp &= \Delta p \left( \Phi_b + \frac{1}{2} A \Delta p + \lambda \left( 1 - \frac{1 - \epsilon}{2 \epsilon} \ln \left| \frac{1 + \epsilon}{1 - \epsilon} \right| \right) \right) \\ &= \Delta p \left( \Phi_b + \frac{1}{2} A \Delta p + \lambda \left( 1 - (1 - \epsilon) \left( 1 + \frac{\epsilon^2}{3} + \frac{\epsilon^4}{5} + \cdots \right) \right) \right) \\ &= \Delta p \left( \Phi_b + \frac{1}{2} A \Delta p + \lambda \left( \epsilon - (1 - \epsilon) \epsilon^2 \left( \frac{1}{3} + \frac{\epsilon^2}{5} + \cdots \right) \right) \right) \end{eqnarray}

where \(\Phi, \Delta p, P, A\) and \(\lambda\) are each evaluated on the left or right side of the volume.

The top and bottom integrals in must allow for the effect of varying
\(\theta\) and \(s\) on \(A, \lambda\) and \(P\) . We evaluate these integrals numerically using sixth\sphinxhyphen{}order quadrature; Boole’s rule requires evaluating the coefficients in the equation of state at five points, two of which have already been evaluated for the side integrals. For efficiency, we linearly interpolate the coefficients \(A, P\) and \(\lambda\) between the end points, which seems to make very little difference to the solution. We also verified that tenth\sphinxhyphen{}order quadrature makes little difference to the solution. The values of the top and bottom integrals are carried upward in a hydrostatic\sphinxhyphen{}like integration, obtained as follows:

\begin{eqnarray} \int_{p_{tl}}^{p_{tr}} \Phi_t dp &= (p_{tr} - p_{tl}) \int_0^1 \Phi_t dx \\ &= (p_{tr} - p_{tl}) \int_0^1 \left( \Phi_b + A(x) \Delta p(x) + \lambda (x) \ln \left| \frac{1 + \epsilon (x)}{1 - \epsilon (x)} \right| \right) dx \\ &= (p_{tr} - p_{tl}) \int_0^1 \Phi_b dx \\ &+ \int_0^1 \Delta p(x) \left( A(x) + \frac{\lambda (x)}{P(x) + \overline{p} (x)} \sum_{n=1}^\infty \frac{\epsilon^{2n-2}}{2n-1} \right) dx \end{eqnarray}

The first integral is either known from the top integral of the layer below or the boundary condition at the ocean bottom. The second integral is evaluated numerically.

All the above definite integrals are specific to the Wright equation of state; the use of a different equation of state requires analytic integration of the appropriate equations. We have found, however, that high\sphinxhyphen{}order numerical integration appears to be sufficient. Although the numerical implementation is more general (allowing the use of arbitrary equations of state), it is significantly more expensive and so we advocate the analytic implementation for efficiency.


\section{Energetic Consistency}
\label{\detokenize{api/generated/pages/Energetic_Consistency:energetic-consistency}}\label{\detokenize{api/generated/pages/Energetic_Consistency:id1}}\label{\detokenize{api/generated/pages/Energetic_Consistency::doc}}
Energetic Consistency


\section{Discrete Open Boundary Conditions}
\label{\detokenize{api/generated/pages/Discrete_OBC:discrete-open-boundary-conditions}}\label{\detokenize{api/generated/pages/Discrete_OBC:discrete-obc}}\label{\detokenize{api/generated/pages/Discrete_OBC::doc}}
Discrete Open Boundary Conditions


\chapter{Time Discretization}
\label{\detokenize{discrete_time:time-discretization}}\label{\detokenize{discrete_time::doc}}
In MOM6, it is possible to have at least four different timesteps: the barotropic
timestep, the baroclinic (momentum dynamics) timestep, the tracer timestep, and the
remapping interval. There can also be a forcing timestep on which model coupling can
occur.


\section{Barotropic Momentum Equations}
\label{\detokenize{api/generated/pages/Barotropic_Momentum_Equations:barotropic-momentum-equations}}\label{\detokenize{api/generated/pages/Barotropic_Momentum_Equations:id1}}\label{\detokenize{api/generated/pages/Barotropic_Momentum_Equations::doc}}
Barotropic Momentum Equations

The barotropic equations are timestepped on a relatively short timestep compared to the rest of the model. Since the timestep constraints for this are known, the barotropic timestep is computed at runtime.

The 2\sphinxhyphen{}d linear momentum equations with integrated continuity are:
\begin{equation*}
\begin{split}\frac{\partial \eta}{\partial t} + \nabla \cdot \left( ( D + \eta) \vec{u}_{BT} h_k \right) = P - E\end{split}
\end{equation*}\begin{equation*}
\begin{split}\frac{\partial \vec{u}_{BT}}{\partial t} = - g \nabla \eta - f \hat{z} \times \vec{u}_{BT} + \vec{F}_{BT}\end{split}
\end{equation*}
where
\begin{equation*}
\begin{split}\vec{u}_{BT} \equiv \frac{1}{D + \eta} \int_{-D}^\eta \vec{u}dz\end{split}
\end{equation*}
and
\(\vec{F}_{BT}\) is the barotropic momentum forcing from baroclinic processes. Note that explicit mass fluxes such as evaporation and precipitation change the model volume explicitly.

In the mode splitting between baroclinic and barotropic processes, it is important to include the contribution of free surface waves on the internal interface heights on the pressure gradient force, shown here as
\(g_{Eff}\) :
\begin{equation*}
\begin{split}\frac{\partial p}{\partial z} = -\rho g\end{split}
\end{equation*}\begin{equation*}
\begin{split}g_{Eff} = g + \frac{\partial}{\partial \eta} \left[ \frac{1}{D + \eta} \int_{-D}^\eta p dz \right]\end{split}
\end{equation*}
The barotropic momentum equation then becomes:
\begin{equation*}
\begin{split}\frac{\partial \vec{u}_{BT}}{\partial t} + f \hat{z} \times \vec{u}_{BT} + \frac{1}{\rho_0} \nabla g_{Eff} \eta = \mbox{Residual}\end{split}
\end{equation*}
Without including the internal wave motion in the barotropic equations, one can generate instabilities (\sphinxcite{zzbibliography:bleck1990}
, \sphinxcite{zzbibliography:hallberg1997a} ).


\section{Baroclinic Momentum Equations}
\label{\detokenize{api/generated/pages/Baroclinic_Momentum_Equations:baroclinic-momentum-equations}}\label{\detokenize{api/generated/pages/Baroclinic_Momentum_Equations:id1}}\label{\detokenize{api/generated/pages/Baroclinic_Momentum_Equations::doc}}
Baroclinic Momentum Equations

The baroclinic momentum equations are the stacked shallow water equations:
\begin{equation*}
\begin{split}\frac{\partial \vec{u}_k}{\partial t} + (f + \nabla_s \times \vec{u}_k) \hat{z} \times \vec{u}_k = - \frac{\nabla_s p_k}{\rho} - \nabla_s (\phi_k + \frac{1}{2} || \vec{u}_k ||^2 ) + \frac{\nabla \cdot \tilde{\tau}_k}{\rho}\end{split}
\end{equation*}\begin{equation*}
\begin{split}\frac{\partial h_k}{\partial t} + \nabla_s \cdot (\vec{u}h_k) = 0\end{split}
\end{equation*}
The timestepping for these equations is a (quasi?) second\sphinxhyphen{}order Runge\sphinxhyphen{}Kutta step for the inertial oscillations and a forward\sphinxhyphen{}backward Euler step for the pressure (gravity) waves. Using the graphical notation from \sphinxcite{zzbibliography:shchepetkin2005}
, it looks like:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{timestep_MOM6}.png}
\caption{Graphical notation for timestepping schemes in which the black line represents the ideal solution and the red line shows the actual solution. Phase errors are represented by the grey shapes between the bars normal to the circle.}\label{\detokenize{api/generated/pages/Baroclinic_Momentum_Equations:id3}}\end{figure}

The timestep used in ROMS looks instead like:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{timestep_ROMS}.png}
\caption{Graphical notation for the Adams\sphinxhyphen{}Bashforth technique used in the ROMS model.}\label{\detokenize{api/generated/pages/Baroclinic_Momentum_Equations:id4}}\end{figure}

The ROMS timestepping has smaller phase errors, strong damping at high frequency. The MOM6 use as a global climate model has made the phase errors of lower priority. However, the phase errors may become more problematic for future uses of MOM6. While the MOM6 use of the ALE remapping makes an Adams\sphinxhyphen{}Bashforth scheme impractical, there may be a better timestepping scheme out there for MOM6. Please let the MOM6 developers know if you would like to work on this problem.


\section{Barotropic\sphinxhyphen{}Baroclinic Coupling}
\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:barotropic-baroclinic-coupling}}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:id1}}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling::doc}}
Time\sphinxhyphen{}averaged accelerations

The barotropic equations are timestepped with a timestep to resolve the surface gravity waves. With care, the baroclinic timestep only need resolve the inertial oscillations. The barotropic accelerations are averaged over the many barotropic timesteps taken between baroclinic steps. At time
\(n\) , the baroclinic accelerations are computed. The vertical average of that acceleration is subtracted off and replaced by the time\sphinxhyphen{}averaged acceleration from the group of barotropic timesteps:
\begin{equation*}
\begin{split}\Delta t \frac{\partial \vec{u}}{\partial t} = \Delta t \left( \frac{\partial \vec{u}}{\partial t} - \frac{\partial \vec{u}_{BT}}{\partial t} \right)^n + \Delta t \overline{\frac{\partial \vec{u}_{BT}}{\partial t}}^{\Delta t}\end{split}
\end{equation*}
Similarly, the velocities used in the tracer equation are a careful blend of the barotropic and baroclinic solutions:
\begin{equation*}
\begin{split}\Delta t \frac{\partial \theta}{\partial t} + \Delta t \left( \tilde{\vec{u}} \cdot \nabla \theta + \widetilde{w} \frac{\partial \theta}{\partial z} \right)\end{split}
\end{equation*}
with
\begin{equation*}
\begin{split}\tilde{\vec{u}} = \vec{u}_{BC} + \overline{\vec{u}_{BT}}^{\Delta t}\end{split}
\end{equation*}\begin{equation*}
\begin{split}\frac{\partial \widetilde{w}}{\partial z} = - \nabla \cdot \tilde{\vec{u}}\end{split}
\end{equation*}

\subsection{Two estimates of the free surface height}
\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:two-estimates-of-the-free-surface-height}}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:barotropic-baroclinic-coupling-1ssh-estimates}}
The vertically discrete, temporally continuous layer continuity equations are:
\begin{equation*}
\begin{split}\frac{\partial h_k}{\partial t} = - \nabla \cdot (\vec{u} h_k) = - \nabla \cdot \mathbf{F} (u_k, h_k)\end{split}
\end{equation*}
The relationship between the free surface height and the layer thicknesses
\(h_k\) is:
\begin{equation*}
\begin{split}\eta = \sum_{k=1}^N h_k - D\end{split}
\end{equation*}
We get an evolution equation for the free surface height:
\begin{equation*}
\begin{split}\frac{\partial \eta}{\partial t} = \sum_{k=1}^N \frac{\partial h_k}{\partial t} = - \nabla \cdot \sum_{k=1}^N \mathbf{F} (u_k, h_k)\end{split}
\end{equation*}
If the algorithms for the fluxes in the continuity equations are
\sphinxstyleemphasis{linear}
in the velocity, the free surface height can be rewritten as:
\begin{equation*}
\begin{split}\frac{\partial \eta}{\partial t} \&= - \nabla \cdot \sum_{k=1}^N \mathbf{F} (u_k, h_k) = - \nabla \cdot \sum_{k=1}^N (\vec{u}_k h_k) \\ \&= - \nabla \cdot \left[ \sum_{k=1}^N h_k \frac{\sum_{k=1}^N (\vec{u}_k h_k)} {\sum_{k=1}^M k_k} \right] \equiv - \nabla \cdot H \mathbf{U}\end{split}
\end{equation*}
where
\begin{equation*}
\begin{split}\mathbf{U} \equiv \frac{\sum_{k=1}^N (\vec{u}_k h_k)} {\sum_{k=1}^M k_k}\end{split}
\end{equation*}\begin{equation*}
\begin{split}H \equiv \sum_{k=1}^N h_k\end{split}
\end{equation*}
However, ALE models like MOM6 require positive\sphinxhyphen{}definite, nonlinear continuity solvers (MOM6 uses {\hyperref[\detokenize{api/generated/pages/PPM:ppm}]{\sphinxcrossref{\DUrole{std,std-ref}{PPM Advection Scheme}}}} ). We need a different way to reconcile this estimate of free surface height with the one coming from the barotropic equations. After rejecting several other options, MOM6 is now using the scheme from \sphinxcite{zzbibliography:hallberg2009} . The barotropic update of \(\eta\) is given by:
\begin{equation*}
\begin{split}\frac{\eta^{n+1} - \eta^n}{\Delta t} + \nabla \cdot \left( \overline{UH} \right) = 0\end{split}
\end{equation*}
Determine the
\(\Delta U\) such that:
\begin{equation*}
\begin{split}\sum_{k=1}^N \mathbf{F} (\tilde{u}_k, h_k) = \left( \overline{UH} \right)\end{split}
\end{equation*}
where
\begin{equation*}
\begin{split}\tilde{u}_k = u_k + \Delta U\end{split}
\end{equation*}
The layer timestep equation becomes:
\begin{equation*}
\begin{split}h_k^{n+1} = h_k^n - \Delta t \nabla \cdot \mathbf{F} (\tilde{u}_k, h_k)\end{split}
\end{equation*}
This scheme has these properties:
\begin{itemize}
\item {} 
Total mass is conserved layer\sphinxhyphen{}wise.

\item {} 
Layer equations retain their flux form.

\item {} 
Total salt, heat, and other tracers are exactly conserved.

\item {} 
Free surface heights exactly agree.

\item {} 
Requires (very few) completely local iterations.

\item {} 
The velocity corrections are barotropic, and more likely to correspond to the layers whose flow was deficient than in some older schemes.

\end{itemize}

The solution is unique provided that:
\begin{equation*}
\begin{split}\frac{\partial}{\partial \tilde{u}_k} \mathbf{F}(\tilde{u}_k, h_k) > 0\end{split}
\end{equation*}
This is a reasonable requirement for any discretization of the continuity equation. In the continuous limit, \(\mathbf{F} (u,h) = uh\) , so one interpretation is:
\begin{equation*}
\begin{split}\frac{\partial}{\partial \tilde{u}_k} \mathbf{F}(\tilde{u}_k, h_k) = h_{k,\mbox{Marginal}}\end{split}
\end{equation*}
With the PPM continuity scheme:
\begin{equation*}
\begin{split}F_{i+1/2} = \frac{1}{\Delta t} \int_{x_{i+1/2} - u \Delta t}^{x_{i+1/2}} h_i^n (x) dx\end{split}
\end{equation*}
leads to:
\begin{equation*}
\begin{split}\frac{\partial F_{i+1/2}}{\partial u_{i+1/2}} = h_i^n ( x_{i+1/2} - u_{i+1/2} \Delta t ) \equiv h_{k, \mbox{Marginal}}\end{split}
\end{equation*}
\(h_i(x) > 0\) is already required for positive definiteness.

Newton’s method iterations quickly give
\(\Delta U\) :
\begin{equation*}
\begin{split}\Delta U^{m+1} = \Delta U^m + \frac{\left( \overline{UH} \right) - \sum_{k=1}^N F(u_k + \Delta U^m, h_k)}{\sum_{k=1}^N h_{k,\mbox{Marginal}}}\end{split}
\end{equation*}

\subsubsection{How practical is this iterative approach?}
\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:how-practical-is-this-iterative-approach}}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:barotropic-baroclinic-coupling-1subsec-practical}}
The piecewise parabolic method continuity solver uses two steps:
\begin{itemize}
\item {} 
Set up the positive\sphinxhyphen{}definite subgridscale profiles, \(h_{PPM}(x)\) .

\end{itemize}

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{h_PPM}.png}
\caption{Piecewise parabolic reconstructions of \$h(x)\$.}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:id3}}\end{figure}
\begin{itemize}
\item {} 
Integrating the profiles to determine \(F\) . Step 1 is typically \(\sim 3\) times as expensive as step 2. \(F(u,h)\) is piecewise cubic in \(u\) , but often nearly linear. Newton’s method iterations converge quickly:

\end{itemize}

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{Newton_PPM}.png}
\caption{Newton’s method iterations for finding \$ U\$.}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:id4}}\end{figure}

In a global model the sea surface heights converge everywhere to a tolerance of \(10^{-6}\) m within five iterations. These five iterations add \(\sim 1.6\) times more CPU time to the PPM continuity solver and the continuity solver is just 12\% of the total model time.


\subsubsection{A note on bottom drag}
\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:a-note-on-bottom-drag}}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:barotropic-baroclinic-coupling-1bottom-drag}}
Barotropic accelerations do not lead to barotropic flows after a timestep when vertical viscosity is taken into account.
\begin{equation*}
\begin{split}u_k^{n+1} = u_k^n + \Delta t A_k + \Delta t \frac{\tau_{k-1/2} - \tau_{k+1/2}}{h_k}\end{split}
\end{equation*}\begin{equation*}
\begin{split}\tau_{1/2} = \tau_{Wind}\end{split}
\end{equation*}\begin{equation*}
\begin{split}\tau_{k+1/2} = \nu_{k+1/2} \frac{u_k^{n+1} - u_{k+1}^{n+1}}{h_{k+1/2}}\end{split}
\end{equation*}\begin{equation*}
\begin{split}\tau_{N+1/2} = \nu_{N+1/2} \frac{2 u_N^{n+1}}{h_{N+1/2}}\end{split}
\end{equation*}\begin{equation*}
\begin{split}\gamma_k \equiv \frac{1}{\Delta t} \frac{\partial u_k^{n+1}} {\overline{\partial A}}\end{split}
\end{equation*}
A tridiagonal equation for
\(\gamma_k\) results, going from 0 for thin layers near the bottom to 1 far above the bottom.
\begin{equation*}
\begin{split}\gamma_1 = 1 + \frac{1}{h_1} \left[ - \frac{\nu_{3/2} \Delta t}{h_{3/2}} (\gamma_1 - \gamma_2) \right]\end{split}
\end{equation*}\begin{equation*}
\begin{split}\gamma_k = 1 + \frac{1}{h_k} \left[ \frac{\nu_{k-1/2} \Delta t}{h_{k-1/2}} (\gamma_{k-1} - \gamma_k) - \frac{\nu_{k+1/2} \Delta t}{h_{k+1/2}} (\gamma_k - \gamma_{k+1}) \right]\end{split}
\end{equation*}\begin{equation*}
\begin{split}\gamma_N = 1 + \frac{1}{h_N} \left[ \frac{\nu_{N-1/2} \Delta t}{h_{N-1/2}} (\gamma_{N-1} - \gamma_N) - \frac{2\nu_{N+1/2} \Delta t}{h_{N+1/2}} \gamma_N \right]\end{split}
\end{equation*}
In the continuous limit:
\begin{equation*}
\begin{split}\gamma(z) = 1 + \Delta t \frac{d}{dz} \left( \nu \frac{d \gamma}{dz} \right)\end{split}
\end{equation*}
with boundary conditions:
\begin{equation*}
\begin{split}\frac{d \gamma}{dz} (0) = 0\end{split}
\end{equation*}\begin{equation*}
\begin{split}\gamma(-D) = 0\end{split}
\end{equation*}
For deep water and contant
\(\nu\) , we get:
\begin{equation*}
\begin{split}\gamma (z) = 1 - \exp \left( - \sqrt{\nu \Delta t} (z + D) \right)\end{split}
\end{equation*}
\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{bottom_drag}.png}
\caption{The continuous solution for barotropic flow plus a no\sphinxhyphen{}slip condition at the bottom.}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:id5}}\end{figure}

We want a scheme in which the split model looks exactly like the unsplit model would if we had taken all those short 3D timesteps. Rather than applying a barotropic velocity, we use a barotropic acceleration and allow the continuity solver to determine the tranports consistent with a no\sphinxhyphen{}slip bottom boundary layer and perhaps also a no\sphinxhyphen{}slip surface boundary layer under an ice shelf.

From above, the barotropic equation is:
\begin{equation*}
\begin{split}\frac{\eta^{n+1} - \eta^n}{\Delta t} + \nabla \cdot \left( \overline{UH} \right) = 0\end{split}
\end{equation*}
We need to determine the \(\Delta \overline{A}\) such that:
\begin{equation*}
\begin{split}\sum_{k=1}^N \mathbf{F} (\tilde{u}_k, h_k) = \left( \overline{UH} \right)\end{split}
\end{equation*}
where
\begin{equation*}
\begin{split}\tilde{u}_k = u_k + \gamma_k \Delta \overline{A} \Delta t\end{split}
\end{equation*}

\subsection{Additional details about the split time stepping}
\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:additional-details-about-the-split-time-stepping}}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:barotropic-baroclinic-coupling-1bt-bc-details}}\begin{itemize}
\item {} 
Transports are used as input and output to the barotropic solver. The continuity solver is inverted to determine velocities.

\end{itemize}
\begin{equation*}
\begin{split}\frac{\partial \eta}{\partial t} = \nabla \cdot \overline{U} + M\end{split}
\end{equation*}\begin{equation*}
\begin{split}\overline{U} (\overline{u}) = \frac{1}{\Delta t} \int_0^{\overline{u} \Delta t} H(x) dx\end{split}
\end{equation*}\begin{equation*}
\begin{split}\overline{u}^n = \overline{U}^{-1} \left( \sum_{k=1}^N U_k^n \right)\end{split}
\end{equation*}\begin{equation*}
\begin{split}u_k^{n+1} = \tilde{u}_k^{n+1} + \Delta \overline{u}\end{split}
\end{equation*}
We need to find
\(\Delta \overline{u}\) such that:
\begin{equation*}
\begin{split}\sum_{k=1}^N U_k \left( \tilde{u}_k^{n+1} + \Delta \overline{u} \right) = \overline{U}^{n+1}\end{split}
\end{equation*}\begin{itemize}
\item {} 
Barotropic accelerations are treates as anomalies from the baroclinic state:

\end{itemize}
\begin{equation*}
\begin{split}\frac{\partial \overline{u}}{\partial t} \&= - f \hat{k} \times (\overline{u} - \overline{u}_{Cor}) - \nabla \overline{g} (\eta - \eta_{PF}) - \\ \& \frac{c_D \left( ||u_{Bot}|| + ||u_{Shelf}|| \right)}{\sum_{k=1}^N h_k} (\overline{u} - \overline{u}_{Drag}) + \frac{\sum_{k=1}^N h_k \frac{\partial u_k}{\partial t}} {\sum_{k=1}^N h_k}\end{split}
\end{equation*}\begin{itemize}
\item {} 
Bottom drag (and under ice surface\sphinxhyphen{}drag) is treated implicitly.

\item {} 
The barotropic continuity solver uses flow\sphinxhyphen{}dependent thickness fits which approximate the sum of the layer thicness transports, to accommodate wetting and drying. An image of this is shown here:

\end{itemize}

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{bt_bc_thickness}.png}
\caption{The barotropic transports depend on the baroclinic flows and thicknesses.}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:id6}}\end{figure}


\subsection{Summary of MOM6 split time stepping}
\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:summary-of-mom6-split-time-stepping}}\label{\detokenize{api/generated/pages/Barotropic_Baroclinic_Coupling:barotropic-baroclinic-coupling-1time-split-summary}}\begin{itemize}
\item {} 
We use an efficient approach for handling fast modes via simplified 2\sphinxhyphen{}d equations, while the 3\sphinxhyphen{}d baroclinic timestep is determined by baroclinic dynamics.

\item {} 
The barotropic solver determines free surface height and time\sphinxhyphen{}averaged depth\sphinxhyphen{}integrated transports.

\item {} 
By using anomalies, the MOM6 split solver gives identical answers to an equivalent unsplit scheme for short timesteps.

\item {} 
This scheme has been demonstrated to work with wetting and drying, as well as under ice\sphinxhyphen{}shelves.

\item {} 
The linear barotropic solver allows MOM6 to automatically set a stable barotropic timestep (e.g. to 98\% of maximum).

\end{itemize}


\section{Tracer Timestep}
\label{\detokenize{api/generated/pages/Tracer_Timestep:tracer-timestep}}\label{\detokenize{api/generated/pages/Tracer_Timestep:id1}}\label{\detokenize{api/generated/pages/Tracer_Timestep::doc}}
Overview of Tracer Timestep

The MOM6 code handles advection and lateral diffusion of all tracers. For potential temperature and salinity, it also timesteps the thermodynamics and vertical mixing (column physics). Since evaporation and precipitation are handled as volume changes, the layer thicknesses need to be updated:
\begin{equation*}
\begin{split}\frac{\partial h_k}{\partial t} = (P - E)_k\end{split}
\end{equation*}
The full tracer equation for tracer
\(\theta\) is:
\begin{equation*}
\begin{split}\frac{\partial}{\partial t} (h_k\theta_k) + \nabla_s \cdot (\vec{u}h_k \theta_k) = Q_k^\theta h_k + \frac{1}{h_k} \Delta \left( \kappa \frac{\partial \theta}{\partial z} \right) + \frac{1}{h_k} \nabla_s (h_k K \nabla_s \theta)\end{split}
\end{equation*}
Here, the advection is on the left hand side of the equation while the right hand side contains thermodynamic processes, vertical diffusion, and horizontal diffusion. There is more than one choice for vertical diffusion; these will be described elsewhere. Also, the lateral diffusion is handled in novel ways so as to avoid introduction of new extrema and to avoid instabilities associated with rotated mixing tensors. The lateral diffusion is described in {\hyperref[\detokenize{api/generated/pages/Horizontal_Diffusion:horizontal-diffusion}]{\sphinxcrossref{\DUrole{std,std-ref}{Horizontal Diffusion}}}}
.


\section{ALE Timestep}
\label{\detokenize{api/generated/pages/ALE_Timestep:ale-timestep}}\label{\detokenize{api/generated/pages/ALE_Timestep:id1}}\label{\detokenize{api/generated/pages/ALE_Timestep::doc}}
Explanation of ALE remapping

The Arbitrary Lagrangian\sphinxhyphen{}Eulerian (ALE) remapping is not a timestep in the traditional sense, but rather an operation performed to bring the vertical coordinate back to the target specification. This remapping can be less frequent than the momentum or thermodynamic timesteps, but must be done before the layer interfaces become entangled with each other.

Assuming the target vertical grid is level
\(z\) \sphinxhyphen{}surfaces, the initial state is shown on the left in the following figure:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{remapping1}.png}
\caption{The initial state with level surface (left) and the perturbed state after a wave has come through (right).}\label{\detokenize{api/generated/pages/ALE_Timestep:id2}}\end{figure}

Some time later, a wave has perturbed the surfaces which move with the fluid and it has been determined that a remapping operation is needed. The target vertical grid is still level \(z\) \sphinxhyphen{}surfaces, so this new target grid is shown overlaid on the left as regrid:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{remapping2}.png}
\caption{The regrid operation (left) and the remap operation (right).}\label{\detokenize{api/generated/pages/ALE_Timestep:id3}}\end{figure}

The complex part of the operation is remapping the wavy field onto the new grid as shown on the right and again in the final frame after the old deformed coordinate system has been deleted:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{remapping3}.png}
\caption{The final state after remapping.}\label{\detokenize{api/generated/pages/ALE_Timestep:id4}}\end{figure}

Mathematically, the new layer thicknesses, \(h_k\) , are computed and then populated with the new velocities and tracers:
\begin{equation*}
\begin{split}h_k^{\mbox{new}} = \nabla_k z_{\mbox{coord}}\end{split}
\end{equation*}\begin{equation*}
\begin{split}\sum h_k^{\mbox{new}} = \sum h_k^{\mbox{old}}\end{split}
\end{equation*}\begin{equation*}
\begin{split}\vec{u}_k^{\mbox{new}} = \frac{1}{h_k} \int_{z_{k + \frac{1}{2}}}^{z_{k + \frac{1}{2}} + h_k} \vec{u}^{\mbox{old}}(z')dz'\end{split}
\end{equation*}\begin{equation*}
\begin{split}\theta^{\mbox{new}} = \frac{1}{h_k} \int_{z_{k + \frac{1}{2}}}^{z_{k + \frac{1}{2}} + h_k} \theta^{\mbox{old}}(z')dz'\end{split}
\end{equation*}

\chapter{Tracers in MOM6}
\label{\detokenize{tracers:tracers-in-mom6}}\label{\detokenize{tracers::doc}}

\section{Tracer Advection}
\label{\detokenize{api/generated/pages/Tracer_Advection:tracer-advection}}\label{\detokenize{api/generated/pages/Tracer_Advection:id1}}\label{\detokenize{api/generated/pages/Tracer_Advection::doc}}
Tracer transport schemes

MOM6 implements a generalised tracer advection scheme, which is a combination of the modified flux advection scheme \sphinxcite{zzbibliography:easter1993}
with reconstructed tracer distributions. The tracer distributions may be piecewise linear (PLM) or piecewise parabolic (PPM), which may itself use either the \sphinxcite{zzbibliography:colella1984} (CW84) or \sphinxcite{zzbibliography:huynh1997} (H3) reconstruction.


\subsection{Flux advection}
\label{\detokenize{api/generated/pages/Tracer_Advection:flux-advection}}\label{\detokenize{api/generated/pages/Tracer_Advection:tracer-advection-1flux-advection}}
The modified flux advection scheme preserves the tracer mixing ratio in a cell across directional splitting by accounting for changes in mass changes. Fluxes are applied to alternate directions in turn, restricting the applied flux so as not to evacuate all mass out of a cell. Because of this, we need to know the stencil used during the calculation of the reconstruction. Every iteration of the splitting algorithm, cells at the edge of a processor’s data domain are invalidated. When this invalidation region extends below the halo, a group pass is required to refresh the halo. A larger stencil (such as for the CW84 reconstruction) therefore introduces more frequent updates, and may impact performance.


\subsection{Tracer reconstruction}
\label{\detokenize{api/generated/pages/Tracer_Advection:tracer-reconstruction}}\label{\detokenize{api/generated/pages/Tracer_Advection:tracer-advection-1tracer-reconstruction}}
While MOM6 only carries the mean tracer concentration in a cell, a higher order reconstruction is computed for the purpose of advection. Reconstructions are also modified to ensure that monotonicity is preserved (i.e. spurious minima or maxima cannot be introduced).

The piecewise linear (PLM) reconstruction uses the monotonic modified van Leer scheme \sphinxcite{zzbibliography:lin1994}
. One might think to use the average of the one\sphinxhyphen{}sided differences of mean tracer concentration within a cell to calculate the slope of the linear reconstruction, however this method guarantees neither monotonicity, nor positive definiteness. Instead, the method is locally limited to the minimum of this average slope and each of the one\sphinxhyphen{}sided slopes, i.e.
\begin{equation*}
\begin{split}\Delta \Phi_i = \min\left\{\left|[\Delta \Phi_i]_\text{avg}\right|, 2\left(\Phi_i - \Phi_i^\text{min}\right), 2\left(\Phi_i^\text{max} - \Phi_i\right)\right\}\end{split}
\end{equation*}
(where \(\Phi_i^\text{min}\) is the minimum in the 3\sphinxhyphen{}point stencil).

In a PPM scheme ({\hyperref[\detokenize{api/generated/pages/PPM:ppm}]{\sphinxcrossref{\DUrole{std,std-ref}{PPM Advection Scheme}}}}
), for a cell with mean tracer concentration \(\Phi_i\) , the values at the left and right interfaces, \(\Phi_{L,i}\) and \(\Phi_{R,i}\) must be estimated. First, an interpolation is used to calculate \(\Phi_{i-1/2}\) and \(\Phi_{i+1/2}\) . These values are then modified to preserve monotonicity in each cell, which introduces discontinuities between cell edges (e.g. \(\Phi_{R,i}\) and \(\Phi_{L,i+1}\) ).

The reconstruction
\(\Phi_i(\xi)\) then satisfies three properties:
\begin{itemize}
\item {} 
total amount of tracer is conserved, \(\int_{\xi_{i-1/2}}^{\xi_{i+1/2}} \Phi_i(\xi') \,\mathrm d\xi' = \Phi_i\)

\item {} 
left interface value matches, \(\Phi(\xi_{i-1/2}) = \Phi_{L,i}\)

\item {} 
right interface value matches, \(\Phi(\xi_{i+1/2}) = \Phi_{R,i}\)

\end{itemize}

There are two methods of reconstruction for a piecewise parabolic (PPM) profile. They differ in the estimate of interface values
\(\Phi_{i+1/2}\) prior to monotonicity limiting. The CW84 scheme makes use of the limited slope \(\Delta\Phi_i\) from PLM, above. This has the effect of requiring a larger stencil for each reconstruction. On the other hand, the H3 scheme reduces the requirement of this stencil, by only examining the tracer concentrations in adjacent cells, at the same time reducing order of accuracy of the reconstruction.


\section{Tracer Transport Equations}
\label{\detokenize{api/generated/pages/Tracer_Transport_Equations:tracer-transport-equations}}\label{\detokenize{api/generated/pages/Tracer_Transport_Equations:id1}}\label{\detokenize{api/generated/pages/Tracer_Transport_Equations::doc}}
Tracer Transport Equations

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{PPM_1d}.png}
\caption{The 1\sphinxhyphen{}D finite volume advection of tracers. The reddish fluid will be in the cell at the end of the timestep.}\label{\detokenize{api/generated/pages/Tracer_Transport_Equations:id5}}\end{figure}

Given a piecewise polynomial description of the tracer concentration, the new tracer cell concentration is the average of the fluid that will be in the cell after a timestep.

\begin{eqnarray} \int_{x_{i-1/2}}^{x_{i+1/2}} A_i^{n+1} (x) dx = \int_{x_{i-1/2 - u \Delta t}}^{x_{i+1/2-u\Delta t}} A_i^{n} (x) dx &= \mbox{} \\ \int_{x_{i-1/2}}^{x_{i+1/2}} A_i^{n} (x) dx - \int_{x_{i+1/2 - u \Delta t}}^{x_{i+1/2}} A_i^{n} (x) dx &+ \int_{x_{i-1/2 - u \Delta t}}^{x_{i-1/2}} A_i^{n} (x) dx \end{eqnarray}

Fluxes are found by analytically integrating the profile over the distance that is swept past the face within a timestep.
\begin{equation*}
\begin{split}a_i^n = \frac{1}{\Delta x} \int_{x_{i-1/2}}^{x_{i+1/2}} A_i^n(x) dx\end{split}
\end{equation*}\begin{equation*}
\begin{split}a_i^{n+1} = a_i^n - \frac{\Delta t}{\Delta x} (F_{i+1/2} - F_{i-1/2})\end{split}
\end{equation*}\begin{equation*}
\begin{split}F_{i+1/2} = \frac{1}{\Delta t} \int_{x_{i+1/2 - u \Delta t}}^{x_{i+1/2}} A_i^n(x) dx\end{split}
\end{equation*}\begin{equation*}
\begin{split}F_{i-1/2} = \frac{1}{\Delta t} \int_{x_{i-1/2 - u \Delta t}}^{x_{i-1/2}} A_i^n(x) dx\end{split}
\end{equation*}
With piecewise constant profiles, this approach give first order upwind advection. Higher order polynomials (e.g., parabolas) can give higher order accuracy.


\subsection{Multidimensional Tracer Advection}
\label{\detokenize{api/generated/pages/Tracer_Transport_Equations:multidimensional-tracer-advection}}\label{\detokenize{api/generated/pages/Tracer_Transport_Equations:tracer-transport-equations-1multidimensional-tracer-advection}}
Using “Easter’s Pseudo\sphinxhyphen{}compressibility” (easter1993), we start with these basic equations for a tracer
\(\psi\) :

\phantomsection\label{\detokenize{api/generated/pages/Tracer_Transport_Equations:tracer-transport-equations-1ht-equation}}\begin{equation*}
\begin{split}\frac{\partial h}{\partial t} + \vec{\nabla} \cdot (\vec{u}h) = 0 \equiv \frac{\partial h}{\partial t} + \vec{\nabla} \cdot (\vec{U})\end{split}
\end{equation*}\begin{equation*}
\begin{split}\frac{\partial}{\partial t} (h \psi) + \vec{\nabla} \cdot (\vec{U}\psi) = 0\end{split}
\end{equation*}\begin{equation*}
\begin{split}\frac{\partial \psi}{\partial t} + \vec{u} \cdot \vec{\nabla} \psi = 0\end{split}
\end{equation*}
We discretize the first of these equations in space:
\begin{equation*}
\begin{split}\frac{\partial h}{\partial t} = \frac{1}{\Delta x} \left(U_{i-\frac{1}{2},j} - U_{i+\frac{1}{2},j} \right) + \frac{1}{\Delta y} \left(V_{i, j-\frac{1}{2}} - V_{i,j+\frac{1}{2}} \right)\end{split}
\end{equation*}
Using our monotonic one\sphinxhyphen{}dimensional flux:
\begin{equation*}
\begin{split}F_{i+\frac{1}{2},j} (\psi) = U_{i+\frac{1}{2},j} \psi_{i+\frac{1}{2},j}\end{split}
\end{equation*}
we come up with an estimate based only on an update in the
\(x\) direction:
\begin{equation*}
\begin{split}\tilde{h}_{i,j} \tilde{\psi}_{i,j} = h^n_{i,j} \psi_{i,j} + \frac{\Delta t}{\Delta x} \left( F_{i-\frac{1}{2},j} (\psi^n) - F_{i+\frac{1}{2},j} (\psi^n) \right)\end{split}
\end{equation*}\begin{equation*}
\begin{split}\tilde{h}_{i,j} = h^n_{i,j} + \frac{\Delta t}{\Delta x} \left( U_{i-\frac{1}{2},j} - U_{i+\frac{1}{2},j} \right)\end{split}
\end{equation*}\begin{equation*}
\begin{split}\tilde{\psi}_{i,j} = \frac{\tilde{h}_{i,j} \tilde{\psi}_{i,j}}{\tilde{h}_{i,j}}\end{split}
\end{equation*}
Next, we update in the
\(y\) direction:
\begin{equation*}
\begin{split}h^{n+1}_{i,j} \psi^{n+1}_{i,j} = \tilde{h}_{i,j} \tilde{\psi}_{i,j} + \frac{\Delta t}{\Delta y} \left( G_{i,j-\frac{1}{2}} (\tilde{\psi}) - G_{i,j+\frac{1}{2}} (\tilde{\psi}) \right)\end{split}
\end{equation*}\begin{equation*}
\begin{split}h^{n+1}_{i,j} = \tilde{h}_{i,j} + \frac{\Delta t}{\Delta y} \left( V_{i,j-\frac{1}{2}} - V_{i,j+\frac{1}{2}} \right)\end{split}
\end{equation*}\begin{equation*}
\begin{split}\psi^{n+1}_{i,j} = \frac{h^{n+1}_{i,j} \psi^{n+1}_{i,j}}{h^{n+1}_{i,j}}\end{split}
\end{equation*}\begin{itemize}
\item {} 
This method ensures monotonicity. Strang splitting can reduce directional splitting error. See \sphinxcite{zzbibliography:easter1993} , \sphinxcite{zzbibliography:durran2010} (section 5.9.4), and \sphinxcite{zzbibliography:russell1981} .

\item {} 
Flux\sphinxhyphen{}form pseudo\sphinxhyphen{}compressibility advection is based on accumulated mass (or volume) fluxes, not velocities.

\item {} 
Additional pseudo\sphinxhyphen{}compressibility passes can be added to accommodate transports exceeding cell masses. Extra passes of tracer advection are used in MOM6 in the small fraction of cells where this is needed.

\item {} 
Explicit layered dynamics time\sphinxhyphen{}steps are limited by Doppler\sphinxhyphen{}shifted internal gravity wave speeds or inertial oscillations. Flow speeds in most of the ocean volume are much smaller than the peak internal wave speeds so that the advective time\sphinxhyphen{}steps can be longer.

\item {} 
Advective mass fluxes in MOM6 are often accumulated over multiple dynamic steps. The goal is that as we go to higher resolution, this tracer advection will remain stable at relatively long time\sphinxhyphen{}steps, allowing for the inclusion of many biogeochemical tracers without adding an undue burden in computational cost.

\end{itemize}


\section{Horizontal Diffusion}
\label{\detokenize{api/generated/pages/Horizontal_Diffusion:horizontal-diffusion}}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:id1}}\label{\detokenize{api/generated/pages/Horizontal_Diffusion::doc}}
Horizontal diffusion of tracers

Lateral mixing due to mesoscale eddies is believed to occur according to this figure:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{eddy_fluxes}.png}
\caption{Horizontal surface boundary layer fluxes and interior epineutral fluxes.}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:id3}}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:horizontal-diffusion-1eddy-flux}}\end{figure}

We start by describing an implementation of the mixing in the interior and then introduce a surface mixed layer implementation. A bottom mixed layer implementation is planned for the future.


\subsection{Epineutral Diffusion}
\label{\detokenize{api/generated/pages/Horizontal_Diffusion:epineutral-diffusion}}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:horizontal-diffusion-1epineutral-diffusion}}
For the interior of the ocean, we would like to have horizontal diffusion with the following properties:
\begin{itemize}
\item {} 
Suitable for general coordinate models

\item {} 
Preserves extrema

\item {} 
Has no need for regularization or tapering (such as needed by rotated mixing tensors)

\end{itemize}

The algorithm used in MOM6 is described by \sphinxcite{zzbibliography:shao2019-in-review} and will be introduced here. The aim is to allow lateral mixing of tracers within isopycnal layers. It is appropriate for the adiabatic interior of the ocean while a lateral mixing scheme for the surface boundary layer is described below.

Before presenting this scheme, a quick review of polynomial reconstructions is in order. Some choices for the vertical representation of a finite volume quantity are shown here:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{shao0}.png}
\caption{Polynomial reconstructions, starting with piecewise constant on the left, piecewise linear in the middle and piecewise parabolic on the right.}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:id4}}\end{figure}

Some desired quantities for the polynomial reconstructions to be used are:
\begin{itemize}
\item {} 
Tracer concentrations represent the cell\sphinxhyphen{}averages in vertical discretization.

\item {} 
Must be monotonic and introduce no new extrema.

\item {} 
Discontinuous reconstructions are desirable to limit intracell slopes.

\end{itemize}

The algorithm has three phases: initialization, sorting, and flux calculation.


\subsubsection{Initialization}
\label{\detokenize{api/generated/pages/Horizontal_Diffusion:initialization}}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:horizontal-diffusion-1epineutral-initialization}}
We begin by generating polynomial reconstructions of the vertical tracer quantities such as shown by the blue lines here:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{shao1}.png}
\caption{Polynomial reconstructions of two adjacent water columns.}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:id5}}\end{figure}

Because we are looking to mix along epineutral surfaces, we will need to find surfaces of uniform density by using the temperature, salinity, and their effect on the density, \(\alpha\) and \(\beta\) . The next step is to find the values of \(\alpha\) and \(\beta\) at the interfaces.

Also during the initialization, the unstable parts of the water column are set aside to be skipped by this algorithm.


\subsubsection{Sorting}
\label{\detokenize{api/generated/pages/Horizontal_Diffusion:sorting}}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:horizontal-diffusion-1epineutral-sorting}}
The epineutral surfaces have constant density, where we use this equation:
\begin{equation*}
\begin{split}\Delta \rho = \rho_1 - \rho_2 = \frac{\alpha_1 + \alpha_2}{2} (T_1 - T_2) + \frac{\beta_1 + \beta_2}{2} (S_1 - S_2)\end{split}
\end{equation*}
When calculating
\(\alpha\) and \(\beta\) , there’s more than one way to do it. Using a midpoint pressure gives neutral density while using a reference pressure gives isopycnal values.

Given two adjacent water columns, we are going to be looking to match densities. The match does not need to be at the same level or even near each other in depth. Starting from the top two interfaces, search the column with the lighter surface water (second column) downward to find which layer contains water matching that of the first column at the surface:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{shao2}.png}
\caption{Searching the column with the lighter surface for the water matching the other column’s surface water.}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:id6}}\end{figure}

If the surface density matches that of an interface, point to the interface. Otherwise, solve for the matching density along the polynomial reconstruction for that layer. There are again some choices:
\begin{itemize}
\item {} 
Use Newton’s method to find the root with higher order polynomials.

\item {} 
Assume \(\alpha\) and \(\beta\) vary linearly from top to bottom (cubic if \(T\) and \(S\) are parabolic).

\item {} 
Equation of state is linear from top to bottom interface (parabolic of \(T\) and \(S\) are parabolic).

\item {} 
\(\Delta \rho\) is linear in the vertical.

\end{itemize}

Once the location of the first column’s surface density is found in the second column, one goes to the next interface below to find the bottom density of the water to be mixed. Then find that density within the first column. Iterate downward until no more matches are found. These pairs of surfaces make up what is known as a sublayer along which the diffusion can take place.


\subsubsection{Flux Calculation}
\label{\detokenize{api/generated/pages/Horizontal_Diffusion:flux-calculation}}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:horizontal-diffusion-1epineutral-flux-calculation}}
For each sublayer, the fluxes are based on the mean tracer quantities within that sublayer in each column. For a tracer
\(C\) , compute the vertical average of that tracer within the sublayer to form \(\overline{C}\) . The flux can then be computed based on:
\begin{equation*}
\begin{split}F = K h_{\mbox{eff}} \frac{\overline{C_{j,k+1}} - \overline{C_{j+1,k-1}} }{\Delta x} \Delta t\end{split}
\end{equation*}
where the effective thickness of the sublayer is:
\begin{equation*}
\begin{split}h_{\mbox{eff}} = \frac{2 h_{j,n}^\gamma h_{j,n+1}^\gamma}{h_{j,n}^\gamma + h_{j,n+1}^\gamma}\end{split}
\end{equation*}
and as shown in this figure:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{shao3}.png}
\caption{Diagram of sublayer thickness for the sublayer bounded by surfaces \$\$ and \$\{n+1\}\$.}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:id7}}\end{figure}

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{shao4}.png}
\caption{Flux of tracer \$C\$ along the sublayer.}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:id8}}\end{figure}

When updating the tracer state, one needs to accumulate all the fluxes through each face as shown here:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{shao5}.png}
\caption{Accumulate all the fluxes across a face from all the layers in the next column contributing to it.}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:id9}}\end{figure}


\subsection{Surface Diffusion}
\label{\detokenize{api/generated/pages/Horizontal_Diffusion:surface-diffusion}}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:horizontal-diffusion-1surface-diffusion}}
As shown in figure {\hyperref[\detokenize{api/generated/pages/Horizontal_Diffusion:horizontal-diffusion-1eddy-flux}]{\sphinxcrossref{\DUrole{std,std-ref}{Horizontal surface boundary layer fluxes and interior epineutral fluxes.}}}}
of the eddy fluxes, the diffusion in the surface boundary layer is assumed to be purely horizontal. A bulk scheme was explored but found wanting, so a layer\sphinxhyphen{}by\sphinxhyphen{}layer approach has been implemented instead. It is this layer\sphinxhyphen{}by\sphinxhyphen{}layer code which is described here.

For each water column, the boundary layer thickness is determined first. This can be either via the CVMIX boundary layer thickness or through some other means. Next, determine how many of the model layers are within this boundary layer thickness. It is common for neighboring cells to have differing numbers of layers within the surface boundary layer, such as shown here:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{sbl1}.png}
\caption{Two cells within the surface mixed layer, red on the left, blue on the right. The mixed layer depth is shown in green.}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:id10}}\end{figure}

In this case, the cell on the left has four layers within the boundary layer while the cell on the right has just two. The layer\sphinxhyphen{}by\sphinxhyphen{}layer scheme computes fluxes for the first two layers, then has linearly reduced fluxes for the next two layers below as shown here:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{sbl2}.png}
\caption{Two cells within the surface mixed layer with down\sphinxhyphen{}gradient fluxes as shown by the black arrows.}\label{\detokenize{api/generated/pages/Horizontal_Diffusion:id11}}\end{figure}

In all cases, the tracer flux is always down\sphinxhyphen{}gradient.
\begin{equation*}
\begin{split}F(k) = K h_{\mbox{eff}(k)} \left[ \phi_L(k) - \phi_R(k)\right]\end{split}
\end{equation*}
where the effective thickness of the layer
\(k\) is:
\begin{equation*}
\begin{split}h_{\mbox{eff}(k)} = \frac{2 h_{L}(k) h_{R}(k)} {h_{L}(k) + h_{R}(k)}\end{split}
\end{equation*}

\section{Vertical Diffusion}
\label{\detokenize{api/generated/pages/Vertical_Diffusion:vertical-diffusion}}\label{\detokenize{api/generated/pages/Vertical_Diffusion:id1}}\label{\detokenize{api/generated/pages/Vertical_Diffusion::doc}}
Vertical diffusion of tracers

The MOM6 tracer registry takes care of the tracer advection as well as horizontal diffusion, but it is up to each individual tracer package to define its own vertical diffusion.


\section{Passive and Other User\sphinxhyphen{}defined Tracers}
\label{\detokenize{api/generated/pages/Passive_Tracers:passive-and-other-user-defined-tracers}}\label{\detokenize{api/generated/pages/Passive_Tracers:passive-tracers}}\label{\detokenize{api/generated/pages/Passive_Tracers::doc}}
Tracers beyond temperature and salinity


\subsection{Passive Tracers}
\label{\detokenize{api/generated/pages/Passive_Tracers:passive-tracers-1passive-tracers}}\label{\detokenize{api/generated/pages/Passive_Tracers:id1}}

\subsection{Generic Tracers}
\label{\detokenize{api/generated/pages/Passive_Tracers:generic-tracers}}\label{\detokenize{api/generated/pages/Passive_Tracers:passive-tracers-1generic-tracers}}

\subsection{User\sphinxhyphen{}defined Tracers}
\label{\detokenize{api/generated/pages/Passive_Tracers:user-defined-tracers}}\label{\detokenize{api/generated/pages/Passive_Tracers:passive-tracers-1user-tracers}}

\chapter{Grids}
\label{\detokenize{grids:grids}}\label{\detokenize{grids::doc}}
We love grids.


\section{Global Orthogonal Grids}
\label{\detokenize{api/generated/pages/Global_Grids:global-orthogonal-grids}}\label{\detokenize{api/generated/pages/Global_Grids:global-grids}}\label{\detokenize{api/generated/pages/Global_Grids::doc}}
Global Orthogonal Grids


\subsection{Dipole Grids}
\label{\detokenize{api/generated/pages/Global_Grids:dipole-grids}}\label{\detokenize{api/generated/pages/Global_Grids:global-grids-1dipole}}

\subsection{Tripole Grids}
\label{\detokenize{api/generated/pages/Global_Grids:tripole-grids}}\label{\detokenize{api/generated/pages/Global_Grids:global-grids-1tripole}}

\section{Regional Orthogonal Grids}
\label{\detokenize{api/generated/pages/Regional_Grids:regional-orthogonal-grids}}\label{\detokenize{api/generated/pages/Regional_Grids:regional-grids}}\label{\detokenize{api/generated/pages/Regional_Grids::doc}}
Regional Orthogonal Grids


\subsection{Map Projections}
\label{\detokenize{api/generated/pages/Regional_Grids:map-projections}}\label{\detokenize{api/generated/pages/Regional_Grids:regional-grids-1map-projections}}

\subsection{Open Boundary Segments}
\label{\detokenize{api/generated/pages/Regional_Grids:open-boundary-segments}}\label{\detokenize{api/generated/pages/Regional_Grids:regional-grids-1obc-segments}}

\section{Vertical Orthogonal Grids}
\label{\detokenize{api/generated/pages/Vertical_Grids:vertical-orthogonal-grids}}\label{\detokenize{api/generated/pages/Vertical_Grids:vertical-grids}}\label{\detokenize{api/generated/pages/Vertical_Grids::doc}}
Vertical Orthogonal Grids


\subsection{Layered}
\label{\detokenize{api/generated/pages/Vertical_Grids:layered}}\label{\detokenize{api/generated/pages/Vertical_Grids:vertical-grids-1vert-layer}}

\subsection{Z\sphinxhyphen{}Star}
\label{\detokenize{api/generated/pages/Vertical_Grids:z-star}}\label{\detokenize{api/generated/pages/Vertical_Grids:vertical-grids-1vert-z-star}}

\subsection{Sigma}
\label{\detokenize{api/generated/pages/Vertical_Grids:sigma}}\label{\detokenize{api/generated/pages/Vertical_Grids:vertical-grids-1vert-sigma}}

\subsection{Rho}
\label{\detokenize{api/generated/pages/Vertical_Grids:rho}}\label{\detokenize{api/generated/pages/Vertical_Grids:vertical-grids-1vert-rho}}

\subsection{Hybrid}
\label{\detokenize{api/generated/pages/Vertical_Grids:hybrid}}\label{\detokenize{api/generated/pages/Vertical_Grids:vertical-grids-1vert-hybrid}}

\chapter{Parameterizations}
\label{\detokenize{parameterizations:parameterizations}}\label{\detokenize{parameterizations::doc}}
Sub\sphinxhyphen{}grid scale parameterizations are broadly grouped into vertical and lateral directions, referring to the direction in which fluxes are predominantly oriented.


\section{Vertical Parameterizations}
\label{\detokenize{parameterizations_vertical:vertical-parameterizations}}\label{\detokenize{parameterizations_vertical::doc}}
The following sub\sphinxhyphen{}grid scale parameterizations generally yield fluxes that act in the vertical direction, with no lateral components resolved by the model.


\subsection{Upper boundary}
\label{\detokenize{parameterizations_vertical:upper-boundary}}\begin{description}
\item[{K\sphinxhyphen{}profile parameterization (KPP)}] \leavevmode
Provided by module MOM\_KPP, uses the CVmix implementation of KPP.
\begin{quote}

\DUrole{xref,std,std-ref}{CVMix\_KPP}
\end{quote}

\item[{Energetic Planetary Boundary Layer (ePBL)}] \leavevmode
A energetically constrained boundary layer scheme following \sphinxcite{zzbibliography:reichl2018}. Implemented in MOM\_energetic\_PBL.

\item[{Bulk mixed layer (BML)}] \leavevmode
A 2\sphinxhyphen{}layer bulk mixed layer used in pure\sphinxhyphen{}isopycnal model. Implemented in MOM\_bulk\_mixed\_layer.

\end{description}


\subsection{Interior and bottom\sphinxhyphen{}driven mixing}
\label{\detokenize{parameterizations_vertical:interior-and-bottom-driven-mixing}}\begin{description}
\item[{Kappa\sphinxhyphen{}shear}] \leavevmode
MOM\_kappa\_shear implement the shear\sphinxhyphen{}driven mixing of \sphinxcite{zzbibliography:jackson2008}.

\item[{Internal\sphinxhyphen{}tide driven mixing}] \leavevmode
The schemes of \sphinxcite{zzbibliography:st-laurent2002}, \sphinxcite{zzbibliography:polzin2009}, and \sphinxcite{zzbibliography:melet2012}, are all implemented through MOM\_set\_diffusivity and MOM\_diabatic\_driver.

\end{description}


\subsection{Vertical friction}
\label{\detokenize{parameterizations_vertical:vertical-friction}}
Vertical viscosity is implemented in MOM\_vert\_frict and coefficient computed in MOM\_set\_viscosity, although contributions to viscosity from other parameterizations are calculated in those respective modules (e.g. MOM\_kappa\_shear, MOM\_KPP, MOM\_energetic\_PBL).


\subsection{Vertical diffusion}
\label{\detokenize{parameterizations_vertical:vertical-diffusion}}
Vertical diffusion of scalars is implemented in MOM\_diabatic\_driver although contributions to diffusion from other parameterizations are calculated in those respective modules (e.g. MOM\_kappa\_shear, MOM\_KPP, MOM\_energetic\_PBL).


\subsection{Radiation}
\label{\detokenize{parameterizations_vertical:radiation}}\begin{description}
\item[{Opacity}] \leavevmode
Ocean color is prescribed or dynamically calculated in converted into optical properties in MOM\_opacity.

\item[{Short\sphinxhyphen{}wave absorption}] \leavevmode
Optical properties from MOM\_opacity are used to calculate the convergence of shortwave radiation penetrating from the upper surface in MOM\_shortwave\_abs.

\end{description}


\subsection{Geothermal heating}
\label{\detokenize{parameterizations_vertical:geothermal-heating}}
Geothermal heat fluxes are implemented in MOM\_geothermal.


\subsection{Isopycnal\sphinxhyphen{}mode entrainment and diapycnal diffusion}
\label{\detokenize{parameterizations_vertical:isopycnal-mode-entrainment-and-diapycnal-diffusion}}
Diapycnal diffusion in a layered isopycnal mode following \sphinxcite{zzbibliography:hallberg2000}, is implemented in MOM\_entrain\_diffuse.


\section{Lateral Parameterizations}
\label{\detokenize{parameterizations_lateral:lateral-parameterizations}}\label{\detokenize{parameterizations_lateral::doc}}
The following sub\sphinxhyphen{}grid scale parameterizations generally yield fluxes that act in the lateral direction.


\subsection{Lateral viscosity}
\label{\detokenize{parameterizations_lateral:lateral-viscosity}}
Laplacian and bi\sphinxhyphen{}harmonic viscosities with linear and Smagorinsky options are implemented in MOM\_hor\_visc.


\subsection{Gent\sphinxhyphen{}McWilliams/TEM/isopycnal height diffusion}
\label{\detokenize{parameterizations_lateral:gent-mcwilliams-tem-isopycnal-height-diffusion}}
Lagrangian mean eddy mass transport is parameterized following \sphinxcite{zzbibliography:gent1990}, in MOM\_thickness\_diffuse.

The diffusivity coefficients are calculated in MOM\_lateral\_mixing\_coeffs
and MOM\_thickness\_diffuse and includes constants and the \sphinxcite{zzbibliography:visbeck1997}
scaling.

A model of sub\sphinxhyphen{}grid scale Mesoscale Eddy Kinetic Energy (MEKE) is implement in MOM\_MEKE and the associated diffusivity added in MOM\_thickness\_diffuse.
See \sphinxcite{zzbibliography:jansen2015} and \sphinxcite{zzbibliography:marshall2010}.
\begin{quote}

{\hyperref[\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke}]{\sphinxcrossref{\DUrole{std,std-ref}{The Mesoscale Eddy Kinetic Energy (MEKE) framework}}}}
\end{quote}


\subsection{Backscatter}
\label{\detokenize{parameterizations_lateral:backscatter}}
A parameterization of the upscale unresolved cascade utilizes MOM\_MEKE
and negative Laplacian viscosity in MOM\_hor\_visc.


\subsection{Mixed layer restratification by sub\sphinxhyphen{}mesoscale eddies}
\label{\detokenize{parameterizations_lateral:mixed-layer-restratification-by-sub-mesoscale-eddies}}
Mixed layer restratification from \sphinxcite{zzbibliography:fox-kemper2008} and
\sphinxcite{zzbibliography:fox-kemper2008-2} is implemented in MOM\_mixed\_layer\_restrat.


\subsection{Lateral diffusion}
\label{\detokenize{parameterizations_lateral:lateral-diffusion}}
See {\hyperref[\detokenize{api/generated/pages/Horizontal_Diffusion:horizontal-diffusion}]{\sphinxcrossref{\DUrole{std,std-ref}{Horizontal Diffusion}}}}.


\subsection{Tidal forcing}
\label{\detokenize{parameterizations_lateral:tidal-forcing}}
Astronomical tidal forcings and self\sphinxhyphen{}attraction and loading are implement in MOM\_tidal\_forcing.


\chapter{Other Physics}
\label{\detokenize{other_physics:other-physics}}\label{\detokenize{other_physics::doc}}

\section{Equation of State}
\label{\detokenize{api/generated/pages/Equation_of_State:equation-of-state}}\label{\detokenize{api/generated/pages/Equation_of_State:id1}}\label{\detokenize{api/generated/pages/Equation_of_State::doc}}
Within MOM6, there is a wrapper for the equation of state, so that all calls look the same from the rest of the model. The equation of state code has to calculate not just in situ density, but also the compressibility and various derivatives of the density. There is also code for computing specific volume and the freezing temperature.


\subsection{Linear Equation of State}
\label{\detokenize{api/generated/pages/Equation_of_State:linear-equation-of-state}}\label{\detokenize{api/generated/pages/Equation_of_State:equation-of-state-1linear-eos}}
Compute the required quantities with uniform values for
\(\alpha = \frac{\partial \rho}{\partial T}\) and \(\beta = \frac{\partial \rho}{\partial S}\) , (DRHO\_DT, DRHO\_DS in MOM\_input, also uses RHO\_T0\_S0).


\subsection{Wright Equation of State}
\label{\detokenize{api/generated/pages/Equation_of_State:wright-equation-of-state}}\label{\detokenize{api/generated/pages/Equation_of_State:equation-of-state-1wright-eos}}
Compute the required quantities using the equation of state from \sphinxcite{zzbibliography:wright1997}
. This equation of state is in the form:
\begin{equation*}
\begin{split}\alpha(s, \theta, p) = A(s, \theta) + \frac{\lambda(s, \theta)}{P(s, \theta) + p\end{split}
\end{equation*}
where \(A, \lambda\) and \(P\) are functions only of \(s\) and \(\theta\) and \(\alpha = 1/ \rho\) is the specific volume. This form is useful for the pressure gradient computation as discussed in {\hyperref[\detokenize{api/generated/pages/Discrete_PG:discrete-pg-1pg}]{\sphinxcrossref{\DUrole{std,std-ref}{Pressure Gradient Term}}}} .


\subsection{NEMO Equation of State}
\label{\detokenize{api/generated/pages/Equation_of_State:nemo-equation-of-state}}\label{\detokenize{api/generated/pages/Equation_of_State:equation-of-state-1nemo-eos}}
Compute the required quantities using the equation of state from \sphinxcite{zzbibliography:roquet2015}
.


\subsection{UNESCO Equation of State}
\label{\detokenize{api/generated/pages/Equation_of_State:unesco-equation-of-state}}\label{\detokenize{api/generated/pages/Equation_of_State:equation-of-state-1unesco-eos}}
Compute the required quantities using the equation of state from \sphinxcite{zzbibliography:jackett1995}
.


\subsection{TEOS\sphinxhyphen{}10 Equation of State}
\label{\detokenize{api/generated/pages/Equation_of_State:teos-10-equation-of-state}}\label{\detokenize{api/generated/pages/Equation_of_State:equation-of-state-1teos-10-eos}}
Compute the required quantities using the equation of state from
\sphinxhref{http://www.teos-10.org/}{TEOS\sphinxhyphen{}10}
.


\subsection{Freezing Temperature of Sea Water}
\label{\detokenize{api/generated/pages/Equation_of_State:freezing-temperature-of-sea-water}}\label{\detokenize{api/generated/pages/Equation_of_State:equation-of-state-1tfreeze}}
There are three choices for computing the freezing point of sea water:
\begin{itemize}
\item {} 
Linear The freezing temperature is a linear function of the salinity and pressure:

\end{itemize}
\begin{equation*}
\begin{split}T_{Fr} = (T_{Fr0} + a\,S) + b\,P\end{split}
\end{equation*}
where \(T_{Fr0},a,b\) are contants which can be set in MOM\_input (TFREEZE\_S0\_P0, DTFREEZE\_DS, DTFREEZE\_DP).
\begin{itemize}
\item {} 
Millero The \sphinxcite{zzbibliography:millero1978} equation is used, but modified so that it is a function of potential temperature rather than \sphinxstyleemphasis{in situ} temperature:

\end{itemize}
\begin{equation*}
\begin{split}T_{Fr} = S(a + (b \sqrt{\max(S,0.0)} + c\, S)) + d\,P\end{split}
\end{equation*}
where \(a,b, c, d\) are fixed contants.
\begin{itemize}
\item {} 
TEOS\sphinxhyphen{}10 The TEOS\sphinxhyphen{}10 package is used to compute the freezing conservative temperature {[}degC{]} from absolute salinity {[}g/kg{]}, and pressure {[}Pa{]}. This one must be used if you are using the NEMO or TEOS\sphinxhyphen{}10 equation of state.

\end{itemize}


\section{Sea Ice Considerations}
\label{\detokenize{api/generated/pages/Sea_Ice:sea-ice-considerations}}\label{\detokenize{api/generated/pages/Sea_Ice:sea-ice}}\label{\detokenize{api/generated/pages/Sea_Ice::doc}}
Sea Ice Coupling


\subsection{Ice Formation}
\label{\detokenize{api/generated/pages/Sea_Ice:ice-formation}}\label{\detokenize{api/generated/pages/Sea_Ice:sea-ice-1frazil}}

\chapter{Working with MOM6}
\label{\detokenize{working_with_MOM6:working-with-mom6}}\label{\detokenize{working_with_MOM6::doc}}

\section{Organization of the code}
\label{\detokenize{code_organization:organization-of-the-code}}\label{\detokenize{code_organization::doc}}
The MOM6 source code is divided into a tree of directories (folders) to group
related code (e.g. \sphinxtitleref{src/core}) or similar modules (e.g.
\sphinxtitleref{src/parametizations/vertical}).

The highest level of directories are:
\begin{description}
\item[{\sphinxtitleref{src/}}] \leavevmode
Code underneath \sphinxtitleref{src/} is always required and compiled.

\item[{\sphinxtitleref{config\_src/}}] \leavevmode
Under \sphinxtitleref{config\_src} are various drivers and memory configuration sources that
can only be compiled in limited configurations. See {\hyperref[\detokenize{code_organization:config-src}]{\sphinxcrossref{\DUrole{std,std-ref}{config\_src/}}}}

\item[{\sphinxtitleref{pkg/}}] \leavevmode
Packages (source code) from other sources/parties only some of which might
be used. We include the entire package as a sub\sphinxhyphen{}module but use
symbolic\sphinxhyphen{}links to extract the parts the MOM6 uses.

\item[{\sphinxtitleref{docs/}}] \leavevmode
The directory that contains this documentation, namely that beyond the
in\sphinxhyphen{}code API documentation. Some of the files are configuration files
needed for running doxygen and sphinx. Most documentation in this folder
is in the form of reStructuredText (.rst) files.

\item[{\sphinxtitleref{.testing/}}] \leavevmode
A directory for running tests on MOM6. These are some of the
smaller/simpler examples that MOM6 can run out of the box, without
large netCDF files.

\end{description}

The directory tree is:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
MOM6
├── config\PYGZus{}src
│   ├── coupled\PYGZus{}driver
│   ├── dynamic
│   ├── dynamic\PYGZus{}symmetric
│   ├── ice\PYGZus{}solo\PYGZus{}driver
│   ├── solo\PYGZus{}driver
│   └── unit\PYGZus{}drivers
├── docs
│   └── images
├── pkg
│   ├── CVMix\PYGZhy{}src
│   │   ├── ...
│   │   └── src
│   │       ├── drivers
│   │       └── shared
│   └── GSW\PYGZhy{}Fortran
├── src
│   ├── ALE
│   ├── core
│   ├── diagnostics
│   ├── equation\PYGZus{}of\PYGZus{}state
│   │   └── TEOS10
│   ├── framework
│   ├── ice\PYGZus{}shelf
│   ├── initialization
│   ├── parameterizations
│   │   ├── CVmix \PYGZhy{}\PYGZgt{} ../../pkg/CVMix\PYGZhy{}src/src/shared
│   │   ├── lateral
│   │   └── vertical
│   ├── tracer
│   └── user
└── .testing
    ├── tc0
    ├── tc1
    ├── tc1.a
    ├── tc1.b
    ├── tc2
    ├── tc2.a
    ├── tc3
    └── tc4
\end{sphinxVerbatim}


\subsection{\sphinxtitleref{config\_src/}}
\label{\detokenize{code_organization:config-src}}\label{\detokenize{code_organization:id1}}\begin{description}
\item[{\sphinxtitleref{dynamic/}, \sphinxtitleref{dynamic\_symmetric/}}] \leavevmode
One or none of \sphinxtitleref{config\_src/dynamic/} or \sphinxtitleref{config\_src/dynamic\_symmetric/} can
be included at compile time. If neither is used then a \sphinxtitleref{MOM\_memory.h} file
specific to the model configuration must be present \sphinxhyphen{} this is known as a
“static” compile with fixed layout and domain shape.

\item[{\sphinxtitleref{solo\_driver/}}] \leavevmode
This driver produces an ocean\sphinxhyphen{}only executable with no other coupled
components (no sea\sphinxhyphen{}ice, no atmosphere, etc.). It is the simplest
configuration and fastest to compile and thus used for a lot of testing.

\item[{\sphinxtitleref{coupled\_driver/}}] \leavevmode
This driver provides an interface for the GFDL coupler to call. It requires
compiling MOM6 along with at least a sea\sphinxhyphen{}ice model and possibly all other
components in a coupled model.

\end{description}


\subsection{\sphinxtitleref{src/}}
\label{\detokenize{code_organization:src}}\label{\detokenize{code_organization:id2}}\begin{description}
\item[{\sphinxtitleref{core/}}] \leavevmode
The dynamical core modules (except for the ALE remapping/regridding).

\item[{\sphinxtitleref{ALE/}}] \leavevmode
Functions for remapping from between arbitrary vertical grids
and generating grids.

\item[{\sphinxtitleref{diagnostics/}}] \leavevmode
Some diagnostic calculations

\item[{\sphinxtitleref{equation\_of\_state/}}] \leavevmode
Various equations of state (linear; Wright, 1997; TEOS\sphinxhyphen{}10; …).

\item[{\sphinxtitleref{framework/}}] \leavevmode
Low\sphinxhyphen{}level wrappers for communication, diagnostics management, parsing
of input parameters, time management, CPU clocks.

\item[{\sphinxtitleref{initialization/}}] \leavevmode
Initialization of the horizontal grid, vertical coordinate, and the state.

\item[{\sphinxtitleref{parameterizations/lateral}}] \leavevmode
Sub\sphinxhyphen{}grid scale parameterization with fluxes primarily oriented in the
lateral direction.

\item[{\sphinxtitleref{parameterizations/vertical}}] \leavevmode
Sub\sphinxhyphen{}grid scale parameterization with fluxes primarily oriented in the
vertical direction, including the top and bottom boundary layer schemes.

\item[{\sphinxtitleref{tracer/}}] \leavevmode
Everything to do with tracers, including advection and isopycnal stirring.

\item[{\sphinxtitleref{user/}}] \leavevmode
Initialization and forcing for specific (coded) configurations.

\end{description}


\section{Run\sphinxhyphen{}time Parameter System}
\label{\detokenize{api/generated/pages/Runtime_Parameter_System:run-time-parameter-system}}\label{\detokenize{api/generated/pages/Runtime_Parameter_System:runtime-parameter-system}}\label{\detokenize{api/generated/pages/Runtime_Parameter_System::doc}}
How run\sphinxhyphen{}time parameters work in MOM6

MOM6 has an extensive set of parameters that are set at run\sphinxhyphen{}time by parsing an input file. Many parameters have default values and are not required to be in the input file, although there are a number of parameters that must be set for the model to run. The numerous examples provided with the MOM6 code mostly differ in their run\sphinxhyphen{}time parameters (although some add other components, like sea\sphinxhyphen{}ice), and comparison between these examples is an excellent way to get a broad overview of many of MOM6’s parameters and how they might be set.


\subsection{Getting parameters into MOM6}
\label{\detokenize{api/generated/pages/Runtime_Parameter_System:getting-parameters-into-mom6}}\label{\detokenize{api/generated/pages/Runtime_Parameter_System:runtime-parameter-system-1reading-params}}
Run\sphinxhyphen{}time parameters are provided to the model in two phases:
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
A very small set of logistical parameters are read as namelist variables from the FMS parameter file \sphinxcode{\sphinxupquote{input.nml}} . One of these logistical parameters is a list of ascii files that contain all the other run\sphinxhyphen{}time parameters.

\item {} 
All of the above\sphinxhyphen{}named parameter files are scanned for MOM6 model parameters, default values assigned and replaced, conflicts detected and various parameter summaries logged to files and/or the standard output.

\end{enumerate}


\subsubsection{Namelist parameters (\sphinxtitleref{input.nml})}
\label{\detokenize{api/generated/pages/Runtime_Parameter_System:namelist-parameters-input-nml}}\label{\detokenize{api/generated/pages/Runtime_Parameter_System:runtime-parameter-system-1mom6-namelist}}
All FMS derived MOM6 parameters reside in the namelist \sphinxcode{\sphinxupquote{MOM\_input\_nml}}
in the file \sphinxcode{\sphinxupquote{input.nml}} . The parameters are:
\begin{itemize}
\item {} 
\sphinxcode{\sphinxupquote{input\_filename}} \sphinxhyphen{} If equal to “n” will run a new run (i.e. will not read a restart file). If equal to “r” MOM6 will attempt to read a restart file.

\item {} 
\sphinxcode{\sphinxupquote{parameter\_filename}} \sphinxhyphen{} A list of file names containing the MOM6 internal run\sphinxhyphen{}time parameters. Typically \sphinxcode{\sphinxupquote{param\_files="MOM6\_input","MOM6\_override"}} where the file MOM6\_input contains all the non\sphinxhyphen{}default parameters that define a “baseline” experiment and MOM6\_override will be either empty (for baseline) or contain a few parameters that define a “derived” experiment (that differs from the baseline). This helps keep the parameter lists concise and enables easy comparison of parameters in related experiments.

\item {} 
\sphinxcode{\sphinxupquote{restart\_input\_dir}} , \sphinxcode{\sphinxupquote{restart\_output\_dir}} , and \sphinxcode{\sphinxupquote{output\_directory}} \sphinxhyphen{} These specify the directories for reading input files, writing restart files, and writing many non\sphinxhyphen{}restart files.

\end{itemize}


\subsubsection{Other MOM6\sphinxhyphen{}relevant FMS parameters}
\label{\detokenize{api/generated/pages/Runtime_Parameter_System:other-mom6-relevant-fms-parameters}}\label{\detokenize{api/generated/pages/Runtime_Parameter_System:runtime-parameter-system-1fms-params}}
The namelist ocean\_solo\_nml may have the integer parameters secs, hours, days, months and years, which dictate how long the FMS ocean driver will try to run the model each run\sphinxhyphen{}segment.


\subsubsection{MOM6 parameter file syntax}
\label{\detokenize{api/generated/pages/Runtime_Parameter_System:mom6-parameter-file-syntax}}\label{\detokenize{api/generated/pages/Runtime_Parameter_System:runtime-parameter-system-1param-syntax}}
The general syntax for an entry in a MOM6 parameter file is

\begin{sphinxVerbatim}[commandchars=\\\{\}]
[!]\PYGZsh{}[override]  PARAMETER\PYGZus{}NAME  =  value[,value][...][!comments]
\end{sphinxVerbatim}

Parameter names must be constructed from the characters \sphinxcode{\sphinxupquote{{[}A\sphinxhyphen{}Za\sphinxhyphen{}z0\sphinxhyphen{}9\_{]}}}
and by soft convention are upper case. The \sphinxcode{\sphinxupquote{!}} character is a remark or comment indicator; all subsequent text on that line is ignored.

Parameters that are not specified in the parameter files may assume a default value. It is not an error to specify a parameter more than once with the same value. It is an error to specify different values.

The keyword \#override indicates that this parameter specification takes precedence over other specifications. It is
an error to have two \#override specifications for a single parameter with the same values. It is an error to have two \#override statements with different values.

Some illustrations:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
DO\PYGZus{}THIS  =  True   !  Set  the  Boolean  to  .TRUE.
DO\PYGZus{}THAT  =  False  !  Set  the  Boolean  to  .FALSE.
NXYZ  =  5   !  Set  the  value  to  NXYZ  to  5
HALF  =  0.5   !  Set  the  value  of  HALF  to  0.5
NAME  =  \PYGZdq{}abc\PYGZdq{}   !  Set  the  string  NAME  to  \PYGZsq{}abc\PYGZsq{}
VECTOR  =  1.0,2.0   !  Set  the  array  VECTOR  to  [1.0,  2.0]
NAMES  =  \PYGZsq{}abc\PYGZsq{},\PYGZsq{}xyz\PYGZsq{}  !  Set  the  strings  NAMES  to  \PYGZsq{}abc\PYGZsq{},\PYGZsq{}xyz\PYGZsq{}
\PYGZsh{}override  DO\PYGZus{}THIS  =  False  !  Set  the  Boolean  to  .FALSE.,  ignoring  the  above  specification
\PYGZsh{}override  HALF  =  0.25  !  Set  the  value  of  HALF  to  0.25,  ignoring  the  above  value
\PYGZsh{}override  HALF  =  0.25  !  Same  as  the  above  value  of  HALF  to  0.25  so  is  accepted
\end{sphinxVerbatim}


\subsubsection{Logging of parameters}
\label{\detokenize{api/generated/pages/Runtime_Parameter_System:logging-of-parameters}}\label{\detokenize{api/generated/pages/Runtime_Parameter_System:runtime-parameter-system-1param-logging}}
The subroutine that reads MOM6 parameters has also serves to log every parameter to a file set by DOCUMENT\_FILE, usually “MOM6\_parameter\_doc”. In addition to the name of the variable being read, these calls contain a brief description, along with a description of the units and the default value (if any) or an indication that there is no default and that the variable must be present. For example, \sphinxcode{\sphinxupquote{DT}}
is always required to be present:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{call}  \PYG{n}{get\PYGZus{}param}\PYG{p}{(}\PYG{n}{param\PYGZus{}file}\PYG{p}{,}  \PYG{n}{module}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{DT}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{n}{CS}\PYG{o}{\PYGZpc{}}\PYG{n}{dt}\PYG{p}{,}  \PYG{o}{\PYGZam{}}
             \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{The  (baroclinic)  dynamics  time  step.   The  time\PYGZhy{}step  that  }\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o}{/}\PYG{o}{/}\PYG{o}{\PYGZam{}}
             \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{is  actually  used  will  be  an  integer  fraction  of  the  }\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o}{/}\PYG{o}{/}\PYG{o}{\PYGZam{}}
             \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{forcing  time\PYGZhy{}step  (DT\PYGZus{}FORCING  in  ocean\PYGZhy{}only  mode  or  the  }\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o}{/}\PYG{o}{/}\PYG{o}{\PYGZam{}}
             \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{coupling  timestep  in  coupled  mode.)}\PYG{l+s+s2}{\PYGZdq{}} \PYG{p}{,}  \PYG{n}{units}\PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{s}\PYG{l+s+s2}{\PYGZdq{}} \PYG{p}{,}  \PYG{o}{\PYGZam{}}
             \PYG{n}{fail\PYGZus{}if\PYGZus{}missing}\PYG{o}{=}\PYG{o}{.}\PYG{n}{true}\PYG{o}{.}\PYG{p}{)}
\end{sphinxVerbatim}

At run\sphinxhyphen{}time, two levels of logging are performed, depending on the value of the parameter \sphinxcode{\sphinxupquote{MINIMAL\_DOCUMENTATION}}
:
\begin{itemize}
\item {} 
(TRUE) The end result of the combination of default values, assignments and overrides are recorded with default and current values, description and units, for all parameters.

\item {} 
(FALSE) The minimal list of required and non\sphinxhyphen{}default value parameters are recorded with current values, description and units only for those parameters needed to reproduce the configuration.

\end{itemize}

Either of the generated logging files can be used as inputs and yield the same configuration.

In addition, there are also calls that log derived quantities (e.g., a time\sphinxhyphen{}step that is derived from a CFL number, or the full path to an input file) without reading anything in.


\subsubsection{Error checking of parameters and parameter files}
\label{\detokenize{api/generated/pages/Runtime_Parameter_System:error-checking-of-parameters-and-parameter-files}}\label{\detokenize{api/generated/pages/Runtime_Parameter_System:runtime-parameter-system-1param-checking}}
There are several techniques that are used for error checking on MOM6 parameters:
\begin{itemize}
\item {} 
Some parameters have internal error messages if they are set to nonsensical values.

\item {} 
No parameter can be set twice inconsistently without an explicit \#override specification.

\item {} 
If the run\sphinxhyphen{}time parameter REPORT\_UNUSED\_PARAMS is true, a warning will be issued for any entries in the input parameter files that are not read in, for instance if they are misspelled.

\item {} 
Setting the run\sphinxhyphen{}time parameter FATAL\_UNUSED\_PARAMS to true causes a fatal error that will bring down the model if there are any unused entries in the input parameter files.

\end{itemize}


\section{Diagnostics}
\label{\detokenize{api/generated/pages/Diagnostics:diagnostics}}\label{\detokenize{api/generated/pages/Diagnostics:id1}}\label{\detokenize{api/generated/pages/Diagnostics::doc}}
Controlling run\sphinxhyphen{}time diagnostics and how to add diagnostics to the code

MOM6 diagnostics are orchestrated via the FMS diag\_manager, as for previous versions of MOM. However, because MOM6 is a general coordinate model, the model native\sphinxhyphen{}coordinae output can be less familiar to users of earlier generations of MOM. To alleviate this problem, MOM6 provides both “native” and “remapped” diagnostics; the former being diagnostics in the actual model coordinate space, and the latter in user\sphinxhyphen{}defined coordinates.


\subsection{The “diag\_table”}
\label{\detokenize{api/generated/pages/Diagnostics:the-diag-table}}\label{\detokenize{api/generated/pages/Diagnostics:diagnostics-1diag-table}}
At run\sphinxhyphen{}time, diagnostics are controlled by the input file \sphinxcode{\sphinxupquote{diag\_table}}
which is interpreted but the FMS package diag\_manager.

The diag\_table file has three kinds of section: Title, File and Field. The title section is mandatory and always the first. There can be multiple file and field sections, typically either in pairs or grouped in to all files and all fields, but always with the file section preceding the corresponding field section.


\subsubsection{Title section}
\label{\detokenize{api/generated/pages/Diagnostics:title-section}}\label{\detokenize{api/generated/pages/Diagnostics:diagnostics-1diag-table-title}}
The first two lines are mandatory and comprise a line with a title and a line with six integers defining a base date against which time will be referenced.

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{My  ocean\PYGZhy{}only  test  case}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{l+m+mi}{1900}  \PYG{l+m+mi}{1}  \PYG{l+m+mi}{1}  \PYG{l+m+mi}{0}  \PYG{l+m+mi}{0}  \PYG{l+m+mi}{0}
\end{sphinxVerbatim}


\subsubsection{File section}
\label{\detokenize{api/generated/pages/Diagnostics:file-section}}\label{\detokenize{api/generated/pages/Diagnostics:diagnostics-1diag-table-files}}
This section defines an arbitrary number of files that will be created. Each file is limited to a single rate of either sampling or time\sphinxhyphen{}averaging.

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{file\PYGZus{}name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{n}{output\PYGZus{}freq}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{output\PYGZus{}freq\PYGZus{}units}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{n}{file\PYGZus{}format}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time\PYGZus{}axis\PYGZus{}units}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time\PYGZus{}axis\PYGZus{}name}\PYG{l+s+s2}{\PYGZdq{}}
\end{sphinxVerbatim}
\begin{itemize}
\item {} 
\sphinxcode{\sphinxupquote{file\_name}} : The name of the file that contains diagnostics at the given frequency (excluding the “.nc” extension).

\item {} 
\sphinxcode{\sphinxupquote{output\_freq}} : The period between records in \sphinxcode{\sphinxupquote{file\_name}} , if positive. Special values of 0 mean write every time step and \sphinxhyphen{}1 write only at the end of the run.

\item {} 
\sphinxcode{\sphinxupquote{output\_freq\_units}} : The units in which \sphinxcode{\sphinxupquote{output\_freq}} is given. Valid values are “years”, “months”, “days”, “hours”, “minutes” or “seconds”.

\item {} 
\sphinxcode{\sphinxupquote{file\_format}} : Always set to 1, meaning netcdf.

\item {} 
\sphinxcode{\sphinxupquote{time\_axis\_units}} : The units to use for the time\sphinxhyphen{}axis in the file. Valid values are “years”, “months”, “days”, “hours”, “minutes” or “seconds”.

\item {} 
\sphinxcode{\sphinxupquote{time\_axis\_name}} : The name of the time\sphinxhyphen{}axis (usually “Time”).

\end{itemize}

Optional entries in the file line allow the generation of multiple files are intervals:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{file\PYGZus{}name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{n}{output\PYGZus{}freq}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{output\PYGZus{}freq\PYGZus{}units}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{n}{file\PYGZus{}format}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time\PYGZus{}axis\PYGZus{}units}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time\PYGZus{}axis\PYGZus{}name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{[}\PYG{p}{,}  \PYG{n}{new\PYGZus{}file\PYGZus{}freq}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{new\PYGZus{}file\PYGZus{}freq\PYGZus{}units}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{[}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{start\PYGZus{}time}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{[}\PYG{p}{,}  \PYG{n}{file\PYGZus{}duration}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{file\PYGZus{}duration\PYGZus{}units}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{]}\PYG{p}{]}
\end{sphinxVerbatim}
\begin{itemize}
\item {} 
file\_name : The base name of the file that contains diagnostics at the given frequency (excluding the “.nc” extension). The strings \%yr, \%mo, \%dy, \%hr \%mi, \%sc are expanded to the current year, month, day, hour, minute and second respectively, with new files created every new\_file\_freq.

\item {} 
\sphinxcode{\sphinxupquote{new\_file\_freq}} : The period between generation of new files.

\item {} 
\sphinxcode{\sphinxupquote{new\_file\_freq\_units}} : The units in which \sphinxcode{\sphinxupquote{new\_file\_freq}} is given.

\item {} 
\sphinxcode{\sphinxupquote{start\_time}} , \sphinxcode{\sphinxupquote{file\_duration}} , \sphinxcode{\sphinxupquote{file\_duration\_units}} : Even finer grain control of output files.

\end{itemize}


\subsubsection{Field section}
\label{\detokenize{api/generated/pages/Diagnostics:field-section}}\label{\detokenize{api/generated/pages/Diagnostics:diagnostics-1diag-table-fields}}
An arbitrary number of lines, one per diagnostic field:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{module\PYGZus{}name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{field\PYGZus{}name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{output\PYGZus{}name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{file\PYGZus{}name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time\PYGZus{}sampling}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{reduction\PYGZus{}method}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{regional\PYGZus{}section}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{n}{packing}
\end{sphinxVerbatim}
\begin{itemize}
\item {} 
\sphinxcode{\sphinxupquote{module\_name}} : Name of the component model. For native ocean variables this should be “ocean\_model”. See {\hyperref[\detokenize{api/generated/pages/Diagnostics:diagnostics-1remapped-diagnostics}]{\sphinxcrossref{\DUrole{std,std-ref}{Vertically remapped diagnostics}}}} for non\sphinxhyphen{}native vertical\sphinxhyphen{}grid diagnostics in the ocean model.

\item {} 
\sphinxcode{\sphinxupquote{field\_name}} : The name of the variable as registered in the model.

\item {} 
\sphinxcode{\sphinxupquote{output\_name}} ” The name of the variable as it will appear in the file. This is usually the same as the \sphinxcode{\sphinxupquote{field\_name}} but can be used to rename a diagnostic.

\item {} 
\sphinxcode{\sphinxupquote{file\_name}} : One of the files defined above in the section {\hyperref[\detokenize{api/generated/pages/Diagnostics:diagnostics-1diag-table-files}]{\sphinxcrossref{\DUrole{std,std-ref}{File section}}}} .

\item {} 
\sphinxcode{\sphinxupquote{time\_sampling}} : Always set to “all”.

\item {} 
\sphinxcode{\sphinxupquote{reduction\_method}} : “none” means sample or snapshot. “average” or “mean” performs a time\sphinxhyphen{}average. “min” or “max” diagnose the minium or maxium over each time period.

\item {} 
\sphinxcode{\sphinxupquote{regional\_section}} : “none” means global output. A string of six space separated numbers, “lat\_min, lat\_max, lon\_min, lon\_max, vert\_min, vert\_max”, limits the diagnostic to a region.

\item {} 
\sphinxcode{\sphinxupquote{packing}} : Data representation in the file. 1 means “real*8”, 2 means “real*4”, 4 mean 16\sphinxhyphen{}bit integers, 8 means 1\sphinxhyphen{}byte.

\end{itemize}


\subsubsection{Example}
\label{\detokenize{api/generated/pages/Diagnostics:example}}\label{\detokenize{api/generated/pages/Diagnostics:diagnostics-1diag-table-example}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{OM4  1/4  degree}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{l+m+mi}{1900}  \PYG{l+m+mi}{1}  \PYG{l+m+mi}{1}  \PYG{l+m+mi}{0}  \PYG{l+m+mi}{0}  \PYG{l+m+mi}{0}

\PYG{c+c1}{\PYGZsh{}  Static  file}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}static}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{months}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{days}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time}\PYG{l+s+s2}{\PYGZdq{}}  \PYG{c+c1}{\PYGZsh{}  ocean\PYGZus{}static  is  a  protected  name.  Do  not  change  this  line.}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{deptho}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}     \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{deptho}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}     \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}static}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{2}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{geolon}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}     \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{geolon}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}     \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}static}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{2}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{geolat}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}     \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{geolat}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}     \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}static}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{2}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{wet}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}        \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{wet}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}        \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}static}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{2}

\PYG{c+c1}{\PYGZsh{}  High\PYGZhy{}frequency  file}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{surf\PYGZus{}}\PYG{l+s+s2}{\PYGZpc{}}\PYG{l+s+s2}{4yr\PYGZus{}}\PYG{l+s+si}{\PYGZpc{}3d}\PYG{l+s+s2}{y}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{hours}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{days}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{months}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{SSH}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{SSH}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{surf\PYGZus{}}\PYG{l+s+s2}{\PYGZpc{}}\PYG{l+s+s2}{4yr\PYGZus{}}\PYG{l+s+si}{\PYGZpc{}3d}\PYG{l+s+s2}{y}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+m+mi}{2}

\PYG{c+c1}{\PYGZsh{}  Daily  averages}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}daily}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{days}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{days}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{tos}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{tos}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}daily}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{mean}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+m+mi}{2}

\PYG{c+c1}{\PYGZsh{}  Monthly  averages}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}month}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{months}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{days}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{thetao}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{thetao}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}month}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{mean}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+m+mi}{2}

\PYG{c+c1}{\PYGZsh{}  Annual  averages}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}annual}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{12}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{months}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{days}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{thetao}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{thetao}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}annual}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{mean}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+m+mi}{2}

\PYG{c+c1}{\PYGZsh{}  Vertical  section}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}Bering\PYGZus{}Strait}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{5}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{days}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{days}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{thetao}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{thetao}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}Bering\PYGZus{}Strait}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{mean}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZhy{}171.4  \PYGZhy{}168.7   66.1  66.1  \PYGZhy{}1  \PYGZhy{}1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+m+mi}{2}
\end{sphinxVerbatim}


\subsection{Native diagnostics}
\label{\detokenize{api/generated/pages/Diagnostics:native-diagnostics}}\label{\detokenize{api/generated/pages/Diagnostics:diagnostics-1native-diagnostics}}
The list of available diagnostics is dependent on the particular configuration of the model. For this reason the model writes a record of the available diagnostic fields at run\sphinxhyphen{}time into a file “available\_diags.*”. See, for example,
\sphinxhref{https://github.com/NOAA-GFDL/MOM6-examples/blob/dev/master/ocean\_only/global\_ALE/z/available\_diags.000000}{available\_diags.000000}
for the global\_ALE z\sphinxhyphen{}coordinate ocean\sphinxhyphen{}only test case.

Diagnostic fields in the module “ocean\_model” refer to the native variables or diagnostics in the native grid. Since the model can be run in arbitrary coordinates, say in hybrid\sphinxhyphen{}coordinate mode, then native\sphinxhyphen{}space diagnostics can be potentially confusing. Native diagnostics are useful when examining exactly what the model is doing, or if the vertical coordinate of the model is configured to be a natural coordinate such as pure isopycnal or z* geopotential.


\subsection{Vertically remapped diagnostics}
\label{\detokenize{api/generated/pages/Diagnostics:vertically-remapped-diagnostics}}\label{\detokenize{api/generated/pages/Diagnostics:diagnostics-1remapped-diagnostics}}
Alternative vertical coordinates can be configured for diagnostic purposes only.

The run\sphinxhyphen{}time parameter \sphinxcode{\sphinxupquote{NUM\_DIAG\_COORDS}}
controls how many diagnostic coordinates to use.

The run\sphinxhyphen{}time parameter \sphinxcode{\sphinxupquote{DIAG\_COORDS}}
defines the mapping between each coordinate, the name of the module in the diag\_table and run\sphinxhyphen{}time parameter names that define the coordinate. A list of string tuples, separated by commas, with each tuple in the form of MODULE\_SUFFIX PARAMETER\_SUFFIX COORDINATE\_NAME. \sphinxcode{\sphinxupquote{MODULE\_SUFFIX}} is the string appended to “ocean\_model” to create a module in the diag\_table. \sphinxcode{\sphinxupquote{PARAMETER\_SUFFIX}} is the string appended to “DiAG\_COORD\_DEF”, and other parameters, used to control the generation of the named coordinate. \sphinxcode{\sphinxupquote{COORDINATE\_NAME}} is a name understood by the MOM6 regridding module. Valid examples are “ZSTAR”, “SIGMA”, “RHO”, etc.

By default, \sphinxcode{\sphinxupquote{NUM\_DIAG\_COORDS=1}}
and \sphinxcode{\sphinxupquote{DIAG\_COORDS="z Z ZSTAR"}} , meaning the module “ocean\_model\_z” provides diagnostics in “z*” coordinates and uses the parameter \sphinxcode{\sphinxupquote{DIAG\_COORD\_DEF\_Z}} .

For example, multiple z*\sphinxhyphen{}coordinates could be used for diagnostics with

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{NUM\PYGZus{}DIAG\PYGZus{}COORDS}  \PYG{o}{=}  \PYG{l+m+mi}{2}
\PYG{n}{DIAG\PYGZus{}COORDS}  \PYG{o}{=}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{z  01  ZSTAR,abc  02  ZSTAR}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{n}{DIAG\PYGZus{}COORD\PYGZus{}DEF\PYGZus{}01}  \PYG{o}{=}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{WOA09}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{n}{DIAG\PYGZus{}COORD\PYGZus{}DEF\PYGZus{}02}  \PYG{o}{=}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{UNIFORM:10,20.}\PYG{l+s+s2}{\PYGZdq{}}
\end{sphinxVerbatim}

would create the diag\_manager modules “ocean\_model\_z” and “ocean\_model\_abc”.

The above is equivalent to

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{NUM\PYGZus{}DIAG\PYGZus{}COORDS}  \PYG{o}{=}  \PYG{l+m+mi}{2}
\PYG{n}{DIAG\PYGZus{}COORDS}  \PYG{o}{=}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{z  ZA  ZSTAR,abc  ZB  ZSTAR}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{n}{DIAG\PYGZus{}COORD\PYGZus{}DEF\PYGZus{}ZA}  \PYG{o}{=}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{WOA09}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{n}{DIAG\PYGZus{}COORD\PYGZus{}DEF\PYGZus{}ZB}  \PYG{o}{=}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{UNIFORM:10,20.}\PYG{l+s+s2}{\PYGZdq{}}
\end{sphinxVerbatim}

To obtain a diagnostic of monthly\sphinxhyphen{}averaged potential temperature in both these coordinate systems the diag\_table must include the lines

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}month\PYGZus{}z}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{months}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{days}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}month\PYGZus{}abc}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{months}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+m+mi}{1}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{days}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{time}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model\PYGZus{}z}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{temp}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{temp}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}month\PYGZus{}z}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{mean}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+m+mi}{2}
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}model\PYGZus{}abc}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{temp}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{temp}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ocean\PYGZus{}month\PYGZus{}abc}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{all}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{mean}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+m+mi}{2}
\end{sphinxVerbatim}


\subsubsection{Diagnostic vertical coordinates}
\label{\detokenize{api/generated/pages/Diagnostics:diagnostic-vertical-coordinates}}\label{\detokenize{api/generated/pages/Diagnostics:diagnostics-1diag-table-vertical-coords}}
For each of the \sphinxcode{\sphinxupquote{NUM\_DIAG\_COORDS}}
vertical coordinates listed in \sphinxcode{\sphinxupquote{DIAG\_COORDS}} the corresponding \sphinxcode{\sphinxupquote{DIAG\_COORD\_DEF\_\%}} parameter must be provided. It can take the following values:
\begin{itemize}
\item {} 
PARAM : In this case, a corresponding parameter \sphinxcode{\sphinxupquote{DIAG\_COORD\_RES\_\%}} is read that lists the deltas for each level in the coordinate. For example, DIAG\_COODS=”z Z ZTAR”, DIAG\_COORD\_DEF\_Z=”PARAM”, DIAG\_COORD\_RES\_Z=5,10,10,15 creates z*\sphinxhyphen{}level with 5,10,10,15 meters thicknesses.

\item {} 
UNIFORM : Uniform distribution down to the maximum depth of the model using the same number of levels as he model.

\item {} 
UNIFORM:N : Uniform distribution down to the maximum depth of the model using \sphinxcode{\sphinxupquote{N}} levels.

\item {} 
UNIFORM:N,D : Uniform distribution of \sphinxcode{\sphinxupquote{N}} levels with thickness \sphinxcode{\sphinxupquote{D}} .

\item {} 
\sphinxurl{FILE:filename,varname} : Reads vector of coordinate thicknesses from field “varname” from file “filename”.

\item {} 
\sphinxurl{FILE:filename,interfaces=varname} : Reads vector of coordinate positions from field “varname” from file “filename”.

\item {} 
WOA09 : Z\sphinxhyphen{}levels that correspond to the World Ocean Atlas, 2009, standard levels down to and including the maximum depth of the model.

\item {} 
WOA09:N : The first \sphinxcode{\sphinxupquote{N}} levels of the World Ocean Atlas, 2009, standard levels.

\end{itemize}


\subsection{APIs for diagnostics}
\label{\detokenize{api/generated/pages/Diagnostics:apis-for-diagnostics}}\label{\detokenize{api/generated/pages/Diagnostics:diagnostics-1diagnostics-implementation}}
The multiple diagnostic\sphinxhyphen{}coordinates are implemented in a layer that sits on top of the FMS diag\_manager known as the mom6\_diag\_mediator.

A diagnostic is registered with register\_diag\_field() which is an API that looks similar to the FMS diag\_manager routine of the same name:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{diag\PYGZus{}id}  \PYG{o}{=}  \PYG{n}{register\PYGZus{}diag\PYGZus{}field}\PYG{p}{(}\PYG{n}{module\PYGZus{}name}\PYG{p}{,}  \PYG{n}{diag\PYGZus{}name}\PYG{p}{,}  \PYG{n}{axes}\PYG{p}{,}  \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)}
\end{sphinxVerbatim}

The MOM6 version of this routine optionally allows the specification of CMOR names in addition to the native names which then registers the diagnostic twice, once with each name.

For each of the native and CMOR names, the diagnostic is registered in the native module “ocean\_model”, corresponding to the native model coordinate, and a module associated with each of the diagnostic coordinates.

For each diagnostic coordinate, a horizontally\sphinxhyphen{}averaged diagnostic is also registered.

In all, for each 3D diagnostic, the are 2 + 4N diagnostics registered, where N is the number of diagnostic coordinates. As a result, the global\_ALE examples have of order 900 total diagnostics available in the shipped configuration.

The data is made available to the diag\_manager via a call to post\_data() which is a wrapper that does all the vertical remapping before calling FMS’s send\_data():

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{call}  \PYG{n}{post\PYGZus{}data}\PYG{p}{(}\PYG{n}{diag\PYGZus{}id}\PYG{p}{,}  \PYG{n}{data}\PYG{p}{,}  \PYG{n}{diag\PYGZus{}control}\PYG{p}{)}
\end{sphinxVerbatim}


\subsubsection{Artifacts of posting frequency for diagnostics}
\label{\detokenize{api/generated/pages/Diagnostics:artifacts-of-posting-frequency-for-diagnostics}}\label{\detokenize{api/generated/pages/Diagnostics:diagnostics-1diag-post-frequency}}
Variables area “posted” for i/o or averaging to the diag\_manager (via MOM6’s diag\_mediator) at different frequencies relative to each other. This is because the MOM6 algorithm takes the form of nested sub\sphinxhyphen{}cycles with different time\sphinxhyphen{}steps in each loop (e.g. barotropic solver with dynamics). A consequence of this is that a time average of a related quantities may appear to be inconsistent since the diagnostic posted with higher frequency may not vary linearly between the end\sphinxhyphen{}points seen on the longer time\sphinxhyphen{}step. The differences are usually small, but if you see large differences it might indicate you should re\sphinxhyphen{}examine the time\sphinxhyphen{}steps used for the various sub\sphinxhyphen{}cycles.


\section{Horizontal indexing and memory}
\label{\detokenize{api/generated/pages/Horizontal_Indexing:horizontal-indexing-and-memory}}\label{\detokenize{api/generated/pages/Horizontal_Indexing:horizontal-indexing}}\label{\detokenize{api/generated/pages/Horizontal_Indexing::doc}}
Conventions for staggering of variables and loops over 2d/3d arrays

MOM6 is written in Fortran90 and uses the \sphinxcode{\sphinxupquote{i,j,k}}
order of indexing. \sphinxcode{\sphinxupquote{i}} corresponds to the fastest index (stride\sphinxhyphen{}1 in memory) and thus should be the inner\sphinxhyphen{}most loop variable. We often refer to the i\sphinxhyphen{}direction as the x\sphinxhyphen{} or zonal direction, and similarly to the j\sphinxhyphen{}direction as y\sphinxhyphen{} or meridional direction. The model can use curvilinear grids/coordinates in the horizontal and so these labels have loose meanings but convenient.


\subsection{Loops and staggered variables}
\label{\detokenize{api/generated/pages/Horizontal_Indexing:loops-and-staggered-variables}}\label{\detokenize{api/generated/pages/Horizontal_Indexing:horizontal-indexing-1section-staggering}}
Many variables are staggered horizontally with respect to each other. The dynamics and tracer equations are discretized on an Arakawa C grid. Staggered variables must still have integer indices and we use a north\sphinxhyphen{}east convention centered on the h\sphinxhyphen{}points. These means a variable with indices \sphinxcode{\sphinxupquote{i,j}}
will be either collocated, to the east, to the north, or to the north\sphinxhyphen{}east of the h\sphinxhyphen{}point with the same indices.

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{Arakawa_C_grid}.png}
\caption{MOM6 uses an Arakawa C grid staggering of variables with a North\sphinxhyphen{}East indexing convention. “Cells” refer to the control volumes around tracer\sphinxhyphen{} or h\sphinxhyphen{}point located variables unless labelled otherwise.}\label{\detokenize{api/generated/pages/Horizontal_Indexing:id1}}\end{figure}


\subsubsection{Soft convention for loop variables}
\label{\detokenize{api/generated/pages/Horizontal_Indexing:soft-convention-for-loop-variables}}\label{\detokenize{api/generated/pages/Horizontal_Indexing:horizontal-indexing-1soft-convention}}
To ease reading the code we use a “soft” convection (soft because there is no syntax checking) where an upper\sphinxhyphen{}case index variable can be interpreted as the lower\sphinxhyphen{}case index variable plus
\(\frac{1}{2}\) .

For example, when a loop is over h\sphinxhyphen{}points collocated variables
\begin{itemize}
\item {} 
the do\sphinxhyphen{}loop statements will be for lower\sphinxhyphen{}case \sphinxcode{\sphinxupquote{i,j}} variables

\item {} 
references to h\sphinxhyphen{}point variables will be \sphinxcode{\sphinxupquote{h(i,j)}} , \sphinxcode{\sphinxupquote{D(i+1,j)}} , etc.

\item {} 
references to u\sphinxhyphen{}point variables will be \sphinxcode{\sphinxupquote{u(I,j)}} (meaning \(u_{i+\frac{1}{2},j}\) ), \sphinxcode{\sphinxupquote{u(I\sphinxhyphen{}1,j)}} (meaning \(u_{i-\frac{1}{2},j}\) ), etc.

\item {} 
references to v\sphinxhyphen{}point variables will be \sphinxcode{\sphinxupquote{v(i,J)}} (meaning \(v_{i,j+\frac{1}{2}}\) ), \sphinxcode{\sphinxupquote{u(I\sphinxhyphen{}1,j)}} (meaning \(u_{i,j-\frac{1}{2}}\) ), etc.

\item {} 
references to q\sphinxhyphen{}point variables will be \sphinxcode{\sphinxupquote{q(I,J)}} (meaning \(q_{i+\frac{1}{2},j+\frac{1}{2}}\) ), etc.

\end{itemize}

In contrast, when a loop is over u\sphinxhyphen{}points collocated variables
\begin{itemize}
\item {} 
the do\sphinxhyphen{}loop statements will be for upper\sphinxhyphen{}case \sphinxcode{\sphinxupquote{I}} and lower\sphinxhyphen{}case \sphinxcode{\sphinxupquote{j}} variables

\item {} 
the expression \(u_{i+\frac{1}{2},j} ( h_{i,j} + h_{i+1,j} )\) is \sphinxcode{\sphinxupquote{u(I,j) * ( h(i,j) + h(i+1,j)}} .

\end{itemize}


\subsection{Declaration of variables}
\label{\detokenize{api/generated/pages/Horizontal_Indexing:declaration-of-variables}}\label{\detokenize{api/generated/pages/Horizontal_Indexing:horizontal-indexing-1section-memory}}
\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{Horizontal_NE_indexing_nonsym}.png}
\caption{Non\sphinxhyphen{}symmetric mode: All arrays are declared with the same shape (isd:ied,jsd:jed).}\label{\detokenize{api/generated/pages/Horizontal_Indexing:id2}}\end{figure}

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{Horizontal_NE_indexing_sym}.png}
\caption{Symmetric mode: Arrays have different shapes depending on their staggering location on the Arakawa C grid.}\label{\detokenize{api/generated/pages/Horizontal_Indexing:id3}}\end{figure}

A field is described by 2D or 3D arrays which are distributed across parallel processors. Each processor only sees a small window of the global field. The processor “owns” the computational domain (red in above figure) but arrays are extended horizontally with halos which are intermittently updated with the values from neighboring processors. The halo regions (blue in above figure) may not always be up\sphinxhyphen{}to\sphinxhyphen{}date. Data in halo regions (blue in above figure) will be overwritten my mpp\_updates.

MOM6 has two memory models, “symmetric” and “non\sphinxhyphen{}symmetric”. In non\sphinxhyphen{}symmetric mode all arrays are given the same shape. The consequence of this is that there are fewer staggered variables to the south\sphinxhyphen{}west of the computational domain. An operator applied at h\sphinxhyphen{}point locations involving u\sphinxhyphen{} or v\sphinxhyphen{} point data can not have as wide a stencil on the south\sphinxhyphen{}west side of the processor domain as it can on the north\sphinxhyphen{}east side.

In symmetric mode, declarations are dependent on the variables staggered location on the Arakawa C grid. This allows loops to be symmetric and stencils to be applied more uniformly.

In the code, declarations are consistent with the symmetric memory model. The non\sphinxhyphen{}symmetric mode is implemented by setting the start values of the staggered data domain to be the same as the non\sphinxhyphen{}staggered start value.

The horizontal index type (mom\_hor\_index::hor\_index\_type) provides the data domain start values. The values are also copied into the mom\_grid::ocean\_grid\_type for convenience although we might deprecate this convenience in the future.

Declarations of h\sphinxhyphen{}point data take the form:
\begin{itemize}
\item {} 
\sphinxcode{\sphinxupquote{real, dimension(HI\%isd:HI\%ied, HI\%jsd:HI\%jed) :: D !\textless{} Depth at h\sphinxhyphen{}points (m)}}

\item {} 
\sphinxcode{\sphinxupquote{real, dimension(HI\%isd:HI\%ied, HI\%jsd:HI\%jed, GV\%ke) :: h !\textless{} Layer thickness (H units)}}

\end{itemize}

Declarations of u\sphinxhyphen{}point data take the form:
\begin{itemize}
\item {} 
\sphinxcode{\sphinxupquote{real, dimension(HI\%IsdB:HI\%IedB, HI\%jsd:HI\%jed) :: Du !\textless{} Depth at u\sphinxhyphen{}points (m)}}

\item {} 
\sphinxcode{\sphinxupquote{real, dimension(HI\%IsdB:HI\%IedB, HI\%jsd:HI\%jed, GV\%ke) :: h !\textless{} Zonal flow (m/s)}}

\end{itemize}

Declarations of v\sphinxhyphen{}point data take the form:
\begin{itemize}
\item {} 
\sphinxcode{\sphinxupquote{real, dimension(HI\%isd:HI\%ied, HI\%JsdB:HI\%JedB) :: Dv !\textless{} Depth at v\sphinxhyphen{}points (m)}}

\item {} 
\sphinxcode{\sphinxupquote{real, dimension(HI\%isd:HI\%ied, HI\%JsdB:HI\%JedB, GV\%ke) :: h !\textless{} Zonal flow (m/s)}}

\end{itemize}

Declarations of q\sphinxhyphen{}point data take the form:
\begin{itemize}
\item {} 
\sphinxcode{\sphinxupquote{real, dimension(HI\%IsdB:HI\%IedB, HI\%JsdB:HI\%JedB) :: Dq !\textless{} Depth at q\sphinxhyphen{}points (m)}}

\item {} 
\sphinxcode{\sphinxupquote{real, dimension(HI\%IsdB:HI\%IedB, HI\%JsdB:HI\%JedB, GV\%ke) :: vort !\textless{} Vertical componentof vorticity (s\sphinxhyphen{}1)}}

\end{itemize}

The file MOM\_memory\_macros.h provides the macros \sphinxcode{\sphinxupquote{SZI\_}}
, \sphinxcode{\sphinxupquote{SZJ\_}} , \sphinxcode{\sphinxupquote{SZIB\_}} and \sphinxcode{\sphinxupquote{SZJB\_}} that help make the above more concise:
\begin{itemize}
\item {} 
\sphinxcode{\sphinxupquote{real, dimension(SZI\_(HI), SZJ\_(HI)) :: D !\textless{} Depth at h\sphinxhyphen{}points (m)}}

\item {} 
\sphinxcode{\sphinxupquote{real, dimension(SZIB\_(HI), SZJ\_(HI)) :: Du !\textless{} Depth at u\sphinxhyphen{}points (m)}}

\item {} 
\sphinxcode{\sphinxupquote{real, dimension(SZI\_(HI), SZJB\_(HI)) :: Dv !\textless{} Depth at v\sphinxhyphen{}points (m)}}

\item {} 
\sphinxcode{\sphinxupquote{real, dimension(SZIB\_(HI), SZJB\_(HI)) :: Dq !\textless{} Depth at q\sphinxhyphen{}points (m)}}

\end{itemize}

See MOM\_memory\_macros.h for the complete list of macros used in various memory modes.


\subsection{Calculating a global index}
\label{\detokenize{api/generated/pages/Horizontal_Indexing:calculating-a-global-index}}\label{\detokenize{api/generated/pages/Horizontal_Indexing:horizontal-indexing-1global-index}}
For the most part MOM6 code should be independent of an equivalent absolute global index. There are exceptions and when the global index of a cell \sphinxcode{\sphinxupquote{i,j}}
is needed is can be calculated as follows:
\sphinxcode{\sphinxupquote{i\_global = i + HI\%idg\_offset}}

Before the mom\_hor\_index::hor\_index\_type was introduced, this conversion was done use variables in the mom\_grid::ocean\_grid\_type:
\sphinxcode{\sphinxupquote{i\_global = (i\sphinxhyphen{}G\%isd) + G\%isd\_global}}

which is no longer preferred.

Note that a global index only makes sense for a rectangular global domain. If the domain is a Mosaic of connected tiles (e.g. size tiles of a cube) the global indices (i,j) become meaningless.


\chapter{Forcing}
\label{\detokenize{forcing:forcing}}\label{\detokenize{forcing::doc}}

\section{Solar Radiation}
\label{\detokenize{api/generated/pages/Solar_Radiation:solar-radiation}}\label{\detokenize{api/generated/pages/Solar_Radiation:id1}}\label{\detokenize{api/generated/pages/Solar_Radiation::doc}}
Penetration of Solar Radiation


\subsection{Jerlov water type}
\label{\detokenize{api/generated/pages/Solar_Radiation:jerlov-water-type}}\label{\detokenize{api/generated/pages/Solar_Radiation:solar-radiation-1jerlov-wt}}

\subsection{Absorption by Chlorophyll}
\label{\detokenize{api/generated/pages/Solar_Radiation:absorption-by-chlorophyll}}\label{\detokenize{api/generated/pages/Solar_Radiation:solar-radiation-1chl-absorb}}

\section{Tracer Fluxes}
\label{\detokenize{api/generated/pages/Tracer_Fluxes:tracer-fluxes}}\label{\detokenize{api/generated/pages/Tracer_Fluxes:id1}}\label{\detokenize{api/generated/pages/Tracer_Fluxes::doc}}
Tracer Fluxes


\subsection{Tracer Fluxes}
\label{\detokenize{api/generated/pages/Tracer_Fluxes:tracer-fluxes-1tracer-fluxes}}\label{\detokenize{api/generated/pages/Tracer_Fluxes:id2}}

\subsection{River Runoff}
\label{\detokenize{api/generated/pages/Tracer_Fluxes:river-runoff}}\label{\detokenize{api/generated/pages/Tracer_Fluxes:tracer-fluxes-1river-runoff}}

\subsection{Ice Runoff}
\label{\detokenize{api/generated/pages/Tracer_Fluxes:ice-runoff}}\label{\detokenize{api/generated/pages/Tracer_Fluxes:tracer-fluxes-1ice-runoff}}

\chapter{Parallel Implementation}
\label{\detokenize{parallel:parallel-implementation}}\label{\detokenize{parallel::doc}}

\section{Domain Decomposition}
\label{\detokenize{api/generated/pages/Domain_Decomposition:domain-decomposition}}\label{\detokenize{api/generated/pages/Domain_Decomposition:id1}}\label{\detokenize{api/generated/pages/Domain_Decomposition::doc}}

\subsection{Domain Decomposition}
\label{\detokenize{api/generated/pages/Domain_Decomposition:domain-decomposition-1section-domain-decomp}}\label{\detokenize{api/generated/pages/Domain_Decomposition:id2}}
MOM6 supports serial, OpenMP, and MPI computations, with the user choosing between them at run time. All are accomplished through domain decomposition in the horizontal. All of the horizontal operations are explicit with a relatively small footprint, so the tiling is a logical choice. Some goals in the parallel design of MOM6 were:
\begin{itemize}
\item {} 
Don’t hard\sphinxhyphen{}code the number of processes.

\item {} 
MPI and OpenMP share the same basic structure.

\item {} 
Don’t break the serial optimizations.

\item {} 
Same result as serial code for any number of processes.

\item {} 
Portability \sphinxhyphen{} able to run on any (Unix) system.

\end{itemize}

The whole horizontal MOM6 grid is shown in {\hyperref[\detokenize{api/generated/pages/Horizontal_Indexing:horizontal-indexing-1section-memory}]{\sphinxcrossref{\DUrole{std,std-ref}{Declaration of variables}}}} . The computations are done over the cells inside the darker line; the cells are numbered 1 to NIGLOBAL in the \(x\) \sphinxhyphen{}direction and 1 to NJGLOBAL in the \(y\) \sphinxhyphen{}direction. Those looking ahead to running in parallel would be wise to include factors of two and three in their choice of NIGLOBAL and NJGLOBAL when building new grids. MOM6 will run in parallel with any values of these, but the computations might not be load\sphinxhyphen{}balanced.


\subsection{Wide Halos}
\label{\detokenize{api/generated/pages/Domain_Decomposition:wide-halos}}\label{\detokenize{api/generated/pages/Domain_Decomposition:domain-decomposition-1section-wide-halos}}

\section{Parallel I/O}
\label{\detokenize{api/generated/pages/Parallel_IO:parallel-i-o}}\label{\detokenize{api/generated/pages/Parallel_IO:parallel-io}}\label{\detokenize{api/generated/pages/Parallel_IO::doc}}
Parallel I/O

The model can be told to write a different output file per process. This may or may not save time, and is a bad idea on Lustre filesystems. If the model is writing individual files per process, one can combine them using the mppnccombine program from the
\sphinxhref{https://github.com/NOAA-GFDL/FRE-NCtools}{FRE\sphinxhyphen{}nctools package}
.


\chapter{Testing of MOM6}
\label{\detokenize{testing:testing-of-mom6}}\label{\detokenize{testing::doc}}

\section{Testing}
\label{\detokenize{api/generated/pages/Testing:testing}}\label{\detokenize{api/generated/pages/Testing:id1}}\label{\detokenize{api/generated/pages/Testing::doc}}
MOM6 Validation and Verification

In the software engineering world, people talk about validation and verification of their codes. Verification is the confirmation of design specifications, such as:
\begin{itemize}
\item {} 
Does it compile on the target platform?

\item {} 
Is it dimensionally consistent?

\item {} 
Do answers change with the number of processes?

\item {} 
Do answers change after a restart?

\end{itemize}

Validation is a little trickier:
\begin{itemize}
\item {} 
Does the model meet operational needs?

\item {} 
Does it produce realistic simulations?

\item {} 
Are relevant physical features present?

\item {} 
Can I reproduce my old simulations?

\end{itemize}

There are a number of ways in which MOM6 is tested before each commit, especially commits to the shared dev/main branch.


\subsection{Travis Testing}
\label{\detokenize{api/generated/pages/Testing:travis-testing}}\label{\detokenize{api/generated/pages/Testing:testing-1travis}}
When pushing code to github, it is possible to set it up so that testing is performed automatically by travis. For MOM6, the .travis.yml file is executed, causing the code to be compiled and then run on all the tests in the .testing directory. It is also possible to run these tests on your local machine, but you might have to do some setup first. See

\sphinxstylestrong{See also}

../../../.testing/README.md for more information.


\subsection{Consortium Testing}
\label{\detokenize{api/generated/pages/Testing:consortium-testing}}\label{\detokenize{api/generated/pages/Testing:testing-1consortium-testing}}
For commits to the dev/main branch, there is an opportunity for all consortium members to weigh in on proposed updates. A view of the consortium is shown here:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{consortium}.png}
\caption{The MOM6 consortium.}\label{\detokenize{api/generated/pages/Testing:id2}}\end{figure}

Each group is expected to have their own tests and to keep track of expected answers when these tests are run to be compared to prior answers after the code is updated. Answer\sphinxhyphen{}changing updates have to be evaluated carefully, though there are circumstances in which the new answers may well be “better”.


\subsection{Novel Tests}
\label{\detokenize{api/generated/pages/Testing:novel-tests}}\label{\detokenize{api/generated/pages/Testing:testing-1novel-tests}}
There are two classes of tests which MOM6 performs within the .testing suite which could be considered unusual, but which can be quite useful for finding bugs.


\subsubsection{Scaling tests}
\label{\detokenize{api/generated/pages/Testing:scaling-tests}}\label{\detokenize{api/generated/pages/Testing:testing-1scalings}}
The equations of motion can be multiplied by factors of two without changing answers. One can use that to scale each of six units by a different factor of two to check for consistent use of units. For instance, the equation:
\begin{equation*}
\begin{split}u^{n+1} = u^n + \Delta t \times \cal{F}\end{split}
\end{equation*}
can be scaled as:
\begin{equation*}
\begin{split}{2^{L-T}} u^{n+1} = {2^{L-T}} u^n + {2^T} \Delta t \times {2^{L-2T}} \cal{F}\end{split}
\end{equation*}
MOM6 has been recoded to include six different scale factors:


\begin{savenotes}\sphinxattablestart
\centering
\begin{tabulary}{\linewidth}[t]{|T|T|T|}
\hline
\sphinxstyletheadfamily 
Unit
&\sphinxstyletheadfamily 
Scaling
&\sphinxstyletheadfamily 
Name
\\
\hline
s
&
T
&
Time
\\
\hline
m
&
L
&
Horizontal length
\\
\hline
m
&
H
&
Layer thickness
\\
\hline
m
&
Z
&
Vertical length
\\
\hline
kg/m3
&
R
&
Density
\\
\hline
J/kg
&
Q
&
Enthalpy
\\
\hline
\end{tabulary}
\par
\sphinxattableend\end{savenotes}

You can add these integer scaling factors through the runtime parameters X\_RESCALE\_POWER, where X is one of T, L, H, Z, R, or Q. The valid range for these is \sphinxhyphen{}300 to 300.

When adding contributions to MOM6, this coding style with the scale factors must be maintained. For example, if you add new parameters to read from the input file:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{call}  \PYG{n}{get\PYGZus{}param}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{DT}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}  \PYG{p}{,}  \PYG{n}{scale}\PYG{o}{=}\PYG{n}{US}\PYG{o}{\PYGZpc{}}\PYG{n}{s\PYGZus{}to\PYGZus{}T}\PYG{p}{)}
\end{sphinxVerbatim}

This is also required for explicit contants, though we are trying to move those out of the code:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{ustar}  \PYG{o}{=}  \PYG{l+m+mf}{0.01}  \PYG{o}{*}  \PYG{n}{US}\PYG{o}{\PYGZpc{}}\PYG{n}{m\PYGZus{}to\PYGZus{}Z}  \PYG{o}{*}  \PYG{n}{US}\PYG{o}{\PYGZpc{}}\PYG{n}{T\PYGZus{}to\PYGZus{}s}
\end{sphinxVerbatim}

or for adding diagnostics:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{call}  \PYG{n}{register\PYGZus{}diag\PYGZus{}field}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,}  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{u}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}  \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}  \PYG{p}{,}  \PYG{o}{\PYGZam{}}
       \PYG{n}{conversion}\PYG{o}{=}\PYG{n}{US}\PYG{o}{\PYGZpc{}}\PYG{n}{L\PYGZus{}T\PYGZus{}to\PYGZus{}m\PYGZus{}s}\PYG{p}{)}
\end{sphinxVerbatim}

\sphinxstylestrong{See also}

{\hyperref[\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_unit\_scaling()}}}}}


\subsubsection{Rotational tests}
\label{\detokenize{api/generated/pages/Testing:rotational-tests}}\label{\detokenize{api/generated/pages/Testing:testing-1rotations}}
By setting the runtime option ROTATE\_INDEX to True, the model rotates the domain by some number of 90 degree turns. This option can be used to look for bugs in which east\sphinxhyphen{}west operations do not match north\sphinxhyphen{}south operations. It changes the order of array elements as shown here:

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics{{Rotated_indices}.png}
\caption{The original non\sphinxhyphen{}rotated domain is shown on the left while the right shows the domain rotated counterclockwise by 90 degrees. The array values are shown by the (invariant) colors, while the array indices (and dimensions) change.}\label{\detokenize{api/generated/pages/Testing:id3}}\end{figure}

It only currently runs in serial mode. One can ask for rotations of 90, 180, or 270 degrees, but only 90 degree turns are supported if there are open boundaries.

Because order matters in numerical computations, care must be taken for four\sphinxhyphen{}way averages to match between rotated and non\sphinxhyphen{}rotated runs. Say you want to compute the following quantity:
\begin{equation*}
\begin{split}\phi_{i,j}^{(c)} = \frac{1}{4} (\phi_A + \phi_B + \phi_C + \phi_D)\end{split}
\end{equation*}
as shown in this diagram:

You might write this first as:
\begin{equation*}
\begin{split}\frac{1}{4} ((\phi_A + \phi_B) + (\phi_C + \phi_D))\end{split}
\end{equation*}
as shown on the left in this figure:

However, the round\sphinxhyphen{}off errors could give differing answers when rotated. Instead, you want to group the terms on the diagonal as shown in the right of the above figure and here:
\begin{equation*}
\begin{split}\frac{1}{4} ((\phi_A + \phi_D) + (\phi_B + \phi_C))\end{split}
\end{equation*}

\chapter{API Reference}
\label{\detokenize{apiref:api-reference}}\label{\detokenize{apiref:id1}}\label{\detokenize{apiref::doc}}
This API reference is a partial image of the complete API documentation.
The pages you find here are linkable \sphinxhyphen{} the url for the page is static.
The complete API documentation is generated with doxygen and can be found at \sphinxurl{http://noaa-gfdl.github.io/MOM6/APIs/}.


\section{Modules}
\label{\detokenize{api/modules:modules}}\label{\detokenize{api/modules:id1}}\label{\detokenize{api/modules::doc}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom:f/mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom}}}}}
&
The central module of the MOM6 ocean model.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_ale}}}}}
&
This module contains the main regridding routines.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_eos}}}}}
&
Provides subroutines for quantities specific to the equation of state.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_ice\_shelf}}}}}
&
Implements the thermodynamic aspects of ocean / ice\sphinxhyphen{}shelf interactions, along with a crude placeholder for a later implementation of full ice shelf dynamics, all using the MOM framework and coding style.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_meke}}}}}
&
Implements the Mesoscale Eddy Kinetic Energy framework with topographic beta effect included in computing beta in Rhines scale.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_unit\_scaling}}}}}
&
Provides a transparent unit rescaling type to facilitate dimensional consistency testing.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsection{mom module reference}
\label{\detokenize{api/generated/modules/mom:f/mom}}\label{\detokenize{api/generated/modules/mom:mom-module-reference}}\label{\detokenize{api/generated/modules/mom::doc}}\index{mom (module)@\spxentry{mom}\spxextra{module}|spxpagem}
The central module of the MOM6 ocean model.

{\hyperref[\detokenize{api/generated/modules/mom:detamom}]{\sphinxcrossref{More…}}}


\subsubsection{Data Types}
\label{\detokenize{api/generated/modules/mom:data-types}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom:f/mom/mom_control_struct}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_control\_struct}}}}}
&
Control structure for the MOM module, including the variables that describe the state of the ocean.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/mom_diag_ids}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_diag\_ids}}}}}
&
A structure with diagnostic IDs of the state variables.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Functions/Subroutines}
\label{\detokenize{api/generated/modules/mom:functions-subroutines}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom()}}}}}
&
This subroutine orchestrates the time stepping of MOM.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom_dynamics}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom\_dynamics()}}}}}
&
Time step the ocean dynamics, including the momentum and continuity equations.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom_tracer_dyn}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom\_tracer\_dyn()}}}}}
&
step\_MOM\_tracer\_dyn does tracer advection and lateral diffusion, bringing the tracers up to date with the changes in state due to the dynamics. Surface sources and sinks and remapping are handled via step\_MOM\_thermo.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom_thermo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom\_thermo()}}}}}
&
MOM\_step\_thermo orchestrates the thermodynamic time stepping and vertical remapping, via calls to diabatic (or adiabatic) and ALE\_main.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_offline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_offline()}}}}}
&
step\_offline is the main driver for running tracers offline in MOM6. This has been primarily developed with ALE configurations in mind. Some work has been done in isopycnal configuration, but the work is very preliminary. Some more detail about this capability along with some of the subroutines called here can be found in tracers/MOM\_offline\_control.F90
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/initialize_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_mom()}}}}}
&
Initialize MOM, including memory allocation, setting up parameters and diagnostics, initializing the ocean state variables, and initializing subsidiary modules.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/finish_mom_initialization}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{finish\_mom\_initialization()}}}}}
&
Finishes initializing MOM and writes out the initial conditions.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/register_diags}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{register\_diags()}}}}}
&
Register certain diagnostics.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/mom_timing_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_timing\_init()}}}}}
&
Set up CPU clock IDs for timing various subroutines.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/set_restart_fields}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_restart\_fields()}}}}}
&
Set the fields that are needed for bitwise identical restarting the time stepping scheme.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/adjust_ssh_for_p_atm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{adjust\_ssh\_for\_p\_atm()}}}}}
&
Apply a correction to the sea surface height to compensate for the atmospheric pressure (the inverse barometer).
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/extract_surface_state}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{extract\_surface\_state()}}}}}
&
Set the surface (return) properties of the ocean model by setting the appropriate fields in sfc\_state.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/rotate_initial_state}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate\_initial\_state()}}}}}
&
Rotate initialization fields from input to rotated arrays.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/mom_state_is_synchronized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_state\_is\_synchronized()}}}}}
&
Return true if all phases of step\_MOM are at the same point in time.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/get_mom_state_elements}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_mom\_state\_elements()}}}}}
&
This subroutine offers access to values or pointers to other types from within the MOM\_control\_struct, allowing the MOM\_control\_struct to be opaque.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/get_ocean_stocks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_ocean\_stocks()}}}}}
&
Find the global integrals of various quantities.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/mom_end}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_end()}}}}}
&
End of ocean model, including memory deallocation.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Detailed Description}
\label{\detokenize{api/generated/modules/mom:detailed-description}}\label{\detokenize{api/generated/modules/mom:detamom}}
Modular Ocean Model (MOM) Version 6.0 (MOM6)

Additional contributions from:
\begin{itemize}
\item {} 
Whit Anderson

\item {} 
Brian Arbic

\item {} 
Will Cooke

\item {} 
Anand Gnanadesikan

\item {} 
Matthew Harrison

\item {} 
Mehmet Ilicak

\item {} 
Laura Jackson

\item {} 
Jasmine John

\item {} 
John Krasting

\item {} 
Zhi Liang

\item {} 
Bonnie Samuels

\item {} 
Harper Simmons

\item {} 
Laurent White

\item {} 
Niki Zadeh

\end{itemize}

MOM ice\sphinxhyphen{}shelf code was developed by
\begin{itemize}
\item {} 
Daniel Goldberg

\item {} 
Robert Hallberg

\item {} 
Chris Little

\item {} 
Olga Sergienko

\end{itemize}


\paragraph{Overview of MOM}
\label{\detokenize{api/generated/modules/mom:overview-of-mom}}\label{\detokenize{api/generated/modules/mom:namespacemom-1section-overview}}
This program (MOM) simulates the ocean by numerically solving the hydrostatic primitive equations in generalized Lagrangian vertical coordinates, typically tracking stretched pressure (p*) surfaces or following isopycnals in the ocean’s interior, and general orthogonal horizontal coordinates. Unlike earlier versions of MOM, in MOM6 these equations are horizontally discretized on an Arakawa C\sphinxhyphen{}grid. (It remains to be seen whether a B\sphinxhyphen{}grid dynamic core will be revived in MOM6 at a later date; for now applications requiring a B\sphinxhyphen{}grid discretization should use MOM5.1.) MOM6 offers a range of options for the physical parameterizations, from those most appropriate to highly idealized models for geophysical fluid dynamics studies to a rich suite of processes appropriate for realistic ocean simulations. The thermodynamic options typically use conservative temperature and preformed salinity as conservative state variables and a full nonlinear equation of state, but there are also idealized adiabatic configurations of the model that use fixed density layers. Version 6.0 of MOM continues in the long tradition of a commitment to climate\sphinxhyphen{}quality ocean simulations embodied in previous versions of MOM, even as it draws extensively on the lessons learned in the development of the Generalized Ocean Layered Dynamics (GOLD) ocean model, which was also primarily developed at NOAA/GFDL. MOM has also benefited tremendously from the FMS infrastructure, which it utilizes and shares with other component models developed at NOAA/GFDL.

When run is isopycnal\sphinxhyphen{}coordinate mode, the uppermost few layers are often used to describe a bulk mixed layer, including the effects of penetrating shortwave radiation. Either a split\sphinxhyphen{} explicit time stepping scheme or a non\sphinxhyphen{}split scheme may be used for the dynamics, while the time stepping may be split (and use different numbers of steps to cover the same interval) for the forcing, the thermodynamics, and for the dynamics. Most of the numerics are second order accurate in space. MOM can run with an absurdly thin minimum layer thickness. A variety of non\sphinxhyphen{}isopycnal vertical coordinate options are under development, but all exploit the advantages of a Lagrangian vertical coordinate, as discussed in detail by Adcroft and Hallberg (Ocean Modelling, 2006).

Details of the numerics and physical parameterizations are provided in the appropriate source files. All of the available options are selected at run\sphinxhyphen{}time by parsing the input files, usually MOM\_input and MOM\_override, and the options choices are then documented for each run in MOM\_param\_docs.

MOM6 integrates the equations forward in time in three distinct phases. In one phase, the dynamic equations for the velocities and layer thicknesses are advanced, capturing the propagation of external and internal inertia\sphinxhyphen{}gravity waves, Rossby waves, and other strictly adiabatic processes, including lateral stresses, vertical viscosity and momentum forcing, and interface height diffusion (commonly called Gent\sphinxhyphen{}McWilliams diffusion in depth\sphinxhyphen{} coordinate models). In the second phase, all tracers are advected and diffused along the layers. The third phase applies diabatic processes, vertical mixing of water properties, and perhaps vertical remapping to cause the layers to track the desired vertical coordinate.

The present file (\sphinxcode{\sphinxupquote{MOM.F90}}
) orchestrates the main time stepping loops. One time integration option for the dynamics uses a split explicit time stepping scheme to rapidly step the barotropic pressure and velocity fields. The barotropic velocities are averaged over the baroclinic time step before they are used to advect thickness and determine the baroclinic accelerations. As described in Hallberg and Adcroft (2009), a barotropic correction is applied to the time\sphinxhyphen{}mean layer velocities to ensure that the sum of the layer transports agrees with the time\sphinxhyphen{}mean barotropic transport, thereby ensuring that the estimates of the free surface from the sum of the layer thicknesses agrees with the final free surface height as calculated by the barotropic solver. The barotropic and baroclinic velocities are kept consistent by recalculating the barotropic velocities from the baroclinic transports each time step. This scheme is described in Hallberg, 1997, J. Comp. Phys. 135, 54\sphinxhyphen{}65 and in Hallberg and Adcroft, 2009, Ocean Modelling, 29, 15\sphinxhyphen{}26.

The other time integration options use non\sphinxhyphen{}split time stepping schemes based on the 3\sphinxhyphen{}step third order Runge\sphinxhyphen{}Kutta scheme described in Matsuno, 1966, J. Met. Soc. Japan, 44, 85\sphinxhyphen{}88, or on a two\sphinxhyphen{}step quasi\sphinxhyphen{}2nd order Runge\sphinxhyphen{}Kutta scheme. These are much slower than the split time\sphinxhyphen{}stepping scheme, but they are useful for providing a more robust solution for debugging cases where the more complicated split time\sphinxhyphen{}stepping scheme may be giving suspect solutions.

There are a range of closure options available. Horizontal velocities are subject to a combination of horizontal biharmonic and Laplacian friction (based on a stress tensor formalism) and a vertical Fickian viscosity (perhaps using the kinematic viscosity of water). The horizontal viscosities may be constant, spatially varying or may be dynamically calculated using Smagorinsky’s approach. A diapycnal diffusion of density and thermodynamic quantities is also allowed, but not required, as is horizontal diffusion of interface heights (akin to the Gent\sphinxhyphen{}McWilliams closure of geopotential coordinate models). The diapycnal mixing may use a fixed diffusivity or it may use the shear Richardson number dependent closure, like that described in Jackson et al. (JPO, 2008). When there is diapycnal diffusion, it applies to momentum as well. As this is in addition to the vertical viscosity, the vertical Prandtl always exceeds 1. A refined bulk\sphinxhyphen{}mixed layer is often used to describe the planetary boundary layer in realistic ocean simulations.

MOM has a number of noteworthy debugging capabilities. Excessively large velocities are truncated and MOM will stop itself after a number of such instances to keep the model from crashing altogether. This is useful in diagnosing failures, or (by accepting some truncations) it may be useful for getting the model past the adjustment from an ill\sphinxhyphen{}balanced initial condition. In addition, all of the accelerations in the columns with excessively large velocities may be directed to a text file. Parallelization errors may be diagnosed using the DEBUG option, which causes extensive checksums to be written out along with comments indicating where in the algorithm the sums originate and what variable is being summed. The point where these checksums differ between runs is usually a good indication of where in the code the problem lies. All of the test cases provided with MOM are routinely tested to ensure that they give bitwise identical results regardless of the domain decomposition, or whether they use static or dynamic memory allocation.


\paragraph{Structure of MOM}
\label{\detokenize{api/generated/modules/mom:structure-of-mom}}\label{\detokenize{api/generated/modules/mom:namespacemom-1section-structure}}
About 115 other files of source code and 4 header files comprise the MOM code, although there are several hundred more files that make up the FMS infrastructure upon which MOM is built. Each of the MOM files contains comments documenting what it does, and most of the file names are fairly self\sphinxhyphen{}evident. In addition, all subroutines and data types are referenced via a module use, only statement, and the module names are consistent with the file names, so it is not too hard to find the source file for a subroutine.

The typical MOM directory tree is as follows:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
../MOM
|\PYGZhy{}\PYGZhy{} config\PYGZus{}src
|   |\PYGZhy{}\PYGZhy{} coupled\PYGZus{}driver
|   |\PYGZhy{}\PYGZhy{} dynamic
|   `\PYGZhy{}\PYGZhy{} solo\PYGZus{}driver
|\PYGZhy{}\PYGZhy{} examples
|   |\PYGZhy{}\PYGZhy{} CM2G
|   |\PYGZhy{}\PYGZhy{} ...
|   `\PYGZhy{}\PYGZhy{} torus\PYGZus{}advection\PYGZus{}test
`\PYGZhy{}\PYGZhy{} src
    |\PYGZhy{}\PYGZhy{} core
    |\PYGZhy{}\PYGZhy{} diagnostics
    |\PYGZhy{}\PYGZhy{} equation\PYGZus{}of\PYGZus{}state
    |\PYGZhy{}\PYGZhy{} framework
    |\PYGZhy{}\PYGZhy{} ice\PYGZus{}shelf
    |\PYGZhy{}\PYGZhy{} initialization
    |\PYGZhy{}\PYGZhy{} parameterizations
    |   |\PYGZhy{}\PYGZhy{} lateral
    |   `\PYGZhy{}\PYGZhy{} vertical
    |\PYGZhy{}\PYGZhy{} tracer
    `\PYGZhy{}\PYGZhy{} user
\end{sphinxVerbatim}

Rather than describing each file here, each directory contents will be described to give a broad overview of the MOM code structure.

The directories under config\_src contain files that are used for configuring the code, for instance for coupled or ocean\sphinxhyphen{}only runs. Only one or two of these directories are used in compiling any, particular run.
\begin{itemize}
\item {} 
config\_src/coupled\_driver: The files here are used to couple MOM as a component in a larger run driven by the FMS coupler. This includes code that converts various forcing fields into the code structures and flux and unit conventions used by MOM, and converts the MOM surface fields back to the forms used by other FMS components.

\item {} 
config\_src/dynamic: The only file here is the version of MOM\_memory.h that is used for dynamic memory configurations of MOM.

\item {} 
config\_src/solo\_driver: The files here are include the \_main driver that is used when MOM is configured as an ocean\sphinxhyphen{}only model, as well as the files that specify the surface forcing in this configuration.

\end{itemize}

The directories under examples provide a large number of working configurations of MOM, along with reference solutions for several different compilers on GFDL’s latest large computer. The versions of MOM\_memory.h in these directories need not be used if dynamic memory allocation is desired, and the answers should be unchanged.

The directories under src contain most of the MOM files. These files are used in every configuration using MOM.
\begin{itemize}
\item {} 
src/core: The files here constitute the MOM dynamic core. This directory also includes files with the types that describe the model’s lateral grid and have defined types that are shared across various MOM modules to allow for more succinct and flexible subroutine argument lists.

\item {} 
src/diagnostics: The files here calculate various diagnostics that are anciliary to the model itself. While most of these diagnostics do not directly affect the model’s solution, there are some, like the calculation of the deformation radius, that are used in some of the process parameterizations.

\item {} 
src/equation\_of\_state: These files describe the physical properties of sea\sphinxhyphen{}water, including both the equation of state and when it freezes.

\item {} 
src/framework: These files provide infrastructure utilities for MOM. Many are simply wrappers for capabilities provided by FMS, although others provide capabilities (like the file\_parser) that are unique to MOM. When MOM is adapted to use a modeling infrastructure distinct from FMS, most of the required changes are in this directory.

\item {} 
src/initialization: These are the files that are used to initialize the MOM grid or provide the initial physical state for MOM. These files are not intended to be modified, but provide a means for calling user\sphinxhyphen{}specific initialization code like the examples in src/user.

\item {} 
src/parameterizations/lateral: These files implement a number of quasi\sphinxhyphen{}lateral (along\sphinxhyphen{}layer) process parameterizations, including lateral viscosities, parameterizations of eddy effects, and the calculation of tidal forcing.

\item {} 
src/parameterizations/vertical: These files implement a number of vertical mixing or diabatic processes, including the effects of vertical viscosity and code to parameterize the planetary boundary layer. There is a separate driver that orchestrates this portion of the algorithm, and there is a diversity of parameterizations to be found here.

\item {} 
src/tracer: These files handle the lateral transport and diffusion of tracers, or are the code to implement various passive tracer packages. Additional tracer packages are readily accommodated.

\item {} 
src/user: These are either stub routines that a user could use to change the model’s initial conditions or forcing, or are examples that implement specific test cases. These files can easily be hand edited to create new analytically specified configurations.

\end{itemize}

Most simulations can be set up by modifying only the files MOM\_input, and possibly one or two of the files in src/user. In addition, the diag\_table (MOM\_diag\_table) will commonly be modified to tailor the output to the needs of the question at hand. The FMS utility mkmf works with a file called path\_names to build an appropriate makefile, and path\_names should be edited to reflect the actual location of the desired source code.

There are 3 publicly visible subroutines in this file (\sphinxcode{\sphinxupquote{MOM.F90}}
).
\begin{itemize}
\item {} 
step\_MOM steps MOM over a specified interval of time.

\item {} 
MOM\_initialize calls initialize and does other initialization that does not warrant user modification.

\item {} 
extract\_surface\_state determines the surface (bulk mixed layer if traditional isoycnal vertical coordinate) properties of the current model state and packages pointers to these fields into an exported structure.

\end{itemize}

The remaining subroutines in this file (\sphinxcode{\sphinxupquote{src/core/MOM.F90}}
) are:
\begin{itemize}
\item {} 
find\_total\_transport determines the barotropic mass transport.

\item {} 
register\_diags registers many diagnostic fields for the dynamic solver, or of the main model variables.

\item {} 
MOM\_timing\_init initializes various CPU time clocks.

\item {} 
write\_static\_fields writes out various time\sphinxhyphen{}invariant fields.

\item {} 
set\_restart\_fields is used to specify those fields that are written to and read from the restart file.

\end{itemize}


\paragraph{Diagnosing MOM heat budget}
\label{\detokenize{api/generated/modules/mom:diagnosing-mom-heat-budget}}\label{\detokenize{api/generated/modules/mom:namespacemom-1section-heat-budget}}
Here are some example heat budgets for the ALE version of MOM6.


\subparagraph{Depth integrated heat budget}
\label{\detokenize{api/generated/modules/mom:depth-integrated-heat-budget}}\label{\detokenize{api/generated/modules/mom:namespacemom-1subsection-2d-heat-budget}}
Depth integrated heat budget diagnostic for MOM.
\begin{itemize}
\item {} 
OPOTTEMPTEND\_2d = T\_ADVECTION\_XY\_2d + OPOTTEMPPMDIFF\_2d + HFDS + HFGEOU

\item {} 
T\_ADVECTION\_XY\_2d = horizontal advection

\item {} 
OPOTTEMPPMDIFF\_2d = neutral diffusion

\item {} 
HFDS = net surface boundary heat flux

\item {} 
HFGEOU = geothermal heat flux

\item {} 
HFDS = net surface boundary heat flux entering the ocean = rsntds + rlntds + hfls + hfss + heat\_pme + hfsifrazil

\item {} 
More heat flux cross\sphinxhyphen{}checks
\begin{itemize}
\item {} 
hfds = net\_heat\_coupler + hfsifrazil + heat\_pme

\item {} 
heat\_pme = heat\_content\_surfwater = heat\_content\_massin + heat\_content\_massout = heat\_content\_fprec + heat\_content\_cond + heat\_content\_vprec
\begin{itemize}
\item {} 
hfrunoffds + hfevapds + hfrainds

\end{itemize}

\end{itemize}

\end{itemize}


\subparagraph{Depth integrated heat budget}
\label{\detokenize{api/generated/modules/mom:namespacemom-1subsection-3d-heat-budget}}\label{\detokenize{api/generated/modules/mom:id1}}
Here is an example 3d heat budget diagnostic for MOM.
\begin{itemize}
\item {} 
OPOTTEMPTEND = T\_ADVECTION\_XY + TH\_TENDENCY\_VERT\_REMAP + OPOTTEMPDIFF + OPOTTEMPPMDIFF
\begin{itemize}
\item {} 
BOUNDARY\_FORCING\_HEAT\_TENDENCY + FRAZIL\_HEAT\_TENDENCY

\end{itemize}

\item {} 
OPOTTEMPTEND = net tendency of heat as diagnosed in \sphinxcode{\sphinxupquote{MOM.F90}}

\item {} 
T\_ADVECTION\_XY = heating of a cell from lateral advection

\item {} 
TH\_TENDENCY\_VERT\_REMAP = heating of a cell from vertical remapping

\item {} 
OPOTTEMPDIFF = heating of a cell from diabatic diffusion

\item {} 
OPOTTEMPPMDIFF = heating of a cell from neutral diffusion

\item {} 
BOUNDARY\_FORCING\_HEAT\_TENDENCY = heating of cell from boundary fluxes

\item {} 
FRAZIL\_HEAT\_TENDENCY = heating of cell from frazil

\item {} 
TH\_TENDENCY\_VERT\_REMAP has zero vertical sum, as it redistributes heat in vertical.

\item {} 
OPOTTEMPDIFF has zero vertical sum, as it redistributes heat in the vertical.

\item {} 
BOUNDARY\_FORCING\_HEAT\_TENDENCY generally has 3d structure, with k \textgreater{} 1 contributions from penetrative shortwave, and from other fluxes for the case when layers are tiny, in which case MOM6 partitions tendencies into k \textgreater{} 1 layers.

\item {} 
FRAZIL\_HEAT\_TENDENCY generally has 3d structure, since MOM6 frazil calculation checks the full ocean column.

\item {} 
FRAZIL\_HEAT\_TENDENCY{[}\sphinxhref{mailto:k=@sum}{k=@sum}{]} = HFSIFRAZIL = column integrated frazil heating.

\item {} 
HFDS = FRAZIL\_HEAT\_TENDENCY{[}\sphinxhref{mailto:k=@sum}{k=@sum}{]} + BOUNDARY\_FORCING\_HEAT\_TENDENCY{[}\sphinxhref{mailto:k=@sum}{k=@sum}{]}

\end{itemize}

Here is an example 2d heat budget (depth summed) diagnostic for MOM.
\begin{itemize}
\item {} 
OPOTTEMPTEND\_2d = T\_ADVECTION\_XY\_2d + OPOTTEMPPMDIFF\_2d + HFDS

\end{itemize}

Here is an example 3d salt budget diagnostic for MOM.
\begin{itemize}
\item {} 
OSALTTEND = S\_ADVECTION\_XY + SH\_TENDENCY\_VERT\_REMAP + OSALTDIFF + OSALTPMDIFF
\begin{itemize}
\item {} 
BOUNDARY\_FORCING\_SALT\_TENDENCY

\end{itemize}

\item {} 
OSALTTEND = net tendency of salt as diagnosed in \sphinxcode{\sphinxupquote{MOM.F90}}

\item {} 
S\_ADVECTION\_XY = salt convergence to cell from lateral advection

\item {} 
SH\_TENDENCY\_VERT\_REMAP = salt convergence to cell from vertical remapping

\item {} 
OSALTDIFF = salt convergence to cell from diabatic diffusion

\item {} 
OSALTPMDIFF = salt convergence to cell from neutral diffusion

\item {} 
BOUNDARY\_FORCING\_SALT\_TENDENCY = salt convergence to cell from boundary fluxes

\item {} 
SH\_TENDENCY\_VERT\_REMAP has zero vertical sum, as it redistributes salt in vertical.

\item {} 
OSALTDIFF has zero vertical sum, as it redistributes salt in the vertical.

\item {} 
BOUNDARY\_FORCING\_SALT\_TENDENCY generally has 3d structure, with k \textgreater{} 1 contributions from the case when layers are tiny, in which case MOM6 partitions tendencies into k \textgreater{} 1 layers.

\item {} 
SFDSI = BOUNDARY\_FORCING\_SALT\_TENDENCY{[}\sphinxhref{mailto:k=@sum}{k=@sum}{]}

\end{itemize}

Here is an example 2d salt budget (depth summed) diagnostic for MOM.
\begin{itemize}
\item {} 
OSALTTEND\_2d = S\_ADVECTION\_XY\_2d + OSALTPMDIFF\_2d + SFDSI (+ SALT\_FLUX\_RESTORE)

\end{itemize}


\subsubsection{Type Documentation}
\label{\detokenize{api/generated/modules/mom:type-documentation}}\index{mom\_control\_struct (fortran type in module mom)@\spxentry{mom\_control\_struct}\spxextra{fortran type in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/mom_control_struct}}\pysigline{\sphinxbfcode{\sphinxupquote{type  }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{mom\_control\_struct}}}
Control structure for the MOM module, including the variables that describe the state of the ocean.
\begin{quote}\begin{description}
\item[{Type fields}] \leavevmode\begin{itemize}
\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} (* eta\_av\_bc {[}*) :: layer thickness {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: potential temperature {[}degC{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: salinity {[}ppt{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: zonal velocity component {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: uh = u * h * dy at u grid points {[}H L2 T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m3 s\sphinxhyphen{}1 or kg s\sphinxhyphen{}1{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: accumulated zonal thickness fluxes to advect tracers {[}H L2 \textasciitilde{}\textgreater{} m3 or kg{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: meridional velocity {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: vh = v * h * dx at v grid points {[}H L2 T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m3 s\sphinxhyphen{}1 or kg s\sphinxhyphen{}1{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: accumulated meridional thickness fluxes to advect tracers {[}H L2 \textasciitilde{}\textgreater{} m3 or kg{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: A running time integral of the sea surface height {[}T m \textasciitilde{}\textgreater{} s m{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: time\sphinxhyphen{}averaged (over a forcing time step) sea surface height with a correction for the inverse barometer {[}m{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{real}} :: free surface height or column mass time averaged over the last baroclinic dynamics time step {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{hml}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: active mixed layer depth {[}Z \textasciitilde{}\textgreater{} m{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{time\_in\_cycle}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The running time of the current time\sphinxhyphen{}stepping cycle in calls that step the dynamics, and also the length of the time integral of ssh\_rint {[}T \textasciitilde{}\textgreater{} s{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{time\_in\_thermo\_cycle}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The running time of the current time\sphinxhyphen{}stepping cycle in calls that step the thermodynamics {[}T \textasciitilde{}\textgreater{} s{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{g\_in}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(ocean\_grid\_type)}\sphinxstyleemphasis{{]}} :: Input grid metric.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{g}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(ocean\_grid\_type)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Model grid metric.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{rotate\_index}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: True if index map is rotated.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{gv}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(verticalgrid\_type)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: structure containing vertical grid info

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{us}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(unit\_scale\_type)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: structure containing various unit conversion factors

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{tv}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(thermo\_var\_ptrs)}\sphinxstyleemphasis{{]}} :: structure containing pointers to available thermodynamic fields

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{t\_dyn\_rel\_adv}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The time of the dynamics relative to tracer advection and lateral mixing {[}T \textasciitilde{}\textgreater{} s{]}, or equivalently the elapsed time since advectively updating the tracers. t\_dyn\_rel\_adv is invariably positive and may span multiple coupling timesteps.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{t\_dyn\_rel\_thermo}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The time of the dynamics relative to diabatic processes and remapping {[}T \textasciitilde{}\textgreater{} s{]}. t\_dyn\_rel\_thermo can be negative or positive depending on whether the diabatic processes are applied before or after the dynamics and may span multiple coupling timesteps.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{t\_dyn\_rel\_diag}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The time of the diagnostics relative to diabatic processes and remapping {[}T \textasciitilde{}\textgreater{} s{]}. t\_dyn\_rel\_diag is always positive, since the diagnostics must lag.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{preadv\_h\_stored}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, the thicknesses from before the advective cycle have been stored for use in diagnostics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{diag}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(diag\_ctrl)}\sphinxstyleemphasis{{]}} :: structure to regulate diagnostic output timing

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{visc}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(vertvisc\_type)}\sphinxstyleemphasis{{]}} :: structure containing vertical viscosities, bottom drag viscosities, and related fields

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(meke\_type)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: structure containing fields related to the Mesoscale Eddy Kinetic Energy

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{adiabatic}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, there are no diapycnal mass fluxes, and no calls to routines to calculate or apply diapycnal fluxes.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{diabatic\_first}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, apply diabatic and thermodynamic processes before time stepping the dynamics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{use\_ale\_algorithm}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, use the ALE algorithm rather than layered isopycnal/stacked shallow water mode. This logical is set by calling the function useRegridding() from the MOM\_regridding module.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{offline\_tracer\_mode}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true,

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{time}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(time\_type)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: pointer to the ocean clock

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dt}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: (baroclinic) dynamics time step {[}T \textasciitilde{}\textgreater{} s{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dt\_therm}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: thermodynamics time step {[}T \textasciitilde{}\textgreater{} s{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{thermo\_spans\_coupling}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, thermodynamic and tracer time steps can span multiple coupled time steps.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{nstep\_tot}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: The total number of dynamic timesteps tcaaken so far in this run segment.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{count\_calls}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, count the calls to step\_MOM, rather than the number of dynamics steps in nstep\_tot.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{debug}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, write verbose checksums for debugging purposes.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{ntrunc}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: number u,v truncations since last call to write\_energy

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{cont\_stencil}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: The stencil for thickness from the continuity solver.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{do\_dynamics}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If false, does not call step\_MOM\_dyn\_*. This is an undocumented run\sphinxhyphen{}time flag that is fragile.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{split}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, use the split time stepping scheme.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{use\_rk2}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, use RK2 instead of RK3 in unsplit mode (i.e., no split between barotropic and baroclinic).

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{thickness\_diffuse}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, diffuse interface height w/ a diffusivity KHTH.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{thickness\_diffuse\_first}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, diffuse thickness before dynamics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{mixedlayer\_restrat}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, use submesoscale mixed layer restratifying scheme.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{usemeke}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, call the MEKE parameterization.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{usewaves}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, update Stokes drift.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{use\_p\_surf\_in\_eos}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, always include the surface pressure contributions in equation of state calculations.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dtbt\_reset\_period}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The time interval between dynamic recalculation of the barotropic time step {[}s{]}. If this is negative dtbt is never calculated, and if it is 0, dtbt is calculated every step.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dtbt\_reset\_interval}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(time\_type)}\sphinxstyleemphasis{{]}} :: A time\_time representation of dtbt\_reset\_period.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dtbt\_reset\_time}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(time\_type)}\sphinxstyleemphasis{{]}} :: The next time DTBT should be calculated.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{h\_pre\_dyn}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: The thickness before the transports {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{t\_pre\_dyn}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Temperature before the transports {[}degC{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{s\_pre\_dyn}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Salinity before the transports {[}ppt{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{adp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(accel\_diag\_ptrs)}\sphinxstyleemphasis{{]}} :: structure containing pointers to accelerations, for derived diagnostics (e.g., energy budgets)

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{cdp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(cont\_diag\_ptrs)}\sphinxstyleemphasis{{]}} :: structure containing pointers to continuity equation terms, for derived diagnostics (e.g., energy budgets)

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{u\_prev}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: previous value of u stored for diagnostics {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{v\_prev}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: previous value of v stored for diagnostics {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{interp\_p\_surf}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, linearly interpolate surface pressure over the coupling time step, using specified value at the end of the coupling step. False by default.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{p\_surf\_prev\_set}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, p\_surf\_prev has been properly set from a previous time\sphinxhyphen{}step or the ocean restart file. This is only valid when interp\_p\_surf is true.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{p\_surf\_prev}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: surface pressure {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]} at end previous call to step\_MOM

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{p\_surf\_begin}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: surface pressure {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]} at start of {\color{red}\bfseries{}step\_MOM\_dyn\_}…

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{p\_surf\_end}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: surface pressure {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]} at end of {\color{red}\bfseries{}step\_MOM\_dyn\_}…

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{write\_ic}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, then the initial conditions will be written to file.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{ic\_file}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{character(len=120)}\sphinxstyleemphasis{{]}} :: A file into which the initial conditions are written in a new run if SAVE\_INITIAL\_CONDS is true.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{calc\_rho\_for\_sea\_lev}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, calculate rho to convert pressure to sea level.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{hmix}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Diagnostic mixed layer thickness over which to average surface tracer properties when a bulk mixed layer is not used {[}Z \textasciitilde{}\textgreater{} m{]}, or a negative value if a bulk mixed layer is being used.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{hfrz}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: If HFrz \textgreater{} 0, the nominal depth over which melt potential is computed {[}Z \textasciitilde{}\textgreater{} m{]}. The actual depth over which melt potential is computed is min(HFrz, OBLD), where OBLD is the boundary layer depth. If HFrz \textless{}= 0 (default), melt potential will not be computed.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{hmix\_uv}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Depth scale over which to average surface flow to feedback to the coupler/driver {[}Z \textasciitilde{}\textgreater{} m{]} when bulk mixed layer is not used, or a negative value if a bulk mixed layer is being used.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{check\_bad\_sfc\_vals}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, scan surface state for ridiculous values.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{bad\_val\_ssh\_max}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Maximum SSH before triggering bad value message {[}Z \textasciitilde{}\textgreater{} m{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{bad\_val\_sst\_max}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Maximum SST before triggering bad value message {[}degC{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{bad\_val\_sst\_min}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Minimum SST before triggering bad value message {[}degC{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{bad\_val\_sss\_max}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Maximum SSS before triggering bad value message {[}ppt{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{bad\_val\_col\_thick}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Minimum column thickness before triggering bad value message {[}Z \textasciitilde{}\textgreater{} m{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{answers\_2018}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, use expressions for the surface properties that recover the answers from the end of 2018. Otherwise, use more appropriate expressions that differ at roundoff for non\sphinxhyphen{}Boussinsq cases.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{ids}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type( mom\_diag\_ids )}\sphinxstyleemphasis{{]}} :: Handles used for diagnostics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{transport\_ids}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(transport\_diag\_ids)}\sphinxstyleemphasis{{]}} :: Handles used for transport diagnostics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{sfc\_ids}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(surface\_diag\_ids)}\sphinxstyleemphasis{{]}} :: Handles used for surface diagnostics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{diag\_pre\_sync}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(diag\_grid\_storage)}\sphinxstyleemphasis{{]}} :: The grid (thicknesses) before remapping.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{diag\_pre\_dyn}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(diag\_grid\_storage)}\sphinxstyleemphasis{{]}} :: The grid (thicknesses) before dynamics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dyn\_unsplit\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(mom\_dyn\_unsplit\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure used for the unsplit dynamics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dyn\_unsplit\_rk2\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(mom\_dyn\_unsplit\_rk2\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure used for the unsplit RK2 dynamics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dyn\_split\_rk2\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(mom\_dyn\_split\_rk2\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure used for the mode\sphinxhyphen{}split RK2 dynamics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{thickness\_diffuse\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(thickness\_diffuse\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure used for the isopycnal height diffusive transport. This is also common referred to as Gent\sphinxhyphen{}McWilliams diffusion.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{mixedlayer\_restrat\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(mixedlayer\_restrat\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure used for the mixed layer restratification.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{set\_visc\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(set\_visc\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure used to set viscosities.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{diabatic\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(diabatic\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure for the diabatic driver.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(meke\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure for the MEKE updates.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{varmix}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(varmix\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure for the variable mixing module.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{barotropic\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(barotropic\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure for the barotropic module.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{tracer\_reg}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(tracer\_registry\_type)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the MOM tracer registry.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{tracer\_adv\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(tracer\_advect\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the MOM tracer advection control structure.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{tracer\_diff\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(tracer\_hor\_diff\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the MOM along\sphinxhyphen{}isopycnal tracer diffusion control structure.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{tracer\_flow\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(tracer\_flow\_control\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure that orchestrates the calling of tracer packages.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{update\_obc\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(update\_obc\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the control structure for updating open boundary condition properties.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{obc}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(ocean\_obc\_type)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the MOM open boundary condition type.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{sponge\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(sponge\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the layered\sphinxhyphen{}mode sponge control structure.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{ale\_sponge\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(ale\_sponge\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the ALE\sphinxhyphen{}mode sponge control structure.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{ale\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(ale\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the Arbitrary Lagrangian Eulerian (ALE) vertical coordinate control structure.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{sum\_output\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(sum\_output\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the globally summed output control structure.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{diagnostics\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(diagnostics\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the MOM diagnostics control structure.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{offline\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(offline\_transport\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Pointer to the offline tracer transport control structure.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{ensemble\_ocean}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: if true, this run is part of a larger ensemble for the purpose of data assimilation or statistical analysis.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{odacs}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(oda\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: a pointer to the control structure for handling ensemble model state vectors and data assimilation increments and priors

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{mom\_diag\_ids (fortran type in module mom)@\spxentry{mom\_diag\_ids}\spxextra{fortran type in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/mom_diag_ids}}\pysigline{\sphinxbfcode{\sphinxupquote{type  }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{mom\_diag\_ids}}}
A structure with diagnostic IDs of the state variables.
\begin{quote}\begin{description}
\item[{Type fields}] \leavevmode\begin{itemize}
\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_u}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{,}\sphinxstyleemphasis{private}\sphinxstyleemphasis{{]}} :: 3\sphinxhyphen{}d state field diagnostic IDs

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_v}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{,}\sphinxstyleemphasis{private}\sphinxstyleemphasis{{]}} :: 3\sphinxhyphen{}d state field diagnostic IDs

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_h}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{,}\sphinxstyleemphasis{private}\sphinxstyleemphasis{{]}} :: 3\sphinxhyphen{}d state field diagnostic IDs

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_ssh\_inst}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{,}\sphinxstyleemphasis{private}\sphinxstyleemphasis{{]}} :: 2\sphinxhyphen{}d state field diagnotic ID

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}



\subsubsection{Function/Subroutine Documentation}
\label{\detokenize{api/generated/modules/mom:function-subroutine-documentation}}\index{step\_mom() (fortran subroutine in module mom)@\spxentry{step\_mom()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/step_mom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{step\_mom}}}{\emph{forces\_in}, \emph{fluxes\_in}, \emph{sfc\_state}, \emph{Time\_start}, \emph{time\_int\_in}, \emph{CS}, \emph{Waves}, \emph{do\_dynamics}, \emph{do\_thermodynamics}, \emph{start\_cycle}, \emph{end\_cycle}, \emph{cycle\_length}, \emph{reset\_therm}}{}
This subroutine orchestrates the time stepping of MOM. The adiabatic dynamics are stepped by calls to one of the {\color{red}\bfseries{}step\_MOM\_dyn\_}…routines. The action of lateral processes on tracers occur in calls to advect\_tracer and tracer\_hordiff. Vertical mixing and possibly remapping occur inside of diabatic.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{forces\_in} :: {[}inout{]} A structure with the driving mechanical forces

\item {} 
\sphinxstylestrong{fluxes\_in} :: {[}inout{]} A structure with pointers to themodynamic, tracer and mass exchange forcing fields

\item {} 
\sphinxstylestrong{sfc\_state} :: {[}inout{]} surface ocean state

\item {} 
\sphinxstylestrong{time\_start} :: {[}in{]} starting time of a segment, as a time type

\item {} 
\sphinxstylestrong{time\_int\_in} :: {[}in{]} time interval covered by this run segment {[}s{]}.

\item {} 
\sphinxstylestrong{cs} :: control structure from initialize\_MOM

\item {} 
\sphinxstylestrong{waves} :: An optional pointer to a wave property CS

\item {} 
\sphinxstylestrong{do\_dynamics} :: {[}in{]} Present and false, do not do updates due to the dynamics.

\item {} 
\sphinxstylestrong{do\_thermodynamics} :: {[}in{]} Present and false, do not do updates due to the thermodynamics or remapping.

\item {} 
\sphinxstylestrong{start\_cycle} :: {[}in{]} This indicates whether this call is to be treated as the first call to step\_MOM in a time\sphinxhyphen{}stepping cycle; missing is like true.

\item {} 
\sphinxstylestrong{end\_cycle} :: {[}in{]} This indicates whether this call is to be treated as the last call to step\_MOM in a time\sphinxhyphen{}stepping cycle; missing is like true.

\item {} 
\sphinxstylestrong{cycle\_length} :: {[}in{]} The amount of time in a coupled time stepping cycle {[}s{]}.

\item {} 
\sphinxstylestrong{reset\_therm} :: {[}in{]} This indicates whether the running sums of thermodynamic quantities should be reset. If missing, this is like start\_cycle.

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/adjust_ssh_for_p_atm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{adjust\_ssh\_for\_p\_atm}}}}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/extract_surface_state}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{extract\_surface\_state}}}}} \sphinxcode{\sphinxupquote{id\_clock\_diagnostics}} \sphinxcode{\sphinxupquote{id\_clock\_dynamics}} \sphinxcode{\sphinxupquote{id\_clock\_ocean}} \sphinxcode{\sphinxupquote{id\_clock\_other}} \sphinxcode{\sphinxupquote{id\_clock\_pass}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/mom_state_is_synchronized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_state\_is\_synchronized}}}}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom_dynamics}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom\_dynamics}}}}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom_thermo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom\_thermo}}}}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom_tracer_dyn}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom\_tracer\_dyn}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{step\_mom\_dynamics() (fortran subroutine in module mom)@\spxentry{step\_mom\_dynamics()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/step_mom_dynamics}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{step\_mom\_dynamics}}}{\emph{forces}, \emph{p\_surf\_begin}, \emph{p\_surf\_end}, \emph{dt}, \emph{dt\_thermo}, \emph{bbl\_time\_int}, \emph{CS}, \emph{Time\_local}, \emph{Waves}}{}
Time step the ocean dynamics, including the momentum and continuity equations.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{forces} :: {[}in{]} A structure with the driving mechanical forces

\item {} 
\sphinxstylestrong{p\_surf\_begin} :: A pointer (perhaps NULL) to the surface pressure at the beginning of this dynamic step, intent in {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}.

\item {} 
\sphinxstylestrong{p\_surf\_end} :: A pointer (perhaps NULL) to the surface pressure at the end of this dynamic step, intent in {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}.

\item {} 
\sphinxstylestrong{dt} :: {[}in{]} time interval covered by this call {[}T \textasciitilde{}\textgreater{} s{]}.

\item {} 
\sphinxstylestrong{dt\_thermo} :: {[}in{]} time interval covered by any updates that may span multiple dynamics steps {[}T \textasciitilde{}\textgreater{} s{]}.

\item {} 
\sphinxstylestrong{bbl\_time\_int} :: {[}in{]} time interval over which updates to the bottom boundary layer properties will apply {[}T \textasciitilde{}\textgreater{} s{]}, or zero not to update the properties.

\item {} 
\sphinxstylestrong{cs} :: control structure from initialize\_MOM

\item {} 
\sphinxstylestrong{time\_local} :: {[}in{]} End time of a segment, as a time type

\item {} 
\sphinxstylestrong{waves} :: Container for wave related parameters; the

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{id\_clock\_bbl\_visc}} \sphinxcode{\sphinxupquote{id\_clock\_diagnostics}} \sphinxcode{\sphinxupquote{id\_clock\_dynamics}} \sphinxcode{\sphinxupquote{id\_clock\_ml\_restrat}} \sphinxcode{\sphinxupquote{id\_clock\_other}} \sphinxcode{\sphinxupquote{id\_clock\_pass}} \sphinxcode{\sphinxupquote{id\_clock\_thick\_diff}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{step\_mom\_tracer\_dyn() (fortran subroutine in module mom)@\spxentry{step\_mom\_tracer\_dyn()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/step_mom_tracer_dyn}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{step\_mom\_tracer\_dyn}}}{\emph{CS}, \emph{G}, \emph{GV}, \emph{US}, \emph{h}, \emph{Time\_local}}{}
step\_MOM\_tracer\_dyn does tracer advection and lateral diffusion, bringing the tracers up to date with the changes in state due to the dynamics. Surface sources and sinks and remapping are handled via step\_MOM\_thermo.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: {[}inout{]} control structure

\item {} 
\sphinxstylestrong{g} :: {[}inout{]} ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} ocean vertical grid structure

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{h} :: {[}in{]} layer thicknesses after the transports {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{time\_local} :: {[}in{]} The model time at the end of the time step.

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{id\_clock\_diagnostics}} \sphinxcode{\sphinxupquote{id\_clock\_other}} \sphinxcode{\sphinxupquote{id\_clock\_pass}} \sphinxcode{\sphinxupquote{id\_clock\_thermo}} \sphinxcode{\sphinxupquote{id\_clock\_tracer}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{step\_mom\_thermo() (fortran subroutine in module mom)@\spxentry{step\_mom\_thermo()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/step_mom_thermo}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{step\_mom\_thermo}}}{\emph{CS}, \emph{G}, \emph{GV}, \emph{US}, \emph{u}, \emph{v}, \emph{h}, \emph{tv}, \emph{fluxes}, \emph{dtdia}, \emph{Time\_end\_thermo}, \emph{update\_BBL}, \emph{Waves}}{}
MOM\_step\_thermo orchestrates the thermodynamic time stepping and vertical remapping, via calls to diabatic (or adiabatic) and ALE\_main.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: {[}inout{]} Master MOM control structure

\item {} 
\sphinxstylestrong{g} :: {[}inout{]} ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}inout{]} ocean vertical grid structure

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{u} :: {[}inout{]} zonal velocity {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{v} :: {[}inout{]} meridional velocity {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{h} :: {[}inout{]} layer thickness {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{tv} :: {[}inout{]} A structure pointing to various thermodynamic variables

\item {} 
\sphinxstylestrong{fluxes} :: {[}inout{]} pointers to forcing fields

\item {} 
\sphinxstylestrong{dtdia} :: {[}in{]} The time interval over which to advance {[}T \textasciitilde{}\textgreater{} s{]}

\item {} 
\sphinxstylestrong{time\_end\_thermo} :: {[}in{]} End of averaging interval for thermo diags

\item {} 
\sphinxstylestrong{update\_bbl} :: {[}in{]} If true, calculate the bottom boundary layer properties.

\item {} 
\sphinxstylestrong{waves} :: Container for wave related parameters

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{id\_clock\_adiabatic}} \sphinxcode{\sphinxupquote{id\_clock\_ale}} \sphinxcode{\sphinxupquote{id\_clock\_bbl\_visc}} \sphinxcode{\sphinxupquote{id\_clock\_diabatic}} \sphinxcode{\sphinxupquote{id\_clock\_pass}} \sphinxcode{\sphinxupquote{id\_clock\_thermo}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{step\_offline() (fortran subroutine in module mom)@\spxentry{step\_offline()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/step_offline}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{step\_offline}}}{\emph{forces}, \emph{fluxes}, \emph{sfc\_state}, \emph{Time\_start}, \emph{time\_interval}, \emph{CS}}{}
step\_offline is the main driver for running tracers offline in MOM6. This has been primarily developed with ALE configurations in mind. Some work has been done in isopycnal configuration, but the work is very preliminary. Some more detail about this capability along with some of the subroutines called here can be found in tracers/MOM\_offline\_control.F90
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{forces} :: {[}in{]} A structure with the driving mechanical forces

\item {} 
\sphinxstylestrong{fluxes} :: {[}inout{]} pointers to forcing fields

\item {} 
\sphinxstylestrong{sfc\_state} :: {[}inout{]} surface ocean state

\item {} 
\sphinxstylestrong{time\_start} :: {[}in{]} starting time of a segment, as a time type

\item {} 
\sphinxstylestrong{time\_interval} :: {[}in{]} time interval

\item {} 
\sphinxstylestrong{cs} :: control structure from initialize\_MOM

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/adjust_ssh_for_p_atm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{adjust\_ssh\_for\_p\_atm}}}}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/extract_surface_state}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{extract\_surface\_state}}}}} \sphinxcode{\sphinxupquote{id\_clock\_ale}} \sphinxcode{\sphinxupquote{id\_clock\_offline\_tracer}}

\end{description}\end{quote}

\end{fulllineitems}

\index{initialize\_mom() (fortran subroutine in module mom)@\spxentry{initialize\_mom()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/initialize_mom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{initialize\_mom}}}{\emph{Time}, \emph{Time\_init}, \emph{param\_file}, \emph{dirs}, \emph{CS}, \emph{restart\_CSp}, \emph{Time\_in}, \emph{offline\_tracer\_mode}, \emph{input\_restart\_file}, \emph{diag\_ptr}, \emph{count\_calls}, \emph{tracer\_flow\_CSp}}{}
Initialize MOM, including memory allocation, setting up parameters and diagnostics, initializing the ocean state variables, and initializing subsidiary modules.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{time} :: {[}inout{]} model time, set in this routine

\item {} 
\sphinxstylestrong{time\_init} :: {[}in{]} The start time for the coupled model’s calendar

\item {} 
\sphinxstylestrong{param\_file} :: {[}out{]} structure indicating parameter file to parse

\item {} 
\sphinxstylestrong{dirs} :: {[}out{]} structure with directory paths

\item {} 
\sphinxstylestrong{cs} :: pointer set in this routine to MOM control structure

\item {} 
\sphinxstylestrong{restart\_csp} :: pointer set in this routine to the restart control structure that will be used for MOM.

\item {} 
\sphinxstylestrong{time\_in} :: {[}in{]} time passed to MOM\_initialize\_state when model is not being started from a restart file

\item {} 
\sphinxstylestrong{offline\_tracer\_mode} :: {[}out{]} True is returned if tracers are being run offline

\item {} 
\sphinxstylestrong{input\_restart\_file} :: {[}in{]} If present, name of restart file to read

\item {} 
\sphinxstylestrong{diag\_ptr} :: A pointer set in this routine to the diagnostic regulatory structure

\item {} 
\sphinxstylestrong{tracer\_flow\_csp} :: A pointer set in this routine to

\item {} 
\sphinxstylestrong{count\_calls} :: {[}in{]} If true, nstep\_tot counts the number of calls to step\_MOM instead of the number of dynamics timesteps.

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{id\_clock\_init}} \sphinxcode{\sphinxupquote{id\_clock\_mom\_init}} \sphinxcode{\sphinxupquote{id\_clock\_pass\_init}} \sphinxcode{\sphinxupquote{id\_clock\_unit\_tests}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/mom_timing_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_timing\_init}}}}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/register_diags}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{register\_diags}}}}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/rotate_initial_state}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate\_initial\_state}}}}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/set_restart_fields}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_restart\_fields}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{finish\_mom\_initialization() (fortran subroutine in module mom)@\spxentry{finish\_mom\_initialization()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/finish_mom_initialization}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{finish\_mom\_initialization}}}{\emph{Time}, \emph{dirs}, \emph{CS}, \emph{restart\_CSp}}{}
Finishes initializing MOM and writes out the initial conditions.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{time} :: {[}in{]} model time, used in this routine

\item {} 
\sphinxstylestrong{dirs} :: {[}in{]} structure with directory paths

\item {} 
\sphinxstylestrong{cs} :: pointer to MOM control structure

\item {} 
\sphinxstylestrong{restart\_csp} :: pointer to the restart control structure that will be used for MOM.

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{id\_clock\_init}}

\end{description}\end{quote}

\end{fulllineitems}

\index{register\_diags() (fortran subroutine in module mom)@\spxentry{register\_diags()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/register_diags}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{register\_diags}}}{\emph{Time}, \emph{G}, \emph{GV}, \emph{US}, \emph{IDs}, \emph{diag}}{}
Register certain diagnostics.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{time} :: {[}in{]} current model time

\item {} 
\sphinxstylestrong{g} :: {[}in{]} ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} ocean vertical grid structure

\item {} 
\sphinxstylestrong{us} :: {[}inout{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{ids} :: {[}inout{]} A structure with the diagnostic IDs.

\item {} 
\sphinxstylestrong{diag} :: {[}inout{]} regulates diagnostic output

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/initialize_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_mom}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{mom\_timing\_init() (fortran subroutine in module mom)@\spxentry{mom\_timing\_init()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/mom_timing_init}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{mom\_timing\_init}}}{\emph{CS}}{}
Set up CPU clock IDs for timing various subroutines.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{cs} :: {[}in{]} control structure set up by initialize\_MOM.

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{id\_clock\_adiabatic}} \sphinxcode{\sphinxupquote{id\_clock\_ale}} \sphinxcode{\sphinxupquote{id\_clock\_bbl\_visc}} \sphinxcode{\sphinxupquote{id\_clock\_continuity}} \sphinxcode{\sphinxupquote{id\_clock\_diabatic}} \sphinxcode{\sphinxupquote{id\_clock\_diagnostics}} \sphinxcode{\sphinxupquote{id\_clock\_dynamics}} \sphinxcode{\sphinxupquote{id\_clock\_ml\_restrat}} \sphinxcode{\sphinxupquote{id\_clock\_mom\_init}} \sphinxcode{\sphinxupquote{id\_clock\_ocean}} \sphinxcode{\sphinxupquote{id\_clock\_offline\_tracer}} \sphinxcode{\sphinxupquote{id\_clock\_other}} \sphinxcode{\sphinxupquote{id\_clock\_pass}} \sphinxcode{\sphinxupquote{id\_clock\_pass\_init}} \sphinxcode{\sphinxupquote{id\_clock\_thermo}} \sphinxcode{\sphinxupquote{id\_clock\_thick\_diff}} \sphinxcode{\sphinxupquote{id\_clock\_tracer}} \sphinxcode{\sphinxupquote{id\_clock\_z\_diag}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/initialize_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_mom}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{set\_restart\_fields() (fortran subroutine in module mom)@\spxentry{set\_restart\_fields()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/set_restart_fields}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{set\_restart\_fields}}}{\emph{GV}, \emph{US}, \emph{param\_file}, \emph{CS}, \emph{restart\_CSp}}{}
Set the fields that are needed for bitwise identical restarting the time stepping scheme. In addition to those specified here directly, there may be fields related to the forcing or to the barotropic solver that are needed; these are specified in sub\sphinxhyphen{} routines that are called from this one.

This routine should be altered if there are any changes to the time stepping scheme. The CHECK\_RESTART facility may be used to confirm that all needed restart fields have been included.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{gv} :: {[}inout{]} ocean vertical grid structure

\item {} 
\sphinxstylestrong{us} :: {[}inout{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{param\_file} :: {[}in{]} opened file for parsing to get parameters

\item {} 
\sphinxstylestrong{cs} :: {[}in{]} control structure set up by initialize\_MOM

\item {} 
\sphinxstylestrong{restart\_csp} :: pointer to the restart control structure that will be used for MOM.

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/initialize_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_mom}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{adjust\_ssh\_for\_p\_atm() (fortran subroutine in module mom)@\spxentry{adjust\_ssh\_for\_p\_atm()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/adjust_ssh_for_p_atm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{adjust\_ssh\_for\_p\_atm}}}{\emph{tv}, \emph{G}, \emph{GV}, \emph{US}, \emph{ssh}, \emph{p\_atm}, \emph{use\_EOS}}{}
Apply a correction to the sea surface height to compensate for the atmospheric pressure (the inverse barometer).
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{tv} :: {[}in{]} A structure pointing to various thermodynamic variables

\item {} 
\sphinxstylestrong{g} :: {[}in{]} ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} ocean vertical grid structure

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{ssh} :: {[}inout{]} time mean surface height {[}m{]}

\item {} 
\sphinxstylestrong{p\_atm} :: Ocean surface pressure {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{use\_eos} :: {[}in{]} If true, calculate the density for the SSH correction using the equation of state.

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom}}}}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_offline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_offline}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{extract\_surface\_state() (fortran subroutine in module mom)@\spxentry{extract\_surface\_state()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/extract_surface_state}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{extract\_surface\_state}}}{\emph{CS}, \emph{sfc\_state\_in}}{}
Set the surface (return) properties of the ocean model by setting the appropriate fields in sfc\_state. Unused fields are set to NULL or are unallocated.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: Master MOM control structure

\item {} 
\sphinxstylestrong{sfc\_state\_in} :: {[}inout{]} transparent ocean surface state structure shared with the calling routine data in this structure is intent out.

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom}}}}} {\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_offline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_offline}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{rotate\_initial\_state() (fortran subroutine in module mom)@\spxentry{rotate\_initial\_state()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/rotate_initial_state}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{rotate\_initial\_state}}}{\emph{u\_in}, \emph{v\_in}, \emph{h\_in}, \emph{T\_in}, \emph{S\_in}, \emph{use\_temperature}, \emph{turns}, \emph{u}, \emph{v}, \emph{h}, \emph{T}, \emph{S}}{}
Rotate initialization fields from input to rotated arrays.
\begin{quote}\begin{description}
\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/initialize_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_mom}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{mom\_state\_is\_synchronized() (fortran function in module mom)@\spxentry{mom\_state\_is\_synchronized()}\spxextra{fortran function in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/mom_state_is_synchronized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{function }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{mom\_state\_is\_synchronized}}}{\emph{CS}, \emph{adv\_dyn}}{\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}}}
Return true if all phases of step\_MOM are at the same point in time.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: MOM control structure

\item {} 
\sphinxstylestrong{adv\_dyn} :: {[}in{]} If present and true, only check whether the advection is up\sphinxhyphen{}to\sphinxhyphen{}date with the dynamics.

\end{itemize}

\item[{Return}] \leavevmode
\sphinxstylestrong{undefined} :: True if all phases of the update are synchronized.

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom:f/mom/step_mom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_mom}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{get\_mom\_state\_elements() (fortran subroutine in module mom)@\spxentry{get\_mom\_state\_elements()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/get_mom_state_elements}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{get\_mom\_state\_elements}}}{\emph{CS}, \emph{G}, \emph{GV}, \emph{US}, \emph{C\_p}, \emph{C\_p\_scaled}, \emph{use\_temp}}{}
This subroutine offers access to values or pointers to other types from within the MOM\_control\_struct, allowing the MOM\_control\_struct to be opaque.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: MOM control structure

\item {} 
\sphinxstylestrong{g} :: structure containing metrics and grid info

\item {} 
\sphinxstylestrong{gv} :: structure containing vertical grid info

\item {} 
\sphinxstylestrong{us} :: A dimensional unit scaling type

\item {} 
\sphinxstylestrong{c\_p} :: {[}out{]} The heat capacity {[}J kg degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{c\_p\_scaled} :: {[}out{]} The heat capacity in scaled units {[}Q degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} J kg degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{use\_temp} :: {[}out{]} True if temperature is a state variable

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{get\_ocean\_stocks() (fortran subroutine in module mom)@\spxentry{get\_ocean\_stocks()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/get_ocean_stocks}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{get\_ocean\_stocks}}}{\emph{CS}, \emph{mass}, \emph{heat}, \emph{salt}, \emph{on\_PE\_only}}{}
Find the global integrals of various quantities.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: MOM control structure

\item {} 
\sphinxstylestrong{heat} :: {[}out{]} The globally integrated integrated ocean heat {[}J{]}.

\item {} 
\sphinxstylestrong{salt} :: {[}out{]} The globally integrated integrated ocean salt {[}kg{]}.

\item {} 
\sphinxstylestrong{mass} :: {[}out{]} The globally integrated integrated ocean mass {[}kg{]}.

\item {} 
\sphinxstylestrong{on\_pe\_only} :: {[}in{]} If present and true, only sum on the local PE.

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{mom\_end() (fortran subroutine in module mom)@\spxentry{mom\_end()}\spxextra{fortran subroutine in module mom}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom:f/mom/mom_end}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom/}}\sphinxbfcode{\sphinxupquote{mom\_end}}}{\emph{CS}}{}
End of ocean model, including memory deallocation.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{cs} :: MOM control structure

\end{description}\end{quote}

\end{fulllineitems}



\subsection{mom\_ale module reference}
\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale}}\label{\detokenize{api/generated/modules/mom_ale:mom-ale-module-reference}}\label{\detokenize{api/generated/modules/mom_ale::doc}}\index{mom\_ale (module)@\spxentry{mom\_ale}\spxextra{module}|spxpagem}
This module contains the main regridding routines.

{\hyperref[\detokenize{api/generated/modules/mom_ale:detamom-ale}]{\sphinxcrossref{More…}}}


\subsubsection{Data Types}
\label{\detokenize{api/generated/modules/mom_ale:data-types}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_cs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_cs}}}}}
&
ALE control structure.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Functions/Subroutines}
\label{\detokenize{api/generated/modules/mom_ale:functions-subroutines}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_init()}}}}}
&
This routine is typically called (from initialize\_MOM in file \sphinxcode{\sphinxupquote{MOM.F90}} ) before the main time integration loop to initialize the regridding stuff.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_register_diags}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_register\_diags()}}}}}
&
Initialize diagnostics for the ALE module.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/adjustgridforintegrity}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{adjustgridforintegrity()}}}}}
&
Crudely adjust (initial) grid for integrity.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_end}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_end()}}}}}
&
End of regridding (memory deallocation).
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_main}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_main()}}}}}
&
Takes care of (1) building a new grid and (2) remapping all variables between the old grid and the new grid.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_main_offline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_main\_offline()}}}}}
&
Takes care of (1) building a new grid and (2) remapping all variables between the old grid and the new grid.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_offline_inputs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_offline\_inputs()}}}}}
&
Regrid/remap stored fields used for offline tracer integrations.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_offline_tracer_final}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_offline\_tracer\_final()}}}}}
&
Remaps all tracers from h onto h\_target.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/check_grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{check\_grid()}}}}}
&
Check grid for negative thicknesses.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_build_grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_build\_grid()}}}}}
&
Generates new grid.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_regrid_accelerated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_regrid\_accelerated()}}}}}
&
For a state\sphinxhyphen{}based coordinate, accelerate the process of regridding by repeatedly applying the grid calculation algorithm.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/remap_all_state_vars}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remap\_all\_state\_vars()}}}}}
&
This routine takes care of remapping all variable between the old and the new grids.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_remap_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_remap\_scalar()}}}}}
&
Remaps a single scalar between grids described by thicknesses h\_src and h\_dst.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ts_plm_edge_values}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ts\_plm\_edge\_values()}}}}}
&
Calculate edge values (top and bottom of layer) for T and S consistent with a PLM reconstruction in the vertical direction.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_plm_edge_values}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_plm\_edge\_values()}}}}}
&
Calculate edge values (top and bottom of layer) 3d scalar array.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ts_ppm_edge_values}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ts\_ppm\_edge\_values()}}}}}
&
Calculate edge values (top and bottom of layer) for T and S consistent with a PPM reconstruction in the vertical direction.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_initregridding}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_initregridding()}}}}}
&
Initializes regridding for the main ALE algorithm.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_getcoordinate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_getcoordinate()}}}}}
&
Query the target coordinate interfaces positions.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_getcoordinateunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_getcoordinateunits()}}}}}
&
Query the target coordinate units.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_remap_init_conds}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_remap\_init\_conds()}}}}}
&
Returns true if initial conditions should be regridded and remapped.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_update_regrid_weights}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_update\_regrid\_weights()}}}}}
&
Updates the weights for time filtering the new grid generated in regridding.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_updateverticalgridtype}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_updateverticalgridtype()}}}}}
&
Update the vertical grid type with ALE information.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_writecoordinatefile}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_writecoordinatefile()}}}}}
&
Write the vertical coordinate information into a file.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_initthicknesstocoord}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_initthicknesstocoord()}}}}}
&
Set h to coordinate values for fixed coordinate systems.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Detailed Description}
\label{\detokenize{api/generated/modules/mom_ale:detailed-description}}\label{\detokenize{api/generated/modules/mom_ale:detamom-ale}}
Regridding comprises two steps:
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
Interpolation and creation of a new grid based on target interface densities (or any other criterion).

\item {} 
Remapping of quantities between old grid and new grid.

\end{enumerate}

Original module written by Laurent White, 2008.06.09


\subsubsection{Type Documentation}
\label{\detokenize{api/generated/modules/mom_ale:type-documentation}}\index{ale\_cs (fortran type in module mom\_ale)@\spxentry{ale\_cs}\spxextra{fortran type in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_cs}}\pysigline{\sphinxbfcode{\sphinxupquote{type  }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_cs}}}
ALE control structure.
\begin{quote}\begin{description}
\item[{Type fields}] \leavevmode\begin{itemize}
\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{remap\_uv\_using\_old\_alg}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, uses the old “remapping via a delta z” method. If False, uses the new method that remaps between grids described by h.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{regrid\_time\_scale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The time\sphinxhyphen{}scale used in blending between the current (old) grid and the target (new) grid {[}T \textasciitilde{}\textgreater{} s{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{regridcs}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(regridding\_cs)}\sphinxstyleemphasis{{]}} :: Regridding parameters and work arrays.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{remapcs}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(remapping\_cs)}\sphinxstyleemphasis{{]}} :: Remapping parameters and work arrays.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{nk}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Used only for queries, not directly by this module.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{remap\_after\_initialization}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: Indicates whether to regrid/remap after initializing the state.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{answers\_2018}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, use the order of arithmetic and expressions for remapping that recover the answers from the end of 2018. Otherwise, use more robust and accurate forms of mathematically equivalent expressions.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{show\_call\_tree}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: For debugging.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{diag}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(diag\_ctrl)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: structure to regulate output

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_tracer\_remap\_tendency}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer(:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{allocatable}\sphinxstyleemphasis{{]}} :: diagnostic id

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_htracer\_remap\_tendency}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer(:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{allocatable}\sphinxstyleemphasis{{]}} :: diagnostic id

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_htracer\_remap\_tendency\_2d}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer(:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{allocatable}\sphinxstyleemphasis{{]}} :: diagnostic id

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{do\_tendency\_diag}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical(:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{allocatable}\sphinxstyleemphasis{{]}} :: flag for doing diagnostics

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_dzregrid}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: diagnostic id

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_u\_preale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: diagnostic id for zonal velocity before ALE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_v\_preale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: diagnostic id for meridional velocity before ALE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_h\_preale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: diagnostic id for layer thicknesses before ALE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_t\_preale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: diagnostic id for temperatures before ALE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_s\_preale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: diagnostic id for salinities before ALE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_e\_preale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: diagnostic id for interface heights before ALE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_vert\_remap\_h}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: diagnostic id for layer thicknesses used for remapping

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_vert\_remap\_h\_tendency}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: diagnostic id for layer thickness tendency due to ALE

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}



\subsubsection{Function/Subroutine Documentation}
\label{\detokenize{api/generated/modules/mom_ale:function-subroutine-documentation}}\index{ale\_init() (fortran subroutine in module mom\_ale)@\spxentry{ale\_init()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_init}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_init}}}{\emph{param\_file}, \emph{GV}, \emph{US}, \emph{max\_depth}, \emph{CS}}{}
This routine is typically called (from initialize\_MOM in file \sphinxcode{\sphinxupquote{MOM.F90}}
) before the main time integration loop to initialize the regridding stuff. We read the MOM\_input file to register the values of different regridding/remapping parameters.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{param\_file} :: {[}in{]} Parameter file

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{max\_depth} :: {[}in{]} The maximum depth of the ocean {[}Z \textasciitilde{}\textgreater{} m{]}.

\item {} 
\sphinxstylestrong{cs} :: Module control structure

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_initregridding}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_initregridding}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_register\_diags() (fortran subroutine in module mom\_ale)@\spxentry{ale\_register\_diags()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_register_diags}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_register\_diags}}}{\emph{Time}, \emph{G}, \emph{GV}, \emph{US}, \emph{diag}, \emph{CS}}{}
Initialize diagnostics for the ALE module.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{time} :: {[}in{]} Time structure

\item {} 
\sphinxstylestrong{g} :: {[}in{]} Grid structure

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{diag} :: {[}in{]} Diagnostics control structure

\item {} 
\sphinxstylestrong{cs} :: Module control structure

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{adjustgridforintegrity() (fortran subroutine in module mom\_ale)@\spxentry{adjustgridforintegrity()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/adjustgridforintegrity}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{adjustgridforintegrity}}}{\emph{CS}, \emph{G}, \emph{GV}, \emph{h}}{}
Crudely adjust (initial) grid for integrity. This routine is typically called (from initialize\_MOM in file \sphinxcode{\sphinxupquote{MOM.F90}}
) before the main time integration loop to initialize the regridding stuff. We read the MOM\_input file to register the values of different regridding/remapping parameters.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: Regridding parameters and options

\item {} 
\sphinxstylestrong{g} :: {[}in{]} Ocean grid informations

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{h} :: {[}inout{]} Current 3D grid thickness that are to be adjusted {[}H \textasciitilde{}\textgreater{} m or kg\sphinxhyphen{}2{]}

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_end() (fortran subroutine in module mom\_ale)@\spxentry{ale\_end()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_end}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_end}}}{\emph{CS}}{}
End of regridding (memory deallocation). This routine is typically called (from MOM\_end in file \sphinxcode{\sphinxupquote{MOM.F90}}
) after the main time integration loop to deallocate the regridding stuff.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{cs} :: module control structure

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_main() (fortran subroutine in module mom\_ale)@\spxentry{ale\_main()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_main}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_main}}}{\emph{G}, \emph{GV}, \emph{US}, \emph{h}, \emph{u}, \emph{v}, \emph{tv}, \emph{Reg}, \emph{CS}, \emph{OBC}, \emph{dt}, \emph{frac\_shelf\_h}}{}
Takes care of (1) building a new grid and (2) remapping all variables between the old grid and the new grid. The creation of the new grid can be based on z coordinates, target interface densities, sigma coordinates or any arbitrary coordinate system.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}in{]} Ocean grid informations

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{h} :: {[}inout{]} Current 3D grid obtained after the last time step {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{u} :: {[}inout{]} Zonal velocity field {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{v} :: {[}inout{]} Meridional velocity field {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{tv} :: {[}inout{]} Thermodynamic variable structure

\item {} 
\sphinxstylestrong{reg} :: Tracer registry structure

\item {} 
\sphinxstylestrong{cs} :: Regridding parameters and options

\item {} 
\sphinxstylestrong{obc} :: Open boundary structure

\item {} 
\sphinxstylestrong{dt} :: {[}in{]} Time step between calls to ALE\_main {[}T \textasciitilde{}\textgreater{} s{]}

\item {} 
\sphinxstylestrong{frac\_shelf\_h} :: Fractional ice shelf coverage

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_update_regrid_weights}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_update\_regrid\_weights}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/check_grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{check\_grid}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/remap_all_state_vars}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remap\_all\_state\_vars}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_main\_offline() (fortran subroutine in module mom\_ale)@\spxentry{ale\_main\_offline()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_main_offline}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_main\_offline}}}{\emph{G}, \emph{GV}, \emph{h}, \emph{tv}, \emph{Reg}, \emph{CS}, \emph{OBC}, \emph{dt}}{}
Takes care of (1) building a new grid and (2) remapping all variables between the old grid and the new grid. The creation of the new grid can be based on z coordinates, target interface densities, sigma coordinates or any arbitrary coordinate system.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}in{]} Ocean grid informations

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{h} :: {[}inout{]} Current 3D grid obtained after the last time step {[}H \textasciitilde{}\textgreater{} m or kg\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{tv} :: {[}inout{]} Thermodynamic variable structure

\item {} 
\sphinxstylestrong{reg} :: Tracer registry structure

\item {} 
\sphinxstylestrong{cs} :: Regridding parameters and options

\item {} 
\sphinxstylestrong{obc} :: Open boundary structure

\item {} 
\sphinxstylestrong{dt} :: {[}in{]} Time step between calls to ALE\_main {[}T \textasciitilde{}\textgreater{} s{]}

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_update_regrid_weights}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_update\_regrid\_weights}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/check_grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{check\_grid}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/remap_all_state_vars}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remap\_all\_state\_vars}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_offline\_inputs() (fortran subroutine in module mom\_ale)@\spxentry{ale\_offline\_inputs()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_offline_inputs}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_offline\_inputs}}}{\emph{CS}, \emph{G}, \emph{GV}, \emph{h}, \emph{tv}, \emph{Reg}, \emph{uhtr}, \emph{vhtr}, \emph{Kd}, \emph{debug}, \emph{OBC}}{}
Regrid/remap stored fields used for offline tracer integrations. These input fields are assumed to have the same layer thicknesses at the end of the last offline interval (which should be a Zstar grid). This routine builds a grid on the runtime specified vertical coordinate.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: Regridding parameters and options

\item {} 
\sphinxstylestrong{g} :: {[}in{]} Ocean grid informations

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{h} :: {[}inout{]} Layer thicknesses

\item {} 
\sphinxstylestrong{tv} :: {[}inout{]} Thermodynamic variable structure

\item {} 
\sphinxstylestrong{reg} :: Tracer registry structure

\item {} 
\sphinxstylestrong{uhtr} :: {[}inout{]} Zonal mass fluxes

\item {} 
\sphinxstylestrong{vhtr} :: {[}inout{]} Meridional mass fluxes

\item {} 
\sphinxstylestrong{kd} :: {[}inout{]} Input diffusivites

\item {} 
\sphinxstylestrong{debug} :: {[}in{]} If true, then turn checksums

\item {} 
\sphinxstylestrong{obc} :: Open boundary structure

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_remap_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_remap\_scalar}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/check_grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{check\_grid}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/remap_all_state_vars}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remap\_all\_state\_vars}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_offline\_tracer\_final() (fortran subroutine in module mom\_ale)@\spxentry{ale\_offline\_tracer\_final()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_offline_tracer_final}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_offline\_tracer\_final}}}{\emph{G}, \emph{GV}, \emph{h}, \emph{tv}, \emph{h\_target}, \emph{Reg}, \emph{CS}, \emph{OBC}}{}
Remaps all tracers from h onto h\_target. This is intended to be called when tracers are done offline. In the case where transports don’t quite conserve, we still want to make sure that layer thicknesses offline do not drift too far away from the online model.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}in{]} Ocean grid informations

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{h} :: {[}inout{]} Current 3D grid obtained after the last time step {[}H \textasciitilde{}\textgreater{} m or kg\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{tv} :: {[}inout{]} Thermodynamic variable structure

\item {} 
\sphinxstylestrong{h\_target} :: {[}inout{]} Current 3D grid obtained after last time step {[}H \textasciitilde{}\textgreater{} m or kg\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{reg} :: Tracer registry structure

\item {} 
\sphinxstylestrong{cs} :: Regridding parameters and options

\item {} 
\sphinxstylestrong{obc} :: Open boundary structure

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/check_grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{check\_grid}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/remap_all_state_vars}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remap\_all\_state\_vars}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{check\_grid() (fortran subroutine in module mom\_ale)@\spxentry{check\_grid()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/check_grid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{check\_grid}}}{\emph{G}, \emph{GV}, \emph{h}, \emph{threshold}}{}
Check grid for negative thicknesses.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}in{]} Ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{h} :: {[}in{]} Current 3D grid obtained after the last time step {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{threshold} :: {[}in{]} Value below which to flag issues, {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_main}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_main}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_main_offline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_main\_offline}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_offline_inputs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_offline\_inputs}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_offline_tracer_final}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_offline\_tracer\_final}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_build\_grid() (fortran subroutine in module mom\_ale)@\spxentry{ale\_build\_grid()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_build_grid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_build\_grid}}}{\emph{G}, \emph{GV}, \emph{regridCS}, \emph{remapCS}, \emph{h}, \emph{tv}, \emph{debug}, \emph{frac\_shelf\_h}}{}
Generates new grid.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}in{]} Ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{regridcs} :: {[}in{]} Regridding parameters and options

\item {} 
\sphinxstylestrong{remapcs} :: {[}in{]} Remapping parameters and options

\item {} 
\sphinxstylestrong{tv} :: {[}inout{]} Thermodynamical variable structure

\item {} 
\sphinxstylestrong{h} :: {[}inout{]} Current 3D grid obtained after the last time step {[}H \textasciitilde{}\textgreater{} m or kg\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{debug} :: {[}in{]} If true, show the call tree

\item {} 
\sphinxstylestrong{frac\_shelf\_h} :: Fractional ice shelf coverage

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_regrid\_accelerated() (fortran subroutine in module mom\_ale)@\spxentry{ale\_regrid\_accelerated()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_regrid_accelerated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_regrid\_accelerated}}}{\emph{CS}, \emph{G}, \emph{GV}, \emph{h}, \emph{tv}, \emph{n}, \emph{u}, \emph{v}, \emph{OBC}, \emph{Reg}, \emph{dt}, \emph{dzRegrid}, \emph{initial}}{}
For a state\sphinxhyphen{}based coordinate, accelerate the process of regridding by repeatedly applying the grid calculation algorithm.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: ALE control structure

\item {} 
\sphinxstylestrong{g} :: {[}inout{]} Ocean grid

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Vertical grid

\item {} 
\sphinxstylestrong{h} :: {[}inout{]} Original thicknesses {[}H \textasciitilde{}\textgreater{} m or kg\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{tv} :: {[}inout{]} Thermo vars (T/S/EOS)

\item {} 
\sphinxstylestrong{n} :: {[}in{]} Number of times to regrid

\item {} 
\sphinxstylestrong{u} :: {[}inout{]} Zonal velocity {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{v} :: {[}inout{]} Meridional velocity {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{obc} :: Open boundary structure

\item {} 
\sphinxstylestrong{reg} :: Tracer registry to remap onto new grid

\item {} 
\sphinxstylestrong{dt} :: {[}in{]} Model timestep to provide a timescale for regridding {[}T \textasciitilde{}\textgreater{} s{]}

\item {} 
\sphinxstylestrong{dzregrid} :: {[}inout{]} Final change in interface positions

\item {} 
\sphinxstylestrong{initial} :: {[}in{]} Whether we’re being called from an initialization routine (and expect diagnostics to work)

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_update_regrid_weights}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_update\_regrid\_weights}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/remap_all_state_vars}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remap\_all\_state\_vars}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{remap\_all\_state\_vars() (fortran subroutine in module mom\_ale)@\spxentry{remap\_all\_state\_vars()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/remap_all_state_vars}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{remap\_all\_state\_vars}}}{\emph{CS\_remapping}, \emph{CS\_ALE}, \emph{G}, \emph{GV}, \emph{h\_old}, \emph{h\_new}, \emph{Reg}, \emph{OBC}, \emph{dxInterface}, \emph{u}, \emph{v}, \emph{debug}, \emph{dt}}{}
This routine takes care of remapping all variable between the old and the new grids. When velocity components need to be remapped, thicknesses at velocity points are taken to be arithmetic averages of tracer thicknesses. This routine is called during initialization of the model at time=0, to remap initiali conditions to the model grid. It is also called during a time step to update the state.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs\_remapping} :: {[}in{]} Remapping control structure

\item {} 
\sphinxstylestrong{cs\_ale} :: {[}in{]} ALE control structure

\item {} 
\sphinxstylestrong{g} :: {[}in{]} Ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{h\_old} :: {[}in{]} Thickness of source grid {[}H \textasciitilde{}\textgreater{} m or kg\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{h\_new} :: {[}in{]} Thickness of destination grid {[}H \textasciitilde{}\textgreater{} m or kg\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{reg} :: Tracer registry structure

\item {} 
\sphinxstylestrong{obc} :: Open boundary structure

\item {} 
\sphinxstylestrong{dxinterface} :: {[}in{]} Change in interface position

\item {} 
\sphinxstylestrong{u} :: {[}inout{]} Zonal velocity {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{v} :: {[}inout{]} Meridional velocity {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{debug} :: {[}in{]} If true, show the call tree

\item {} 
\sphinxstylestrong{dt} :: {[}in{]} time step for diagnostics {[}T \textasciitilde{}\textgreater{} s{]}

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_main}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_main}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_main_offline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_main\_offline}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_offline_inputs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_offline\_inputs}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_offline_tracer_final}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_offline\_tracer\_final}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_regrid_accelerated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_regrid\_accelerated}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_remap\_scalar() (fortran subroutine in module mom\_ale)@\spxentry{ale\_remap\_scalar()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_remap_scalar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_remap\_scalar}}}{\emph{CS}, \emph{G}, \emph{GV}, \emph{nk\_src}, \emph{h\_src}, \emph{s\_src}, \emph{h\_dst}, \emph{s\_dst}, \emph{all\_cells}, \emph{old\_remap}, \emph{answers\_2018}}{}
Remaps a single scalar between grids described by thicknesses h\_src and h\_dst. h\_dst must be dimensioned as a model array with GVke layers while h\_src can have an arbitrary number of layers specified by nk\_src.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: {[}in{]} Remapping control structure

\item {} 
\sphinxstylestrong{g} :: {[}in{]} Ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{nk\_src} :: {[}in{]} Number of levels on source grid

\item {} 
\sphinxstylestrong{h\_src} :: {[}in{]} Level thickness of source grid {[}H \textasciitilde{}\textgreater{} m or kg\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{s\_src} :: {[}in{]} Scalar on source grid

\item {} 
\sphinxstylestrong{h\_dst} :: {[}in{]} Level thickness of destination grid {[}H \textasciitilde{}\textgreater{} m or kg\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{s\_dst} :: {[}inout{]} Scalar on destination grid

\item {} 
\sphinxstylestrong{all\_cells} :: {[}in{]} If false, only reconstruct for non\sphinxhyphen{}vanished cells. Use all vanished layers otherwise (default).

\item {} 
\sphinxstylestrong{old\_remap} :: {[}in{]} If true, use the old “remapping\_core\_w” method, otherwise use “remapping\_core\_h”.

\item {} 
\sphinxstylestrong{answers\_2018} :: {[}in{]} If true, use the order of arithmetic and expressions that recover the answers for remapping from the end of 2018. Otherwise, use more robust forms of the same expressions.

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_offline_inputs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_offline\_inputs}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ts\_plm\_edge\_values() (fortran subroutine in module mom\_ale)@\spxentry{ts\_plm\_edge\_values()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ts_plm_edge_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ts\_plm\_edge\_values}}}{\emph{CS}, \emph{S\_t}, \emph{S\_b}, \emph{T\_t}, \emph{T\_b}, \emph{G}, \emph{GV}, \emph{tv}, \emph{h}, \emph{bdry\_extrap}}{}
Calculate edge values (top and bottom of layer) for T and S consistent with a PLM reconstruction in the vertical direction. Boundary reconstructions are PCM unless bdry\_extrap is true.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}in{]} ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{cs} :: {[}inout{]} module control structure

\item {} 
\sphinxstylestrong{s\_t} :: {[}inout{]} Salinity at the top edge of each layer

\item {} 
\sphinxstylestrong{s\_b} :: {[}inout{]} Salinity at the bottom edge of each layer

\item {} 
\sphinxstylestrong{t\_t} :: {[}inout{]} Temperature at the top edge of each layer

\item {} 
\sphinxstylestrong{t\_b} :: {[}inout{]} Temperature at the bottom edge of each layer

\item {} 
\sphinxstylestrong{tv} :: {[}in{]} thermodynamics structure

\item {} 
\sphinxstylestrong{h} :: {[}in{]} layer thickness {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{bdry\_extrap} :: {[}in{]} If true, use high\sphinxhyphen{}order boundary extrapolation within boundary cells

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_plm_edge_values}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_plm\_edge\_values}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_plm\_edge\_values() (fortran subroutine in module mom\_ale)@\spxentry{ale\_plm\_edge\_values()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_plm_edge_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_plm\_edge\_values}}}{\emph{CS}, \emph{G}, \emph{GV}, \emph{h}, \emph{Q}, \emph{bdry\_extrap}, \emph{Q\_t}, \emph{Q\_b}}{}
Calculate edge values (top and bottom of layer) 3d scalar array. Boundary reconstructions are PCM unless bdry\_extrap is true.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: {[}in{]} module control structure

\item {} 
\sphinxstylestrong{g} :: {[}in{]} ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{h} :: {[}in{]} layer thickness {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{q} :: {[}in{]} 3d scalar array

\item {} 
\sphinxstylestrong{bdry\_extrap} :: {[}in{]} If true, use high\sphinxhyphen{}order boundary extrapolation within boundary cells

\item {} 
\sphinxstylestrong{q\_t} :: {[}inout{]} Scalar at the top edge of each layer

\item {} 
\sphinxstylestrong{q\_b} :: {[}inout{]} Scalar at the bottom edge of each layer

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ts_plm_edge_values}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ts\_plm\_edge\_values}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ts\_ppm\_edge\_values() (fortran subroutine in module mom\_ale)@\spxentry{ts\_ppm\_edge\_values()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ts_ppm_edge_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ts\_ppm\_edge\_values}}}{\emph{CS}, \emph{S\_t}, \emph{S\_b}, \emph{T\_t}, \emph{T\_b}, \emph{G}, \emph{GV}, \emph{tv}, \emph{h}, \emph{bdry\_extrap}}{}
Calculate edge values (top and bottom of layer) for T and S consistent with a PPM reconstruction in the vertical direction. Boundary reconstructions are PCM unless bdry\_extrap is true.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}in{]} ocean grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{cs} :: {[}inout{]} module control structure

\item {} 
\sphinxstylestrong{s\_t} :: {[}inout{]} Salinity at the top edge of each layer

\item {} 
\sphinxstylestrong{s\_b} :: {[}inout{]} Salinity at the bottom edge of each layer

\item {} 
\sphinxstylestrong{t\_t} :: {[}inout{]} Temperature at the top edge of each layer

\item {} 
\sphinxstylestrong{t\_b} :: {[}inout{]} Temperature at the bottom edge of each layer

\item {} 
\sphinxstylestrong{tv} :: {[}in{]} thermodynamics structure

\item {} 
\sphinxstylestrong{h} :: {[}in{]} layer thicknesses {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{bdry\_extrap} :: {[}in{]} If true, use high\sphinxhyphen{}order boundary extrapolation within boundary cells

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_initregridding() (fortran subroutine in module mom\_ale)@\spxentry{ale\_initregridding()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_initregridding}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_initregridding}}}{\emph{GV}, \emph{US}, \emph{max\_depth}, \emph{param\_file}, \emph{mdl}, \emph{regridCS}}{}
Initializes regridding for the main ALE algorithm.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{max\_depth} :: {[}in{]} The maximum depth of the ocean {[}Z \textasciitilde{}\textgreater{} m{]}.

\item {} 
\sphinxstylestrong{param\_file} :: {[}in{]} parameter file

\item {} 
\sphinxstylestrong{mdl} :: {[}in{]} Name of calling module

\item {} 
\sphinxstylestrong{regridcs} :: {[}out{]} Regridding parameters and work arrays

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_init}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_getcoordinate() (fortran function in module mom\_ale)@\spxentry{ale\_getcoordinate()}\spxextra{fortran function in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_getcoordinate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{function }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_getcoordinate}}}{\emph{CS}}{\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}}}
Query the target coordinate interfaces positions.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{cs} :: module control structure

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_getcoordinateunits() (fortran function in module mom\_ale)@\spxentry{ale\_getcoordinateunits()}\spxextra{fortran function in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_getcoordinateunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{function }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_getcoordinateunits}}}{\emph{CS}}{\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{character(len=20)}\sphinxstyleemphasis{{]}}}
Query the target coordinate units.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{cs} :: module control structure

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_remap\_init\_conds() (fortran function in module mom\_ale)@\spxentry{ale\_remap\_init\_conds()}\spxextra{fortran function in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_remap_init_conds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{function }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_remap\_init\_conds}}}{\emph{CS}}{\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}}}
Returns true if initial conditions should be regridded and remapped.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{cs} :: module control structure

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_update\_regrid\_weights() (fortran subroutine in module mom\_ale)@\spxentry{ale\_update\_regrid\_weights()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_update_regrid_weights}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_update\_regrid\_weights}}}{\emph{dt}, \emph{CS}}{}
Updates the weights for time filtering the new grid generated in regridding.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{dt} :: {[}in{]} Time\sphinxhyphen{}step used between ALE calls {[}T \textasciitilde{}\textgreater{} s{]}

\item {} 
\sphinxstylestrong{cs} :: ALE control structure

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_main}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_main}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_main_offline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_main\_offline}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_regrid_accelerated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ale\_regrid\_accelerated}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_updateverticalgridtype() (fortran subroutine in module mom\_ale)@\spxentry{ale\_updateverticalgridtype()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_updateverticalgridtype}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_updateverticalgridtype}}}{\emph{CS}, \emph{GV}}{}
Update the vertical grid type with ALE information. This subroutine sets information in the verticalGrid\_type to be consistent with the use of ALE mode.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: ALE control structure

\item {} 
\sphinxstylestrong{gv} :: vertical grid information

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_writecoordinatefile() (fortran subroutine in module mom\_ale)@\spxentry{ale\_writecoordinatefile()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_writecoordinatefile}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_writecoordinatefile}}}{\emph{CS}, \emph{GV}, \emph{directory}}{}
Write the vertical coordinate information into a file. This subroutine writes out a file containing any available data related to the vertical grid used by the MOM ocean model when in ALE mode.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: module control structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} ocean vertical grid structure

\item {} 
\sphinxstylestrong{directory} :: {[}in{]} directory for writing grid info

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{ale\_initthicknesstocoord() (fortran subroutine in module mom\_ale)@\spxentry{ale\_initthicknesstocoord()}\spxextra{fortran subroutine in module mom\_ale}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ale:f/mom_ale/ale_initthicknesstocoord}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ale/}}\sphinxbfcode{\sphinxupquote{ale\_initthicknesstocoord}}}{\emph{CS}, \emph{G}, \emph{GV}, \emph{h}}{}
Set h to coordinate values for fixed coordinate systems.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: {[}inout{]} module control structure

\item {} 
\sphinxstylestrong{g} :: {[}in{]} module grid structure

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure

\item {} 
\sphinxstylestrong{h} :: {[}out{]} layer thickness {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}



\subsection{mom\_eos module reference}
\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos}}\label{\detokenize{api/generated/modules/mom_eos:mom-eos-module-reference}}\label{\detokenize{api/generated/modules/mom_eos::doc}}\index{mom\_eos (module)@\spxentry{mom\_eos}\spxextra{module}|spxpagem}
Provides subroutines for quantities specific to the equation of state.

{\hyperref[\detokenize{api/generated/modules/mom_eos:detamom-eos}]{\sphinxcrossref{More…}}}


\subsubsection{Data Types}
\label{\detokenize{api/generated/modules/mom_eos:data-types}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_type}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eos\_type}}}}}
&
A control structure for the equation of state.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Functions/Subroutines}
\label{\detokenize{api/generated/modules/mom_eos:functions-subroutines}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_scalar()}}}}}
&
Calls the appropriate subroutine to calculate density of sea water for scalar inputs.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_stanley_density_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_stanley\_density\_scalar()}}}}}
&
Calls the appropriate subroutine to calculate density of sea water for scalar inputs including the variance of T, S and covariance of T\sphinxhyphen{}S.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_array()}}}}}
&
Calls the appropriate subroutine to calculate the density of sea water for 1\sphinxhyphen{}D array inputs.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_stanley_density_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_stanley\_density\_array()}}}}}
&
Calls the appropriate subroutine to calculate the density of sea water for 1\sphinxhyphen{}D array inputs including the variance of T, S and covariance of T\sphinxhyphen{}S.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_1d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_1d()}}}}}
&
Calls the appropriate subroutine to calculate the density of sea water for 1\sphinxhyphen{}D array inputs, potentially limiting the domain of indices that are worked on.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_stanley_density_1d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_stanley\_density\_1d()}}}}}
&
Calls the appropriate subroutine to calculate the density of sea water for 1\sphinxhyphen{}D array inputs including the variance of T, S and covariance of T\sphinxhyphen{}S, potentially limiting the domain of indices that are worked on.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_spec_vol_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_spec\_vol\_array()}}}}}
&
Calls the appropriate subroutine to calculate the specific volume of sea water for 1\sphinxhyphen{}D array inputs.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calc_spec_vol_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calc\_spec\_vol\_scalar()}}}}}
&
Calls the appropriate subroutine to calculate specific volume of sea water for scalar inputs.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calc_spec_vol_1d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calc\_spec\_vol\_1d()}}}}}
&
Calls the appropriate subroutine to calculate the specific volume of sea water for 1\sphinxhyphen{}D array inputs, potentially limiting the domain of indices that are worked on.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_tfreeze_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_tfreeze\_scalar()}}}}}
&
Calls the appropriate subroutine to calculate the freezing point for scalar inputs.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_tfreeze_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_tfreeze\_array()}}}}}
&
Calls the appropriate subroutine to calculate the freezing point for a 1\sphinxhyphen{}D array.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_derivs_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_derivs\_array()}}}}}
&
Calls the appropriate subroutine to calculate density derivatives for 1\sphinxhyphen{}D array inputs.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_derivs_1d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_derivs\_1d()}}}}}
&
Calls the appropriate subroutine to calculate density derivatives for 1\sphinxhyphen{}D array inputs.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_derivs_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_derivs\_scalar()}}}}}
&
Calls the appropriate subroutines to calculate density derivatives by promoting a scalar to a one\sphinxhyphen{}element array.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_second_derivs_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_second\_derivs\_array()}}}}}
&
Calls the appropriate subroutine to calculate density second derivatives for 1\sphinxhyphen{}D array inputs.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_second_derivs_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_second\_derivs\_scalar()}}}}}
&
Calls the appropriate subroutine to calculate density second derivatives for scalar nputs.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_spec_vol_derivs_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_spec\_vol\_derivs\_array()}}}}}
&
Calls the appropriate subroutine to calculate specific volume derivatives for an array.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calc_spec_vol_derivs_1d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calc\_spec\_vol\_derivs\_1d()}}}}}
&
Calls the appropriate subroutine to calculate specific volume derivatives for 1\sphinxhyphen{}d array inputs, potentially limiting the domain of indices that are worked on.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_compress_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_compress\_array()}}}}}
&
Calls the appropriate subroutine to calculate the density and compressibility for 1\sphinxhyphen{}D array inputs.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_compress_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_compress\_scalar()}}}}}
&
Calculate density and compressibility for a scalar.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_domain}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eos\_domain()}}}}}
&
This subroutine returns a two point integer array indicating the domain of i\sphinxhyphen{}indices to work on in EOS calls based on information from a hor\_index type.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/analytic_int_specific_vol_dp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{analytic\_int\_specific\_vol\_dp()}}}}}
&
Calls the appropriate subroutine to calculate analytical and nearly\sphinxhyphen{}analytical integrals in pressure across layers of geopotential anomalies, which are required for calculating the finite\sphinxhyphen{}volume form pressure accelerations in a non\sphinxhyphen{}Boussinesq model.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/analytic_int_density_dz}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{analytic\_int\_density\_dz()}}}}}
&
This subroutine calculates analytical and nearly\sphinxhyphen{}analytical integrals of pressure anomalies across layers, which are required for calculating the finite\sphinxhyphen{}volume form pressure accelerations in a Boussinesq model.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/query_compressible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{query\_compressible()}}}}}
&
Returns true if the equation of state is compressible (i.e.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eos\_init()}}}}}
&
Initializes EOS\_type by allocating and reading parameters.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_manual_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eos\_manual\_init()}}}}}
&
Manually initialized an EOS type (intended for unit testing of routines which need a specific EOS)
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_allocate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eos\_allocate()}}}}}
&
Allocates EOS\_type.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_end}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eos\_end()}}}}}
&
Deallocates EOS\_type.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_use_linear}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eos\_use\_linear()}}}}}
&
Set equation of state structure (EOS) to linear with given coefficients.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/convert_temp_salt_for_teos10}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{convert\_temp\_salt\_for\_teos10()}}}}}
&
Convert T\&S to Absolute Salinity and Conservative Temperature if using TEOS10.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_quadrature}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eos\_quadrature()}}}}}
&
Return value of EOS\_quadrature.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/extract_member_eos}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{extract\_member\_eos()}}}}}
&
Extractor routine for the EOS type if the members need to be accessed outside this module.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Detailed Description}
\label{\detokenize{api/generated/modules/mom_eos:detailed-description}}\label{\detokenize{api/generated/modules/mom_eos:detamom-eos}}
The MOM\_EOS module is a wrapper for various equations of state (e.g. Linear, Wright, UNESCO) and provides a uniform interface to the rest of the model independent of which equation of state is being used.


\subsubsection{Type Documentation}
\label{\detokenize{api/generated/modules/mom_eos:type-documentation}}\index{eos\_type (fortran type in module mom\_eos)@\spxentry{eos\_type}\spxextra{fortran type in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_type}}\pysigline{\sphinxbfcode{\sphinxupquote{type  }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{eos\_type}}}
A control structure for the equation of state.
\begin{quote}\begin{description}
\item[{Type fields}] \leavevmode\begin{itemize}
\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{form\_of\_eos}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: The equation of state to use.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{form\_of\_tfreeze}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: The expression for the potential temperature of the freezing point.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{eos\_quadrature}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, always use the generic (quadrature) code for the integrals of density.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{compressible}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, in situ density is a function of pressure.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{rho\_t0\_s0}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The density at T=0, S=0 {[}kg m\sphinxhyphen{}3{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{drho\_dt}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The partial derivative of density with temperature {[}kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{drho\_ds}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The partial derivative of density with salinity {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{tfr\_s0\_p0}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The freezing potential temperature at S=0, P=0 {[}degC{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dtfr\_ds}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The derivative of freezing point with salinity {[}degC ppt\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dtfr\_dp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The derivative of freezing point with pressure {[}degC Pa\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{m\_to\_z}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates distances in meters to the units of depth.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{kg\_m3\_to\_r}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates kilograms per meter cubed to the units of density.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{r\_to\_kg\_m3}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates the units of density to kilograms per meter cubed.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{rl2\_t2\_to\_pa}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert pressures from R L2 T\sphinxhyphen{}2 to Pa.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{l\_t\_to\_m\_s}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert lateral velocities from L T\sphinxhyphen{}1 to m s\sphinxhyphen{}1.

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}



\subsubsection{Function/Subroutine Documentation}
\label{\detokenize{api/generated/modules/mom_eos:function-subroutine-documentation}}\index{calculate\_density\_scalar() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_density\_scalar()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_scalar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_density\_scalar}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{rho}, \emph{EOS}, \emph{rho\_ref}, \emph{scale}}{}
Calls the appropriate subroutine to calculate density of sea water for scalar inputs. If rho\_ref is present, the anomaly with respect to rho\_ref is returned. The pressure and density can be rescaled with the US. If both the US and scale arguments are present the density scaling uses the product of the two scaling factors.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]} or {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{rho} :: {[}out{]} Density (in\sphinxhyphen{}situ if pressure is local) {[}kg m\sphinxhyphen{}3{]} or {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{rho\_ref} :: {[}in{]} A reference density {[}kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_nemo}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_unesco}} \sphinxcode{\sphinxupquote{eos\_wright}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_stanley\_density\_scalar() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_stanley\_density\_scalar()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_stanley_density_scalar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_stanley\_density\_scalar}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{Tvar}, \emph{TScov}, \emph{Svar}, \emph{rho}, \emph{EOS}, \emph{rho\_ref}, \emph{scale}}{}
Calls the appropriate subroutine to calculate density of sea water for scalar inputs including the variance of T, S and covariance of T\sphinxhyphen{}S. The calculation uses only the second order correction in a series as discussed in Stanley et al., 2020. If rho\_ref is present, the anomaly with respect to rho\_ref is returned. The density can be rescaled using rho\_ref.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{tvar} :: {[}in{]} Variance of potential temperature referenced to the surface {[}degC2{]}

\item {} 
\sphinxstylestrong{tscov} :: {[}in{]} Covariance of potential temperature and salinity {[}degC ppt{]}

\item {} 
\sphinxstylestrong{svar} :: {[}in{]} Variance of salinity {[}ppt2{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]}

\item {} 
\sphinxstylestrong{rho} :: {[}out{]} Density (in\sphinxhyphen{}situ if pressure is local) {[}kg m\sphinxhyphen{}3{]} or {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{rho\_ref} :: {[}in{]} A reference density {[}kg m\sphinxhyphen{}3{]}.

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density from kg m\sphinxhyphen{}3 to the desired units {[}R m3 kg\sphinxhyphen{}1{]}

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_wright}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_density\_array() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_density\_array()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_density\_array}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{rho}, \emph{start}, \emph{npts}, \emph{EOS}, \emph{rho\_ref}, \emph{scale}}{}
Calls the appropriate subroutine to calculate the density of sea water for 1\sphinxhyphen{}D array inputs. If rho\_ref is present, the anomaly with respect to rho\_ref is returned.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]} or {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{rho} :: {[}inout{]} Density (in\sphinxhyphen{}situ if pressure is local) {[}kg m\sphinxhyphen{}3{]} or {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{start} :: {[}in{]} Start index for computation

\item {} 
\sphinxstylestrong{npts} :: {[}in{]} Number of point to compute

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{rho\_ref} :: {[}in{]} A reference density {[}kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_nemo}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_unesco}} \sphinxcode{\sphinxupquote{eos\_wright}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_1d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_1d}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_stanley\_density\_array() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_stanley\_density\_array()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_stanley_density_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_stanley\_density\_array}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{Tvar}, \emph{TScov}, \emph{Svar}, \emph{rho}, \emph{start}, \emph{npts}, \emph{EOS}, \emph{rho\_ref}, \emph{scale}}{}
Calls the appropriate subroutine to calculate the density of sea water for 1\sphinxhyphen{}D array inputs including the variance of T, S and covariance of T\sphinxhyphen{}S. The calculation uses only the second order correction in a series as discussed in Stanley et al., 2020. If rho\_ref is present, the anomaly with respect to rho\_ref is returned.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]}

\item {} 
\sphinxstylestrong{tvar} :: {[}in{]} Variance of potential temperature referenced to the surface {[}degC2{]}

\item {} 
\sphinxstylestrong{tscov} :: {[}in{]} Covariance of potential temperature and salinity {[}degC ppt{]}

\item {} 
\sphinxstylestrong{svar} :: {[}in{]} Variance of salinity {[}ppt2{]}

\item {} 
\sphinxstylestrong{rho} :: {[}inout{]} Density (in\sphinxhyphen{}situ if pressure is local) {[}kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{start} :: {[}in{]} Start index for computation

\item {} 
\sphinxstylestrong{npts} :: {[}in{]} Number of point to compute

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{rho\_ref} :: {[}in{]} A reference density {[}kg m\sphinxhyphen{}3{]}.

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density from kg m\sphinxhyphen{}3 to the desired units {[}R m3 kg\sphinxhyphen{}1{]}

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_wright}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_density\_1d() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_density\_1d()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_1d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_density\_1d}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{rho}, \emph{EOS}, \emph{dom}, \emph{rho\_ref}, \emph{scale}}{}
Calls the appropriate subroutine to calculate the density of sea water for 1\sphinxhyphen{}D array inputs, potentially limiting the domain of indices that are worked on. If rho\_ref is present, the anomaly with respect to rho\_ref is returned.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{rho} :: {[}inout{]} Density (in\sphinxhyphen{}situ if pressure is local) {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{dom} :: {[}in{]} The domain of indices to work on, taking into account that arrays start at 1.

\item {} 
\sphinxstylestrong{rho\_ref} :: {[}in{]} A reference density {[}kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_array}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_stanley\_density\_1d() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_stanley\_density\_1d()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_stanley_density_1d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_stanley\_density\_1d}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{Tvar}, \emph{TScov}, \emph{Svar}, \emph{rho}, \emph{EOS}, \emph{dom}, \emph{rho\_ref}, \emph{scale}}{}
Calls the appropriate subroutine to calculate the density of sea water for 1\sphinxhyphen{}D array inputs including the variance of T, S and covariance of T\sphinxhyphen{}S, potentially limiting the domain of indices that are worked on. The calculation uses only the second order correction in a series as discussed in Stanley et al., 2020. If rho\_ref is present, the anomaly with respect to rho\_ref is returned.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{tvar} :: {[}in{]} Variance of potential temperature {[}degC2{]}

\item {} 
\sphinxstylestrong{tscov} :: {[}in{]} Covariance of potential temperature and salinity {[}degC ppt{]}

\item {} 
\sphinxstylestrong{svar} :: {[}in{]} Variance of salinity {[}ppt2{]}

\item {} 
\sphinxstylestrong{rho} :: {[}inout{]} Density (in\sphinxhyphen{}situ if pressure is local) {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{dom} :: {[}in{]} The domain of indices to work on, taking into account that arrays start at 1.

\item {} 
\sphinxstylestrong{rho\_ref} :: {[}in{]} A reference density {[}kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_wright}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_spec\_vol\_array() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_spec\_vol\_array()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_spec_vol_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_spec\_vol\_array}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{specvol}, \emph{start}, \emph{npts}, \emph{EOS}, \emph{spv\_ref}, \emph{scale}}{}
Calls the appropriate subroutine to calculate the specific volume of sea water for 1\sphinxhyphen{}D array inputs.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} potential temperature relative to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} pressure {[}Pa{]}

\item {} 
\sphinxstylestrong{specvol} :: {[}inout{]} in situ specific volume {[}kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{start} :: {[}in{]} the starting point in the arrays.

\item {} 
\sphinxstylestrong{npts} :: {[}in{]} the number of values to calculate.

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{spv\_ref} :: {[}in{]} A reference specific volume {[}m3 kg\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale specific volume in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_nemo}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_unesco}} \sphinxcode{\sphinxupquote{eos\_wright}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calc_spec_vol_1d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calc\_spec\_vol\_1d}}}}} {\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calc_spec_vol_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calc\_spec\_vol\_scalar}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calc\_spec\_vol\_scalar() (fortran subroutine in module mom\_eos)@\spxentry{calc\_spec\_vol\_scalar()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calc_spec_vol_scalar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calc\_spec\_vol\_scalar}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{specvol}, \emph{EOS}, \emph{spv\_ref}, \emph{scale}}{}
Calls the appropriate subroutine to calculate specific volume of sea water for scalar inputs.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]} or {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{specvol} :: {[}out{]} In situ? specific volume {[}m3 kg\sphinxhyphen{}1{]} or {[}R\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m3 kg\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{spv\_ref} :: {[}in{]} A reference specific volume {[}m3 kg\sphinxhyphen{}1{]} or {[}R\sphinxhyphen{}1 m3 kg\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale specific volume in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_spec_vol_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_spec\_vol\_array}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calc\_spec\_vol\_1d() (fortran subroutine in module mom\_eos)@\spxentry{calc\_spec\_vol\_1d()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calc_spec_vol_1d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calc\_spec\_vol\_1d}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{specvol}, \emph{EOS}, \emph{dom}, \emph{spv\_ref}, \emph{scale}}{}
Calls the appropriate subroutine to calculate the specific volume of sea water for 1\sphinxhyphen{}D array inputs, potentially limiting the domain of indices that are worked on.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{specvol} :: {[}inout{]} In situ specific volume {[}R\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m3 kg\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{dom} :: {[}in{]} The domain of indices to work on, taking into account that arrays start at 1.

\item {} 
\sphinxstylestrong{spv\_ref} :: {[}in{]} A reference specific volume {[}R\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m3 kg\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale output specific volume in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_spec_vol_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_spec\_vol\_array}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_tfreeze\_scalar() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_tfreeze\_scalar()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_tfreeze_scalar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_tfreeze\_scalar}}}{\emph{S}, \emph{pressure}, \emph{T\_fr}, \emph{EOS}, \emph{pres\_scale}}{}
Calls the appropriate subroutine to calculate the freezing point for scalar inputs.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]} or {[}other{]}

\item {} 
\sphinxstylestrong{t\_fr} :: {[}out{]} Freezing point potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{pres\_scale} :: {[}in{]} A multiplicative factor to convert pressure into Pa

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{tfreeze\_linear}} \sphinxcode{\sphinxupquote{tfreeze\_millero}} \sphinxcode{\sphinxupquote{tfreeze\_teos10}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_tfreeze\_array() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_tfreeze\_array()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_tfreeze_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_tfreeze\_array}}}{\emph{S}, \emph{pressure}, \emph{T\_fr}, \emph{start}, \emph{npts}, \emph{EOS}, \emph{pres\_scale}}{}
Calls the appropriate subroutine to calculate the freezing point for a 1\sphinxhyphen{}D array.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]} or {[}other{]}

\item {} 
\sphinxstylestrong{t\_fr} :: {[}inout{]} Freezing point potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{start} :: {[}in{]} Starting index within the array

\item {} 
\sphinxstylestrong{npts} :: {[}in{]} The number of values to calculate

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{pres\_scale} :: {[}in{]} A multiplicative factor to convert pressure into Pa.

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{tfreeze\_linear}} \sphinxcode{\sphinxupquote{tfreeze\_millero}} \sphinxcode{\sphinxupquote{tfreeze\_teos10}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_density\_derivs\_array() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_density\_derivs\_array()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_derivs_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_density\_derivs\_array}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{drho\_dT}, \emph{drho\_dS}, \emph{start}, \emph{npts}, \emph{EOS}, \emph{scale}}{}
Calls the appropriate subroutine to calculate density derivatives for 1\sphinxhyphen{}D array inputs.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]} or {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{drho\_dt} :: {[}inout{]} The partial derivative of density with potential temperature {[}kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1{]} or {[}R degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{drho\_ds} :: {[}inout{]} The partial derivative of density with salinity, in {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1{]} or {[}R degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{start} :: {[}in{]} Starting index within the array

\item {} 
\sphinxstylestrong{npts} :: {[}in{]} The number of values to calculate

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_nemo}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_unesco}} \sphinxcode{\sphinxupquote{eos\_wright}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_derivs_1d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_derivs\_1d}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_density\_derivs\_1d() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_density\_derivs\_1d()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_derivs_1d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_density\_derivs\_1d}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{drho\_dT}, \emph{drho\_dS}, \emph{EOS}, \emph{dom}, \emph{scale}}{}
Calls the appropriate subroutine to calculate density derivatives for 1\sphinxhyphen{}D array inputs.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{drho\_dt} :: {[}inout{]} The partial derivative of density with potential temperature {[}R degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{drho\_ds} :: {[}inout{]} The partial derivative of density with salinity {[}R degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{dom} :: {[}in{]} The domain of indices to work on, taking into account that arrays start at 1.

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_derivs_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_density\_derivs\_array}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_density\_derivs\_scalar() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_density\_derivs\_scalar()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_derivs_scalar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_density\_derivs\_scalar}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{drho\_dT}, \emph{drho\_dS}, \emph{EOS}, \emph{scale}}{}
Calls the appropriate subroutines to calculate density derivatives by promoting a scalar to a one\sphinxhyphen{}element array.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]} or {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{drho\_dt} :: {[}out{]} The partial derivative of density with potential temperature {[}kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1{]} or {[}R degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{drho\_ds} :: {[}out{]} The partial derivative of density with salinity, in {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1{]} or {[}R ppt\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_wright}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_density\_second\_derivs\_array() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_density\_second\_derivs\_array()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_second_derivs_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_density\_second\_derivs\_array}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{drho\_dS\_dS}, \emph{drho\_dS\_dT}, \emph{drho\_dT\_dT}, \emph{drho\_dS\_dP}, \emph{drho\_dT\_dP}, \emph{start}, \emph{npts}, \emph{EOS}, \emph{scale}}{}
Calls the appropriate subroutine to calculate density second derivatives for 1\sphinxhyphen{}D array inputs.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]} or {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{drho\_ds\_ds} :: {[}inout{]} Partial derivative of beta with respect to S {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}2{]} or {[}R ppt\sphinxhyphen{}2 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{drho\_ds\_dt} :: {[}inout{]} Partial derivative of beta with respect to T {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1 degC\sphinxhyphen{}1{]} or {[}R ppt\sphinxhyphen{}1 degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1 degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{drho\_dt\_dt} :: {[}inout{]} Partial derivative of alpha with respect to T {[}kg m\sphinxhyphen{}3 degC\sphinxhyphen{}2{]} or {[}R degC\sphinxhyphen{}2 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 degC\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{drho\_ds\_dp} :: {[}inout{]} Partial derivative of beta with respect to pressure {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1 Pa\sphinxhyphen{}1{]} or {[}R ppt\sphinxhyphen{}1 Pa\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1 Pa\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{drho\_dt\_dp} :: {[}inout{]} Partial derivative of alpha with respect to pressure {[}kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1 Pa\sphinxhyphen{}1{]} or {[}R degC\sphinxhyphen{}1 Pa\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1 Pa\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{start} :: {[}in{]} Starting index within the array

\item {} 
\sphinxstylestrong{npts} :: {[}in{]} The number of values to calculate

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_wright}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_density\_second\_derivs\_scalar() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_density\_second\_derivs\_scalar()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_density_second_derivs_scalar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_density\_second\_derivs\_scalar}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{drho\_dS\_dS}, \emph{drho\_dS\_dT}, \emph{drho\_dT\_dT}, \emph{drho\_dS\_dP}, \emph{drho\_dT\_dP}, \emph{EOS}, \emph{scale}}{}
Calls the appropriate subroutine to calculate density second derivatives for scalar nputs.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]} or {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{drho\_ds\_ds} :: {[}out{]} Partial derivative of beta with respect to S {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}2{]} or {[}R ppt\sphinxhyphen{}2 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{drho\_ds\_dt} :: {[}out{]} Partial derivative of beta with respect to T {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1 degC\sphinxhyphen{}1{]} or {[}R ppt\sphinxhyphen{}1 degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1 degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{drho\_dt\_dt} :: {[}out{]} Partial derivative of alpha with respect to T {[}kg m\sphinxhyphen{}3 degC\sphinxhyphen{}2{]} or {[}R degC\sphinxhyphen{}2 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 degC\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{drho\_ds\_dp} :: {[}out{]} Partial derivative of beta with respect to pressure {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1 Pa\sphinxhyphen{}1{]} or {[}R ppt\sphinxhyphen{}1 Pa\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1 Pa\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{drho\_dt\_dp} :: {[}out{]} Partial derivative of alpha with respect to pressure {[}kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1 Pa\sphinxhyphen{}1{]} or {[}R degC\sphinxhyphen{}1 Pa\sphinxhyphen{}1 \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1 Pa\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale density in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_wright}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_spec\_vol\_derivs\_array() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_spec\_vol\_derivs\_array()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_spec_vol_derivs_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_spec\_vol\_derivs\_array}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{dSV\_dT}, \emph{dSV\_dS}, \emph{start}, \emph{npts}, \emph{EOS}}{}
Calls the appropriate subroutine to calculate specific volume derivatives for an array.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]}

\item {} 
\sphinxstylestrong{dsv\_dt} :: {[}inout{]} The partial derivative of specific volume with potential temperature {[}m3 kg\sphinxhyphen{}1 degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{dsv\_ds} :: {[}inout{]} The partial derivative of specific volume with salinity {[}m3 kg\sphinxhyphen{}1 ppt\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{start} :: {[}in{]} Starting index within the array

\item {} 
\sphinxstylestrong{npts} :: {[}in{]} The number of values to calculate

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_nemo}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_unesco}} \sphinxcode{\sphinxupquote{eos\_wright}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calc_spec_vol_derivs_1d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calc\_spec\_vol\_derivs\_1d}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calc\_spec\_vol\_derivs\_1d() (fortran subroutine in module mom\_eos)@\spxentry{calc\_spec\_vol\_derivs\_1d()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calc_spec_vol_derivs_1d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calc\_spec\_vol\_derivs\_1d}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{dSV\_dT}, \emph{dSV\_dS}, \emph{EOS}, \emph{dom}, \emph{scale}}{}
Calls the appropriate subroutine to calculate specific volume derivatives for 1\sphinxhyphen{}d array inputs, potentially limiting the domain of indices that are worked on.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{dsv\_dt} :: {[}inout{]} The partial derivative of specific volume with potential temperature {[}R\sphinxhyphen{}1 degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m3 kg\sphinxhyphen{}1 degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{dsv\_ds} :: {[}inout{]} The partial derivative of specific volume with salinity {[}R\sphinxhyphen{}1 ppt\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m3 kg\sphinxhyphen{}1 ppt\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{dom} :: {[}in{]} The domain of indices to work on, taking into account that arrays start at 1.

\item {} 
\sphinxstylestrong{scale} :: {[}in{]} A multiplicative factor by which to scale specific volume in combination with scaling given by US {[}various{]}

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_spec_vol_derivs_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_spec\_vol\_derivs\_array}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_compress\_array() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_compress\_array()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_compress_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_compress\_array}}}{\emph{T}, \emph{S}, \emph{press}, \emph{rho}, \emph{drho\_dp}, \emph{start}, \emph{npts}, \emph{EOS}}{}
Calls the appropriate subroutine to calculate the density and compressibility for 1\sphinxhyphen{}D array inputs. If US is present, the units of the inputs and outputs are rescaled.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}PSU{]}

\item {} 
\sphinxstylestrong{press} :: {[}in{]} Pressure {[}Pa{]} or {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{rho} :: {[}inout{]} In situ density {[}kg m\sphinxhyphen{}3{]} or {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{drho\_dp} :: {[}inout{]} The partial derivative of density with pressure (also the inverse of the square of sound speed) {[}s2 m\sphinxhyphen{}2{]} or {[}T2 L\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{start} :: {[}in{]} Starting index within the array

\item {} 
\sphinxstylestrong{npts} :: {[}in{]} The number of values to calculate

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_nemo}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_unesco}} \sphinxcode{\sphinxupquote{eos\_wright}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_compress_scalar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_compress\_scalar}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{calculate\_compress\_scalar() (fortran subroutine in module mom\_eos)@\spxentry{calculate\_compress\_scalar()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_compress_scalar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{calculate\_compress\_scalar}}}{\emph{T}, \emph{S}, \emph{pressure}, \emph{rho}, \emph{drho\_dp}, \emph{EOS}}{}
Calculate density and compressibility for a scalar. This just promotes the scalar to an array with a singleton dimension and calls calculate\_compress\_array. If US is present, the units of the inputs and outputs are rescaled.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{pressure} :: {[}in{]} Pressure {[}Pa{]} or {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]}

\item {} 
\sphinxstylestrong{rho} :: {[}out{]} In situ density {[}kg m\sphinxhyphen{}3{]} or {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{drho\_dp} :: {[}out{]} The partial derivative of density with pressure (also the inverse of the square of sound speed) {[}s2 m\sphinxhyphen{}2{]} or {[}T2 L\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/calculate_compress_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{calculate\_compress\_array}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{eos\_domain() (fortran function in module mom\_eos)@\spxentry{eos\_domain()}\spxextra{fortran function in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_domain}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{function }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{eos\_domain}}}{\emph{HI}, \emph{halo}}{\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}}}
This subroutine returns a two point integer array indicating the domain of i\sphinxhyphen{}indices to work on in EOS calls based on information from a hor\_index type.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{hi} :: {[}in{]} The horizontal index structure

\item {} 
\sphinxstylestrong{halo} :: {[}in{]} The halo size to work on; missing is equivalent to 0.

\end{itemize}

\item[{Return}] \leavevmode
\sphinxstylestrong{undefined} :: The index domain that the EOS will work on, taking into account that the arrays inside the EOS routines will start at 1.

\end{description}\end{quote}

\end{fulllineitems}

\index{analytic\_int\_specific\_vol\_dp() (fortran subroutine in module mom\_eos)@\spxentry{analytic\_int\_specific\_vol\_dp()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/analytic_int_specific_vol_dp}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{analytic\_int\_specific\_vol\_dp}}}{\emph{T}, \emph{S}, \emph{p\_t}, \emph{p\_b}, \emph{alpha\_ref}, \emph{HI}, \emph{EOS}, \emph{dza}, \emph{intp\_dza}, \emph{intx\_dza}, \emph{inty\_dza}, \emph{halo\_size}, \emph{bathyP}, \emph{dP\_tiny}, \emph{useMassWghtInterp}}{}
Calls the appropriate subroutine to calculate analytical and nearly\sphinxhyphen{}analytical integrals in pressure across layers of geopotential anomalies, which are required for calculating the finite\sphinxhyphen{}volume form pressure accelerations in a non\sphinxhyphen{}Boussinesq model. There are essentially no free assumptions, apart from the use of Boole’s rule to do the horizontal integrals, and from a truncation in the series for log(1\sphinxhyphen{}eps/1+eps) that assumes that {\color{red}\bfseries{}|eps|} \textless{} 0.34.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{hi} :: {[}in{]} The horizontal index structure

\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{p\_t} :: {[}in{]} Pressure at the top of the layer {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]} or {[}Pa{]}

\item {} 
\sphinxstylestrong{p\_b} :: {[}in{]} Pressure at the bottom of the layer {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]} or {[}Pa{]}

\item {} 
\sphinxstylestrong{alpha\_ref} :: {[}in{]} A mean specific volume that is subtracted out to reduce the magnitude of each of the integrals {[}R\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m3 kg\sphinxhyphen{}1{]} The calculation is mathematically identical with different values of alpha\_ref, but this reduces the effects of roundoff.

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{dza} :: {[}inout{]} The change in the geopotential anomaly across

\item {} 
\sphinxstylestrong{intp\_dza} :: {[}inout{]} The integral in pressure through the layer of the

\item {} 
\sphinxstylestrong{intx\_dza} :: {[}inout{]} The integral in x of the difference between the

\item {} 
\sphinxstylestrong{inty\_dza} :: {[}inout{]} The integral in y of the difference between the

\item {} 
\sphinxstylestrong{halo\_size} :: {[}in{]} The width of halo points on which to calculate dza.

\item {} 
\sphinxstylestrong{bathyp} :: {[}in{]} The pressure at the bathymetry {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]} or {[}Pa{]}

\item {} 
\sphinxstylestrong{dp\_tiny} :: {[}in{]} A miniscule pressure change with the same units as p\_t {[}R L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} Pa{]} or {[}Pa{]}

\item {} 
\sphinxstylestrong{usemasswghtinterp} :: {[}in{]} If true, uses mass weighting to interpolate T/S for top and bottom integrals.

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_wright}}

\end{description}\end{quote}

\end{fulllineitems}

\index{analytic\_int\_density\_dz() (fortran subroutine in module mom\_eos)@\spxentry{analytic\_int\_density\_dz()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/analytic_int_density_dz}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{analytic\_int\_density\_dz}}}{\emph{T}, \emph{S}, \emph{z\_t}, \emph{z\_b}, \emph{rho\_ref}, \emph{rho\_0}, \emph{G\_e}, \emph{HI}, \emph{EOS}, \emph{dpa}, \emph{intz\_dpa}, \emph{intx\_dpa}, \emph{inty\_dpa}, \emph{bathyT}, \emph{dz\_neglect}, \emph{useMassWghtInterp}}{}
This subroutine calculates analytical and nearly\sphinxhyphen{}analytical integrals of pressure anomalies across layers, which are required for calculating the finite\sphinxhyphen{}volume form pressure accelerations in a Boussinesq model.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{hi} :: {[}in{]} Ocean horizontal index structure

\item {} 
\sphinxstylestrong{t} :: {[}in{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}in{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{z\_t} :: {[}in{]} Height at the top of the layer in depth units {[}Z \textasciitilde{}\textgreater{} m{]}

\item {} 
\sphinxstylestrong{z\_b} :: {[}in{]} Height at the bottom of the layer {[}Z \textasciitilde{}\textgreater{} m{]}

\item {} 
\sphinxstylestrong{rho\_ref} :: {[}in{]} A mean density {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]} or {[}kg m\sphinxhyphen{}3{]}, that is subtracted out to reduce the magnitude of each of the integrals.

\item {} 
\sphinxstylestrong{rho\_0} :: {[}in{]} A density {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]} or {[}kg m\sphinxhyphen{}3{]}, that is used to calculate the pressure (as p\textasciitilde{}=\sphinxhyphen{}z*rho\_0*G\_e) used in the equation of state.

\item {} 
\sphinxstylestrong{g\_e} :: {[}in{]} The Earth’s gravitational acceleration {[}L2 Z\sphinxhyphen{}1 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}2{]} or {[}m2 Z\sphinxhyphen{}1 s\sphinxhyphen{}2 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}2{]}

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{dpa} :: {[}inout{]} The change in the pressure anomaly

\item {} 
\sphinxstylestrong{intz\_dpa} :: {[}inout{]} The integral through the thickness of the

\item {} 
\sphinxstylestrong{intx\_dpa} :: {[}inout{]} The integral in x of the difference between

\item {} 
\sphinxstylestrong{inty\_dpa} :: {[}inout{]} The integral in y of the difference between

\item {} 
\sphinxstylestrong{bathyt} :: {[}in{]} The depth of the bathymetry {[}Z \textasciitilde{}\textgreater{} m{]}

\item {} 
\sphinxstylestrong{dz\_neglect} :: {[}in{]} A miniscule thickness change {[}Z \textasciitilde{}\textgreater{} m{]}

\item {} 
\sphinxstylestrong{usemasswghtinterp} :: {[}in{]} If true, uses mass weighting to interpolate T/S for top and bottom integrals.

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_wright}}

\end{description}\end{quote}

\end{fulllineitems}

\index{query\_compressible() (fortran function in module mom\_eos)@\spxentry{query\_compressible()}\spxextra{fortran function in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/query_compressible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{function }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{query\_compressible}}}{\emph{EOS}}{\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}}}
Returns true if the equation of state is compressible (i.e. has pressure dependence)
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{eos} :: Equation of state structure

\end{description}\end{quote}

\end{fulllineitems}

\index{eos\_init() (fortran subroutine in module mom\_eos)@\spxentry{eos\_init()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_init}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{eos\_init}}}{\emph{param\_file}, \emph{EOS}, \emph{US}}{}
Initializes EOS\_type by allocating and reading parameters.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{param\_file} :: {[}in{]} Parameter file structure

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_allocate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eos\_allocate}}}}} \sphinxcode{\sphinxupquote{eos\_default}} \sphinxcode{\sphinxupquote{eos\_linear}} \sphinxcode{\sphinxupquote{eos\_linear\_string}} \sphinxcode{\sphinxupquote{eos\_nemo}} \sphinxcode{\sphinxupquote{eos\_nemo\_string}} \sphinxcode{\sphinxupquote{eos\_teos10}} \sphinxcode{\sphinxupquote{eos\_teos10\_string}} \sphinxcode{\sphinxupquote{eos\_unesco}} \sphinxcode{\sphinxupquote{eos\_unesco\_string}} \sphinxcode{\sphinxupquote{eos\_wright}} \sphinxcode{\sphinxupquote{eos\_wright\_string}} \sphinxcode{\sphinxupquote{tfreeze\_default}} \sphinxcode{\sphinxupquote{tfreeze\_linear}} \sphinxcode{\sphinxupquote{tfreeze\_linear\_string}} \sphinxcode{\sphinxupquote{tfreeze\_millero}} \sphinxcode{\sphinxupquote{tfreeze\_millero\_string}} \sphinxcode{\sphinxupquote{tfreeze\_teos10}} \sphinxcode{\sphinxupquote{tfreeze\_teos10\_string}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_ice_shelf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_ice\_shelf::initialize\_ice\_shelf}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{eos\_manual\_init() (fortran subroutine in module mom\_eos)@\spxentry{eos\_manual\_init()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_manual_init}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{eos\_manual\_init}}}{\emph{EOS}, \emph{form\_of\_EOS}, \emph{form\_of\_TFreeze}, \emph{EOS\_quadrature}, \emph{Compressible}, \emph{Rho\_T0\_S0}, \emph{drho\_dT}, \emph{dRho\_dS}, \emph{TFr\_S0\_P0}, \emph{dTFr\_dS}, \emph{dTFr\_dp}}{}
Manually initialized an EOS type (intended for unit testing of routines which need a specific EOS)
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{form\_of\_eos} :: {[}in{]} A coded integer indicating the equation of state to use.

\item {} 
\sphinxstylestrong{form\_of\_tfreeze} :: {[}in{]} A coded integer indicating the expression for the potential temperature of the freezing point.

\item {} 
\sphinxstylestrong{eos\_quadrature} :: {[}in{]} If true, always use the generic (quadrature) code for the integrals of density.

\item {} 
\sphinxstylestrong{compressible} :: {[}in{]} If true, in situ density is a function of pressure.

\item {} 
\sphinxstylestrong{rho\_t0\_s0} :: {[}in{]} Density at T=0 degC and S=0 ppt {[}kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{drho\_dt} :: {[}in{]} Partial derivative of density with temperature in {[}kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{drho\_ds} :: {[}in{]} Partial derivative of density with salinity in {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{tfr\_s0\_p0} :: {[}in{]} The freezing potential temperature at S=0, P=0 {[}degC{]}

\item {} 
\sphinxstylestrong{dtfr\_ds} :: {[}in{]} The derivative of freezing point with salinity in {[}degC ppt\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{dtfr\_dp} :: {[}in{]} The derivative of freezing point with pressure in {[}degC Pa\sphinxhyphen{}1{]}

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{eos\_allocate() (fortran subroutine in module mom\_eos)@\spxentry{eos\_allocate()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_allocate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{eos\_allocate}}}{\emph{EOS}}{}
Allocates EOS\_type.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{eos} :: Equation of state structure

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eos\_init}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{eos\_end() (fortran subroutine in module mom\_eos)@\spxentry{eos\_end()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_end}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{eos\_end}}}{\emph{EOS}}{}
Deallocates EOS\_type.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{eos} :: Equation of state structure

\end{description}\end{quote}

\end{fulllineitems}

\index{eos\_use\_linear() (fortran subroutine in module mom\_eos)@\spxentry{eos\_use\_linear()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_use_linear}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{eos\_use\_linear}}}{\emph{Rho\_T0\_S0}, \emph{dRho\_dT}, \emph{dRho\_dS}, \emph{EOS}, \emph{use\_quadrature}}{}
Set equation of state structure (EOS) to linear with given coefficients.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{rho\_t0\_s0} :: {[}in{]} Density at T=0 degC and S=0 ppt {[}kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{drho\_dt} :: {[}in{]} Partial derivative of density with temperature {[}kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{drho\_ds} :: {[}in{]} Partial derivative of density with salinity {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{use\_quadrature} :: {[}in{]} If true, always use the generic (quadrature) code for the integrals of density.

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_linear}}

\end{description}\end{quote}

\end{fulllineitems}

\index{convert\_temp\_salt\_for\_teos10() (fortran subroutine in module mom\_eos)@\spxentry{convert\_temp\_salt\_for\_teos10()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/convert_temp_salt_for_teos10}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{convert\_temp\_salt\_for\_teos10}}}{\emph{T}, \emph{S}, \emph{HI}, \emph{kd}, \emph{mask\_z}, \emph{EOS}}{}
Convert T\&S to Absolute Salinity and Conservative Temperature if using TEOS10.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{kd} :: {[}in{]} The number of layers to work on

\item {} 
\sphinxstylestrong{hi} :: {[}in{]} The horizontal index structure

\item {} 
\sphinxstylestrong{t} :: {[}inout{]} Potential temperature referenced to the surface {[}degC{]}

\item {} 
\sphinxstylestrong{s} :: {[}inout{]} Salinity {[}ppt{]}

\item {} 
\sphinxstylestrong{mask\_z} :: {[}in{]} 3d mask regulating which points to convert.

\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\end{itemize}

\item[{Call to}] \leavevmode
\sphinxcode{\sphinxupquote{eos\_nemo}} \sphinxcode{\sphinxupquote{eos\_teos10}}

\end{description}\end{quote}

\end{fulllineitems}

\index{eos\_quadrature() (fortran function in module mom\_eos)@\spxentry{eos\_quadrature()}\spxextra{fortran function in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_quadrature}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{function }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{eos\_quadrature}}}{\emph{EOS}}{\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}}}
Return value of EOS\_quadrature.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{eos} :: Equation of state structure

\end{description}\end{quote}

\end{fulllineitems}

\index{extract\_member\_eos() (fortran subroutine in module mom\_eos)@\spxentry{extract\_member\_eos()}\spxextra{fortran subroutine in module mom\_eos}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_eos:f/mom_eos/extract_member_eos}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_eos/}}\sphinxbfcode{\sphinxupquote{extract\_member\_eos}}}{\emph{EOS}, \emph{form\_of\_EOS}, \emph{form\_of\_TFreeze}, \emph{EOS\_quadrature}, \emph{Compressible}, \emph{Rho\_T0\_S0}, \emph{drho\_dT}, \emph{dRho\_dS}, \emph{TFr\_S0\_P0}, \emph{dTFr\_dS}, \emph{dTFr\_dp}}{}
Extractor routine for the EOS type if the members need to be accessed outside this module.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{eos} :: Equation of state structure

\item {} 
\sphinxstylestrong{form\_of\_eos} :: {[}out{]} A coded integer indicating the equation of state to use.

\item {} 
\sphinxstylestrong{form\_of\_tfreeze} :: {[}out{]} A coded integer indicating the expression for the potential temperature of the freezing point.

\item {} 
\sphinxstylestrong{eos\_quadrature} :: {[}out{]} If true, always use the generic (quadrature) code for the integrals of density.

\item {} 
\sphinxstylestrong{compressible} :: {[}out{]} If true, in situ density is a function of pressure.

\item {} 
\sphinxstylestrong{rho\_t0\_s0} :: {[}out{]} Density at T=0 degC and S=0 ppt {[}kg m\sphinxhyphen{}3{]}

\item {} 
\sphinxstylestrong{drho\_dt} :: {[}out{]} Partial derivative of density with temperature in {[}kg m\sphinxhyphen{}3 degC\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{drho\_ds} :: {[}out{]} Partial derivative of density with salinity in {[}kg m\sphinxhyphen{}3 ppt\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{tfr\_s0\_p0} :: {[}out{]} The freezing potential temperature at S=0, P=0 {[}degC{]}

\item {} 
\sphinxstylestrong{dtfr\_ds} :: {[}out{]} The derivative of freezing point with salinity {[}degC PSU\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{dtfr\_dp} :: {[}out{]} The derivative of freezing point with pressure {[}degC Pa\sphinxhyphen{}1{]}

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}



\subsection{mom\_ice\_shelf module reference}
\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf}}\label{\detokenize{api/generated/modules/mom_ice_shelf:mom-ice-shelf-module-reference}}\label{\detokenize{api/generated/modules/mom_ice_shelf::doc}}\index{mom\_ice\_shelf (module)@\spxentry{mom\_ice\_shelf}\spxextra{module}|spxpagem}
Implements the thermodynamic aspects of ocean / ice\sphinxhyphen{}shelf interactions, along with a crude placeholder for a later implementation of full ice shelf dynamics, all using the MOM framework and coding style.

{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:detamom-ice-shelf}]{\sphinxcrossref{More…}}}


\subsubsection{Data Types}
\label{\detokenize{api/generated/modules/mom_ice_shelf:data-types}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/ice_shelf_cs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ice\_shelf\_cs}}}}}
&
Control structure that contains ice shelf parameters and diagnostics handles.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Functions/Subroutines}
\label{\detokenize{api/generated/modules/mom_ice_shelf:functions-subroutines}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/shelf_calc_flux}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shelf\_calc\_flux()}}}}}
&
Calculates fluxes between the ocean and ice\sphinxhyphen{}shelf using the three\sphinxhyphen{}equations formulation (optional to use just two equations).
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/change_thickness_using_melt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{change\_thickness\_using\_melt()}}}}}
&
Changes the thickness (mass) of the ice shelf based on sub\sphinxhyphen{}ice\sphinxhyphen{}shelf melting.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_forces}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_shelf\_forces()}}}}}
&
This subroutine adds the mechanical forcing fields and perhaps shelf areas, based on the ice state in ice\_shelf\_CS.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_pressure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_shelf\_pressure()}}}}}
&
This subroutine adds the ice shelf pressure to the fluxes type.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_flux}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_shelf\_flux()}}}}}
&
Updates surface fluxes that are influenced by sub\sphinxhyphen{}ice\sphinxhyphen{}shelf melting.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_ice_shelf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_ice\_shelf()}}}}}
&
Initializes shelf model data, parameters and diagnostics.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_shelf_mass}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_shelf\_mass()}}}}}
&
Initializes shelf mass based on three options (file, zero and user)
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/update_shelf_mass}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{update\_shelf\_mass()}}}}}
&
Updates the ice shelf mass using data from a file.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/ice_shelf_save_restart}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ice\_shelf\_save\_restart()}}}}}
&
Save the ice shelf restart file.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/ice_shelf_end}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ice\_shelf\_end()}}}}}
&
Deallocates all memory associated with this module.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/solo_step_ice_shelf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solo\_step\_ice\_shelf()}}}}}
&
This routine is for stepping a stand\sphinxhyphen{}alone ice shelf model without an ocean.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Detailed Description}
\label{\detokenize{api/generated/modules/mom_ice_shelf:detailed-description}}\label{\detokenize{api/generated/modules/mom_ice_shelf:detamom-ice-shelf}}

\paragraph{section\_ICE\_SHELF}
\label{\detokenize{api/generated/modules/mom_ice_shelf:section-ice-shelf}}\label{\detokenize{api/generated/modules/mom_ice_shelf:namespacemom-ice-shelf-1section-ice-shelf}}
This module implements the thermodynamic aspects of ocean/ice\sphinxhyphen{}shelf inter\sphinxhyphen{}actions using the MOM framework and coding style.

Derived from code by Chris Little, early 2010.

The ice\sphinxhyphen{}sheet dynamics subroutines do the following: initialize\_shelf\_mass \sphinxhyphen{} Initializes the ice shelf mass distribution.
\begin{itemize}
\item {} 
Initializes h\_shelf, h\_mask, area\_shelf\_h

\item {} 
CURRENTLY: initializes mass\_shelf as well, but this is unnecessary, as mass\_shelf is initialized based on h\_shelf and density\_ice immediately afterwards. Possibly subroutine should be renamed update\_shelf\_mass \sphinxhyphen{} updates ice shelf mass via netCDF file USER\_update\_shelf\_mass (TODO). solo\_step\_ice\_shelf \sphinxhyphen{} called only in ice\sphinxhyphen{}only mode. shelf\_calc\_flux \sphinxhyphen{} after melt rate \& fluxes are calculated, ice dynamics are done. currently mass\_shelf is updated immediately after ice\_shelf\_advect in fully dynamic mode.

\end{itemize}

NOTES: be aware that hmask(:,:) has a number of functions; it is used for front advancement, for subroutines in the velocity solve, and for thickness boundary conditions (this last one may be removed). in other words, interfering with its updates will have implications you might not expect.

Overall issues: Many variables need better documentation and units and the subgrid on which they are discretized.


\subparagraph{ICE\_SHELF equations}
\label{\detokenize{api/generated/modules/mom_ice_shelf:ice-shelf-equations}}\label{\detokenize{api/generated/modules/mom_ice_shelf:namespacemom-ice-shelf-1section-ice-shelf-equations}}
The three fundamental equations are: Heat flux
\begin{equation*}
\begin{split}\qquad \rho_w C_{pw} \gamma_T (T_w - T_b) = \rho_i \dot{m} L_f\end{split}
\end{equation*}
Salt flux
\begin{equation*}
\begin{split}\qquad \rho_w \gamma_s (S_w - S_b) = \rho_i \dot{m} S_b\end{split}
\end{equation*}
Freezing temperature
\begin{equation*}
\begin{split}\qquad T_b = a S_b + b + c P\end{split}
\end{equation*}
where ….


\subparagraph{References}
\label{\detokenize{api/generated/modules/mom_ice_shelf:references}}\label{\detokenize{api/generated/modules/mom_ice_shelf:namespacemom-ice-shelf-1section-ice-shelf-references}}
Asay\sphinxhyphen{}Davis, Xylar S., Stephen L. Cornford, Benjamin K. Galton\sphinxhyphen{}Fenzi, Rupert M. Gladstone, G. Hilmar Gudmundsson, David M. Holland, Paul R. Holland, and Daniel F. Martin. Experimental design for three interrelated marine ice sheet and ocean model intercomparison projects: MISMIP v. 3 (MISMIP+), ISOMIP v. 2 (ISOMIP+) and MISOMIP v. 1 (MISOMIP1). Geoscientific Model Development 9, no. 7 (2016): 2471.

Goldberg, D. N., et al. Investigation of land ice\sphinxhyphen{}ocean interaction with a fully coupled ice\sphinxhyphen{}ocean model: 1. Model description and behavior. Journal of Geophysical Research: Earth Surface 117.F2 (2012).

Goldberg, D. N., et al. Investigation of land ice\sphinxhyphen{}ocean interaction with a fully coupled ice\sphinxhyphen{}ocean model: 2. Sensitivity to external forcings. Journal of Geophysical Research: Earth Surface 117.F2 (2012).

Holland, David M., and Adrian Jenkins. Modeling thermodynamic ice\sphinxhyphen{}ocean interactions at the base of an ice shelf. Journal of Physical Oceanography 29.8 (1999): 1787\sphinxhyphen{}1800.


\subsubsection{Type Documentation}
\label{\detokenize{api/generated/modules/mom_ice_shelf:type-documentation}}\index{ice\_shelf\_cs (fortran type in module mom\_ice\_shelf)@\spxentry{ice\_shelf\_cs}\spxextra{fortran type in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/ice_shelf_cs}}\pysigline{\sphinxbfcode{\sphinxupquote{type  }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{ice\_shelf\_cs}}}
Control structure that contains ice shelf parameters and diagnostics handles.
\begin{quote}\begin{description}
\item[{Type fields}] \leavevmode\begin{itemize}
\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_melt}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_exch\_vel\_s}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_exch\_vel\_t}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_tfreeze}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_tfl\_shelf}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_thermal\_driving}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_haline\_driving}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_u\_ml}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_v\_ml}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_sbdry}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_h\_shelf}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_h\_mask}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_surf\_elev}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_bathym}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_area\_shelf\_h}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_ustar\_shelf}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_shelf\_mass}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_mass\_flux}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{restart\_csp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(mom\_restart\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: A pointer to the restart control structure for the ice shelves.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{grid}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(ocean\_grid\_type)}\sphinxstyleemphasis{{]}} :: Grid for the ice\sphinxhyphen{}shelf model.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{us}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(unit\_scale\_type)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: A structure containing various unit conversion factors.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{ocn\_grid}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(ocean\_grid\_type)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: A pointer to the ocean model grid The rest is private.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{flux\_factor}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A factor that can be used to turn off ice shelf melting (flux\_factor = 0) {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{restart\_output\_dir}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{character(len=128)}\sphinxstyleemphasis{{]}} :: The directory in which to write restart files.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{iss}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(ice\_shelf\_state)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: A structure with elements that describe the ice\sphinxhyphen{}shelf state.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dcs}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(ice\_shelf\_dyn\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: The control structure for the ice\sphinxhyphen{}shelf dynamics.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{utide}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: An unresolved tidal velocity {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{ustar\_bg}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A minimum value for ustar under ice shelves {[}Z T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{cdrag}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: drag coefficient under ice shelves {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{g\_earth}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The gravitational acceleration {[}L2 Z\sphinxhyphen{}1 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}2{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{cp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The heat capacity of sea water {[}Q degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} J kg\sphinxhyphen{}1 degC\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{rho\_ocn}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A reference ocean density {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{cp\_ice}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The heat capacity of fresh ice {[}Q degC\sphinxhyphen{}1 \textasciitilde{}\textgreater{} J kg\sphinxhyphen{}1 degC\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{gamma\_t}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The (fixed) turbulent exchange velocity in the 2\sphinxhyphen{}equation formulation {[}Z T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{salin\_ice}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The salinity of shelf ice {[}ppt{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{temp\_ice}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The core temperature of shelf ice {[}degC{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{kv\_ice}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The viscosity of ice {[}L4 Z\sphinxhyphen{}2 T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m2 s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{density\_ice}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A typical density of ice {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{kv\_molec}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The molecular kinematic viscosity of sea water {[}Z2 T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m2 s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{kd\_molec\_salt}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The molecular diffusivity of salt {[}Z2 T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m2 s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{kd\_molec\_temp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The molecular diffusivity of heat {[}Z2 T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m2 s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{lat\_fusion}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The latent heat of fusion {[}Q \textasciitilde{}\textgreater{} J kg\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{gamma\_t\_3eq}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Nondimensional heat\sphinxhyphen{}transfer coefficient, used in the 3Eq. formulation.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{gamma\_s\_3eq}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Nondimensional salt\sphinxhyphen{}transfer coefficient, used in the 3Eq. formulation This number should be specified by the user.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{col\_mass\_melt\_threshold}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: An ocean column mass below the iceshelf below which melting does not occur {[}R Z \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}2{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{mass\_from\_file}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: Read the ice shelf mass from a file every dt.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{time\_step}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: this is the shortest timestep that the ice shelf sees, and is equal to the forcing timestep (it is passed in when the shelf is initialized \sphinxhyphen{} so need to reorganize MOM driver. it will be the prognistic timestep … maybe.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{solo\_ice\_sheet}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: whether the ice model is running without being coupled to the ocean

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{gl\_regularize}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: whether to regularize the floatation condition at the grounding line a la Goldberg Holland Schoof 2009

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{gl\_couple}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: whether to let the floatation condition be determined by ocean column thickness means update\_OD\_ffrac will be called (note: GL\_regularize and GL\_couple should be exclusive)

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{calve\_to\_mask}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, calve any ice that passes outside of a masked area.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{min\_thickness\_simple\_calve}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: min. ice shelf thickness criteria for calving {[}Z \textasciitilde{}\textgreater{} m{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{t0}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: temperature at ocean surface in the restoring region {[}degC{]}

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{s0}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Salinity at ocean surface in the restoring region {[}ppt{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{input\_flux}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Ice volume flux at an upstream open boundary {[}m3 s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{input\_thickness}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Ice thickness at an upstream open boundary {[}m{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{time}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(time\_type)}\sphinxstyleemphasis{{]}} :: The component’s time.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{eqn\_of\_state}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(eos\_type)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: Type that indicates the equation of state to use.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{active\_shelf\_dynamics}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: True if the ice shelf mass changes as a result the dynamic ice\sphinxhyphen{}shelf model.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{override\_shelf\_movement}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, user code specifies the shelf movement instead of using the dynamic ice\sphinxhyphen{}shelf mode.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{isthermo}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: True if the ice shelf can exchange heat and mass with the underlying ocean.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{threeeq}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, the 3 equation consistency equations are used to calculate the flux at the ocean\sphinxhyphen{}ice interface.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{insulator}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, ice shelf is a perfect insulator.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{const\_gamma}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, gamma\_T is specified by the user.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{constant\_sea\_level}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: if true, apply an evaporative, heat and salt fluxes. It will avoid large increase in sea level.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{min\_ocean\_mass\_float}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The minimum ocean mass per unit area before the ice shelf is considered to float when constant\_sea\_level is used {[}R Z \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}2{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{cutoff\_depth}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Depth above which melt is set to zero (\textgreater{}= 0) {[}Z \textasciitilde{}\textgreater{} m{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{find\_salt\_root}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, if true find Sbdry using a quadratic eq.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{tfr\_0\_0}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The freezing point at 0 pressure and 0 salinity {[}degC{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dtfr\_ds}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Partial derivative of freezing temperature with salinity {[}degC ppt\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{dtfr\_dp}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Partial derivative of freezing temperature with pressure {[}degC T2 R\sphinxhyphen{}1 L\sphinxhyphen{}2 \textasciitilde{}\textgreater{} degC Pa\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_read\_mass}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: An integer handle used in time interpolation of the ice shelf mass read from a file.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_read\_area}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: An integer handle used in time interpolation of the ice shelf mass read from a file.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{diag}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(diag\_ctrl)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: A structure that is used to control diagnostic output.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{user\_cs}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(user\_ice\_shelf\_cs)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: A pointer to the control structure for user\sphinxhyphen{}supplied modifications to the ice shelf code.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{debug}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, write verbose checksums for debugging purposes and use reproducible sums.

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}



\subsubsection{Function/Subroutine Documentation}
\label{\detokenize{api/generated/modules/mom_ice_shelf:function-subroutine-documentation}}\index{shelf\_calc\_flux() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{shelf\_calc\_flux()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/shelf_calc_flux}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{shelf\_calc\_flux}}}{\emph{sfc\_state}, \emph{fluxes}, \emph{Time}, \emph{time\_step}, \emph{CS}, \emph{forces}}{}
Calculates fluxes between the ocean and ice\sphinxhyphen{}shelf using the three\sphinxhyphen{}equations formulation (optional to use just two equations). See {\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:namespacemom-ice-shelf-1section-ice-shelf-equations}]{\sphinxcrossref{\DUrole{std,std-ref}{ICE\_SHELF equations}}}}
.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{sfc\_state} :: {[}inout{]} A structure containing fields that describe the surface state of the ocean. The intent is only inout to allow for halo updates.

\item {} 
\sphinxstylestrong{fluxes} :: {[}inout{]} structure containing pointers to any possible thermodynamic or mass\sphinxhyphen{}flux forcing fields.

\item {} 
\sphinxstylestrong{time} :: {[}in{]} Start time of the fluxes.

\item {} 
\sphinxstylestrong{time\_step} :: {[}in{]} Length of time over which these fluxes will be applied {[}s{]}.

\item {} 
\sphinxstylestrong{cs} :: A pointer to the control structure returned by a previous call to initialize\_ice\_shelf.

\item {} 
\sphinxstylestrong{forces} :: {[}inout{]} A structure with the driving mechanical forces

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_flux}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_shelf\_flux}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_forces}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_shelf\_forces}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/change_thickness_using_melt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{change\_thickness\_using\_melt}}}}} \sphinxcode{\sphinxupquote{id\_clock\_pass}} \sphinxcode{\sphinxupquote{id\_clock\_shelf}} {\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/update_shelf_mass}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{update\_shelf\_mass}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{change\_thickness\_using\_melt() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{change\_thickness\_using\_melt()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/change_thickness_using_melt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{change\_thickness\_using\_melt}}}{\emph{ISS}, \emph{G}, \emph{US}, \emph{time\_step}, \emph{fluxes}, \emph{density\_ice}, \emph{debug}}{}
Changes the thickness (mass) of the ice shelf based on sub\sphinxhyphen{}ice\sphinxhyphen{}shelf melting.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}inout{]} The ocean’s grid structure.

\item {} 
\sphinxstylestrong{iss} :: {[}inout{]} A structure with elements that describe the ice\sphinxhyphen{}shelf state

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{time\_step} :: {[}in{]} The time step for this update {[}T \textasciitilde{}\textgreater{} s{]}.

\item {} 
\sphinxstylestrong{fluxes} :: {[}inout{]} structure containing pointers to any possible thermodynamic or mass\sphinxhyphen{}flux forcing fields.

\item {} 
\sphinxstylestrong{density\_ice} :: {[}in{]} The density of ice\sphinxhyphen{}shelf ice {[}R \textasciitilde{}\textgreater{} kg m\sphinxhyphen{}3{]}.

\item {} 
\sphinxstylestrong{debug} :: {[}in{]} If present and true, write chksums

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/shelf_calc_flux}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shelf\_calc\_flux}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{add\_shelf\_forces() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{add\_shelf\_forces()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_forces}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{add\_shelf\_forces}}}{\emph{G}, \emph{US}, \emph{CS}, \emph{forces}, \emph{do\_shelf\_area}}{}
This subroutine adds the mechanical forcing fields and perhaps shelf areas, based on the ice state in ice\_shelf\_CS.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}inout{]} The ocean’s grid structure.

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{cs} :: This module’s control structure.

\item {} 
\sphinxstylestrong{forces} :: {[}inout{]} A structure with the driving mechanical forces

\item {} 
\sphinxstylestrong{do\_shelf\_area} :: {[}in{]} If true find the shelf\sphinxhyphen{}covered areas.

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_ice_shelf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_ice\_shelf}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/shelf_calc_flux}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shelf\_calc\_flux}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{add\_shelf\_pressure() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{add\_shelf\_pressure()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_pressure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{add\_shelf\_pressure}}}{\emph{G}, \emph{US}, \emph{CS}, \emph{fluxes}}{}
This subroutine adds the ice shelf pressure to the fluxes type.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}inout{]} The ocean’s grid structure.

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{cs} :: {[}in{]} This module’s control structure.

\item {} 
\sphinxstylestrong{fluxes} :: {[}inout{]} A structure of surface fluxes that may be updated.

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_flux}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_shelf\_flux}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_ice_shelf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_ice\_shelf}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{add\_shelf\_flux() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{add\_shelf\_flux()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_flux}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{add\_shelf\_flux}}}{\emph{G}, \emph{US}, \emph{CS}, \emph{sfc\_state}, \emph{fluxes}}{}
Updates surface fluxes that are influenced by sub\sphinxhyphen{}ice\sphinxhyphen{}shelf melting.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}inout{]} The ocean’s grid structure.

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{cs} :: This module’s control structure.

\item {} 
\sphinxstylestrong{sfc\_state} :: {[}inout{]} Surface ocean state

\item {} 
\sphinxstylestrong{fluxes} :: {[}inout{]} A structure of surface fluxes that may be used/updated.

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_pressure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_shelf\_pressure}}}}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/shelf_calc_flux}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shelf\_calc\_flux}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{initialize\_ice\_shelf() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{initialize\_ice\_shelf()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_ice_shelf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{initialize\_ice\_shelf}}}{\emph{param\_file}, \emph{ocn\_grid}, \emph{Time}, \emph{CS}, \emph{diag}, \emph{forces}, \emph{fluxes}, \emph{Time\_in}, \emph{solo\_ice\_sheet\_in}}{}
Initializes shelf model data, parameters and diagnostics.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{param\_file} :: {[}in{]} A structure to parse for run\sphinxhyphen{}time parameters

\item {} 
\sphinxstylestrong{ocn\_grid} :: The calling ocean model’s horizontal grid structure

\item {} 
\sphinxstylestrong{time} :: {[}inout{]} The clock that that will indicate the model time

\item {} 
\sphinxstylestrong{cs} :: A pointer to the ice shelf control structure

\item {} 
\sphinxstylestrong{diag} :: {[}in{]} A structure that is used to regulate the diagnostic output.

\item {} 
\sphinxstylestrong{fluxes} :: {[}inout{]} A structure containing pointers to any possible thermodynamic or mass\sphinxhyphen{}flux forcing fields.

\item {} 
\sphinxstylestrong{forces} :: {[}inout{]} A structure with the driving mechanical forces

\item {} 
\sphinxstylestrong{time\_in} :: {[}in{]} The time at initialization.

\item {} 
\sphinxstylestrong{solo\_ice\_sheet\_in} :: {[}in{]} If present, this indicates whether a solo ice\sphinxhyphen{}sheet driver.

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_forces}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_shelf\_forces}}}}} {\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/add_shelf_pressure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_shelf\_pressure}}}}} {\hyperref[\detokenize{api/generated/modules/mom_eos:f/mom_eos/eos_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_eos::eos\_init}}}}} {\hyperref[\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling/fix_restart_unit_scaling}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_unit\_scaling::fix\_restart\_unit\_scaling}}}}} \sphinxcode{\sphinxupquote{id\_clock\_pass}} \sphinxcode{\sphinxupquote{id\_clock\_shelf}} {\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_shelf_mass}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_shelf\_mass}}}}} {\hyperref[\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling/unit_scaling_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_unit\_scaling::unit\_scaling\_init}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{initialize\_shelf\_mass() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{initialize\_shelf\_mass()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_shelf_mass}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{initialize\_shelf\_mass}}}{\emph{G}, \emph{param\_file}, \emph{CS}, \emph{ISS}, \emph{new\_sim}}{}
Initializes shelf mass based on three options (file, zero and user)
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}in{]} The ocean’s grid structure.

\item {} 
\sphinxstylestrong{param\_file} :: {[}in{]} A structure to parse for run\sphinxhyphen{}time parameters

\item {} 
\sphinxstylestrong{cs} :: A pointer to the ice shelf control structure

\item {} 
\sphinxstylestrong{iss} :: {[}inout{]} The ice shelf state type that is being updated

\item {} 
\sphinxstylestrong{new\_sim} :: {[}in{]} If present and false, this run is being restarted

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_ice_shelf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{initialize\_ice\_shelf}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{update\_shelf\_mass() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{update\_shelf\_mass()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/update_shelf_mass}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{update\_shelf\_mass}}}{\emph{G}, \emph{US}, \emph{CS}, \emph{ISS}, \emph{Time}}{}
Updates the ice shelf mass using data from a file.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}inout{]} The ocean’s grid structure.

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{cs} :: {[}in{]} A pointer to the ice shelf control structure

\item {} 
\sphinxstylestrong{iss} :: {[}inout{]} The ice shelf state type that is being updated

\item {} 
\sphinxstylestrong{time} :: {[}in{]} The current model time

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/shelf_calc_flux}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shelf\_calc\_flux}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{ice\_shelf\_save\_restart() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{ice\_shelf\_save\_restart()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/ice_shelf_save_restart}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{ice\_shelf\_save\_restart}}}{\emph{CS}, \emph{Time}, \emph{directory}, \emph{time\_stamped}, \emph{filename\_suffix}}{}
Save the ice shelf restart file.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: ice shelf control structure

\item {} 
\sphinxstylestrong{time} :: {[}in{]} model time at this call

\item {} 
\sphinxstylestrong{directory} :: {[}in{]} An optional directory into which to write these restart files.

\item {} 
\sphinxstylestrong{time\_stamped} :: {[}in{]} f true, the restart file names include a unique time stamp. The default is false.

\item {} 
\sphinxstylestrong{filename\_suffix} :: {[}in{]} An optional suffix (e.g., a time\sphinxhyphen{}stamp) to append to the restart file names.

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{ice\_shelf\_end() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{ice\_shelf\_end()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/ice_shelf_end}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{ice\_shelf\_end}}}{\emph{CS}}{}
Deallocates all memory associated with this module.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{cs} :: A pointer to the ice shelf control structure

\end{description}\end{quote}

\end{fulllineitems}

\index{solo\_step\_ice\_shelf() (fortran subroutine in module mom\_ice\_shelf)@\spxentry{solo\_step\_ice\_shelf()}\spxextra{fortran subroutine in module mom\_ice\_shelf}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/solo_step_ice_shelf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_ice\_shelf/}}\sphinxbfcode{\sphinxupquote{solo\_step\_ice\_shelf}}}{\emph{CS}, \emph{time\_interval}, \emph{nsteps}, \emph{Time}, \emph{min\_time\_step\_in}}{}
This routine is for stepping a stand\sphinxhyphen{}alone ice shelf model without an ocean.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: A pointer to the ice shelf control structure

\item {} 
\sphinxstylestrong{time\_interval} :: {[}in{]} The time interval for this update {[}s{]}.

\item {} 
\sphinxstylestrong{nsteps} :: {[}inout{]} The running number of ice shelf steps.

\item {} 
\sphinxstylestrong{time} :: {[}inout{]} The current model time

\item {} 
\sphinxstylestrong{min\_time\_step\_in} :: {[}in{]} The minimum permitted time step {[}T \textasciitilde{}\textgreater{} s{]}.

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}



\subsection{mom\_meke module reference}
\label{\detokenize{api/generated/modules/mom_meke:f/mom_meke}}\label{\detokenize{api/generated/modules/mom_meke:mom-meke-module-reference}}\label{\detokenize{api/generated/modules/mom_meke::doc}}\index{mom\_meke (module)@\spxentry{mom\_meke}\spxextra{module}|spxpagem}
Implements the Mesoscale Eddy Kinetic Energy framework with topographic beta effect included in computing beta in Rhines scale.

{\hyperref[\detokenize{api/generated/modules/mom_meke:detamom-meke}]{\sphinxcrossref{More…}}}


\subsubsection{Data Types}
\label{\detokenize{api/generated/modules/mom_meke:data-types}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_cs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_cs}}}}}
&
Control structure that contains MEKE parameters and diagnostics handles.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Functions/Subroutines}
\label{\detokenize{api/generated/modules/mom_meke:functions-subroutines}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/step_forward_meke}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_forward\_meke()}}}}}
&
Integrates forward\sphinxhyphen{}in\sphinxhyphen{}time the MEKE eddy energy equation.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_equilibrium}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_equilibrium()}}}}}
&
Calculates the equilibrium solutino where the source depends only on MEKE diffusivity and there is no lateral diffusion of MEKE.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_equilibrium_restoring}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_equilibrium\_restoring()}}}}}
&

\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_lengthscales}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{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.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_lengthscales_0d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{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.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_init()}}}}}
&
Initializes the MOM\_MEKE module and reads parameters.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_alloc_register_restart}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_alloc\_register\_restart()}}}}}
&
Allocates memory and register restart fields for the MOM\_MEKE module.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_end}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_end()}}}}}
&
Deallocates any variables allocated in MEKE\_init or MEKE\_alloc\_register\_restart.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Detailed Description}
\label{\detokenize{api/generated/modules/mom_meke:detailed-description}}\label{\detokenize{api/generated/modules/mom_meke:detamom-meke}}

\paragraph{The Mesoscale Eddy Kinetic Energy (MEKE) framework}
\label{\detokenize{api/generated/modules/mom_meke:the-mesoscale-eddy-kinetic-energy-meke-framework}}\label{\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke}}
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\sphinxhyphen{}grid scale eddy energy budget provides a means to predict a sub\sphinxhyphen{}grid eddy\sphinxhyphen{}velocity scale which can be used in the lower order closures.


\subparagraph{MEKE equations}
\label{\detokenize{api/generated/modules/mom_meke:meke-equations}}\label{\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-equations}}
The eddy kinetic energy equation is:
\begin{equation*}
\begin{split}\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{split}
\end{equation*}
where \(E\) is the eddy kinetic energy (variable \sphinxcode{\sphinxupquote{MEKE}} ) with units of m $^{\text{2}}$s $^{\text{\sphinxhyphen{}2}}$, and \(\tilde{t} = a t\) is a scaled time. The non\sphinxhyphen{}dimensional factor \(a\geq 1\) is used to accelerate towards equilibrium.

The MEKE equation is two\sphinxhyphen{}dimensional and obtained by depth averaging the the three\sphinxhyphen{}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\sphinxhyphen{}dimensional quantities needed.


\subparagraph{MEKE source terms}
\label{\detokenize{api/generated/modules/mom_meke:meke-source-terms}}\label{\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-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*}
\begin{split}\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{split}
\end{equation*}
equals the mean potential energy removed by the Gent\sphinxhyphen{}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*}
\begin{split}\dot{E}_{v} = \left< \partial_i u_j \tau_{ij} \right>\end{split}
\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]\) .


\subparagraph{MEKE dissipation terms}
\label{\detokenize{api/generated/modules/mom_meke:meke-dissipation-terms}}\label{\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-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\sphinxhyphen{}mean eddy velocty 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*}
\begin{split}U_d = \sqrt{ U_b^2 + |u|^2_{z=-D} + |\gamma_b U_e|^2 } .\end{split}
\end{equation*}
where the eddy velocity scale, \(U_e\) , is given by:
\begin{equation*}
\begin{split}U_e = \sqrt{ 2 E } .\end{split}
\end{equation*}
\(U_b\) is a constant background bottom velocity scale and is typically not used (i.e. set to zero).

Following Jansen et al., 2015, the projection of eddy energy on to the bottom is given by the ratio of bottom energy to column mean energy:
\begin{equation*}
\begin{split}\gamma_b^2 = \frac{E_b}{E} = \gamma_{d0} + \left( 1 + c_{b} \frac{L_d}{L_f} \right)^{-\frac{4}{5}} ,\end{split}
\end{equation*}\begin{equation*}
\begin{split}\gamma_b^2 \leftarrow \max{\left( \gamma_b^2, \gamma_{min}^2 \right)} .\end{split}
\end{equation*}

\subparagraph{MEKE smoothing terms}
\label{\detokenize{api/generated/modules/mom_meke:meke-smoothing-terms}}\label{\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-smoothing}}
\(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 {\hyperref[\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-diffusivity}]{\sphinxcrossref{\DUrole{std,std-ref}{Diffusivity derived from MEKE}}}} . \(\kappa_4\) is a constant bi\sphinxhyphen{}harmonic diffusivity.


\subparagraph{Diffusivity derived from MEKE}
\label{\detokenize{api/generated/modules/mom_meke:diffusivity-derived-from-meke}}\label{\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-diffusivity}}
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*}
\begin{split}\kappa_M = \gamma_\kappa \sqrt{ \gamma_t^2 U_e^2 A_\Delta }\end{split}
\end{equation*}
where
\(A_\Delta\) is the area of the grid cell. Following Jansen et al., 2015, we now use
\begin{equation*}
\begin{split}\kappa_M = \gamma_\kappa l_M \sqrt{ \gamma_t^2 U_e^2 }\end{split}
\end{equation*}
where
\(\gamma_\kappa \in [0,1]\) is a non\sphinxhyphen{}dimensional factor and, following Jansen et al., 2015, \(\gamma_t^2\) is the ratio of barotropic eddy energy to column mean eddy energy given by
\begin{equation*}
\begin{split}\gamma_t^2 = \frac{E_t}{E} = \left( 1 + c_{t} \frac{L_d}{L_f} \right)^{-\frac{1}{4}} ,\end{split}
\end{equation*}\begin{equation*}
\begin{split}\gamma_t^2 \leftarrow \max{\left( \gamma_t^2, \gamma_{min}^2 \right)} .\end{split}
\end{equation*}
The length\sphinxhyphen{}scale is a configurable combination of multiple length scales:
\begin{equation*}
\begin{split}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{split}
\end{equation*}
where

\begin{eqnarray*} 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{eqnarray*}

\(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\sphinxhyphen{}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*}
\begin{split}\beta^* = \sqrt{( \partial_xf - c_\beta\frac{f}{D}\partial_xD )^2 + ( \partial_yf - c_\beta\frac{f}{D}\partial_yD )^2}\end{split}
\end{equation*}
where \(D\) is water column depth at T points.


\subparagraph{Viscosity derived from MEKE}
\label{\detokenize{api/generated/modules/mom_meke:viscosity-derived-from-meke}}\label{\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-viscosity}}
As for
\(\kappa_M\) , the predicted eddy velocity scale can be used to form a harmonic eddy viscosity,
\begin{equation*}
\begin{split}\kappa_u = \gamma_u \sqrt{ U_e^2 A_\Delta }\end{split}
\end{equation*}
as well as a biharmonic eddy viscosity,
\begin{equation*}
\begin{split}\kappa_4 = \gamma_4 \sqrt{ U_e^2 A_\Delta^3 }\end{split}
\end{equation*}

\subparagraph{Limit cases for local source\sphinxhyphen{}dissipative balance}
\label{\detokenize{api/generated/modules/mom_meke:limit-cases-for-local-source-dissipative-balance}}\label{\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-limit-case}}
Note that in steady\sphinxhyphen{}state (or when
\(a>>1\) ) and there is no diffusion of \(E\) then
\begin{equation*}
\begin{split}\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{split}
\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}\) .


\subparagraph{MEKE module parameters}
\label{\detokenize{api/generated/modules/mom_meke:meke-module-parameters}}\label{\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-module-parameters}}

\begin{savenotes}\sphinxattablestart
\centering
\begin{tabular}[t]{|*{2}{\X{1}{2}|}}
\hline
\sphinxstyletheadfamily 
Symbol
&\sphinxstyletheadfamily 
Module parameter
\\
\hline\begin{itemize}
\item {} 
\end{itemize}
&
\sphinxcode{\sphinxupquote{USE\_MEKE}}
\\
\hline
\(a\)
&
\sphinxcode{\sphinxupquote{MEKE\_DTSCALE}}
\\
\hline
\(\dot{E}_b\)
&
\sphinxcode{\sphinxupquote{MEKE\_BGSRC}}
\\
\hline
\(\gamma_\eta\)
&
\sphinxcode{\sphinxupquote{MEKE\_GMCOEFF}}
\\
\hline
\(\gamma_v\)
&
\sphinxcode{\sphinxupquote{MEKE\_FrCOEFF}}
\\
\hline
\(\lambda\)
&
\sphinxcode{\sphinxupquote{MEKE\_DAMPING}}
\\
\hline
\(U_b\)
&
\sphinxcode{\sphinxupquote{MEKE\_USCALE}}
\\
\hline
\(\gamma_{d0}\)
&
\sphinxcode{\sphinxupquote{MEKE\_CD\_SCALE}}
\\
\hline
\(c_{b}\)
&
\sphinxcode{\sphinxupquote{MEKE\_CB}}
\\
\hline
\(c_{t}\)
&
\sphinxcode{\sphinxupquote{MEKE\_CT}}
\\
\hline
\(\kappa_E\)
&
\sphinxcode{\sphinxupquote{MEKE\_KH}}
\\
\hline
\(\kappa_4\)
&
\sphinxcode{\sphinxupquote{MEKE\_K4}}
\\
\hline
\(\gamma_\kappa\)
&
\sphinxcode{\sphinxupquote{MEKE\_KHCOEFF}}
\\
\hline
\(\gamma_M\)
&
\sphinxcode{\sphinxupquote{MEKE\_KHMEKE\_FAC}}
\\
\hline
\(\gamma_u\)
&
\sphinxcode{\sphinxupquote{MEKE\_VISCOSITY\_COEFF\_KU}}
\\
\hline
\(\gamma_4\)
&
\sphinxcode{\sphinxupquote{MEKE\_VISCOSITY\_COEFF\_AU}}
\\
\hline
\(\gamma_{min}^2\)
&
\sphinxcode{\sphinxupquote{MEKE\_MIN\_GAMMA2}}
\\
\hline
\(\alpha_d\)
&
\sphinxcode{\sphinxupquote{MEKE\_ALPHA\_DEFORM}}
\\
\hline
\(\alpha_f\)
&
\sphinxcode{\sphinxupquote{MEKE\_ALPHA\_FRICT}}
\\
\hline
\(\alpha_R\)
&
\sphinxcode{\sphinxupquote{MEKE\_ALPHA\_RHINES}}
\\
\hline
\(\alpha_e\)
&
\sphinxcode{\sphinxupquote{MEKE\_ALPHA\_EADY}}
\\
\hline
\(\alpha_\Delta\)
&
\sphinxcode{\sphinxupquote{MEKE\_ALPHA\_GRID}}
\\
\hline
\(L_c\)
&
\sphinxcode{\sphinxupquote{MEKE\_FIXED\_MIXING\_LENGTH}}
\\
\hline
\(c_\beta\)
&
\sphinxcode{\sphinxupquote{MEKE\_TOPOGRAPHIC\_BETA}}
\\
\hline\begin{itemize}
\item {} 
\end{itemize}
&
\sphinxcode{\sphinxupquote{MEKE\_KHTH\_FAC}}
\\
\hline\begin{itemize}
\item {} 
\end{itemize}
&
\sphinxcode{\sphinxupquote{MEKE\_KHTR\_FAC}}
\\
\hline
\end{tabular}
\par
\sphinxattableend\end{savenotes}


\begin{savenotes}\sphinxattablestart
\centering
\begin{tabulary}{\linewidth}[t]{|T|T|}
\hline
\sphinxstyletheadfamily 
Symbol
&\sphinxstyletheadfamily 
Model parameter
\\
\hline
\(C_d\)
&
\sphinxcode{\sphinxupquote{CDRAG}}
\\
\hline
\end{tabulary}
\par
\sphinxattableend\end{savenotes}


\subparagraph{References}
\label{\detokenize{api/generated/modules/mom_meke:references}}\label{\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-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, \sphinxurl{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, \sphinxurl{http://doi.org/10.1016/j.ocemod.2010.02.001}.


\subsubsection{Type Documentation}
\label{\detokenize{api/generated/modules/mom_meke:type-documentation}}\index{meke\_cs (fortran type in module mom\_meke)@\spxentry{meke\_cs}\spxextra{fortran type in module mom\_meke}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_cs}}\pysigline{\sphinxbfcode{\sphinxupquote{type  }}\sphinxcode{\sphinxupquote{mom\_meke/}}\sphinxbfcode{\sphinxupquote{meke\_cs}}}
Control structure that contains MEKE parameters and diagnostics handles.
\begin{quote}\begin{description}
\item[{Type fields}] \leavevmode\begin{itemize}
\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_meke}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_ue}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_kh}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_src}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_ub}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_ut}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_gm\_src}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_mom\_src}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_gme\_snk}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_decay}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_khmeke\_u}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_khmeke\_v}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_ku}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_au}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_le}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_gamma\_b}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_gamma\_t}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_lrhines}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_leady}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_meke\_equilibrium}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Diagnostic handles.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{equilibrium\_value}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real(:,:)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: The equilbrium value of MEKE to be calculated at each time step {[}L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} m2 s\sphinxhyphen{}2{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_frcoeff}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Efficiency of conversion of ME into MEKE {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_gmcoeff}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Efficiency of conversion of PE into MEKE {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_gmecoeff}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Efficiency of conversion of MEKE into ME by GME {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_damping}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Local depth\sphinxhyphen{}independent MEKE dissipation rate {[}T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_cd\_scale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The ratio of the bottom eddy velocity to the column mean eddy velocity, i.e. sqrt(2*MEKE). This should be less than 1 to account for the surface intensification of MEKE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_cb}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Coefficient in the

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_min\_gamma}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Minimum value of gamma\_b\textasciicircum{}2 allowed {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_ct}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Coefficient in the

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{visc\_drag}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true use the vertvisc\_type to calculate bottom drag.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_geometric}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, uses the GM coefficient formulation from the GEOMETRIC framework (Marshall et al., 2012)

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_geometric\_alpha}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The nondimensional coefficient governing the efficiency of the GEOMETRIC thickness diffusion.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_equilibrium\_alt}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, use an alternative calculation for the equilibrium value of MEKE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_equilibrium\_restoring}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, restore MEKE back to its equilibrium value, which is calculated at each time step.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{gm\_src\_alt}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, use the GM energy conversion form S\textasciicircum{}2*N\textasciicircum{}2*kappa rather than the streamfunction for the MEKE GM source term.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{rd\_as\_max\_scale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true the length scale can not exceed the first baroclinic deformation radius.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{use\_old\_lscale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: Use the old formula for mixing length scale.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{use\_min\_lscale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: Use simple minimum for mixing length scale.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{cdrag}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The bottom drag coefficient for MEKE {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_bgsrc}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Background energy source for MEKE {[}L2 T\sphinxhyphen{}3 \textasciitilde{}\textgreater{} W kg\sphinxhyphen{}1{]} (= m2 s\sphinxhyphen{}3).

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_dtscale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Scale factor to accelerate time\sphinxhyphen{}stepping {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_khcoeff}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Scaling factor to convert MEKE into Kh {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_uscale}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: MEKE velocity scale for bottom drag {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_kh}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Background lateral diffusion of MEKE {[}L2 T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m2 s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_k4}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Background bi\sphinxhyphen{}harmonic diffusivity (of MEKE) {[}L4 T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m4 s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{khmeke\_fac}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A factor relating MEKEKh to the diffusivity used for MEKE itself {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{viscosity\_coeff\_ku}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The scaling coefficient in the expression for viscosity used to parameterize lateral harmonic momentum mixing by unresolved eddies represented by MEKE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{viscosity\_coeff\_au}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: The scaling coefficient in the expression for viscosity used to parameterize lateral biharmonic momentum mixing by unresolved eddies represented by MEKE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{lfixed}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Fixed mixing length scale {[}L \textasciitilde{}\textgreater{} m{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{adeform}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Weighting towards deformation scale of mixing length {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{arhines}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Weighting towards Rhines scale of mixing length {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{africt}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Weighting towards frictional arrest scale of mixing length {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{aeady}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Weighting towards Eady scale of mixing length {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{agrid}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Weighting towards grid scale of mixing length {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_advection\_factor}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A scaling in front of the advection of MEKE {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_topographic\_beta}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Weight for how much topographic beta is considered when computing beta in Rhines scale {[}nondim{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{meke\_restoring\_rate}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Inverse of the timescale used to nudge MEKE toward its equilibrium value {[}s\sphinxhyphen{}1{]}.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{kh\_flux\_enabled}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, lateral diffusive MEKE flux is enabled.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{initialize}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If True, invokes a steady state solver to calculate MEKE.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{debug}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}} :: If true, write out checksums of data for debugging.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{diag}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(diag\_ctrl)}\sphinxstyleemphasis{,}\sphinxstyleemphasis{pointer}\sphinxstyleemphasis{{]}} :: A type that regulates diagnostics output.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{id\_clock\_pass}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{integer}\sphinxstyleemphasis{{]}} :: Clock for group pass calls.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{pass\_meke}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(group\_pass\_type)}\sphinxstyleemphasis{{]}} :: Group halo pass handle for MEKEMEKE and maybe MEKEKh\_diff.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{pass\_kh}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{type(group\_pass\_type)}\sphinxstyleemphasis{{]}} :: Group halo pass handle for MEKEKh, MEKEKu, and/or MEKEAu.

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}



\subsubsection{Function/Subroutine Documentation}
\label{\detokenize{api/generated/modules/mom_meke:function-subroutine-documentation}}\index{step\_forward\_meke() (fortran subroutine in module mom\_meke)@\spxentry{step\_forward\_meke()}\spxextra{fortran subroutine in module mom\_meke}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_meke:f/mom_meke/step_forward_meke}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_meke/}}\sphinxbfcode{\sphinxupquote{step\_forward\_meke}}}{\emph{MEKE}, \emph{h}, \emph{SN\_u}, \emph{SN\_v}, \emph{visc}, \emph{dt}, \emph{G}, \emph{GV}, \emph{US}, \emph{CS}, \emph{hu}, \emph{hv}}{}
Integrates forward\sphinxhyphen{}in\sphinxhyphen{}time the MEKE eddy energy equation. See {\hyperref[\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-equations}]{\sphinxcrossref{\DUrole{std,std-ref}{MEKE equations}}}}
.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{meke} :: MEKE data.

\item {} 
\sphinxstylestrong{g} :: {[}inout{]} Ocean grid.

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure.

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{h} :: {[}in{]} Layer thickness {[}H \textasciitilde{}\textgreater{} m or kg m\sphinxhyphen{}2{]}.

\item {} 
\sphinxstylestrong{sn\_u} :: {[}in{]} Eady growth rate at u\sphinxhyphen{}points {[}T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1{]}.

\item {} 
\sphinxstylestrong{sn\_v} :: {[}in{]} Eady growth rate at v\sphinxhyphen{}points {[}T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1{]}.

\item {} 
\sphinxstylestrong{visc} :: {[}in{]} The vertical viscosity type.

\item {} 
\sphinxstylestrong{dt} :: {[}in{]} Model(baroclinic) time\sphinxhyphen{}step {[}T \textasciitilde{}\textgreater{} s{]}.

\item {} 
\sphinxstylestrong{cs} :: MEKE control structure.

\item {} 
\sphinxstylestrong{hu} :: {[}in{]} Accumlated zonal mass flux {[}H L2 \textasciitilde{}\textgreater{} m3 or kg{]}.

\item {} 
\sphinxstylestrong{hv} :: {[}in{]} Accumlated meridional mass flux {[}H L2 \textasciitilde{}\textgreater{} m3 or kg{]}

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_equilibrium}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_equilibrium}}}}} {\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_equilibrium_restoring}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_equilibrium\_restoring}}}}} {\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_lengthscales}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_lengthscales}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{meke\_equilibrium() (fortran subroutine in module mom\_meke)@\spxentry{meke\_equilibrium()}\spxextra{fortran subroutine in module mom\_meke}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_equilibrium}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_meke/}}\sphinxbfcode{\sphinxupquote{meke\_equilibrium}}}{\emph{CS}, \emph{MEKE}, \emph{G}, \emph{GV}, \emph{US}, \emph{SN\_u}, \emph{SN\_v}, \emph{drag\_rate\_visc}, \emph{I\_mass}}{}
Calculates the equilibrium solutino where the source depends only on MEKE diffusivity and there is no lateral diffusion of MEKE. Results is in MEKEMEKE.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}inout{]} Ocean grid.

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure.

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{cs} :: MEKE control structure.

\item {} 
\sphinxstylestrong{meke} :: A structure with MEKE data.

\item {} 
\sphinxstylestrong{sn\_u} :: {[}in{]} Eady growth rate at u\sphinxhyphen{}points {[}T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1{]}.

\item {} 
\sphinxstylestrong{sn\_v} :: {[}in{]} Eady growth rate at v\sphinxhyphen{}points {[}T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1{]}.

\item {} 
\sphinxstylestrong{drag\_rate\_visc} :: {[}in{]} Mean flow velocity contribution to the MEKE drag rate {[}L T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m s\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{i\_mass} :: {[}in{]} Inverse of column mass {[}R\sphinxhyphen{}1 Z\sphinxhyphen{}1 \textasciitilde{}\textgreater{} m2 kg\sphinxhyphen{}1{]}.

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_lengthscales_0d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_lengthscales\_0d}}}}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/step_forward_meke}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_forward\_meke}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{meke\_equilibrium\_restoring() (fortran subroutine in module mom\_meke)@\spxentry{meke\_equilibrium\_restoring()}\spxextra{fortran subroutine in module mom\_meke}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_equilibrium_restoring}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_meke/}}\sphinxbfcode{\sphinxupquote{meke\_equilibrium\_restoring}}}{\emph{CS}, \emph{G}, \emph{US}, \emph{SN\_u}, \emph{SN\_v}}{}~\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{g} :: {[}inout{]} Ocean grid.

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type.

\item {} 
\sphinxstylestrong{cs} :: MEKE control structure.

\item {} 
\sphinxstylestrong{sn\_u} :: {[}in{]} Eady growth rate at u\sphinxhyphen{}points {[}T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1{]}.

\item {} 
\sphinxstylestrong{sn\_v} :: {[}in{]} Eady growth rate at v\sphinxhyphen{}points {[}T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1{]}.

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/step_forward_meke}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_forward\_meke}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{meke\_lengthscales() (fortran subroutine in module mom\_meke)@\spxentry{meke\_lengthscales()}\spxextra{fortran subroutine in module mom\_meke}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_lengthscales}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_meke/}}\sphinxbfcode{\sphinxupquote{meke\_lengthscales}}}{\emph{CS}, \emph{MEKE}, \emph{G}, \emph{GV}, \emph{US}, \emph{SN\_u}, \emph{SN\_v}, \emph{EKE}, \emph{bottomFac2}, \emph{barotrFac2}, \emph{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 {\hyperref[\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-equations}]{\sphinxcrossref{\DUrole{std,std-ref}{MEKE equations}}}} .
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: MEKE control structure.

\item {} 
\sphinxstylestrong{meke} :: MEKE data.

\item {} 
\sphinxstylestrong{g} :: {[}inout{]} Ocean grid.

\item {} 
\sphinxstylestrong{gv} :: {[}in{]} Ocean vertical grid structure.

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{sn\_u} :: {[}in{]} Eady growth rate at u\sphinxhyphen{}points {[}T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1{]}.

\item {} 
\sphinxstylestrong{sn\_v} :: {[}in{]} Eady growth rate at v\sphinxhyphen{}points {[}T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1{]}.

\item {} 
\sphinxstylestrong{eke} :: {[}in{]} Eddy kinetic energy {[}L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} m2 s\sphinxhyphen{}2{]}.

\item {} 
\sphinxstylestrong{bottomfac2} :: {[}out{]} gamma\_b\textasciicircum{}2

\item {} 
\sphinxstylestrong{barotrfac2} :: {[}out{]} gamma\_t\textasciicircum{}2

\item {} 
\sphinxstylestrong{lmixscale} :: {[}out{]} Eddy mixing length {[}L \textasciitilde{}\textgreater{} m{]}.

\end{itemize}

\item[{Call to}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_lengthscales_0d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_lengthscales\_0d}}}}}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/step_forward_meke}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step\_forward\_meke}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{meke\_lengthscales\_0d() (fortran subroutine in module mom\_meke)@\spxentry{meke\_lengthscales\_0d()}\spxextra{fortran subroutine in module mom\_meke}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_lengthscales_0d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_meke/}}\sphinxbfcode{\sphinxupquote{meke\_lengthscales\_0d}}}{\emph{CS}, \emph{US}, \emph{area}, \emph{beta}, \emph{depth}, \emph{Rd\_dx}, \emph{SN}, \emph{EKE}, \emph{bottomFac2}, \emph{barotrFac2}, \emph{LmixScale}, \emph{Lrhines}, \emph{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 {\hyperref[\detokenize{api/generated/modules/mom_meke:namespacemom-meke-1section-meke-equations}]{\sphinxcrossref{\DUrole{std,std-ref}{MEKE equations}}}} .
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{cs} :: MEKE control structure.

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{area} :: {[}in{]} Grid cell area {[}L2 \textasciitilde{}\textgreater{} m2{]}

\item {} 
\sphinxstylestrong{beta} :: {[}in{]} Planetary beta = {\color{red}\bfseries{}|grad F|} {[}T\sphinxhyphen{}1 L\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1 m\sphinxhyphen{}1{]}

\item {} 
\sphinxstylestrong{depth} :: {[}in{]} Ocean depth {[}Z \textasciitilde{}\textgreater{} m{]}

\item {} 
\sphinxstylestrong{rd\_dx} :: {[}in{]} Resolution Ld/dx {[}nondim{]}.

\item {} 
\sphinxstylestrong{sn} :: {[}in{]} Eady growth rate {[}T\sphinxhyphen{}1 \textasciitilde{}\textgreater{} s\sphinxhyphen{}1{]}.

\item {} 
\sphinxstylestrong{eke} :: {[}in{]} Eddy kinetic energy {[}L2 T\sphinxhyphen{}2 \textasciitilde{}\textgreater{} m2 s\sphinxhyphen{}2{]}.

\item {} 
\sphinxstylestrong{bottomfac2} :: {[}out{]} gamma\_b\textasciicircum{}2

\item {} 
\sphinxstylestrong{barotrfac2} :: {[}out{]} gamma\_t\textasciicircum{}2

\item {} 
\sphinxstylestrong{lmixscale} :: {[}out{]} Eddy mixing length {[}L \textasciitilde{}\textgreater{} m{]}.

\item {} 
\sphinxstylestrong{lrhines} :: {[}out{]} Rhines length scale {[}L \textasciitilde{}\textgreater{} m{]}.

\item {} 
\sphinxstylestrong{leady} :: {[}out{]} Eady length scale {[}L \textasciitilde{}\textgreater{} m{]}.

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_equilibrium}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_equilibrium}}}}} {\hyperref[\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_lengthscales}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{meke\_lengthscales}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{meke\_init() (fortran function in module mom\_meke)@\spxentry{meke\_init()}\spxextra{fortran function in module mom\_meke}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_init}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{function }}\sphinxcode{\sphinxupquote{mom\_meke/}}\sphinxbfcode{\sphinxupquote{meke\_init}}}{\emph{Time}, \emph{G}, \emph{US}, \emph{param\_file}, \emph{diag}, \emph{CS}, \emph{MEKE}, \emph{restart\_CS}}{\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{logical}\sphinxstyleemphasis{{]}}}
Initializes the MOM\_MEKE module and reads parameters. Returns True if module is to be used, otherwise returns False.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{time} :: {[}in{]} The current model time.

\item {} 
\sphinxstylestrong{g} :: {[}inout{]} The ocean’s grid structure.

\item {} 
\sphinxstylestrong{us} :: {[}in{]} A dimensional unit scaling type

\item {} 
\sphinxstylestrong{param\_file} :: {[}in{]} Parameter file parser structure.

\item {} 
\sphinxstylestrong{diag} :: {[}inout{]} Diagnostics structure.

\item {} 
\sphinxstylestrong{cs} :: MEKE control structure.

\item {} 
\sphinxstylestrong{meke} :: MEKE\sphinxhyphen{}related fields.

\item {} 
\sphinxstylestrong{restart\_cs} :: Restart control structure for MOM\_MEKE.

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{meke\_alloc\_register\_restart() (fortran subroutine in module mom\_meke)@\spxentry{meke\_alloc\_register\_restart()}\spxextra{fortran subroutine in module mom\_meke}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_alloc_register_restart}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_meke/}}\sphinxbfcode{\sphinxupquote{meke\_alloc\_register\_restart}}}{\emph{HI}, \emph{param\_file}, \emph{MEKE}, \emph{restart\_CS}}{}
Allocates memory and register restart fields for the MOM\_MEKE module.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{hi} :: {[}in{]} Horizontal index structure

\item {} 
\sphinxstylestrong{param\_file} :: {[}in{]} Parameter file parser structure.

\item {} 
\sphinxstylestrong{meke} :: A structure with MEKE\sphinxhyphen{}related fields.

\item {} 
\sphinxstylestrong{restart\_cs} :: Restart control structure for MOM\_MEKE.

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}

\index{meke\_end() (fortran subroutine in module mom\_meke)@\spxentry{meke\_end()}\spxextra{fortran subroutine in module mom\_meke}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_meke:f/mom_meke/meke_end}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_meke/}}\sphinxbfcode{\sphinxupquote{meke\_end}}}{\emph{MEKE}, \emph{CS}}{}
Deallocates any variables allocated in MEKE\_init or MEKE\_alloc\_register\_restart.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{meke} :: A structure with MEKE\sphinxhyphen{}related fields.

\item {} 
\sphinxstylestrong{cs} :: The control structure for MOM\_MEKE.

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}



\subsection{mom\_unit\_scaling module reference}
\label{\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling}}\label{\detokenize{api/generated/modules/mom_unit_scaling:mom-unit-scaling-module-reference}}\label{\detokenize{api/generated/modules/mom_unit_scaling::doc}}\index{mom\_unit\_scaling (module)@\spxentry{mom\_unit\_scaling}\spxextra{module}|spxpagem}
Provides a transparent unit rescaling type to facilitate dimensional consistency testing.

{\hyperref[\detokenize{api/generated/modules/mom_unit_scaling:detamom-unit-scaling}]{\sphinxcrossref{More…}}}


\subsubsection{Data Types}
\label{\detokenize{api/generated/modules/mom_unit_scaling:data-types}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling/unit_scale_type}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{unit\_scale\_type}}}}}
&
Describes various unit conversion factors.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Functions/Subroutines}
\label{\detokenize{api/generated/modules/mom_unit_scaling:functions-subroutines}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{ll}
\hline

\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline

\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

{\hyperref[\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling/unit_scaling_init}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{unit\_scaling\_init()}}}}}
&
Allocates and initializes the ocean model unit scaling type.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling/fix_restart_unit_scaling}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fix\_restart\_unit\_scaling()}}}}}
&
Set the unit scaling factors for output to restart files to the unit scaling factors for this run.
\\
\hline
{\hyperref[\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling/unit_scaling_end}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{unit\_scaling\_end()}}}}}
&
Deallocates a unit scaling structure.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}


\subsubsection{Detailed Description}
\label{\detokenize{api/generated/modules/mom_unit_scaling:detailed-description}}\label{\detokenize{api/generated/modules/mom_unit_scaling:detamom-unit-scaling}}
Provides a transparent unit rescaling type to facilitate dimensional consistency testing.


\subsubsection{Type Documentation}
\label{\detokenize{api/generated/modules/mom_unit_scaling:type-documentation}}\index{unit\_scale\_type (fortran type in module mom\_unit\_scaling)@\spxentry{unit\_scale\_type}\spxextra{fortran type in module mom\_unit\_scaling}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling/unit_scale_type}}\pysigline{\sphinxbfcode{\sphinxupquote{type  }}\sphinxcode{\sphinxupquote{mom\_unit\_scaling/}}\sphinxbfcode{\sphinxupquote{unit\_scale\_type}}}
Describes various unit conversion factors.
\begin{quote}\begin{description}
\item[{Type fields}] \leavevmode\begin{itemize}
\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{m\_to\_z}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates distances in meters to the units of depth.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{z\_to\_m}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates distances in the units of depth to meters.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{m\_to\_l}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates lengths in meters to the units of horizontal lengths.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{l\_to\_m}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates lengths in the units of horizontal lengths to meters.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{s\_to\_t}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates time intervals in seconds to the units of time.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{t\_to\_s}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates the units of time to seconds.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{r\_to\_kg\_m3}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates the units of density to kilograms per meter cubed.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{kg\_m3\_to\_r}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates kilograms per meter cubed to the units of density.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{q\_to\_j\_kg}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates the units of enthalpy to Joules per kilogram.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{j\_kg\_to\_q}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A constant that translates Joules per kilogram to the units of enthalpy.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{z\_to\_l}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert vertical distances to lateral lengths.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{l\_to\_z}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert lateral lengths to vertical distances.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{l\_t\_to\_m\_s}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert lateral velocities from L T\sphinxhyphen{}1 to m s\sphinxhyphen{}1.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{m\_s\_to\_l\_t}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert lateral velocities from m s\sphinxhyphen{}1 to L T\sphinxhyphen{}1.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{l\_t2\_to\_m\_s2}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert lateral accelerations from L T\sphinxhyphen{}2 to m s\sphinxhyphen{}2.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{z2\_t\_to\_m2\_s}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert vertical diffusivities from Z2 T\sphinxhyphen{}1 to m2 s\sphinxhyphen{}1.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{m2\_s\_to\_z2\_t}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert vertical diffusivities from m2 s\sphinxhyphen{}1 to Z2 T\sphinxhyphen{}1.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{w\_m2\_to\_qrz\_t}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert heat fluxes from W m\sphinxhyphen{}2 to Q R Z T\sphinxhyphen{}1.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{qrz\_t\_to\_w\_m2}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert heat fluxes from Q R Z T\sphinxhyphen{}1 to W m\sphinxhyphen{}2.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{rz\_to\_kg\_m2}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert mass loads from R Z to kg m\sphinxhyphen{}2.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{kg\_m2s\_to\_rz\_t}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert mass fluxes from kg m\sphinxhyphen{}2 s\sphinxhyphen{}1 to R Z T\sphinxhyphen{}1.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{rz\_t\_to\_kg\_m2s}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert mass fluxes from R Z T\sphinxhyphen{}1 to kg m\sphinxhyphen{}2 s\sphinxhyphen{}1.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{rz3\_t3\_to\_w\_m2}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert turbulent kinetic energy fluxes from R Z3 T\sphinxhyphen{}3 to W m\sphinxhyphen{}2.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{w\_m2\_to\_rz3\_t3}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert turbulent kinetic energy fluxes from W m\sphinxhyphen{}2 to R Z3 T\sphinxhyphen{}3.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{rl2\_t2\_to\_pa}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: Convert pressures from R L2 T\sphinxhyphen{}2 to Pa.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{m\_to\_z\_restart}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A copy of the m\_to\_Z that is used in restart files.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{m\_to\_l\_restart}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A copy of the m\_to\_L that is used in restart files.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{s\_to\_t\_restart}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A copy of the s\_to\_T that is used in restart files.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{kg\_m3\_to\_r\_restart}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A copy of the kg\_m3\_to\_R that is used in restart files.

\item {} 
\sphinxbfcode{\sphinxupquote{\%~}}\sphinxbfcode{\sphinxupquote{j\_kg\_to\_q\_restart}}\sphinxstyleemphasis{ {[}}\sphinxstyleemphasis{real}\sphinxstyleemphasis{{]}} :: A copy of the J\_kg\_to\_Q that is used in restart files.

\end{itemize}

\end{description}\end{quote}

\end{fulllineitems}



\subsubsection{Function/Subroutine Documentation}
\label{\detokenize{api/generated/modules/mom_unit_scaling:function-subroutine-documentation}}\index{unit\_scaling\_init() (fortran subroutine in module mom\_unit\_scaling)@\spxentry{unit\_scaling\_init()}\spxextra{fortran subroutine in module mom\_unit\_scaling}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling/unit_scaling_init}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_unit\_scaling/}}\sphinxbfcode{\sphinxupquote{unit\_scaling\_init}}}{\emph{param\_file}, \emph{US}}{}
Allocates and initializes the ocean model unit scaling type.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstylestrong{param\_file} :: {[}in{]} Parameter file handle/type

\item {} 
\sphinxstylestrong{us} :: A dimensional unit scaling type

\end{itemize}

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_ice_shelf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_ice\_shelf::initialize\_ice\_shelf}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{fix\_restart\_unit\_scaling() (fortran subroutine in module mom\_unit\_scaling)@\spxentry{fix\_restart\_unit\_scaling()}\spxextra{fortran subroutine in module mom\_unit\_scaling}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling/fix_restart_unit_scaling}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_unit\_scaling/}}\sphinxbfcode{\sphinxupquote{fix\_restart\_unit\_scaling}}}{\emph{US}}{}
Set the unit scaling factors for output to restart files to the unit scaling factors for this run.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{us} :: {[}inout{]} A dimensional unit scaling type

\item[{Called from}] \leavevmode
{\hyperref[\detokenize{api/generated/modules/mom_ice_shelf:f/mom_ice_shelf/initialize_ice_shelf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mom\_ice\_shelf::initialize\_ice\_shelf}}}}}

\end{description}\end{quote}

\end{fulllineitems}

\index{unit\_scaling\_end() (fortran subroutine in module mom\_unit\_scaling)@\spxentry{unit\_scaling\_end()}\spxextra{fortran subroutine in module mom\_unit\_scaling}|spxpagem}

\begin{fulllineitems}
\phantomsection\label{\detokenize{api/generated/modules/mom_unit_scaling:f/mom_unit_scaling/unit_scaling_end}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subroutine }}\sphinxcode{\sphinxupquote{mom\_unit\_scaling/}}\sphinxbfcode{\sphinxupquote{unit\_scaling\_end}}}{\emph{US}}{}
Deallocates a unit scaling structure.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstylestrong{us} :: A dimensional unit scaling type

\end{description}\end{quote}

\end{fulllineitems}



\chapter{Bibliography}
\label{\detokenize{zzbibliography:bibliography}}\label{\detokenize{zzbibliography::doc}}



\chapter{Indices and tables}
\label{\detokenize{index:indices-and-tables}}\begin{itemize}
\item {} 
\DUrole{xref,std,std-ref}{genindex}

\item {} 
\DUrole{xref,std,std-ref}{search}

\end{itemize}

\begin{sphinxthebibliography}{10}
\bibitem[1]{zzbibliography:adcroft2019}
A. Adcroft, W. Anderson, V. Balaji, C. Blanton, M. Bushuk, C. O. Dufour, J. P. Dunne, S. M. Griffies, R. Hallberg, M. J. Harrison, I. M. Held, M. F. Jansen, J. G. John, J. P. Krasting, A. R. Langenhorst, S. Legg, Z. Liang, C. McHugh, A. Radhakrishnan, B. G. Reichl, T. Rosati, B. L. Samuels, A. Shao, R. Stouffer, M. Winton, A. T. Wittenberg, B. Xiang, N. Zadeh, and R. Zhang. The GFDL global ocean and sea ice model OM4.0: model description and simulation features. \sphinxstyleemphasis{J. Adv. Mod. Earth Sys.}, 11(10):3167\textendash{}3211, 2019. \sphinxhref{https://doi.org/10.1029/2019ms001726}{doi:10.1029/2019ms001726}.
\bibitem[2]{zzbibliography:adcroft2006}
Alistair Adcroft and Robert Hallberg. On methods for solving the oceanic equations of motion in generalized vertical coordinates. \sphinxstyleemphasis{Ocean Modelling}, 11(1\sphinxhyphen{}2):224\textendash{}233, January 2006. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S1463500305000090}, \sphinxhref{https://doi.org/10.1016/j.ocemod.2004.12.007}{doi:10.1016/j.ocemod.2004.12.007}.
\bibitem[3]{zzbibliography:adcroft2008}
Alistair Adcroft, Robert Hallberg, and Matthew Harrison. A finite volume discretization of the pressure gradient force using analytic integration. \sphinxstyleemphasis{Ocean Modelling}, 22(3\sphinxhyphen{}4):106\textendash{}113, January 2008. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S1463500308000243}, \sphinxhref{https://doi.org/10.1016/j.ocemod.2008.02.001}{doi:10.1016/j.ocemod.2008.02.001}.
\bibitem[4]{zzbibliography:arakawa1990}
Akio Arakawa and Yueh\sphinxhyphen{}Jiuan G. Hsu. Energy conserving and potential\sphinxhyphen{}enstrophy dissipating schemes for the shallow water equations. \sphinxstyleemphasis{Monthly Weather Review}, 118:1960\textendash{}1969, 1990. \sphinxhref{https://doi.org/10.1175/1520-0493(1990)118\textless{}1960:ECAPED\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0493(1990)118\textless{}1960:ECAPED\textgreater{}2.0.CO;2}.
\bibitem[5]{zzbibliography:arakawa1981}
Akio Arakawa and Vivian R. Lamb. A Potential Enstrophy and Energy Conserving Scheme for the Shallow Water Equations. \sphinxstyleemphasis{Monthly Weather Review}, 109(1):18\textendash{}36, January 1981. URL: \sphinxurl{https://journals.ametsoc.org/doi/abs/10.1175/1520-0493(1981)109\%3C0018:APEAEC\%3E2.0.CO\%3B2}, \sphinxhref{https://doi.org/10.1175/1520-0493(1981)109\textless{}0018:APEAEC\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0493(1981)109\textless{}0018:APEAEC\textgreater{}2.0.CO;2}.
\bibitem[6]{zzbibliography:bleck2002}
Rainer Bleck. An oceanic general circulation model framed in hybrid isopycnic\sphinxhyphen{}Cartesian coordinates. \sphinxstyleemphasis{Ocean Modelling}, 4(1):55\textendash{}88, 2002. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S1463500301000129}, \sphinxhref{https://doi.org/10.1016/S1463-5003(01)00012-9}{doi:10.1016/S1463\sphinxhyphen{}5003(01)00012\sphinxhyphen{}9}.
\bibitem[7]{zzbibliography:bleck1990}
Rainer Bleck and Linda T. Smith. A wind‐driven isopycnic coordinate model of the north and equatorial atlantic ocean: 1. model development and supporting experiments. \sphinxstyleemphasis{JGR Oceans}, 95:3273\textendash{}3285, 1990. \sphinxhref{https://doi.org/10.1029/JC095iC03p03273}{doi:10.1029/JC095iC03p03273}.
\bibitem[8]{zzbibliography:carpenter1990}
Jr. Carpenter, Richard L., Kelvin K. Droegemeier, Paul R. Woodward, and Carl E. Hane. Application of the piecewise parabolic method (ppm) to meteorological modeling. \sphinxstyleemphasis{Monthly Weather Review}, 118:586\textendash{}\textendash{}612, 1990. \sphinxhref{https://doi.org/https://doi.org/10.1175/1520-0493(1990)118\textless{}0586:AOTPPM\textgreater{}2.0.CO;2}{doi:https://doi.org/10.1175/1520\sphinxhyphen{}0493(1990)118\textless{}0586:AOTPPM\textgreater{}2.0.CO;2}.
\bibitem[9]{zzbibliography:colella1984}
Phillip Colella and Paul R Woodward. The Piecewise Parabolic Method (PPM) for gas\sphinxhyphen{}dynamical simulations. \sphinxstyleemphasis{Journal of Computational Physics}, 54(1):174\textendash{}201, April 1984. URL: \sphinxurl{https://www.sciencedirect.com/science/article/pii/0021999184901438}, \sphinxhref{https://doi.org/10.1016/0021-9991(84)90143-8}{doi:10.1016/0021\sphinxhyphen{}9991(84)90143\sphinxhyphen{}8}.
\bibitem[10]{zzbibliography:dukowicz2000}
John K. Dukowicz and John R. Baumgardner. Incremental Remapping as a Transport/Advection Algorithm. \sphinxstyleemphasis{Journal of Computational Physics}, 160(1):318\textendash{}335, May 2000. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S0021999100964659}, \sphinxhref{https://doi.org/10.1006/jcph.2000.6465}{doi:10.1006/jcph.2000.6465}.
\bibitem[11]{zzbibliography:durran2010}
Dale R. Durran. \sphinxstyleemphasis{Numerical Methods for Fluid Dynamics With Applications to Geophysics}. Springer\sphinxhyphen{}Verlag New York, 2010. \sphinxhref{https://doi.org/10.1007/978-1-4419-6412-0}{doi:10.1007/978\sphinxhyphen{}1\sphinxhyphen{}4419\sphinxhyphen{}6412\sphinxhyphen{}0}.
\bibitem[12]{zzbibliography:easter1993}
Richard C. Easter. Two modified versions of bott’s positive\sphinxhyphen{}definite numerical advection scheme. \sphinxstyleemphasis{Monthly Weather Review}, 121:297\textendash{}304, 1993. \sphinxhref{https://doi.org/10.1175/1520-0493(1993)121\textless{}0297:TMVOBP\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0493(1993)121\textless{}0297:TMVOBP\textgreater{}2.0.CO;2}.
\bibitem[13]{zzbibliography:fox-kemper2011}
B. Fox\sphinxhyphen{}Kemper, G. Danabasoglu, R. Ferrari, S. M. Griffies, R. W. Hallberg, M. M. Holland, M. E. Maltrud, S. Peacock, and B. L. Samuels. Parameterization of mixed layer eddies. III: Implementation and impact in global ocean climate simulations. \sphinxstyleemphasis{Ocean Modelling}, 39(1):61\textendash{}78, January 2011. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S1463500310001290}, \sphinxhref{https://doi.org/10.1016/j.ocemod.2010.09.002}{doi:10.1016/j.ocemod.2010.09.002}.
\bibitem[14]{zzbibliography:fox-kemper2008-2}
B. Fox\sphinxhyphen{}Kemper and R. Ferrari. Parameterization of mixed layer eddies. part ii: prognosis and impact. \sphinxstyleemphasis{J. Phys. Oceangraphy}, 38:1166\textendash{}1179, 2008. \sphinxhref{https://doi.org/10.1175/2007JPO3788.1}{doi:10.1175/2007JPO3788.1}.
\bibitem[15]{zzbibliography:fox-kemper2008}
B. Fox\sphinxhyphen{}Kemper, R. Ferrari, and R. Hallberg. Parameterization of mixed layer eddies. part i: theory and diagnosis. \sphinxstyleemphasis{J. Phys. Oceangraphy}, 38:1145\textendash{}1165, 2008. \sphinxhref{https://doi.org/10.1175/2007JPO3792.1}{doi:10.1175/2007JPO3792.1}.
\bibitem[16]{zzbibliography:gent1990}
Peter R. Gent and James C. Mcwilliams. Isopycnal mixing in ocean circulation models. \sphinxstyleemphasis{J. Phys. Oceanogr.}, 20:150\textendash{}155, 1990. \sphinxhref{https://doi.org/10.1175/1520-0485(1990)020\textless{}0150:IMIOCM\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0485(1990)020\textless{}0150:IMIOCM\textgreater{}2.0.CO;2}.
\bibitem[17]{zzbibliography:gent1995}
Peter R. Gent, Jurgen Willebrand, Trevor J. McDougall, and James C. McWilliams. Parameterizing Eddy\sphinxhyphen{}Induced Tracer Transports in Ocean Circulation Models. \sphinxstyleemphasis{Journal of Physical Oceanography}, 25(4):463\textendash{}474, April 1995. URL: \sphinxurl{https://journals.ametsoc.org/doi/10.1175/1520-0485\%281995\%29025\%3C0463\%3APEITTI\%3E2.0.CO\%3B2}, \sphinxhref{https://doi.org/10.1175/1520-0485(1995)025\textless{}0463:PEITTI\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0485(1995)025\textless{}0463:PEITTI\textgreater{}2.0.CO;2}.
\bibitem[18]{zzbibliography:smgbook}
Stephen M. Griffies. \sphinxstyleemphasis{Fundamentals of Ocean Climate Models}. Princeton University Press, Princeton, USA, 2004. 518+xxxiv pages.
\bibitem[19]{zzbibliography:griffies2000}
Stephen M. Griffies and Robert W. Hallberg. Biharmonic Friction with a Smagorinsky\sphinxhyphen{}Like Viscosity for Use in Large\sphinxhyphen{}Scale Eddy\sphinxhyphen{}Permitting Ocean Models. \sphinxstyleemphasis{Monthly Weather Review}, 128(8):2935\textendash{}2946, August 2000. URL: \sphinxurl{https://journals.ametsoc.org/doi/full/10.1175/1520-0493\%282000\%29128\%3C2935\%3ABFWASL\%3E2.0.CO\%3B2}, \sphinxhref{https://doi.org/10.1175/1520-0493(2000)128\textless{}2935:BFWASL\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0493(2000)128\textless{}2935:BFWASL\textgreater{}2.0.CO;2}.
\bibitem[20]{zzbibliography:hallberg1997a}
Robert Hallberg. Stable split time stepping schemes for large\sphinxhyphen{}scale ocean modeling. \sphinxstyleemphasis{Journal of Computational Physics}, 135:54\textendash{}65, 1997. \sphinxhref{https://doi.org/DOI:10.1006/jcph.1997.5734}{doi:DOI:10.1006/jcph.1997.5734}.
\bibitem[21]{zzbibliography:hallberg2000}
Robert Hallberg. Time integration of diapycnal diffusion and richardson number\textendash{}dependent mixing in isopycnal coordinate ocean models. \sphinxstyleemphasis{Monthly Weather Review}, 128:1402\textendash{}1419, 2000.
\bibitem[22]{zzbibliography:hallberg2005}
Robert Hallberg. A thermobaric instability of lagrangian vertical coordinate ocean models. \sphinxstyleemphasis{Ocean Modelling}, 2005. \sphinxhref{https://doi.org/10.1016/j.ocemod.2004.01.001}{doi:10.1016/j.ocemod.2004.01.001}.
\bibitem[23]{zzbibliography:hallberg2009}
Robert Hallberg and Alistair Adcroft. Reconciling estimates of the free surface height in Lagrangian vertical coordinate ocean models with mode\sphinxhyphen{}split time stepping. \sphinxstyleemphasis{Ocean Modelling}, 29(1):15\textendash{}26, January 2009. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S1463500309000298}, \sphinxhref{https://doi.org/10.1016/j.ocemod.2009.02.008}{doi:10.1016/j.ocemod.2009.02.008}.
\bibitem[24]{zzbibliography:hirt1997}
C. W. Hirt, A. A. Amsden, and J. L. Cook. An Arbitrary Lagrangian\sphinxhyphen{}Eulerian Computing Method for All Flow Speeds. \sphinxstyleemphasis{Journal of Computational Physics}, 135(2):203\textendash{}216, August 1997. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S0021999197957028}, \sphinxhref{https://doi.org/10.1006/jcph.1997.5702}{doi:10.1006/jcph.1997.5702}.
\bibitem[25]{zzbibliography:huynh1997}
H. T. Huynh. \sphinxstyleemphasis{Schemes and constraints for advection}. Volume 490. Springer, Berlin, Heidelberg, 1997. \sphinxhref{https://doi.org/10.1007/BFb0107151}{doi:10.1007/BFb0107151}.
\bibitem[26]{zzbibliography:jackett1995}
David R. Jackett and Trevor J. McDougall. Minimal adjustment of hydrographic profiles to achieve static stability. \sphinxstyleemphasis{J. Atmos. Ocean. Tech.}, 12:381\textendash{}389, 1995. \sphinxhref{https://doi.org/10.1175/1520-0426(1995)012\textless{}0381:MAOHPT\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0426(1995)012\textless{}0381:MAOHPT\textgreater{}2.0.CO;2}.
\bibitem[27]{zzbibliography:jackson2008}
L. Jackson, R. Hallberg, and S. Legg. A Parameterization of Shear\sphinxhyphen{}Driven Turbulence for Ocean Climate Models. \sphinxstyleemphasis{Journal of Physical Oceanography}, 38(5):1033\textendash{}1053, May 2008. URL: \sphinxurl{https://journals.ametsoc.org/doi/10.1175/2007JPO3779.1}, \sphinxhref{https://doi.org/10.1175/2007JPO3779.1}{doi:10.1175/2007JPO3779.1}.
\bibitem[28]{zzbibliography:jansen2015}
Malte F. Jansen, Alistair J. Adcroft, Robert Hallberg, and Isaac M. Held. Parameterization of eddy fluxes based on a mesoscale energy budget. \sphinxstyleemphasis{Ocean Modelling}, 92:28\textendash{}41, August 2015. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S1463500315000967}, \sphinxhref{https://doi.org/10.1016/j.ocemod.2015.05.007}{doi:10.1016/j.ocemod.2015.05.007}.
\bibitem[29]{zzbibliography:large1994}
W. G. Large, J. C. McWilliams, and S. C. Doney. Oceanic vertical mixing: A review and a model with a nonlocal boundary layer parameterization. \sphinxstyleemphasis{Reviews of Geophysics}, 32(4):363\textendash{}403, 1994. URL: \sphinxurl{https://agupubs.onlinelibrary.wiley.com/doi/abs/10.1029/94RG01872}, \sphinxhref{https://doi.org/10.1029/94RG01872}{doi:10.1029/94RG01872}.
\bibitem[30]{zzbibliography:lin1994}
Shian\sphinxhyphen{}Jiann Lin, Winston C. Chao, Y. C. Sud, and G. K. Walker. A class of the van leer\sphinxhyphen{}type transport schemes and its application to the moisture transport in a general circulation model. \sphinxstyleemphasis{Mon. Wea. Rev.}, 122:1575\textendash{}1593, 1994. \sphinxhref{https://doi.org/10.1175/1520-0493(1994)122\textless{}1575:ACOTVL\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0493(1994)122\textless{}1575:ACOTVL\textgreater{}2.0.CO;2}.
\bibitem[31]{zzbibliography:marshall2010}
D. P. Marshall and A. J. Adcroft. Parameterization of ocean eddies: potential vorticity mixing, energetics and arnold first stability theorem. \sphinxstyleemphasis{Ocean Modelling}, 32:188\textendash{}204, 2010. \sphinxhref{https://doi.org/10.1016/j.ocemod.2010.02.001}{doi:10.1016/j.ocemod.2010.02.001}.
\bibitem[32]{zzbibliography:mcdougall2001}
Trevor J. McDougall and Peter C. McIntosh. The Temporal\sphinxhyphen{}Residual\sphinxhyphen{}Mean Velocity. Part II: Isopycnal Interpretation and the Tracer and Momentum Equations. \sphinxstyleemphasis{Journal of Physical Oceanography}, 31(5):1222\textendash{}1246, May 2001. URL: \sphinxurl{https://journals.ametsoc.org/doi/10.1175/1520-0485\%282001\%29031\%3C1222\%3ATTRMVP\%3E2.0.CO\%3B2}, \sphinxhref{https://doi.org/10.1175/1520-0485(2001)031\textless{}1222:TTRMVP\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0485(2001)031\textless{}1222:TTRMVP\textgreater{}2.0.CO;2}.
\bibitem[33]{zzbibliography:melet2012}
Angelique Melet, Robert Hallberg, Sonya Legg, and Kurt Polzin. Sensitivity of the Ocean State to the Vertical Distribution of Internal\sphinxhyphen{}Tide\sphinxhyphen{}Driven Mixing. \sphinxstyleemphasis{Journal of Physical Oceanography}, 43(3):602\textendash{}615, December 2012. URL: \sphinxurl{https://journals.ametsoc.org/doi/full/10.1175/JPO-D-12-055.1}, \sphinxhref{https://doi.org/10.1175/JPO-D-12-055.1}{doi:10.1175/JPO\sphinxhyphen{}D\sphinxhyphen{}12\sphinxhyphen{}055.1}.
\bibitem[34]{zzbibliography:millero1978}
F.J. Millero. Freezing point of seawater. In \sphinxstyleemphasis{Eight report of the Joint Panel on Oceanographic Tables and Standards (JPOTS)}, number 28, 29\textendash{}35. UNESCO technical papers in marine sciences, 1978. Annex 6. URL: \sphinxurl{https://www.researchgate.net/publication/292574579\_Freezing\_point\_of\_seawater}.
\bibitem[35]{zzbibliography:polzin2009}
Kurt L. Polzin. An abyssal recipe. \sphinxstyleemphasis{Ocean Modelling}, 30(4):298\textendash{}309, January 2009. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S1463500309001565}, \sphinxhref{https://doi.org/10.1016/j.ocemod.2009.07.006}{doi:10.1016/j.ocemod.2009.07.006}.
\bibitem[36]{zzbibliography:reichl2018}
Brandon G. Reichl and Robert Hallberg. A simplified energetics based planetary boundary layer (ePBL) approach for ocean climate simulations. \sphinxstyleemphasis{Ocean Modelling}, 132:112\textendash{}129, December 2018. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S1463500318301069}, \sphinxhref{https://doi.org/10.1016/j.ocemod.2018.10.004}{doi:10.1016/j.ocemod.2018.10.004}.
\bibitem[37]{zzbibliography:roquet2015}
F. Roquet, G. Madec, T. J. McDougall, and P. M. Barker. Accurate polynomial expressions for the density and specific volume of seawater using the teos\sphinxhyphen{}10 standard. \sphinxstyleemphasis{Ocean Modelling}, 90:29\textendash{}43, 2015.
\bibitem[38]{zzbibliography:russell1981}
Gary L. Russell and Jean A. Lerner. A new finite\sphinxhyphen{}differencing scheme for the tracer transport equation. \sphinxstyleemphasis{Journal of Applied Meteorology}, 20:1483\textendash{}1498, 1981. \sphinxhref{https://doi.org/10.1175/1520-0450(1981)020\textless{}1483:ANFDSF\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0450(1981)020\textless{}1483:ANFDSF\textgreater{}2.0.CO;2}.
\bibitem[39]{zzbibliography:sadourny1975}
Robert Sadourny. The Dynamics of Finite\sphinxhyphen{}Difference Models of the Shallow\sphinxhyphen{}Water Equations. \sphinxstyleemphasis{Journal of the Atmospheric Sciences}, 32(4):680\textendash{}689, April 1975. URL: \sphinxurl{https://journals.ametsoc.org/doi/abs/10.1175/1520-0469\%281975\%29032\%3C0680\%3ATDOFDM\%3E2.0.CO\%3B2}, \sphinxhref{https://doi.org/10.1175/1520-0469(1975)032\textless{}0680:TDOFDM\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0469(1975)032\textless{}0680:TDOFDM\textgreater{}2.0.CO;2}.
\bibitem[40]{zzbibliography:shao2019-in-review}
Andrew Shao, Alistair Adcroft, Robert Hallberg, and Stephen Griffies. A new, general\sphinxhyphen{}coordinate, non\sphinxhyphen{}local neutral diffusion operator. 2019.
\bibitem[41]{zzbibliography:shchepetkin2005}
A. F. Shchepetkin and J. C. McWilliams. The regional ocean modeling system (roms): a split\sphinxhyphen{}explicit, free\sphinxhyphen{}surface, topography\sphinxhyphen{}following coordinates oceanic model. \sphinxstyleemphasis{Ocean Modeling}, 9:347\textendash{}404, 2005.
\bibitem[42]{zzbibliography:st-laurent2002}
L. C. St Laurent, H. L. Simmons, and S. R. Jayne. Estimating tidally driven mixing in the deep ocean. \sphinxstyleemphasis{Geophysical Research Letters}, 29(23):21\textendash{}1\textendash{}21\textendash{}4, December 2002. URL: \sphinxurl{https://agupubs.onlinelibrary.wiley.com/doi/abs/10.1029/2002GL015633}, \sphinxhref{https://doi.org/10.1029/2002GL015633}{doi:10.1029/2002GL015633}.
\bibitem[43]{zzbibliography:sun1999}
Shan Sun, Rainer Bleck, Claes Rooth, John Dukowicz, Eric Chassignet, and Peter Killworth. Inclusion of thermobaricity in isopycnic\sphinxhyphen{}coordinate ocean models. \sphinxstyleemphasis{Journal of Physical Oceanography}, 29:2719\textendash{}2729, 1999.
\bibitem[44]{zzbibliography:gvbook}
Geoffrey K. Vallis. \sphinxstyleemphasis{Atmospheric and Oceanic Fluid Dynamics: Fundamentals and Large\sphinxhyphen{}scale Circulation}. Cambridge University Press, Cambridge, 2nd edition, 2017. 946 + xxv pp.
\bibitem[45]{zzbibliography:visbeck1997}
Martin Visbeck, John Marshall, Tom Haine, and Mike Spall. Specification of eddy transfer coefficients in coarse\sphinxhyphen{}resolution ocean circulation models. \sphinxstyleemphasis{J. Phys. Oceanogr.}, 27:381\textendash{}402, 1997. \sphinxhref{https://doi.org/10.1175/1520-0485(1997)027\textless{}0381:SOETCI\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0485(1997)027\textless{}0381:SOETCI\textgreater{}2.0.CO;2}.
\bibitem[46]{zzbibliography:white2008}
Laurent White and Alistair Adcroft. A high\sphinxhyphen{}order finite volume remapping scheme for nonuniform grids: The piecewise quartic method (PQM). \sphinxstyleemphasis{Journal of Computational Physics}, 227(15):7394\textendash{}7422, July 2008. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S0021999108002593}, \sphinxhref{https://doi.org/10.1016/j.jcp.2008.04.026}{doi:10.1016/j.jcp.2008.04.026}.
\bibitem[47]{zzbibliography:white2009}
Laurent White, Alistair Adcroft, and Robert Hallberg. High\sphinxhyphen{}order regridding\sphinxhyphen{}remapping schemes for continuous isopycnal and generalized coordinates in ocean models. \sphinxstyleemphasis{Journal of Computational Physics}, 228(23):8665\textendash{}8692, December 2009. URL: \sphinxurl{http://www.sciencedirect.com/science/article/pii/S0021999109004628}, \sphinxhref{https://doi.org/10.1016/j.jcp.2009.08.016}{doi:10.1016/j.jcp.2009.08.016}.
\bibitem[48]{zzbibliography:wright1997}
Daniel G. Wright. An Equation of State for Use in Ocean Models: Eckart’s Formula Revisited. \sphinxstyleemphasis{Journal of Atmospheric and Oceanic Technology}, 14(3):735\textendash{}740, June 1997. URL: \sphinxurl{https://journals.ametsoc.org/doi/abs/10.1175/1520-0426\%281997\%29014\%3C0735\%3AAEOSFU\%3E2.0.CO\%3B2}, \sphinxhref{https://doi.org/10.1175/1520-0426(1997)014\textless{}0735:AEOSFU\textgreater{}2.0.CO;2}{doi:10.1175/1520\sphinxhyphen{}0426(1997)014\textless{}0735:AEOSFU\textgreater{}2.0.CO;2}.
\bibitem[49]{zzbibliography:teos2010}
IOC, SCOR, and IAPSO. \sphinxstyleemphasis{The international thermodynamic equation of seawater\sphinxhyphen{}2010: calculation and use of thermodynamic properties}. Intergovernmental Oceanographic Commission, Manuals and Guides No. 56, UNESCO, edition, 2010. 196pp.
\end{sphinxthebibliography}


\renewcommand{\indexname}{Fortran Module Index}
\begin{sphinxtheindex}
\let\bigletter\sphinxstyleindexlettergroup
\bigletter{m}
\item\relax\sphinxstyleindexentry{mom}\sphinxstyleindexpageref{api/generated/modules/mom:\detokenize{f/mom}}
\item\relax\sphinxstyleindexentry{mom\_ale}\sphinxstyleindexpageref{api/generated/modules/mom_ale:\detokenize{f/mom_ale}}
\item\relax\sphinxstyleindexentry{mom\_eos}\sphinxstyleindexpageref{api/generated/modules/mom_eos:\detokenize{f/mom_eos}}
\item\relax\sphinxstyleindexentry{mom\_ice\_shelf}\sphinxstyleindexpageref{api/generated/modules/mom_ice_shelf:\detokenize{f/mom_ice_shelf}}
\item\relax\sphinxstyleindexentry{mom\_meke}\sphinxstyleindexpageref{api/generated/modules/mom_meke:\detokenize{f/mom_meke}}
\item\relax\sphinxstyleindexentry{mom\_unit\_scaling}\sphinxstyleindexpageref{api/generated/modules/mom_unit_scaling:\detokenize{f/mom_unit_scaling}}
\end{sphinxtheindex}

\renewcommand{\indexname}{Index}
\printindex
\end{document}