##

Convective adjustment

*INTERFACE:*

subroutine convectiveadjustment(nlev,num,nuh,const_num,const_nuh, &
buoy_method,g,rho_0)

*DESCRIPTION:
*

In this subroutine, convective adjustment is performed for the temperature,
, and the salinity, , or alternatively for the buoyancy, ,
if a dynamic
equation is solved for this quantity. Beginning from the first interface
below the surface, the water column is checked for static instability.
If the Brunt-Väisälä frequency squared, , is negative, the two
adjacent boxes are completely mixed. The stability for
the interface below this homogenised upper part of the water column
is then analysed, and, if needed, mixing is performed again. By doing so,
the water column is scanned until the first interface with
statically stable or neutral stratification or the bottom is reached.
An equation of state described in section 8.8 is used
for calculating the Brunt-Väisälä frequency.

The constant values `const_num` and `const_nuh` are then imposed for
the eddy viscosity and the eddy diffusivity , respectively.

*USES:*

use meanflow, only: h,t,s,buoy,NN
use eqstate, only: eqstate1
IMPLICIT NONE

*INPUT PARAMETERS:*
integer, intent(in) :: nlev,buoy_method
REALTYPE, intent(in) :: g,rho_0
REALTYPE, intent(in) :: const_num,const_nuh

*OUTPUT PARAMETERS:*
REALTYPE, intent(out) :: num(1:nlev),nuh(1:nlev)

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

Karsten Bolding
2012-12-28