ocean_tidal_mixing_init Subroutine

private subroutine ocean_tidal_mixing_init(this, grid, nz_ml)

Allocate the persistent fields. Always allocates (configure runs after init, so enable is not known yet); the off-cost is one 2D field + one interface field.

Type Bound

ocean_tidal_mixing_t

Arguments

Type IntentOptional Attributes Name
class(ocean_tidal_mixing_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
integer, intent(in), optional :: nz_ml

Variables

Type Visibility Attributes Name Initial
integer, private :: nx
integer, private :: ny
integer, private :: nz

Source Code

   subroutine ocean_tidal_mixing_init(this, grid, nz_ml)
      !! Allocate the persistent fields.  Always allocates (configure
      !! runs after init, so `enable` is not known yet); the off-cost is
      !! one 2D field + one interface field.
      class(ocean_tidal_mixing_t), intent(inout) :: this
      type(hgrid_t), intent(in) :: grid
      integer, intent(in), optional :: nz_ml
      integer :: nx, ny, nz

      nx = grid%nx_total
      ny = grid%ny_total
      nz = 1
      if (present(nz_ml)) nz = nz_ml

      allocate (this%e_in(nx, ny), source=0.0_wp)
      allocate (this%kd_int(nx, ny, nz + 1), source=0.0_wp)

      this%is_init = .true.
   end subroutine ocean_tidal_mixing_init