ss_nn - calculates shear and buoyancy frequency (Source File: ss_nn.F90)

INTERFACE:

    subroutine ss_nn()
DESCRIPTION:

Here, the shear frequency squared, $M^2=\left(\partial_z u\right)^2+\left(\partial_z v\right)^2$, and the buoyancy frequency squared, $N^2=\partial_z b$, with buoyancy $b$ from (4) are calculated. For both calculations, two alternative methods are coded. The two straight-forward methods which are explained first, do both have the disadvantage of generating numerical instabilities. The straight-forward way for calculating $M^2$ is as follows:

\begin{displaymath}\begin{array}{l}
\displaystyle
(M^2)_{i,j,k}\approx
\frac12
\...
...c12(h^v_{i,j-1,k+1}+h^v_{i,j-1,k})}\right)^2
\Bigg)
\end{array}\end{displaymath} (128)

Burchard (2002a) developed a new scheme, which guarantees that the mean kinetic energy which is dissipated from the mean flow equals the shear production of turbulent kinetic energy. Therefore, this scheme should be numerically more stable than (128):

\begin{displaymath}\begin{array}{l}
\displaystyle
(M^2)_{i,j,k}\approx
\frac12
\...
...{i,j,k}+h^c_{i,j,k+1}\right)\nu_{i,j,k}\right)^{-1}
\end{array}\end{displaymath} (129)

The straight-forward discretisation of $N^2$ is given by

\begin{displaymath}\begin{array}{l}
\displaystyle
(N^2)_{i,j,k}\approx
\frac{b_{...
...+1}-b_{i,j,k}}{\frac12(h^t_{i,j,k+1}+h^t_{i,j,k})}.
\end{array}\end{displaymath} (130)

In some cases, together with the straight-forward discretisation of the shear squared, (128), this did not produce stable numerical results. The reason for this might be that the velocities involved in the calculation for the shear squared do depend on the buoyancies in the two neighbouring T-points such that the straight-forward method (130) leads to an inconsistency. However, other experiments with the energy-conserving discretisation of the shear stress squared, (129) and the straight-forward discretisation of $N^2$, (130), produced numerically stable results.

Most stable results have been obtained with a weighted average for the $N^2$ calculation:

\begin{displaymath}\begin{array}{l}
\displaystyle
(N^2)_{i,j,k}\approx
\frac16 \...
...k}}{\frac12(h^t_{i,j-1,k+1}+h^t_{i,j-1,k})}
\Bigg).
\end{array}\end{displaymath} (131)

These stability issues need to be further investigated in the future. USES:

    use domain, only: imin,imax,jmin,jmax,kmax,au,av,az
    use variables_3d, only: kmin,kumin,hn,uu,hun,kvmin,vv,hvn,SS,num
    use parameters, only: g,rho_0
 #ifndef NO_BAROCLINIC
    use variables_3d, only: NN,buoy,T,S
 #ifndef _OLD_BVF_
    use variables_3d, only: alpha,beta
 #endif
 #endif
    use getm_timers, only: tic, toc, TIM_SSNN
  $ use omp_lib
    IMPLICIT NONE
REVISION HISTORY:
    Original author(s): Hans Burchard & Karsten Bolding
LOCAL VARIABLES:
    integer                   :: i,j,k,nb
    REALTYPE                  :: dz,NNc,ttt
    REALTYPE                  :: NNe,NNw,NNn,NNs
    REALTYPE, parameter       :: small_bvf = 1.d-10
 #ifdef _SMOOTH_BVF_VERT_
    REALTYPE                  :: below,center,above
 #endif