The salinity equation


   subroutine salinity(nlev,dt,cnpar,nus,gams)

This subroutine computes the balance of salinity in the form

$\displaystyle \dot{S} = {\cal D}_S - \frac{1}{\tau^S_R}(S-S_{obs}) \; , \quad$ (30)

where $ \dot{S}$ denotes the material derivative of the salinity $ S$, and $ {\cal D}_S$ is the sum of the turbulent and viscous transport terms modelled according to

$\displaystyle {\cal D}_S = \dfrac{\partial}{\partial {z}} \left( \left( \nu^S_t...
...S \right) \dfrac{\partial {S}}{\partial {z}} - \tilde{\Gamma}_S \right) \quad .$ (31)

In this equation, $ \nu^S_t$ and $ \nu^S$ are the turbulent and molecular diffusivities of salinity, respectively, and $ \tilde{\Gamma}_S$ denotes the non-local flux of salinity, see section 4. In the current version of GOTM, we set $ \nu^S_t = \nu^\Theta_t$ for simplicity.

Horizontal advection is optionally included (see obs.nml) by means of prescribed horizontal gradients $ \partial_xS$ and $ \partial_yS$ and calculated horizontal mean velocities $ U$ and $ V$. Relaxation with the time scale $ \tau^S_R$ towards a precribed (changing in time) profile $ S_{obs}$ is possible.

Inner sources or sinks are not considered. The surface freshwater flux is given by means of the precipitation - evaporation data read in as $ P-E$ through the airsea.nml namelist:

$\displaystyle {\cal D}_S = S (P-E),$   at $\displaystyle z=\zeta,$ (32)

with $ P-E$ given as a velocity (note that $ {\cal D}_S$ is the flux in the direction of $ z$, and thus positive for a loss of salinity) . Diffusion is numerically treated implicitly, see equations (7)-(9). The tri-diagonal matrix is solved then by a simplified Gauss elimination. Vertical advection is included, and it must be non-conservative, which is ensured by setting the local variable adv_mode=0, see section 8.5 on page [*].


   use meanflow,     only: avmols
   use meanflow,     only: h,u,v,w,S,avh
   use observations, only: dsdx,dsdy,s_adv
   use observations, only: w_adv_discr,w_adv_method
   use observations, only: sprof,SRelaxTau
   use airsea,       only: precip,evap
   use util,         only: Dirichlet,Neumann
   use util,         only: oneSided,zeroDivergence
   number of vertical layers
   integer, intent(in)                 :: nlev
    time step (s)
   REALTYPE, intent(in)                :: dt
   numerical "implicitness" parameter
   REALTYPE, intent(in)                :: cnpar
   diffusivity of salinity (m^2/s)
   REALTYPE, intent(in)                :: nus(0:nlev)
   non-local salinity flux (psu m/s)
   REALTYPE, intent(in)                :: gams(0:nlev)
   Original author(s): Hans Burchard & Karsten Bolding

Karsten Bolding 2012-12-28