Numerical Solution Technique

Horizontal Discretization

In the horizontal, the REMORA governing equations are discretized over a boundary-fitted, orthogonal curvilinear coordinates \(\left(\xi,\eta\right)\) grid. The general formulation of the curvilinear coordinates system allows Cartesian, polar, and spherical coordinates applications. The transformation of any of these coordinates to REMORA \(\left(\xi,\eta\right)\) grid is specified in the metric terms (pm, pn).

The model state variables are staggered using an Arakawa C-grid. As illustrated below, the free-surface (zeta), density (rho), and active/passive tracers (t) are located at the center of the cell whereas the horizontal velocity (u and v) are located at the west/east and south/north edges of the cell, respectively. That is, the density is evaluated between points where the currents are evaluated.

Staggered Horizontal Grid

_images/staggered_grid_rho_cells.png

In REMORA all the state arrays are dimensioned the same size to facilitate parallelization. However, the computational ranges for all the state variables are:

Grid Cell

_images/grid_cell.png

Variable

Interior Range

Full Range

\(\rho\text{-type}\)

1:Lm(ng),1:Mm(ng)

0:L(ng),0:M(ng)

\(\psi\text{-type}\)

2:Lm(ng),2:Mm(ng)

1:L(ng),1:M(ng)

\(\text{u-type}\)

2:Lm(ng),1:Mm(ng)

1:L(ng),0:M(ng)

\(\text{v-type}\)

1:Lm(ng),2:Mm(ng)

0:L(ng),1:M(ng)

Vertical Discretization

The REMORA governing equations are discretized over variable topography using a stretched, terrain-following, vertical coordinate. As a result, each grid cell may have different level thickness (Hz) and volume. The model state variables are vertically staggered so that horizontal momentum (u, v), (rho), and active/passive tracers (t) are located at the center of the grid cell. The vertical velocity (omega, w) and vertical mixing variables (Akt, Akv, etc) are located at the bottom and top faces of the cell. See diagram below.

Vieste-Dubrovnik Transect

_images/vieste-dubrovnik.png

Staggered Vertical Grid

_images/vertical_grid.png

In this diagram, indices are 1-indexed (as in ROMS), while the indices in REMORA are 0-indexed.

The total thickness of the water column is \(\zeta\left(i,j\right)+h\left(i,j\right)\). The bathymetry (h) is usually time invariant whereas the free-surface (zeta) evolves in time. At input and output, the bathymetry is always a positive quantity. However, the depths z_r(i,j,k) and z_w(i,j,k) are negative for all locations below the mean sea level.

Grid Variables

Variable

Variable in Code

Definition

Location

Origin

m

x-dir coordinate

corners

n

y-dir coordinate

corners

\(\xi\)

transformed x-dir orthogonal curvilinear coordinate

corners

\(\eta\)

transformed y-dir orthogonal curvilinear coordinate

corners

\(\zeta\)

free-surface

center

\(\rho\)

rho

density

center

equation of state

\(t\)

active/passive tracers

center

\(u\)

vec_Huon

x-dir horizontal velocity

west/east faces

\(v\)

vec_Hvom

y-dir horizontal velocity

north/south faces

\(\overline{u}\)

vec_ubar

x-dir vertically integrated momentum

west/east faces

\(\overline{v}\)

vec_vbar

y-dir vertically integrated momentum

west/east faces

\(\psi\)

corners

\(H_z\)

vec_Hz

level thickness

center

\(\omega\)

vertical velocity

bottom/top faces

\(w\)

vertical velocity

bottom/top faces

Akt

vec_Akv

vertical mixing

bottom/top faces

Akv

vertical mixing

bottom/top faces

\(h\)

vec_hOfTheConfusingName

bathymetry (always positive)

\(z_{r\left(i,j,k\right)}\)

depth (negative below sea level)

center

\(z_{w\left(i,j,k\right)}\)

depth (negative below sea level)

bottom/top faces

\(T\)

vec_t3

