Horizontal diffusion of tracers

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

\label{Horizontal_Diffusion_eddy_flux}%
\Hypertarget{Horizontal_Diffusion_eddy_flux}%

\begin{DoxyImage}
\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{eddy_fluxes.png}
\doxyfigcaption{Horizontal surface boundary layer fluxes and interior epineutral fluxes.}
\end{DoxyImage}
 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.\hypertarget{Horizontal_Diffusion_Epineutral_Diffusion}{}\section{Epineutral Diffusion}\label{Horizontal_Diffusion_Epineutral_Diffusion}
For the interior of the ocean, we would like to have horizontal diffusion with the following properties\+:

\begin{DoxyItemize}
\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{DoxyItemize}
The algorithm used in M\+O\+M6 is described by \cite{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{DoxyImage}
\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{shao0.png}
\doxyfigcaption{Polynomial reconstructions, starting with piecewise constant on the left, piecewise linear in the middle and piecewise parabolic on the right.}
\end{DoxyImage}
 Some desired quantities for the polynomial reconstructions to be used are\+:

\begin{DoxyItemize}
\item Tracer concentrations represent the cell-\/averages in vertical discretization. \item Must be monotonic and introduce no new extrema. \item Discontinuous reconstructions are desirable to limit intracell slopes.\end{DoxyItemize}
The algorithm has three phases\+: initialization, sorting, and flux calculation.\hypertarget{Horizontal_Diffusion_Epineutral_Initialization}{}\subsection{Initialization}\label{Horizontal_Diffusion_Epineutral_Initialization}
We begin by generating polynomial reconstructions of the vertical tracer quantities such as shown by the blue lines here\+:


\begin{DoxyImage}
\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{shao1.png}
\doxyfigcaption{Polynomial reconstructions of two adjacent water columns.}
\end{DoxyImage}
 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.\hypertarget{Horizontal_Diffusion_Epineutral_Sorting}{}\subsection{Sorting}\label{Horizontal_Diffusion_Epineutral_Sorting}
The epineutral surfaces have constant density, where we use this equation\+:

\[ \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) \]

When calculating $\alpha$ and $\beta$, there\textquotesingle{}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{DoxyImage}
\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{shao2.png}
\doxyfigcaption{Searching the column with the lighter surface for the water matching the other column\textquotesingle{}s surface water.}
\end{DoxyImage}
 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{DoxyItemize}
\item Use Newton\textquotesingle{}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{DoxyItemize}
Once the location of the first column\textquotesingle{}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.\hypertarget{Horizontal_Diffusion_Epineutral_Flux_Calculation}{}\subsection{Flux Calculation}\label{Horizontal_Diffusion_Epineutral_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\+:

\[ F = K h_{\mbox{eff}} \frac{\overline{C_{j,k+1}} - \overline{C_{j+1,k-1}} }{\Delta x} \Delta t \]

where the effective thickness of the sublayer is\+:

\[ h_{\mbox{eff}} = \frac{2 h_{j,n}^\gamma h_{j,n+1}^\gamma}{h_{j,n}^\gamma + h_{j,n+1}^\gamma} \]

and as shown in this figure\+:

\begin{DoxyImage}
\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{shao3.png}
\doxyfigcaption{Diagram of sublayer thickness for the sublayer bounded by surfaces $\gamma_n$ and $\gamma_{n+1}$.}
\end{DoxyImage}

\begin{DoxyImage}
\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{shao4.png}
\doxyfigcaption{Flux of tracer $C$ along the sublayer.}
\end{DoxyImage}

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


\begin{DoxyImage}
\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{shao5.png}
\doxyfigcaption{Accumulate all the fluxes across a face from all the layers in the next column contributing to it.}
\end{DoxyImage}
 \hypertarget{Horizontal_Diffusion_Surface_Diffusion}{}\section{Surface Diffusion}\label{Horizontal_Diffusion_Surface_Diffusion}
As shown in figure \hyperlink{Horizontal_Diffusion_eddy_flux}{eddy\+\_\+flux} 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-\/by-\/layer approach has been implemented instead. It is this layer-\/by-\/layer code which is described here.

For each water column, the boundary layer thickness is determined first. This can be either via the C\+V\+M\+IX 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{DoxyImage}
\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{sbl1.png}
\doxyfigcaption{Two cells within the surface mixed layer, red on the left, blue on the right. The mixed layer depth is shown in green.}
\end{DoxyImage}
 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-\/by-\/layer scheme computes fluxes for the first two layers, then has linearly reduced fluxes for the next two layers below as shown here\+:


\begin{DoxyImage}
\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{sbl2.png}
\doxyfigcaption{Two cells within the surface mixed layer with down-\/gradient fluxes as shown by the black arrows.}
\end{DoxyImage}
 In all cases, the tracer flux is always down-\/gradient.

\[ F(k) = K h_{\mbox{eff}(k)} \left[ \phi_L(k) - \phi_R(k)\right] \]

where the effective thickness of the layer $k$ is\+:

\[ h_{\mbox{eff}(k)} = \frac{2 h_{L}(k) h_{R}(k)} {h_{L}(k) + h_{R}(k)} \] 