## The salinity equation

INTERFACE:

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

DESCRIPTION:

This subroutine computes the balance of salinity in the form

 (30)

where denotes the material derivative of the salinity , and is the sum of the turbulent and viscous transport terms modelled according to

 (31)

In this equation, and are the turbulent and molecular diffusivities of salinity, respectively, and denotes the non-local flux of salinity, see section 4. In the current version of GOTM, we set for simplicity.

Horizontal advection is optionally included (see obs.nml) by means of prescribed horizontal gradients and and calculated horizontal mean velocities and . Relaxation with the time scale towards a precribed (changing in time) profile 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 through the airsea.nml namelist:

 at (32)

with given as a velocity (note that is the flux in the direction of , 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 .

USES:

   use meanflow,     only: avmols
use meanflow,     only: h,u,v,w,S,avh
use observations, only: sprof,SRelaxTau
use airsea,       only: precip,evap
use util,         only: Dirichlet,Neumann
use util,         only: oneSided,zeroDivergence

IMPLICIT NONE

INPUT PARAMETERS:

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)

REVISION HISTORY:
   Original author(s): Hans Burchard & Karsten Bolding


Karsten Bolding 2012-12-28