<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.18">
  <compounddef id="Discrete_PG" kind="page">
    <compoundname>Discrete_PG</compoundname>
    <title>Discrete Pressure Gradient Term</title>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
<sect1 id="Discrete_PG_1section_PG">
<title>Pressure Gradient Term</title>
<para>Following <ref refid="citelist_1CITEREF_adcroft2008" kindref="member">[2]</ref>, the horizontal momentum equation in the general coordinate <formula id="1">$r$</formula> can be written as: <formula id="119">\[ \frac{\partial \vec{u}}{\partial t} + \nabla_r \Phi + \alpha \nabla_r p = \cal{F} \]</formula> where the vector <formula id="120">$\cal{F}$</formula> represents all the forcing terms other than the pressure gradient. Here, <formula id="121">$\vec{u}$</formula> is the horizontal component of the velocity, <formula id="122">$\Phi$</formula> is the geopotential: <formula id="123">\[ \Phi = gz \]</formula> <formula id="124">$\alpha = 1/\rho$</formula> is the specific volume and <formula id="125">$p$</formula> is the pressure. The gradient operator is a gradient along the coordinate surface <formula id="1">$r$</formula>.</para>
<para>MOM6 offers two options, an older one using a Montgomery potential as described in <ref refid="citelist_1CITEREF_hallberg1997" kindref="member">[18]</ref> and <ref refid="citelist_1CITEREF_sun1999" kindref="member">[34]</ref>. However, it can have the instability described in <ref refid="citelist_1CITEREF_hallberg2005" kindref="member">[20]</ref>. The version described here is that in <ref refid="citelist_1CITEREF_adcroft2008" kindref="member">[2]</ref> and is the recommended option (ANALYTIC_FV_PGF = True). The paper describes the Boussinesq form while the code supports that and also a non-Boussinesq form.</para>
<para>In two dimensions ( <formula id="111">$x$</formula> and <formula id="125">$p$</formula>), we can integrate the zonal component of the momentum equation above over a finite volume:</para>
<para><formula id="126">\begin{eqnarray} - \int dx \int dp \frac{\partial u}{\partial t} &amp;= \int dx \int dp \left. \frac{\partial \Phi}{\partial x}\right|_p \\ &amp;= \int_{p_{br}}^{p_{tr}} \Phi dp + \int_{p_{tr}}^{p_{tl}} \Phi dp + \int_{p_{tl}}^{p_{bl}} \Phi dp &amp;+ \int_{p_{bl}}^{p_{br}} \Phi dp \label{eq:PG_loop} \end{eqnarray}</formula></para>
<para>We convert to line integrals thanks to the Leibniz rule. See the figure for the location of the line integral ranges:</para>
<para><image type="html" name="PG_loop.png">Schematic of the finite volume used for integrating the \f$u\f$-component of momentum. The thermodynamic variables \f$\theta\f$ and \f$s\f$ 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 \f$(x, p)\f$ space so \f$p\f$ is linear around the volume but \f$\Phi\f$ can vary arbitrarily along the edges.</image>
 <latexonly>\begin{DoxyImage}\n\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{PG_loop.png}\n\doxyfigcaption{Schematic of the finite volume used for integrating the $u$-component of momentum. The thermodynamic variables $\theta$ 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 $\Phi$ can vary arbitrarily along the edges.}\n\end{DoxyImage}</latexonly><image type="latex" name="PG_loop.png">Schematic of the finite volume used for integrating the $u$-component of momentum. The thermodynamic variables $\theta$ 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 $\Phi$ can vary arbitrarily along the edges.</image></para>
