ocean_lateral_mix_init Subroutine

private subroutine ocean_lateral_mix_init(this, grid, nz_ml)

Allocate the face viscosity coefficients + corner-vorticity scratch. Default nz_ml = 1 preserves the barotropic-only constructor; pass nz_ml = ms%nz_ml for the multilayer driver.

Type Bound

ocean_lateral_mix_t

Arguments

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

Calls

proc~~ocean_lateral_mix_init~~CallsGraph proc~ocean_lateral_mix_init ocean_lateral_mix_t%ocean_lateral_mix_init proc~scratch_3d_buffer_init scratch_3d_buffer_t%scratch_3d_buffer_init proc~ocean_lateral_mix_init->proc~scratch_3d_buffer_init

Variables

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

Source Code

   subroutine ocean_lateral_mix_init(this, grid, nz_ml)
      !! Allocate the face viscosity coefficients + corner-vorticity
      !! scratch.  Default `nz_ml = 1` preserves the barotropic-only
      !! constructor; pass `nz_ml = ms%nz_ml` for the multilayer driver.
      class(ocean_lateral_mix_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
      if (nz < 1) nz = 1
      this%nx_total = nx
      this%ny_total = ny
      this%nz_ml = nz

      allocate (this%ah_face_x(nx + 1, ny, nz), source=0.0_wp)
      allocate (this%ah_face_y(nx, ny + 1, nz), source=0.0_wp)
      allocate (this%nu4_face_x(nx + 1, ny, nz), source=0.0_wp)
      allocate (this%nu4_face_y(nx, ny + 1, nz), source=0.0_wp)
      call this%vort_corner%init(nx + 1, ny + 1, nz, "lateral_mix_vort_corner")
      this%is_init = .true.
   end subroutine ocean_lateral_mix_init