next up previous contents
Next: Initialise the turbulence module Up: The turbulence model Previous: Numerics


Module turbulence: its all in here ...


INTERFACE:

   module turbulence
DESCRIPTION:

In this module, variables of the turbulence model and some member functions to manipulate them are defined. The key-functions are init_turbulence(), which initialises the model, and do_turbulence(), which manages the time step for the whole procedure. These two functions are the only `public' member functions i.e. they are callable from outside the module. There are many more internal functions, for which descriptions are provided seperately.

It should be pointed out that the turbulence module of GOTM may be used in combination with virtually any shallow-wate 3-D circulation model using a structured grid in the vertical direction. To this end, a clear interface separating the mean flow and the turbulence part of GOTM is required. Vertical columns of the three-dimensional fields have to copied into one-dimensional vectors, which are passed to GOTM. With the help of this information, GOTM updates the turbulent fields and returns one-dimensional vectors of the turbulent diffusivities and/or the turbulent fluxes to the 3-D model. The `door' between the 3-D model and GOTM is the function do_turbulence(), which has been designed with these ideas in mind.


USES:

   IMPLICIT NONE
 
   default: all is private.
   private
PUBLIC MEMBER FUNCTIONS:
   public init_turbulence, do_turbulence
   public k_bc,q2over2_bc,epsilon_bc,psi_bc,q2l_bc
   public clean_turbulence
