- subroutine turbulence_closure
- Description
- Numerical Equations
- Subroutine Arguments
- Local variables
- Global variables changed
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine al_init
- Description
- Numerical Equations
- Subroutine Arguments
- Local variables
- Global variables changed
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine bulk_gradients
- Description
- Numerical Equations
- Subroutine Arguments
- Local variables
- Global variables changed
- Logical units
- Order of Things
- Called By
- Options - Compiler
- Known Issues

- subroutine update_AL
- Description
- Subroutine Arguments
- Local variables
- Global variables changed
- Order of Things
- Calls
- Called By
- Options - Compiler
- Known Issues

- subroutine limit_AL
- Description
- Numerical Equations
- Subroutine Arguments
- Local variables
- Global variables changed
- Order of Things
- Calls
- Called By
- Options - Compiler
- Known Issues

- subroutine stability_functions
- Description
- Subroutine Arguments
- Local variables
- Global variables changed
- Logical units
- Order of Things
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine Q_L_on_B
- Description
- Subroutine Arguments
- Local variables
- Global variables changed
- Order of Things
- Calls
- Called By
- Options - Compiler
- Known Issues

- subroutine KP_Q2
- Description
- Subroutine Arguments
- Local variables
- Global variables changed
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine update_TKE
- Description
- Subroutine Arguments
- Local variables
- Global variables changed
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine second_eqn

- Numerical Equations
- Subroutine Arguments
- Local variables
- Global variables changed
- Order of Things
- Calls
- Called By
- Options - Compiler
- Known Issues

- subroutine source_terms_q2l

- Numerical Equations
- Subroutine Arguments
- Local variables
- Global variables changed
- Order of Things
- Calls
- Called By
- Options - Compiler
- Known Issues

- subroutine update_Q2L
- Description
- Subroutine Arguments
- Local variables
- Global variables changed
- Order of Things
- Calls
- Called By
- Options - Compiler
- Known Issues

- subroutine Q_L_on_B_Q2L
- Description
- Subroutine Arguments
- Local variables
- Global variables changed
- Order of Things
- Calls
- Called By
- Options - Compiler
- Known Issues

- subroutine aakcon

tubulence.F

subroutine turbulence_closure

**The subroutine uses the Galperin et al (1988)stability relations. The surface
boundary conditions includes the wind waves effect as in Craig and Banner
(1994), while the bottom boundary condition assumes a steady state balance
between shear production and dissipation.
**

**The algebraic mixing l length used here is:
**

**The system is then closed by
**

**i,j,k,iig,jjg**Grid indeces**tagb,tagh,tagqsq,tagaln**Communication tags for MPI**first**Logical

**qsq,aln**twice the turbulent kinetic energy and micing length

- none

- Exchange values of b and h.
- First time called allocate variables and set initial value of al.
- Looping through u-points:
- Calculates bulk gradients.
- Calculates the mixing length if using the algebraic option (default).
- Calculates Stability funtions Sm and Sh
- Calculates the Changes of TKE due to shear strees and buoyancy.
- Calculates the Changes of TKE due to diffusion.
- Updates TKE
- Updates Mixing length scale either algebraically or using the second differential equation.
- Calculates stability functions.
- Calculates
- Exchanges qsq and al
- Looping through b-points:
- Calculates qsq and al
- Calculates stability functions
- Calculates

- Exch3DS,Exch3DR
- al_init
- bulk_gradients
- stability_functions
- source_terms
- KP_Q2
- update_TKE
- update_AL
- second_eqn
- Q_L_on_B
- Q_L_on_B_Q2L

- b3drun

- first

- none

- none

subroutine al_init

- none

**i,j,k**grid indices**tagaln**Message passing tag**al1,al2,almax,hc**max l, critical h

**aln**

- none

- Sets the depth critical value.
- Sets maximum l
- Calculates length scale

- Exch3DS,Exch3DR

- turbulence_closure

- none

- SCOORD

- none

subroutine bulk_gradients

**i,j**Horizontal grid indeces

- none

**none**

- none

- Calculates vertical buoyancy gradient
- Calculates Shear

- turbulence_closure

- SCOORD
- NO_CONVADJ