temperature

\(S\)

vec_s3

salinity

\(D_{crit}\)

critical depth

\(D\)

total water depth

\(C\)

concentration

\(\delta_{\xi}\)

centered finite-difference approximation of \(\Delta\xi\)

\(\delta_{\eta}\)

centered finite-difference approximation of \(\Delta\eta\)

\(\delta_{\sigma}\)

centered finite-difference approximation of \(\Delta\sigma\)

\(\Delta_{\xi}\)

transformed x-dir differential distance

\(\Delta_{\eta}\)

transformed y-dir differential distance

\(\Delta_{\sigma}\)

vec_s_r

transformed z-dir differential distance

\(\Delta_{z}\)

vertical distance from one \(\rho\) to another

\(\overline{\left(\qquad\right)}^{\xi}\)

average taken over \(\Delta\xi\)

\(\overline{\left(\qquad\right)}^{\eta}\)

average taken over \(\Delta\eta\)

\(\overline{\left(\qquad\right)}^{\sigma}\)

average taken over \(\Delta\sigma\)

\(\Delta V\)

grid box volume

Conservation Properties

From Shchepetkin and McWilliams (2005), we have a tracer concentration equation in advective form:

(1)\[\frac{\partial C}{\partial t}+\left(u\cdot\nabla\right)C=0\]

and also a tracer concentration equation in conservation form:

(2)\[\frac{\partial C}{\partial t}+\nabla\cdot\left(uC\right)=0.\]

The continuity equation:

(3)\[\left(\nabla\cdot u\right)=0\]

can be used to get from one tracer equation to the other. As a consequence of eq. (1), if the tracer is spatially uniform, it will remain so regardless of the velocity field (constancy preservation). On the other hand, as a consequence of (2), the volume integral of the tracer concentration is conserved in the absence of internal sources and fluxes through the boundary. Both properties are valuable and should be retained when constructing numerical ocean models.

The semi-discrete form of the tracer equation is:

(4)\[\begin{split}\frac{\partial}{\partial t}\left(\frac{H_zC}{mn}\right)+\delta_{\xi}\left(\frac{u\overline{H_z}^{\xi}\overline{C}^{\xi}}{\overline{n}^{\xi}}\right)+\delta_{\eta}\left(\frac{v\overline{H_z}^{\eta}\overline{C}^{\eta}}{\overline{m}^{\eta}}\right)+\delta_{\sigma}\left(\overline{C}^{\sigma}\frac{H_z\Omega}{mn}\right)= \\ \frac{1}{mn}\frac{\partial}{\partial\sigma}\left(\frac{K_m}{\Delta z}\frac{\partial C}{\partial\sigma}\right)+\mathcal{D}_C+\mathcal{F}_C\end{split}\]

Here \(\delta_{\xi},\delta_{\eta}\) and \(\delta_{\sigma}\) denote simple centered finite-difference approximations to \(\partial/\partial\xi,\partial/\partial\eta\) and \(\partial/\partial\sigma\) with the differences taken over the distances \(\Delta\xi,\Delta\eta\) and \(\Delta\sigma\), respectively. \(\Delta z\) is the vertical distance from one \(\rho\) point to another. \(\overline{\left(\qquad\right)}^{\xi}, \overline{\left(\qquad\right)}^{\eta}\) and \(\overline{\left(\qquad\right)}^{\sigma}\) represent averages taken over the distances \(\Delta\xi,\Delta\eta\) and \(\Delta\sigma\).

The finite volume version of the same equation is no different, except that a quantity \(C\) is defined as the volume-averaged concentration over the grid box \(\Delta V\):

\[C=\frac{mn}{H_z}\int_{\Delta V}\frac{H_z C}{mn}\delta\xi\ \delta\eta\ \delta\sigma\]

The quantity \(\left(\dfrac{u\overline{H_z}^{\xi}\overline{C}^{\xi}}{\overline{n}^{\xi}}\right)\) is the flux through an interface between adjacent grid boxes.

