*INTERFACE:*

subroutine buoyancy(nlev,dt,cnpar,nub,gamb)

This subroutine solves a transport equation for the mean potential buoyancy,

where is the accelaration of gravity, and and are the mean potential density and the reference density, respectively. A simplified transport equation for can be written as

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

In this equation, and are the turbulent and molecular diffusivities of buoyancy, respectively, and denotes the non-local flux of buoyancy, see section 4. In the current version of GOTM, we set for simplicity. Source and sink terms are completely disregarded, and thus (34) mainly serves as a convenient tool for some idealized test cases in GOTM.

Diffusion is treated implicitly in space (see equations (7)-
(9)), and then solved 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.2.3 on page .

*USES:*

use meanflow, only: h,w,buoy,T,avh,init_buoyancy use meanflow, only: w_grid,grid_method use observations, only: b_obs_NN,b_obs_surf,b_obs_sbf use observations, only: w_adv_discr,w_adv_method use util, only: Dirichlet,Neumann use util, only: oneSided,zeroDivergence IMPLICIT NONE

number of vertical layers integer, intent(in) :: nlev time step (s) REALTYPE, intent(in) :: dt numerical "implicitness" parameter REALTYPE, intent(in) :: cnpar diffusivity of buoyancy (m^2/s) REALTYPE, intent(in) :: nub(0:nlev) non-local buoyancy flux (m^2/s^3) REALTYPE, intent(in) :: gamb(0:nlev)

Original author(s): Hans Burchard & Karsten Bolding $Log: buoyancy.F90,v $ Revision 1.10 2010-09-17 12:53:48 jorn extensive code clean-up to ensure proper initialization and clean-up of all variables Revision 1.9 2008-03-07 17:57:49 hb AdvBcup changed to oneSided Revision 1.8 2006-11-06 13:36:45 hb Option for conservative vertical advection added to adv_center Revision 1.7 2005-11-17 09:58:20 hb explicit argument for positive definite variables in diff_center() Revision 1.6 2005/06/27 13:44:07 kbk modified + removed traling blanks Revision 1.5 2003/03/28 09:20:35 kbk added new copyright to files Revision 1.4 2003/03/28 08:56:56 kbk removed tabs Revision 1.3 2003/03/10 08:50:06 gotm Improved documentation and cleaned up code Revision 1.1.1.1 2001/02/12 15:55:57 gotm initial import into CVS

Karsten Bolding 2012-01-24