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 | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_lateral_mix_t), | intent(inout) | :: | this | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in), | optional | :: | nz_ml |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | nx | ||||
| integer, | private | :: | ny | ||||
| integer, | private | :: | nz |
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