This method of averaging was chosen because it internally conserves first moments in the model domain, although it is still possible to exchange mass and energy through the open boundaries. The method is similar to that used in Arakawa and Lamb; though their scheme also conserves enstrophy. Instead, we will focus on (nearly) retaining constancy preservation while coupling the barotropic (depth-integrated) equations and the baroclinic equations.

The timestep in eq. (4) is assumed to be from time \(n\) to time \(n+1\), while the other terms being evaluated at time \(n+1/2\) for second-order accuracy. Setting \(C\) to \(1\) everywhere reduces eq. (4) to:

(5)\[\frac{\partial}{\partial t}\left(\frac{H_z}{mn}\right)+\delta_{\xi}\left(\frac{u\overline{H_z}^{\xi}}{\overline{n}^{\xi}}\right)+\delta_{\eta}\left(\frac{v\overline{H_z}^{\eta}}{\overline{m}^{\eta}}\right)+\delta_{\sigma}\left(\frac{H_z\Omega}{mn}\right)=0\]

If this equation holds true for the step from time \(n\) to time \(n+1\), then constancy preservation will hold.

In a hydrostatic model such as REMORA, the discrete continuity equation is needed to compute vertical velocity rather than grid-box volume \(\dfrac{H_z}{mn}\) (the latter is controlled by changes in \(\zeta\) in the barotropic mode computations). Here, \(\dfrac{H_z\Omega}{mn}\) is the finite-volume flux across the moving grid-box interface, vertically on the \(w\) grid.

The vertical integral of the continuity equation (5), using the vertical boundary conditions on \(\Omega\), is:

(6)\[\frac{\partial}{\partial t}\left(\frac{\zeta}{mn}\right)+\delta_{\xi}\left(\frac{\overline{u}\overline{D}^{\xi}}{\overline{n}^{\xi}}\right)+\delta_{\eta}\left(\frac{\overline{v}\overline{D}^{\eta}}{\overline{m}^{\eta}}\right)=0\]

where \(\zeta\) is the surface elevation, \(D=h+\zeta\) is the total depth, and \(\overline{u},\overline{v}\) are the depth-integrated horizontal velocities. This equation and the corresponding 2-D momentum equations are timestepped on a shorter timestep than eq.(4) and the other 3-D equations. Due to the details in the mode coupling, it is only possible to maintain constancy preservation to the accuracy of the barotropic timesteps.

Depth-Integrated Equations

The depth average of a quantity \(A\) is given by:

(7)\[\overline{A}=\frac{1}{D}\int_{-1}^0H_zA\ d\sigma\]

where the overbar indicates a vertically averaged quantity and

(8)\[D\equiv\zeta\left(\xi,\eta,t\right)+h\left(\xi,\eta\right)\]

is the total depth of the water column. The vertical integral of the momentum equations are:

(9)\[\begin{split}\frac{\partial}{\partial t}\left(\frac{D\overline{u}}{mn}\right)+\frac{\partial}{\partial\xi}\left(\frac{D\overline{uu}}{n}\right)+\frac{\partial}{\partial\eta}\left(\frac{D\overline{uv}}{m}\right)-&\frac{Df\overline{v}}{mn}\\ -\left[\overline{vv}\frac{\partial}{\partial\xi}\left(\frac{1}{n}\right)-\overline{uv}\frac{\partial}{\partial\eta}\left(\frac{1}{m}\right)\right]D=-\frac{D}{n}&\left(\frac{\partial\overline{\phi_2}}{\partial\xi}+g\frac{\partial\zeta}{\partial\xi}\right)\\ +\frac{D}{mn}\left(\overline{\mathcal{F}}_u+\overline{\mathcal{D}}_{h_u}\right)&+\frac{1}{mn}\left(\tau^{\xi}_s-\tau^{\xi}_b\right)\end{split}\]

and