PUBLIC DATA MEMBERS:
   TKE, rate of dissipation, turbulent length-scale
   REALTYPE, public, dimension(:), allocatable   :: tke,eps,L
 
   TKE at old time level
   REALTYPE, public, dimension(:), allocatable   :: tkeo
 
   buoyancy variance and its destruction
   REALTYPE, public, dimension(:), allocatable   :: kb,epsb
 
   shear and buoyancy production
   of tke and buoyancy variance
   REALTYPE, public, dimension(:), allocatable   :: P,B,Pb
 
   turbulent diffusivities
   of momentum, temperature, salinity
   REALTYPE, public, dimension(:), allocatable   :: num,nuh,nus
 
   non-local fluxes of momentum
   REALTYPE, public, dimension(:), allocatable   :: gamu,gamv
 
   non-local fluxes
   of buoyancy, temperature, salinity
   REALTYPE, public, dimension(:), allocatable   :: gamb,gamh,gams
 
   non-dimensional  stability functions
   REALTYPE, public, dimension(:), allocatable   :: cmue1,cmue2
 
   non-dimensional counter-gradient term
   REALTYPE, public, dimension(:), allocatable   :: gam
 
   alpha_M, alpha_N, and alpha_B
   REALTYPE, public, dimension(:), allocatable   :: as,an,at
 
   time scale ratio r
   REALTYPE, public, dimension(:), allocatable   :: r
 
   the gradient Richardson number
   REALTYPE, public, dimension(:), allocatable   :: Rig
 
   the flux Richardson number
   REALTYPE, public, dimension(:), allocatable   :: xRf
 
   turbulent velocity variances
   REALTYPE, public, dimension(:), allocatable   :: uu,vv,ww
 
  ifdef EXTRA_OUTPUT
 
   dummies for testing
   REALTYPE, public, dimension(:), allocatable   :: turb1,turb2,turb3,turb4,turb5
 
  endif
 
   some additional constants
   REALTYPE, public                              :: cm0,cmsf,cde,rcm, b1
 
   Prandtl-number in neutrally stratified flow
   REALTYPE, public                              :: Prandtl0
 
   parameters for wave-breaking
   REALTYPE, public                              :: craig_m,sig_e0
 
   the 'turbulence' namelist
   integer, public                               :: turb_method=2
   integer, public                               :: tke_method=2
   integer, public                               :: len_scale_method=8
   integer, public                               :: stab_method=3
 
   the 'bc' namelist
   integer, public                               :: k_ubc=1
   integer, public                               :: k_lbc=1
   integer, public                               :: kb_ubc=1
   integer, public                               :: kb_lbc=1
   integer, public                               :: psi_ubc=1
   integer, public                               :: psi_lbc=1
   integer, public                               :: ubc_type=1
   integer, public                               :: lbc_type=1
 
   the 'turb_param' namelist
   REALTYPE, public                              :: cm0_fix=0.5477
   REALTYPE, public                              :: Prandtl0_fix=0.74
   REALTYPE, public                              :: cw=100.0
   logical                                       :: compute_kappa=.false.
   REALTYPE, public                              :: kappa=0.4
   logical                                       :: compute_c3=.false.
   REALTYPE                                      :: ri_st=0.25
   logical,  public                              :: length_lim=.false.
   REALTYPE, public                              :: galp=0.53
   REALTYPE, public                              :: const_num=5.0e-4
   REALTYPE, public                              :: const_nuh=5.0e-4
   REALTYPE, public                              :: k_min=1.0e-8
   REALTYPE, public                              :: eps_min=1.0e-12
   REALTYPE, public                              :: kb_min=1.0e-8
   REALTYPE, public                              :: epsb_min=1.0e-12
 
   the 'generic' namelist
   logical                                       :: compute_param=.false.
   REALTYPE, public                              :: gen_m=1.5
   REALTYPE, public                              :: gen_n=-1.0
   REALTYPE, public                              :: gen_p=3.0
   REALTYPE, public                              :: cpsi1=1.44
   REALTYPE, public                              :: cpsi2=1.92
   REALTYPE, public                              :: cpsi3minus=0.0
   REALTYPE, public                              :: cpsi3plus=1.0
   REALTYPE                                      :: sig_kpsi=1.0
   REALTYPE, public                              :: sig_psi=1.3
   REALTYPE                                      :: gen_d=-1.2
   REALTYPE                                      :: gen_alpha=-2.0
   REALTYPE                                      :: gen_l=0.2
 
   the 'keps' namelist
   REALTYPE, public                              :: ce1=1.44
   REALTYPE, public                              :: ce2=1.92
   REALTYPE, public                              :: ce3minus=0.0
   REALTYPE, public                              :: ce3plus=1.0
   REALTYPE, public                              :: sig_k=1.0
   REALTYPE, public                              :: sig_e=1.3
   logical,  public                              :: sig_peps=.false.
 
   the 'my' namelist
   REALTYPE, public                              :: e1=1.8
   REALTYPE, public                              :: e2=1.33
   REALTYPE, public                              :: e3=1.8
   REALTYPE, public                              :: sq=0.2
   REALTYPE, public                              :: sl=0.2
   integer,  public                              :: my_length=1
   logical,  public                              :: new_constr=.false.
 
   the 'scnd' namelist
   integer                                       ::  scnd_method
   integer                                       ::  kb_method
   integer                                       ::  epsb_method
   integer                                       ::  scnd_coeff
   REALTYPE ,public                              ::  cc1
   REALTYPE, public                              ::  ct1,ctt
   REALTYPE, public                              ::  cc2,cc3,cc4,cc5,cc6
   REALTYPE, public                              ::  ct2,ct3,ct4,ct5
 
   the a_i's for the ASM
   REALTYPE, public                              ::  a1,a2,a3,a4,a5
   REALTYPE, public                              ::  at1,at2,at3,at4,at5
 
 
   the 'iw' namelist
   integer,  public                              :: iw_model=0
   REALTYPE, public                              :: alpha=0.0
   REALTYPE, public                              :: klimiw=1e-6
   REALTYPE, public                              :: rich_cr=0.7
   REALTYPE, public                              :: numiw=1.e-4
   REALTYPE, public                              :: nuhiw=5.e-5
   REALTYPE, public                              :: numshear=5.e-3