- none

subroutine update_AL

**i,j**Horizontal grid indeces.

**k**Vertical grid index

**al**

- Calculates al by multiplying aln by h.
- Limits al.

- limitAL

- turbulence_closure

- SCOORD

- none

subroutine limit_AL

- none

**k**vertical grid index**alim, Ri**length scale scaling factor, Richardson Number.

**al**

- Check stratification and shear
- Calculates limiting factor for mixing length.

- none

- update_AL
- update_Q2L
- Q_L_on_B_Q2L
- update_Q2L

- none

- none

subroutine stability_functions

- none

**k**Vertical grid index**gg**Gaperin Stability function

**none**

- none

- Sets the boundary values of S_H and S_M.
- Calculates gg for the internal points.
- Calculates S_M and S_H for the internal points.

- turbulence_closure

- none

- none

- none

subroutine Q_L_on_B

**i,j,iig,jjg**Horizontal grid indeces.

**k**vertical grid indeces.

**qsq,al**Twice TKE and mixing scale.

- Calculates vertical buoyancy gradients and length scale in case of S-coordinates.
- If no convective adjsutment the buoyancy gradients are small they are set to zero.
- Interpolates qsq.
- interpolates al.
- Calculates sqs.
- Limits al.

- limit_AL

- turbulence_closure

- SCOORD
- NO_CONVADJ

- none

subroutine KP_Q2

- None

- k Vertical grid index
- qq Eddy diffusivity for TKE

**none**

- Sets value of .
- Calculates Eddy diffusivity.

- none

- turbulence_closure

- none

- none

- none

subroutine update_TKE

**i,j**Horizontal grdi indeces.

**k**vertical grid.**hh**depth squate**qk**diffusion

**qsq**

- Evaluates Bottom Boundary Condition
- Evaluates Surface Boundary Condition
- Set coefficients for (n-1)*(n-1) tridiagonal matrix: acr*qsq(k-1,i,j)+bcr*qsq(k,i,j)+ccr*qsq(k+1,i,j)=rcr
- Solves tridiagonal matrix for qsq
- Checks that qsq is greater than the minimum qsq

- tridag

- turbulence_closure

- none

- SCOORD

- none

subroutine second_eqn

**i,j**Horizontal grid indeces.

**k**Vertical grid index

**al**mixing length scale

- Calculates balance between production and dissipation
- Updates by solving diferential equation including diffusion terms

- source_terms_q2l
- update_q2l

- turbulence_closure

- none

- Not tested in anger

subroutine source_terms_q2l

**i,j**Vertical grid indeces.

**k**Vertical grid index**gamma**Use to store the shear and buoyancy components.**sigop**Use in the wall proximity function.

**none**

- Calculates 0-order changes in .
- Calculates 1-order changes in .

- none

- second_equation

- SCOORD

- Not tested in anger

subroutine update_Q2L

**i,j**Horizontal indeces.

**k**Vertical index.**hh**Depth square.**qk**Eddy diffusivity for turbulence.

**al**

- Set coefficients for (n-1)*(n-1) tridiagonal matrix acr*qsq(k-1,i,j)+bcr*qsq(k,i,j)+ccr*qsq(k+1,i,j)=rcr
- Solves matrix.
- Calculates al
- limits al

- tridiag
- limit_AL

- second_equation

- SCOORD

- Not used in Anger

subroutine Q_L_on_B_Q2L

- i,j,iig,jjg Horizontal grid indeces.

- k vertical grid indeces.

**qsq,al**Twice TKE and mixing scale.

- Calculates vertical buoyancy gradients and length scale in case of S-coordinates.
- If no convective adjsutment the buoyancy gradients are small they are set to zero.
- Interpolates qsq.
- interpolates al.
- Calculates sqs.
- Limits al.

- limit_AL

- turbulence_closure

- SCOORD
- NO_CONVADJ

- none

subroutine aakcon

**i,j,k**Grid indeces

**aa,ak**Eddy viscosity and eddy diffusivity

- none

- Sets eddy diffusitity on wet points to 0.1 ms as default.
- Set eddy viscosity on wet points to 0.01 ms as default.

- none

- b3drun

- none

- none

- none