(10)\[\begin{split}\frac{\partial}{\partial t}\left(\frac{D\overline{v}}{mn}\right)+\frac{\partial}{\partial\xi}\left(\frac{D\overline{uv}}{n}\right)+\frac{\partial}{\partial\eta}\left(\frac{D\overline{vv}}{m}\right)+&\frac{Df\overline{u}}{mn}\\ +\left[\overline{uv}\frac{\partial}{\partial\xi}\left(\frac{1}{n}\right)-\overline{uu}\frac{\partial}{\partial\eta}\left(\frac{1}{m}\right)\right]D=-\frac{D}{m}&\left(\frac{\partial\overline{\phi_2}}{\partial\eta}+g\frac{\partial\zeta}{\partial\eta}\right)\\ +\frac{D}{mn}\left(\overline{\mathcal{F}}_v+\overline{\mathcal{D}}_{h_v}\right)+&\frac{1}{mn}\left(\tau_s^{\eta}-\tau_b^{\eta}\right)\end{split}\]

where \(\phi_2\) includes the \(\frac{\partial z}{\partial\xi}\) term, \(\overline{\mathcal{D}}_{h_u}\) is the horizontal viscosity, and the vertical viscosity only contributes through the upper and lower boundary conditions. We also need the vertical integral of the continuity equation, shown above as eq. (6). The presence of a free surface introduces waves which propagate at a speed of \(\sqrt{gh}\). These waves usually impose a more severe time-step limit than any of the internal processes. We have therefore chosen to solve the full equations by means of a split time step. In other words, the depth integrated equations (9), (10), and (6) are integrated using a short time step and the values of \(\overline{u}\) and \(\overline{v}\) are used to replace those found by integrating the full equations on a longer time step. A diagram of the barotropic time stepping is shown here:

_images/Shortstep.png

Some of the terms in equations (9) and (10) are updated on the short time step while others are not. The contributions from the slow terms are computed once per long time step and stored. If we call these terms \(R_{u_{\text{slow}}}\) and \(R_{v_{\text{slow}}}\), equations (9) and (10) become:

(11)\[\begin{split}\frac{\partial}{\partial t}\left(\frac{D\overline{u}}{mn}\right)+\frac{\partial}{\partial\xi}\left(\frac{D\overline{u}\,\overline{u}}{n}\right)+\frac{\partial}{\partial\eta}\left(\frac{D\overline{u}\,\overline{v}}{m}\right)&-\frac{Df\overline{v}}{mn}\\ -\left[\overline{v}\,\overline{v}\frac{\partial}{\partial\xi}\left(\frac{1}{n}\right)-\overline{u}\,\overline{v}\frac{\partial}{\partial\eta}\left(\frac{1}{m}\right)\right]D&=R_{u_{\text{slow}}}-\frac{gD}{n}\frac{\partial\zeta}{\partial\xi}+\frac{D}{mn}\mathcal{D}_{\overline{u}}-\frac{1}{mn}\tau_{b}^{\xi}\\\end{split}\]

and

(12)\[\begin{split}\frac{\partial}{\partial t}\left(\frac{D\overline{v}}{mn}\right)+\frac{\partial}{\partial\xi}\left(\frac{D\overline{u}\,\overline{v}}{n}\right)+\frac{\partial}{\partial\eta}\left(\frac{D\overline{v}\,\overline{v}}{m}\right)&+\frac{Df\overline{u}}{mn}\\ +\left[\overline{u}\,\overline{v}\frac{\partial}{\partial\xi}\left(\frac{1}{n}\right)-\overline{u}\,\overline{u}\frac{\partial}{\partial\eta}\left(\frac{1}{m}\right)\right]D&=R_{v_{\text{slow}}}-\frac{gD}{m}\frac{\partial\zeta}{\partial\eta}+\frac{D}{mn}\mathcal{D}_{\overline{v}}-\frac{1}{mn}\tau_{b}^{\eta}.\end{split}\]

