Horizontal Mixing
Deviatory Stress Tensor (Horizontal Viscosity)
The horizontal components of the divergence of the stress tensor ( Wajsowicz, 1993) in nondimesional, orthogonal curvilinear coordinates ( ,
,  ,
,  ) with dimensional, spatially-varying metric factors (
) with dimensional, spatially-varying metric factors ( ,
,  ,
,  ) and velocity components (
) and velocity components ( ,
,  ,
,  ) are given by:
) are given by:
| ![{\displaystyle {\begin{aligned}F^{u}\equiv {\widehat {\xi }}\cdot \left(\nabla \cdot {\vec {\sigma }}\right)={\frac {mn}{H_{z}}}{\Biggl [}&{\frac {\partial }{\partial \xi }}{\Biggl (}{\frac {H_{z}{\sigma }_{\xi \xi }}{n}}{\Biggr )}+{\frac {\partial }{\partial \eta }}{\Biggl (}{\frac {H_{z}{\sigma }_{\xi \eta }}{m}}{\Biggr )}+{\frac {\partial }{\partial s}}{\Biggl (}{\frac {{\sigma }_{\xi s}}{mn}}{\Biggr )}+\\&H_{z}{\sigma }_{\xi \eta }{\frac {\partial }{\partial \eta }}\left({\frac {1}{m}}\right)-H_{z}{\sigma }_{\eta \eta }{\frac {\partial }{\partial \xi }}\left({\frac {1}{n}}\right)-{\frac {1}{n}}{\sigma }_{ss}{\frac {\partial H_{z}}{\partial \xi }}{\Biggr ]}\end{aligned}}}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/a51a8bdad2a92af67ca7e424990d0ff56c1ed66b) | (1) | 
| ![{\displaystyle {\begin{aligned}F^{v}\equiv {\widehat {\eta }}\cdot \left(\nabla \cdot {\vec {\sigma }}\right)={\frac {mn}{H_{z}}}{\Biggl [}&{\frac {\partial }{\partial \xi }}{\Biggl (}{\frac {H_{z}{\sigma }_{\eta \xi }}{n}}{\Biggr )}+{\frac {\partial }{\partial \eta }}{\Biggl (}{\frac {H_{z}{\sigma }_{\eta \eta }}{m}}{\Biggr )}+{\frac {\partial }{\partial s}}{\Biggl (}{\frac {{\sigma }_{\eta s}}{mn}}{\Biggr )}+\\&H_{z}{\sigma }_{\eta \xi }{\frac {\partial }{\partial \xi }}\left({\frac {1}{n}}\right)-H_{z}{\sigma }_{\xi \xi }{\frac {\partial }{\partial \eta }}\left({\frac {1}{m}}\right)-{\frac {1}{m}}{\sigma }_{ss}{\frac {\partial H_{z}}{\partial \eta }}{\Biggr ]}\end{aligned}}}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/da9bf6376631553fe286b9f07e9f17fa03af6df5) | (2) | 
where
|  | (3) | 
and the strain field is:
|  | (4) | 
Here,  and
 and  are the spatially varying horizontal and vertical viscosity coefficients, respectively, and
 are the spatially varying horizontal and vertical viscosity coefficients, respectively, and  is another (very small, often neglected) horizontal viscosity coefficient. Notice that because of the generalized terrain-following vertical coordinates of ROMS, we need to transform the horizontal partial derivatives from constant z-surfaces to constant s-surfaces.  And the vertical metric or level thickness is the Jacobian of the transformation,
 is another (very small, often neglected) horizontal viscosity coefficient. Notice that because of the generalized terrain-following vertical coordinates of ROMS, we need to transform the horizontal partial derivatives from constant z-surfaces to constant s-surfaces.  And the vertical metric or level thickness is the Jacobian of the transformation,  . Also in these models, the vertical velocity is computed as
. Also in these models, the vertical velocity is computed as  and has units of
 and has units of  .