DEFINED PARAMETERS:
 
   general outline of the turbulence model
   integer, parameter, public                    :: convective=0
   integer, parameter, public                    :: algebraic=1
   integer, parameter, public                    :: first_order=2
   integer, parameter, public                    :: second_order=3
 
   method to update TKE
   integer, parameter, public                    :: tke_local_eq=1
   integer, parameter, public                    :: tke_keps=2
   integer, parameter, public                    :: tke_MY=3
 
   stability functions
   integer, parameter, public                    :: Constant=1
   integer, parameter, public                    :: MunkAnderson=2
   integer, parameter, public                    :: SchumGerz=3
   integer, parameter, public                    :: EiflerSchrimpf=4
 
   method to update length scale
   integer, parameter                            :: Parabola=1
   integer, parameter                            :: Triangle=2
   integer, parameter                            :: Xing=3
   integer, parameter                            :: RobertOuellet=4
   integer, parameter                            :: Blackadar=5
   integer, parameter                            :: BougeaultAndre=6
   integer, parameter                            :: ispra_length=7
   integer, parameter, public                    :: diss_eq=8
   integer, parameter, public                    :: length_eq=9
   integer, parameter, public                    :: generic_eq=10
 
   boundary conditions
   integer, parameter, public                    :: Dirichlet=0
   integer, parameter, public                    :: Neumann=1
   integer, parameter, public                    :: viscous=0
   integer, parameter, public                    :: logarithmic=1
   integer, parameter, public                    :: injection=2
 
   type of second-order model
   integer, parameter                            :: quasiEq=1
   integer, parameter                            :: weakEqKbEq=2
   integer, parameter                            :: weakEqKb=3
 
   method to solve equation for k_b
   integer, parameter                            :: kb_algebraic=1
   integer, parameter                            :: kb_dynamic=2
 
   method to solve equation for epsilon_b
   integer, parameter                            :: epsb_algebraic=1
   integer, parameter                            :: epsb_dynamic=2
BUGS:
         The algebraic equation for the TKE is not save
         to use at the moment. Use it only in conncection
         with the prescribed length-scale profiles. The
         functions report_model() will report wrong things
         for the algebraic TKE equation. To be fixed with
         the next version.
REVISION HISTORY:
   Original author(s): Karsten Bolding, Hans Burchard,
                       Manuel Ruiz Villarreal,
                       Lars Umlauf
 
   $Log: turbulence.F90,v $
   Revision 1.18  2007-07-23 11:28:39  hb
   cw for Craig-Banner wave breaking from namelist now used in fk_craig.F90
   Revision 1.17  2007-01-06 11:49:15  kbk
   namelist file extension changed .inp --> .nml
   Revision 1.16  2006-11-24 15:13:41  kbk
   de-allocate memory and close open files
   Revision 1.15  2005/11/15 11:35:02  lars
   documentation finish for print
   Revision 1.14  2005/09/13 10:00:54  kbk
   init_turbulence() now prints version - obtained from Makefile
   Revision 1.13  2005/08/11 13:00:15  lars
   Added explicit interface for xP. Bug found by Vicente Fernandez.
   Revision 1.12  2005/07/19 16:46:14  hb
   removed superfluous variables - NNT, NNS, SSU, SSV
   Revision 1.11  2005/07/19 16:33:22  hb
   moved  variances() from do_turbulence() to time_loop()
   Revision 1.10  2005/07/12 10:13:22  hb
   dependence of init_turbulence from depth, z0s, z0b removed
   Revision 1.9  2005/07/06 14:07:17  kbk
   added KPP, updated documentation, new structure of turbulence module
   Revision 1.7  2003/03/28 09:20:35  kbk
   added new copyright to files
   Revision 1.6  2003/03/28 08:20:01  kbk
   removed tabs
   Revision 1.5  2003/03/10 09:02:06  gotm
   Added new Generic Turbulence Model + 
   improved documentation and cleaned up code
   Revision 1.3  2001/11/27 19:42:58  gotm
   Cleaned
   Revision 1.2  2001/11/18 16:15:30  gotm
   New generic two-equation model
   Revision 1.1.1.1  2001/02/12 15:55:58  gotm
   initial import into CVS



Subsections
next up previous contents
Next: Initialise the turbulence module Up: The turbulence model Previous: Numerics
Lars Umlauf
2007-12-11