When time stepping the model, we compute the right-hand-sides for the full 3-D momentum equations as well as the right-hand-sides for equations (11) and (12). The vertical integral of the 3-D right-hand-sides are obtained and then the 2-D right-hand-sides are subtracted. The resulting fields are the slow forcings \(R_{u_{\text{slow}}}\) and \(R_{v_{\text{slow}}}\). This was found to be the easiest way to retain the baroclinic contributions of the non-linear terms such as \(\overline{uu}-\overline{u}\,\overline{u}\). The model is time stepped from time \(n\) to time \(n+1\) by using short time steps on equations (11), (12) and (6). Equation (6) is time stepped first, so that an estimate of the new \(D\) is available for the time rate of change terms in equations (11) and (12). A third-order predictor-corrector time stepping is used. In practice, we actually time step all the way to time \(\left(n+\textbf{dtfast}\times M^*\right)\) and while maintaining weighted averages of the values of \(\overline{u},\overline{v}\) and \(\zeta\). The averages are used to replace the values at time \(n+1\) in both the baroclinic and barotropic modes, and for recomputing the vertial grid spacing \(H_z\). The following figure shows one option for how these weights might look:

_images/Barostep.png

The primary weights, \(a_m\), are used to compute \(\langle\zeta\rangle^{n+1}\equiv\overunderset{M^*}{m=1}{\sum}a_m\zeta^m\). There is a related set of secondary weights \(b_m\), used as \(\langle\!\langle\overline{u}\rangle\!\rangle^{n+\frac{1}{2}}\equiv\overunderset{M^*}{m=1}{\sum}b_m\overline{u}^m\). In order to maintain constancy preservation, this relation must hold:

(13)\[\begin{split}\langle\zeta\rangle_{i,j}^{n+1}=\langle\zeta\rangle_{i,j}^n&-\\ \left(mn\right)_{i,j}\Delta t&\left[\left\langle\!\!\left\langle\frac{D\overline{u}}{n}\right\rangle\!\!\right\rangle_{i+\frac{1}{2},j}^{n+\frac{1}{2}}-\left\langle\!\!\left\langle\frac{D\overline{u}}{n}\right\rangle\!\!\right\rangle_{i-\frac{1}{2},j}^{n+\frac{1}{2}}+\left\langle\!\!\left\langle\frac{D\overline{v}}{m}\right\rangle\!\!\right\rangle_{i,j+\frac{1}{2}}^{n+\frac{1}{2}}-\left\langle\!\!\left\langle\frac{D\overline{v}}{m}\right\rangle\!\!\right\rangle_{i,j-\frac{1}{2}}^{n+\frac{1}{2}}\right]\end{split}\]

Shchepetkin and McWilliams (2005) introduce a range of possible weights, but the ones used here have a shape function:

(14)\[A\left(\tau\right)=A_0\left\{\left(\frac{\tau}{\tau_0}\right)^p\left[1-\left(\frac{\tau}{\tau_0}\right)^q\right]-r\frac{\tau}{\tau_0}\right\}\]

where \(p,q\) are parameters and \(A_0,\tau_0\), and \(r\) are chosen to satisfy normalization, consistency, and second-order accuracy conditions,

(15)\[I_n=\int_0^{\tau^*}\tau^nA\left(\tau\right)d\tau=1,\qquad n=0,1,2\]

using Newton iterations. \(\tau^*\) is the upper limit of \(\tau\) with \(A\left(\tau\right)\geq0\). In practice we initially set

\[A_0=1,r=0,\text{ and }\tau=\frac{\left(p+2\right)\left(p+q+2\right)}{\left(p+1\right)\left(p+q+1\right)}\]

compute \(A\left(\tau\right)\) using eq.(14), normalize using:

(16)\[\sum_{m=1}^{M^*}a_m\equiv1,\qquad\sum_{m=1}^{M^*}a_m\frac{m}{M}\equiv1,\]

and adjust \(r\) iteratively to satisfy the \(n=2\) condition of (15). We are using values of \(p=2,q=4\), and \(r=0.284\). This form allows some negative weights for small \(m\), allowing \(M^*\) to be less than \(1.5M\).

