The temperature equation


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

This subroutine computes the balance of heat in the form

$\displaystyle \dot{\Theta} = {\cal D}_\Theta - \frac{1}{\tau^\Theta_R}(\Theta-\Theta_{obs}) + \frac{1}{C_p \rho_0} \dfrac{\partial {I}}{\partial {z}} \; , \quad$ (27)

where $ \dot{\Theta}$ denotes the material derivative of the mean potential temperature $ \Theta$, and $ {\cal D}_\Theta$ is the sum of the turbulent and viscous transport terms modelled according to

$\displaystyle {\cal D}_\Theta = \dfrac{\partial}{\partial {z}} \left( \left( \n...
...\dfrac{\partial {\Theta}}{\partial {z}} - \tilde{\Gamma}_\Theta \right) \quad .$ (28)

In this equation, $ \nu^\Theta_t$ and $ \nu^\Theta$ are the turbulent and molecular diffusivities of heat, respectively, and $ \tilde{\Gamma}_\Theta$ denotes the non-local flux of heat, see section 4.

Horizontal advection is optionally included (see obs.nml) by means of prescribed horizontal gradients $ \partial_x\Theta$ and $ \partial_y\Theta$ and calculated horizontal mean velocities $ U$ and $ V$. Relaxation with the time scale $ \tau^\Theta_R$ towards a precribed profile $ \Theta_{obs}$, 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, $ I(z)$. It is computed according the exponential law (see Paulson and Simpson (1977))

$\displaystyle I(z) = I_0 \bigg(Ae^{z/\eta_1}+(1-A)e^{z/\eta_2}\bigg)B(z).$ (29)

The absorbtion coefficients $ \eta_1$ and $ \eta_2$ 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, $ B(z)$ 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 [*].


   use meanflow,     only: avmolt,rho_0,cp
   use meanflow,     only: h,u,v,w,T,S,avh
   use meanflow,     only: bioshade
   use observations, only: dtdx,dtdy,t_adv
   use observations, only: w_adv_discr,w_adv_method
   use observations, only: tprof,TRelaxTau
   use observations, only: A,g1,g2
   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
   surface short waves radiation  (W/m^2)
   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)
   shortwave radiation profile (W/m^2)
   REALTYPE                            :: rad(0:nlev)
   Original author(s): Hans Burchard & Karsten Bolding

Karsten Bolding 2012-12-28