.
Transverse Stress Tensor
Assuming transverse isotropy, as in  Sadourny and Maynard (1997) and  Griffies and Hallberg (2000), the deviatoric stress tensor can be split into vertical and horizontal sub-tensors.  The horizontal (or transverse) sub-tensor is symmetric, it has a null trace, and it possesses axial symmetry in the local vertical direction.  Then, transverse stress tensor can be derived from (1) and (2) yielding
|  | (5) | 
where
| ![{\displaystyle {\begin{aligned}F^{u\xi }&={\frac {1}{n}}\;A_{M}\left[{\frac {m}{n}}{\frac {\partial \left(nu\right)}{\partial \xi }}\;-{\frac {n}{m}}{\frac {\partial \left(mv\right)}{\partial \eta }}\right]\,,\\F^{u\eta }&={\frac {1}{m}}A_{M}\left[{\frac {n}{m}}{\frac {\partial \left(mu\right)}{\partial \eta }}+{\frac {m}{n}}{\frac {\partial \left(nv\right)}{\partial \xi }}\;\right]\,,\\F^{v\xi }&={\frac {1}{n}}\;A_{M}\left[{\frac {m}{n}}{\frac {\partial \left(nv\right)}{\partial \xi }}\;+{\frac {n}{m}}{\frac {\partial \left(mu\right)}{\partial \eta }}\right]\,,\\F^{v\eta }&={\frac {1}{m}}A_{M}\left[{\frac {n}{m}}{\frac {\partial \left(mv\right)}{\partial \eta }}-{\frac {m}{n}}{\frac {\partial \left(nu\right)}{\partial \xi }}\;\right]\,.\end{aligned}}}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/4c9b91ae3459d0f09cc279bd433b831a7c075141) | (6) | 
Notice the flux form of (5) and the symmetry between the  and
 and  terms which are defined at density points on a C-grid. Similarly, the
 terms which are defined at density points on a C-grid. Similarly, the  and
 and  terms are symmetric and defined at vorticity points.  These staggering positions are optimal for the discretization of the tensor; it has no computational modes and satisfy first-moment conservation.
 terms are symmetric and defined at vorticity points.  These staggering positions are optimal for the discretization of the tensor; it has no computational modes and satisfy first-moment conservation.
The biharmonic friction operator can be computed by applying twice the tensor operator (5), but with the squared root of the biharmonic viscosity coefficient (Griffies and Hallberg, 2000).  For simplicity and momentum balance, the thickness  appears only when computing the second harmonic operator as in  Griffies and Hallberg (2000).
 appears only when computing the second harmonic operator as in  Griffies and Hallberg (2000).