Pressure Gradient Terms in Mode Coupling

Equation (11) contains the term \(R_{u_{\text{slow}}}\), computed as the difference between the 3-D right-hand-side and the 2-D right-hand-side. The pressure gradient therefore has the form:

(17)\[-\frac{gD}{n}\frac{\partial\zeta}{\partial\xi}+\left[\frac{gD}{n}\frac{\partial\zeta}{\partial\xi}+\mathcal{F}\right]\]

where the term in square brackets is the mode coupling term and is held fixed over all the barotropic steps and

(18)\[\mathcal{F}=-\frac{1}{\rho_0n}\int_{-h}^{\zeta}\frac{\partial P}{\partial\xi}dz\]

is the vertically integrated pressure gradient. The latter is a function of the bathymetry, free surface gradient, and the free surface itself, as well as the vertical distribution of density.

The disadvantage of this approach is that after the barotropic time stepping is complete and the new free surface is substituted into the full baroclinic pressure gradient, its vertical integral will no longer be equal to the sum of the new surface slope term and the original coupling term based on the old free surface. This is one form of mode-splitting error which can lead to trouble because the vertically integrated pressure gradient is not in balance with the barotropic mass flux.

Instead, let us define the following:

(19)\[\overline{\rho}=\frac{1}{D}\int_{-h}^{\zeta}\rho\ dz,\qquad\rho^*=\frac{1}{\frac{1}{2}D^2}\int_{-h}^{\zeta}\left\{\int_z^{\zeta}\rho\ dz^{\prime}\right\}\ dz\]

Changing the vertical coordinate to \(\sigma\) yields:

(20)\[\overline{\rho}=\int_{-1}^0\rho\ d\sigma,\qquad\rho^*=2\int_{-1}^0\left\{\int_{\sigma}^0\rho\ d\sigma^{\prime}\right\}\ d\sigma\]

which implies that \(\overline{\rho}\) and \(\rho^*\) are actually independent of \(\zeta\) as long as the density profile \(\rho=\rho\left(\sigma\right)\) does not change. The vertically integrated pressure gradient becomes:

(21)\[-\frac{1}{\rho_0}\frac{g}{n}\left\{\frac{\partial}{\partial\xi}\left(\frac{\rho^*D^2}{2}\right)-\overline{\rho}D\frac{\partial h}{\partial\xi}\right\}=-\frac{1}{\rho_0}\frac{g}{n}D\left\{\rho^*\frac{\partial\zeta}{\partial\xi}+\frac{D}{2}\frac{\partial\rho^*}{\partial\xi}+\left(\rho^*-\overline{\rho}\right)\frac{\partial h}{\partial\xi}\right\}\]

In the case of uniform density \(\rho_0\), we obtain \(\rho^*\equiv\overline{\rho}\equiv\rho_0\), but we otherwise have two new terms. The accuracy of these terms depends on an accurate vertical integration of the density, as described in Shchepetkin and McWilliams (2005).

Horizontal and Vertical Advection

The advection of a tracer \(C\) has an equation of the form

\[\frac{\partial}{\partial t}\frac{H_zC}{mn}=-\frac{\partial}{\partial\xi}F^{\xi}-\frac{\partial}{\partial\eta}F^{\eta}-\frac{\partial}{\partial\sigma} F^{\sigma},\]

where we have introduced the advective fluxes:

\[\begin{split}F^{\xi}&=\frac{H_zuC}{n}\\ F^{\eta}&=\frac{H_zvC}{m}\\ F^{\sigma}&=\frac{H_z\Omega C}{mn}.\end{split}\]

Fourth-order Centered

The barotropic advection is centered fourth-order. Create gradient terms:

\[\begin{split}G^{\xi}&=\overline{\left(\frac{\partial C}{\partial\xi}\right)}^{\xi}\\ G^{\eta}&=\overline{\left(\frac{\partial C}{\partial\eta}\right)}^{\eta}\\ G^{\sigma}&=\overline{\left(\frac{\partial C}{\partial\sigma}\right)}^{\sigma}.\end{split}\]

