## The vertical grid

INTERFACE:

   subroutine updategrid(nlev,dt,zeta)

DESCRIPTION:

This subroutine calculates for each time step new layer thicknesses in order to fit them to the changing water depth. Three different grids can be specified:

1. Equidistant grid with possible zooming towards surface and bottom. The number of layers, nlev, and the zooming factors, ddu= and ddl=, are specified in gotmmean.nml. Zooming is applied according to the formula

 (11)

From this formula, the following grids are constructed:

• results in equidistant discretisations.
• results in zooming near the bottom.
• results in zooming near the surface.
• results in double zooming nea both, the surface and the bottom.

2. Sigma-layers. The fraction that every layer occupies is read-in from file, see gotmmean.nml.
3. Cartesian layers. The height of every layer is read in from file, see gotmmean.nml. This method is not recommended when a varying sea surface is considered.

Furthermore, vertical velocity profiles are calculated here, if w_adv_method is 1 or 2, which has to be chosen in the w_advspec namelist in obs.nml. The profiles of vertical velocity are determined by two values, the height of maximum absolute value of vertical velocity, w_height, and the vertical velocity at this height, w_adv. From w_height, the vertical velocity is linearly decreasing towards the surface and the bottom, where is value is zero.

USES:

   use meanflow,     only: grid_ready
use meanflow,     only: depth0,depth
use meanflow,     only: ga,z,h,ho,ddu,ddl,grid_method
use meanflow,     only: NN,SS,w_grid,grid_file,w
use observations, only: zeta_method,w_adv_method
use observations, only: w_adv,w_height,w_adv_discr
IMPLICIT NONE

INPUT PARAMETERS:
   integer, intent(in)                 :: nlev
REALTYPE, intent(in)                :: dt,zeta

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


Karsten Bolding 2012-12-28