<para>The only approximations made are (i) that the potential temperature <formula id="127">$\theta$</formula> and the salinity <formula id="128">$s$</formula> can be represented continuously in the vertical within each layer although discontinuities between layers are allowed and (ii) that <formula id="127">$\theta$</formula> and <formula id="128">$s$</formula> can be represented continuously along each layer. MOM6 has options for piecewise constant (PCM), piecewise linear (PLM), and piecewise parabolic (PPM) in the vertical.</para>
<para>If we use the Wright equation of state (<ref refid="citelist_1CITEREF_wright1997" kindref="member">[38]</ref>), we can integrate the above integrals analytically. This equation of state can be written as:</para>
<para><formula id="129">\[ \alpha(s, \theta, p) = A(s, \theta) + \frac{\lambda(s, \theta)}{P(s, \theta) + p} \]</formula></para>
<para>where <formula id="130">$A, \lambda$</formula> and <formula id="131">$P$</formula> are functions only of <formula id="128">$s$</formula> and <formula id="127">$\theta$</formula>. The integral form of hydrostatic balance is:</para>
<para><formula id="132">\[ \Phi(p_t) - \Phi(p_b) = \int_{p_t}^{p_b} \alpha(s, \theta, p) dp \]</formula></para>
<para>Assuming piecewise constant values for <formula id="127">$\theta$</formula> and <formula id="128">$s$</formula> and the above equation of state, we get: <formula id="133">\begin{eqnarray} \Phi(p_t) - \Phi(p_b) &amp;= \int_{p_t}^{p_b} \alpha(s, \theta, p) dp \\ &amp;= (p_b - p_t) A + \lambda \ln \left| \frac{P + p_b}{P + p_t} \right| \\ &amp;= \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}</formula> which is the exact solution for the continuum only if <formula id="127">$\theta$</formula> and <formula id="128">$s$</formula> are uniform in the interval <formula id="134">$p_t$</formula> to <formula id="135">$p_b$</formula>. Here, we have introduced the variables: <formula id="136">\[ \Delta p = p_b - p_t \]</formula> <formula id="137">\[ \overline{p} = \frac{1}{2}(p_t + p_b) \]</formula> and <formula id="138">\[ \epsilon = \frac{\Delta p}{2 (P + \overline{p})} \]</formula> We will show later that <formula id="139">$\epsilon \ll 1$</formula>. Note the series expansion:</para>
<para><formula id="140">\[ \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 \]</formula></para>
<para>Typical values for the deep ocean with 100 m layer thickness are <formula id="141">$6 \times 10^8$</formula> Pa and <formula id="142">$10^6$</formula> Pa, respectively, yielding <formula id="143">$\epsilon \sim 8 \times 10^{-4}$</formula> and a corresponding accuracy in the geopotential height calculation of <formula id="144">$\frac{\lambda \epsilon^3}{g} \sim 10^{-5}$</formula> m. For this value of <formula id="145">$\epsilon$</formula>, 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, <formula id="146">$\Delta p \sim 6 \times 10^7$</formula> Pa (limited by the depth of the ocean) for which <formula id="147">$\epsilon \sim 0.04$</formula> with geopotential height errors of order 1 m. In this case, the series converges to machine precision with six terms.</para>
<para>The finite volume acceleration is expression terms of four integrals around the volume, <formula id="148">$\int \Phi dp$</formula>. The side integrals can be calculated by direct integration of <latexonly>\ref{eq:PG_vert}</latexonly><htmlonly>&amp;nbsp;\eqref{eq:PG_vert}</htmlonly> \\eqref{eq:PG_vert}, which gives: <formula id="149">\begin{eqnarray} \int_{p_t}^{p_b} \Phi dp &amp;= \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) \\ &amp;= \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) \\ &amp;= \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}</formula> where <formula id="150">$\Phi, \Delta p, P, A$</formula> and <formula id="151">$\lambda$</formula> are each evaluated on the left or right side of the volume.</para>
<para>The top and bottom integrals in<latexonly> \ref{eq:PG_loop}</latexonly><htmlonly> &amp;nbsp;\eqref{eq:PG_loop}</htmlonly> \\eqref{eq:PG_loop} must allow for the effect of varying <formula id="127">$\theta$</formula> and <formula id="128">$s$</formula> on <formula id="130">$A, \lambda$</formula> and <formula id="131">$P$</formula>. We evaluate these integrals numerically using sixth-order quadrature; Boole&apos;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 <formula id="152">$A, P$</formula> and <formula id="151">$\lambda$</formula> between the end points, which seems to make very little difference to the solution. We also verified that tenth-order quadrature makes little difference to the solution. The values of the top and bottom integrals are carried upward in a hydrostatic-like integration, obtained as follows:</para>
<para><formula id="153">\begin{eqnarray} \int_{p_{tl}}^{p_{tr}} \Phi_t dp &amp;= (p_{tr} - p_{tl}) \int_0^1 \Phi_t dx \\ &amp;= (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 \\ &amp;= (p_{tr} - p_{tl}) \int_0^1 \Phi_b dx \\ &amp;+ \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}</formula></para>
<para>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.</para>
<para>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-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. </para>
</sect1>
    </detaileddescription>
  </compounddef>
</doxygen>