The fluxes now become:

\[\begin{split}F^{\xi}&=\frac{\overline{H_z}^{\xi}}{\overline{n}^{\xi}}u\left(\overline{C}^{\xi}-\frac{1}{3}\frac{\partial G^{\xi}}{\partial\xi}\right)\\ F^{\eta}&=\frac{\overline{H_z}^{\eta}}{\overline{m}^{\eta}}v\left(\overline{C}^{\eta}-\frac{1}{3}\frac{\partial G^{\eta}}{\partial\eta}\right)\\ F^{\sigma}&=\frac{\overline{H_z}^{\sigma}}{mn}\Omega\left(\overline{C}^{\sigma}-\frac{1}{3}\frac{\partial G^{\sigma}}{\partial\sigma}\right).\end{split}\]

Third-order Upwind

There is a class of third-order upwind advection schemes, both one-dimensional (Leanord, 1979) and two-dimensional (Rasch, 1994 and Shchepetkin and McWilliams, 1998). This scheme is known as UTOPIA (Uniformly Third-Order Polynomial Interpolation Algorithm). Applying flux limiters to UTOPIA is explored in Thuburn (1995), although it is not implemented in REMORA. The two-dimensional formulation in Rasch contains terms of order \(u^2C\) and \(u^3C\), including cross terms (\(uvC\)). The terms which are nonlinear in velocity have been dropped in REMORA, leaving one extra upwind term in the computation of the advective fluxes:

\[\begin{split}F^{\xi}&=\frac{H_zu}{n}\left(C-\gamma\frac{\partial^2C}{\partial\xi^2}\right)\\ F^{\eta}&=\frac{H_zv}{m}\left(C-\gamma\frac{\partial^2C}{\partial\eta^2}\right)\end{split}\]

The second derivative terms are centered on a \(\rho\) point in the grid, but are needed at a \(u\) or \(v\) point in the flux. The upstream value is used:

\[F^{\xi}_{i,j,k}=\frac{\overline{H_z}^{\eta}}{\overline{n}^{\xi}}\left[\max\left(0,u_{i,j,k}\right)C_{i-1,j,k}+\min\left(0,u_{i,j,k}\right)C_{i,j,k}\right].\]

The value of \(\gamma\) in the model is \(\frac{1}{8}\) while that in Rasch(1994) is \(\frac{1}{6}\).

Because the third-order upwind scheme is designed to be two-dimensional, it is not used in the vertical (though one might argue that we are simply performing one-dimensional operations here). Instead we use a centered fourth-order scheme in the vertical when the third-order upwind option is turned on:

\[F^s=\frac{H_zw}{mn}\left[-\frac{1}{16}C_{i,j,k-1}+\frac{9}{16}C_{i,j,k}+\frac{9}{16}C_{i,j,k+1}-\frac{1}{16}C_{i,j,k+2}\right]\]

One advantage of UTOPIA over MPDATA is that it can be used on variables having both negative and positive values. Therefore, it can be used on velocity as well as scalars (is there a reference for this?). For the \(u\)-velocity, we have:

\[\begin{split}F^{\xi}&=\left(u-\gamma\frac{\partial^2u}{\partial\xi^2}\right)\left[\frac{H_zu}{n}-\gamma\frac{\partial^2}{\partial\xi^2}\left(\frac{H_zu}{n}\right)\right]\\ F^{\eta}&=\left(u-\gamma\frac{\partial^2u}{\partial\eta^2}\right)\left[\frac{H_zv}{m}-\gamma\frac{\partial^2}{\partial\xi^2}\left(\frac{H_zv}{m}\right)\right]\\ F^{\sigma}&=\frac{H_zw}{mn}\left[-\frac{1}{16}u_{i,j,k-1}+\frac{9}{16}u_{i,j,k}+\frac{9}{16}u_{i,j,k+1}-\frac{1}{16}u_{i,j,k+2}\right]\end{split}\]

