## The temperature equation

INTERFACE:

   subroutine temperature(nlev,dt,cnpar,I_0,heat,nuh,gamh,rad)

DESCRIPTION:

This subroutine computes the balance of heat in the form

 (27)

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

 (28)

In this equation, and are the turbulent and molecular diffusivities of heat, respectively, and denotes the non-local flux of heat, see section 4.

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 profile , changing in time, is possible.

The sum of latent, sensible, and longwave radiation is treated as a boundary condition. Solar radiation is treated as an inner source, . It is computed according the exponential law (see Paulson and Simpson (1977))

 (29)

The absorbtion coefficients and depend on the water type and have to be prescribed either by means of choosing a Jerlov (1968) class (see Paulson and Simpson (1977)) or by reading in a file through the namelist extinct in obs.nml. The damping term due to bioturbidity, is calculated in the biogeochemical routines, see section .

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: avmolt,rho_0,cp
use meanflow,     only: h,u,v,w,T,S,avh
use observations, only: tprof,TRelaxTau
use observations, only: A,g1,g2
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

REALTYPE, intent(in)                :: I_0

surface heat flux (W/m^2)
(negative for heat loss)
REALTYPE, intent(in)                :: heat

diffusivity of heat (m^2/s)
REALTYPE, intent(in)                :: nuh(0:nlev)

non-local heat flux (Km/s)
REALTYPE, intent(in)                :: gamh(0:nlev)

OUTPUT PARAMETERS:
   shortwave radiation profile (W/m^2)

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


Karsten Bolding 2012-12-28