Rotated Transverse Stress Tensor
In some applications with tall and steep topography, it will be advantageous to reduce substantially the contribution of the stress tensor (5) to the vertical mixing when operating along constant  -surfaces.  The transverse stress tensor rotated
along geopotentials (constant depth) is, then, given by
-surfaces.  The transverse stress tensor rotated
along geopotentials (constant depth) is, then, given by
|  | (7) | 
where
| ![{\displaystyle {\begin{aligned}R^{u\xi }=&{\frac {1}{n}}\;A_{M}\left[{\frac {1}{n}}\;\left(m{\frac {\partial \left(nu\right)}{\partial \xi }}-m{\frac {\partial z}{\partial \xi }}{\frac {1}{H_{z}}}{\frac {\partial \left(nu\right)}{\partial s}}\right)-{\frac {1}{m}}\left(n{\frac {\partial \left(mv\right)}{\partial \eta }}-n{\frac {\partial z}{\partial \eta }}{\frac {1}{H_{z}}}{\frac {\partial \left(mv\right)}{\partial s}}\right)\right]\,,\\R^{u\eta }=&{\frac {1}{m}}A_{M}\left[{\frac {1}{m}}\left(n{\frac {\partial \left(mu\right)}{\partial \eta }}-n{\frac {\partial z}{\partial \eta }}{\frac {1}{H_{z}}}{\frac {\partial \left(mu\right)}{\partial s}}\right)+{\frac {1}{n}}\;\left(m{\frac {\partial \left(nv\right)}{\partial \xi }}-m{\frac {\partial z}{\partial \xi }}{\frac {1}{H_{z}}}{\frac {\partial \left(nv\right)}{\partial s}}\right)\right]\,,\\R^{us}=&m{\frac {\partial z}{\partial \xi }}A_{M}\left[{\frac {1}{n}}\;\left(m{\frac {\partial z}{\partial \xi }}{\frac {1}{H_{z}}}{\frac {\partial \left(nu\right)}{\partial s}}-m{\frac {\partial \left(nu\right)}{\partial \xi }}\right)-{\frac {1}{m}}\left(n{\frac {\partial z}{\partial \eta }}{\frac {1}{H_{z}}}{\frac {\partial \left(mv\right)}{\partial s}}-n{\frac {\partial \left(mv\right)}{\partial \eta }}\right)\right]+\\&n\;{\frac {\partial z}{\partial \eta }}A_{M}\left[{\frac {1}{m}}\left(n{\frac {\partial z}{\partial \eta }}{\frac {1}{H_{z}}}{\frac {\partial \left(mu\right)}{\partial s}}-n{\frac {\partial \left(mu\right)}{\partial \eta }}\right)+{\frac {1}{n}}\;\left(m{\frac {\partial z}{\partial \xi }}{\frac {1}{H_{z}}}{\frac {\partial \left(nv\right)}{\partial s}}-m{\frac {\partial \left(nv\right)}{\partial \xi }}\right)\right]\,,\end{aligned}}}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/ee3f6ca9fcee9ca263b71ba8ffcc72abdcf127ff) | (8) | 
| ![{\displaystyle {\begin{aligned}R^{v\xi }=&{\frac {1}{n}}\;A_{M}\left[{\frac {1}{n}}\;\left(m{\frac {\partial \left(nv\right)}{\partial \xi }}-m{\frac {\partial z}{\partial \xi }}{\frac {1}{H_{z}}}{\frac {\partial \left(nv\right)}{\partial s}}\right)+{\frac {1}{m}}\left(n{\frac {\partial \left(mu\right)}{\partial \eta }}-n{\frac {\partial z}{\partial \eta }}{\frac {1}{H_{z}}}{\frac {\partial \left(mu\right)}{\partial s}}\right)\right]\,,\\R^{v\eta }=&{\frac {1}{m}}A_{M}\left[{\frac {1}{m}}\left(n{\frac {\partial \left(mv\right)}{\partial \eta }}-n{\frac {\partial z}{\partial \eta }}{\frac {1}{H_{z}}}{\frac {\partial \left(mv\right)}{\partial s}}\right)-{\frac {1}{n}}\;\left(m{\frac {\partial \left(nu\right)}{\partial \xi }}-m{\frac {\partial z}{\partial \xi }}{\frac {1}{H_{z}}}{\frac {\partial \left(nu\right)}{\partial s}}\right)\right]\,,\\R^{vs}=&m{\frac {\partial z}{\partial \xi }}A_{M}\left[{\frac {1}{n}}\;\left(m{\frac {\partial z}{\partial \xi }}{\frac {1}{H_{z}}}{\frac {\partial \left(nv\right)}{\partial s}}-m{\frac {\partial \left(nv\right)}{\partial \xi }}\right)+{\frac {1}{m}}\left(n{\frac {\partial z}{\partial \eta }}{\frac {1}{H_{z}}}{\frac {\partial \left(mu\right)}{\partial s}}-n{\frac {\partial \left(mu\right)}{\partial \eta }}\right)\right]+\\&n\;{\frac {\partial z}{\partial \eta }}A_{M}\left[{\frac {1}{m}}\left(n{\frac {\partial z}{\partial \eta }}{\frac {1}{H_{z}}}{\frac {\partial \left(mv\right)}{\partial s}}-n{\frac {\partial \left(mv\right)}{\partial \eta }}\right)-{\frac {1}{n}}\;\left(m{\frac {\partial z}{\partial \xi }}{\frac {1}{H_{z}}}{\frac {\partial \left(nu\right)}{\partial s}}-m{\frac {\partial \left(nu\right)}{\partial \xi }}\right)\right]\,.\end{aligned}}}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/c867af285e0f9206f574930bab8b34fdb3177078) | (9) | 
Notice that transverse stress tensor remains invariant under coordinate transformation.  The rotated tensor (7) retains the
same properties as the unrotated tensor (5).  The additional terms that arise from the slopes of  -surfaces along
geopotentials are discretized using a modified version of the triad approach of  Griffies et al. (1998).
-surfaces along
geopotentials are discretized using a modified version of the triad approach of  Griffies et al. (1998).
Horizontal Diffusion
Laplacian
The Laplacian of a scalar  in curvilinear coordinates is:
 in curvilinear coordinates is:
| ![{\displaystyle \nabla ^{2}C=\nabla \cdot \nabla C=mn\left[{\partial  \over \partial \xi }\!\!\left({m \over n}{\partial C \over \partial \xi }\right)+{\partial  \over \partial \eta }\!\!\left({n \over m}{\partial C \over \partial \eta }\right)\right]}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/16cf6735630042c41d471f9e0829febe8d7c07b8) | (10) | 
In ROMS, this term is multiplied by  and becomes
 and becomes
| ![{\displaystyle \left[{\partial  \over \partial \xi }\!\!\left({\nu _{2}H_{z}m \over n}{\partial C \over \partial \xi }\right)+{\partial  \over \partial \eta }\!\!\left({\nu _{2}H_{z}n \over m}{\partial C \over \partial \eta }\right)\right]}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/bbfbea571375f532cebe8678bef33b3c5fc07d1a) | (11) | 
where  is any tracer. This form guarantees that the term does not contribute to the volume-integrated equations.
 is any tracer. This form guarantees that the term does not contribute to the volume-integrated equations.
Biharmonic
The biharmonic operator is  ; the
corresponding term is computed using a temporary variable
; the
corresponding term is computed using a temporary variable  :
:
| ![{\displaystyle Y={mn \over H_{z}}\left[{\partial  \over \partial \xi }\!\!\left({\nu _{4}H_{z}m \over n}{\partial C \over \partial \xi }\right)+{\partial  \over \partial \eta }\!\!\left({\nu _{4}H_{z}n \over m}{\partial C \over \partial \eta }\right)\right]}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/c2c80db0d42cbc4739864ce5d9b7c0f7bf5ad74c) | (12) | 
and is
| ![{\displaystyle -\left[{\partial  \over \partial \xi }\!\!\left({\nu _{4}H_{z}m \over n}{\partial Y \over \partial \xi }\right)+{\partial  \over \partial \eta }\!\!\left({\nu _{4}H_{z}n \over m}{\partial Y \over \partial \eta }\right)\right]}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/cc473813beca3b49ddd0ef03435d2b59c5f6baa3) | (13) | 
where  is once again any tracer and
 is once again any tracer and  is the square root of the input value so that it can be applied twice.
 is the square root of the input value so that it can be applied twice.
Rotated mixing tensors
Both the Laplacian and biharmonic terms above operate on surfaces of constant  and can contribute substantially to the vertical mixing. However, the oceans are thought to mix along constant density surfaces so this is not entirely satisfactory. Therefore, the option of using rotated mixing tensors for the Laplacian and biharmonic operators has been added. Options exist to diffuse on constant
 and can contribute substantially to the vertical mixing. However, the oceans are thought to mix along constant density surfaces so this is not entirely satisfactory. Therefore, the option of using rotated mixing tensors for the Laplacian and biharmonic operators has been added. Options exist to diffuse on constant  surfaces (MIX_GEO_TS) and constant potential density surfaces (MIX_ISO_TS).
 surfaces (MIX_GEO_TS) and constant potential density surfaces (MIX_ISO_TS).
The horizontal Laplacian diffusion operator is computed by finding the three components of the flux of the quantity  .  The
.  The  and
 and  components are locally horizontal, rather than along the
 components are locally horizontal, rather than along the  surface. The diffusive fluxes are:
 surface. The diffusive fluxes are:
| ![{\displaystyle {\begin{aligned}F^{\xi }&=\nu _{2}\left[m{\frac {\partial C}{\partial \xi }}-\underbrace {\left(m{\frac {\partial z}{\partial \xi }}\underbrace {+S_{x}} _{{\text{MIX}}{\_}{\text{ISO}}}\right){\frac {\partial C}{\partial z}}} _{{\text{MIX}}{\_}{\text{GEO}}}\right]\\F^{\eta }&=\nu _{2}\left[n{\partial C \over \partial \eta }-\underbrace {\left[n{\partial z \over \partial \eta }\underbrace {+S_{y}} _{{\text{MIX}}{\_}{\text{ISO}}}\right){\partial C \over \partial z}} _{{\text{MIX}}{\_}{\text{GEO}}}\right]\\F^{s}&=-\underbrace {{1 \over H_{z}}\left(m{\partial z \over \partial \xi }\underbrace {+S_{x}} _{{\text{MIX}}{\_}{\text{ISO}}}\right)F^{\xi }} _{{\text{MIX}}{\_}{\text{GEO}}}-\underbrace {{1 \over H_{z}}\left(n{\partial z \over \partial \eta }\underbrace {+S_{y}} _{{\text{MIX}}{\_}{\text{ISO}}}\right)F^{\eta }} _{{\text{MIX}}{\_}{\text{GEO}}}\end{aligned}}}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/30e6820adf93bd8d2f9156ed6fc44c0ebe571bc5) | (14) | 
where
| ![{\displaystyle {\begin{aligned}S_{x}&={{\partial \rho  \over \partial x} \over {\partial \rho  \over \partial z}}={\left[m{\partial \rho  \over \partial \xi }-{m \over H_{z}}{\partial z \over \partial \xi }{\partial \rho  \over \partial s}\right] \over {1 \over H_{z}}{\partial \rho  \over \partial s}}\\S_{y}&={{\partial \rho  \over \partial y} \over {\partial \rho  \over \partial z}}={\left[n{\partial \rho  \over \partial \eta }-{n \over H_{z}}{\partial z \over \partial \eta }{\partial \rho  \over \partial s}\right] \over {1 \over H_{z}}{\partial \rho  \over \partial s}}\end{aligned}}}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/fcdf2b2b6d4da20157d0424b6139b85b35afd898) | (15) | 
and there is some trickery such that the computations depend on the sign of  and of
 and of  . No flux boundary conditions are easily imposed by setting
. No flux boundary conditions are easily imposed by setting

Finally, the flux divergence is calculated and is added to the right-hand-side term for the field being computed:
|  | (16) | 
The biharmonic rotated mixing tensors are computed much as the non-rotated biharmonic mixing. We define a temporary variable  based on equation (16):
 based on equation (16):
| ![{\displaystyle Y={mn \over H_{z}}\left[{\partial  \over \partial \xi }\left({\nu _{4}H_{z}F^{\xi } \over n}\right)+{\partial  \over \partial \eta }\left({\nu _{4}H_{z}F^{\eta } \over m}\right)+{\partial  \over \partial s}\left({\nu _{4}H_{z}F^{s} \over mn}\right)\right]\,.}](https://www.myroms.org/www.myroms.org/v1/media/math/render/svg/76c5d63e835ca417a3edafdb4e6904fa9461310b) | (17) | 
We then build up fluxes of  as in equations (14).  We then apply equation (16) to these
 as in equations (14).  We then apply equation (16) to these  fluxes to obtain the biharmonic mixing tensors. Again, the value of
 fluxes to obtain the biharmonic mixing tensors. Again, the value of  is the square root of that read in so that it can be applied twice.
 is the square root of that read in so that it can be applied twice.
Radiation Stresses
Guidelines for Coefficient Values
The horizontal viscosity and diffusion coefficients are scalars which
are read in from roms.in.  Several
factors to consider when choosing these values are:
- spindown time  The spindown time on wavenumber  is is for the Laplacian operator and for the Laplacian operator and for the biharmonic operator.  The smallest wavenumber corresponds to the length for the biharmonic operator.  The smallest wavenumber corresponds to the length and is and is , leading to , leading to

This time should be short enough to damp out the numerical noise which is being generated but long enough on the larger scales to retain the features you are interested in.  This time should also be resolved by the model timestep.
- boundary layer thickness The western boundary layer has a thickness proportional to:

for the Laplacian and biharmonic viscosity, respectively.  We have found that the model typically requires the boundary layer to be resolved with at least one grid cell.  This leads to coarse grids requiring large values of  .
.
Horizontal Diffusion
We have chosen anything from zero to the value of the horizontal
viscosity for the horizontal diffusion coefficient.  One common choice
is an order of magnitude smaller than the viscosity.