while for the \(v\)-velocity we have:

\[\begin{split}F^{\xi}&=\left(v-\gamma\frac{\partial^2v}{\partial\xi^2}\right)\left[\frac{H_zu}{n}-\gamma\frac{\partial^2}{\partial\eta^2}\left(\frac{H_zu}{n}\right)\right]\\ F^{\eta}&=\left(v-\gamma\frac{\partial^2v}{\partial\eta ^2}\right)\left[\frac{H_zv}{m}-\gamma\frac{\partial^2}{\partial\eta^2}\left(\frac{H_zv}{m}\right)\right]\\ F^{\sigma}&=\frac{H_zw}{mn}\left[-\frac{1}{16}v_{i,j,k-1}+\frac{9}{16}v_{i,j,k}+\frac{9}{16}v_{i,j,k+1}-\frac{1}{16}v_{i,j,k+2}\right]\end{split}\]

In all these terms, the second derivatives are evaluated at an upstream location.

Vertical Velocity

Having obtained a complete specification of the \(u,v,T\), and \(S\) fields at the next time level by the methods outlined above, the vertical velocity and density fields can be calculated. the vertical velocity is obtained by rewriting equation (5) as:

\[\frac{\partial}{\partial t}\left(\frac{\zeta}{mn}\right)+\delta_{\xi}\left(\frac{u\overline{H_z}^{\xi}}{\overline{n}^{\xi}}\right)+\delta_{\eta}\left(\frac{v\overline{H_z}^{\eta}}{\overline{m}^{\eta}}\right)+\delta_{\sigma}\left(\frac{H_z\Omega}{mn}\right)=0\]

and combining it with equation (6) to obtain:

\[\frac{\partial}{\partial\xi}\left(\frac{H_zu}{n}\right)+\frac{\partial}{\partial\eta}\left(\frac{H_zv}{m}\right)+\frac{\partial}{\partial\sigma}\left(\frac{H_z\Omega}{mn}\right)-\frac{\partial}{\partial\xi}\left(\frac{D\overline{u}}{n}\right)-\frac{\partial}{\partial\eta}\left(\frac{D\overline{v}}{m}\right)=0.\]

Solving for \(H_z\Omega/mn\) and using the semi-discrete notation we obtain:

\[\frac{H_z\Omega}{mn}=\int\left[\delta_{\xi}\left(\frac{\overline{u}\,\overline{D}^{\xi}}{\overline{n}^{\xi}}\right)+\delta_{\eta}\left(\frac{\overline{v}\,\overline{D}^{\eta}}{\overline{m}^{\eta}}\right)-\delta_{\xi}\left(\frac{u\overline{H_z}^{\xi}}{\overline{n}^{\xi}}\right)-\delta_{\eta}\left(\frac{v\overline{H_z}^{\eta}}{\overline{m}^{\eta}}\right)\right]\ d\sigma.\]

The integral is actually computed as a sum from the bottom upwards and also as a sum from the top downwards. The value used is a linear combination of the two, weighted so that the surface down value is used near the surface while the other is used near the bottom. [Is this still done?]

Equation of State

The density is obtained from temperature and salinity via an equation of state. REMORA provides a choice of a nonlinear equation of state \(\rho=\rho\left(T,S,z\right)\) or a linear equation of state \(\rho=\rho\left(T\right)\). The nonlinear equation of state has been modified and now corresponds to the UNESCO equation of state as derived by Jackett and McDougall (1995). It computes in situ density as a function of potential temperature, salinity and pressure.

Warning: although we have used it quite extensively in the past, McDougall (personal communication) claims that the single-variable \(\left(\rho=\rho\left(T\right)\right)\) equation of state is not dynamically appropriate as is. He has worked out the extra source and sink terms required, arising from vertical motions and the compressibility of water. They are quite complicated and we have not implemented them to see if they alter the flow.