ocean_kappa_shear_set_f_corner Subroutine

private subroutine ocean_kappa_shear_set_f_corner(this, grid, f_0, beta, y_ref)

Fill f_corner with the SIGNED beta-plane Coriolis at C-grid corners: f_0 + beta(y - y_ref), corner row j at y = (j-1-nghost)dy (half a cell below centre row j — corner (i,j) is the SW corner of cell (i,j)). Bit-identical to metrics_fill_coriolis’s beta-plane corner fill. Call after init_vertex, before enter_data.

Type Bound

ocean_kappa_shear_t

Arguments

Type IntentOptional Attributes Name
class(ocean_kappa_shear_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
real(kind=wp), intent(in) :: f_0
real(kind=wp), intent(in) :: beta
real(kind=wp), intent(in) :: y_ref

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j
integer, private :: ng
real(kind=wp), private :: y

Source Code

   subroutine ocean_kappa_shear_set_f_corner(this, grid, f_0, beta, y_ref)
      !! Fill `f_corner` with the SIGNED beta-plane Coriolis at C-grid
      !! corners: f_0 + beta*(y - y_ref), corner row j at
      !! y = (j-1-nghost)*dy (half a cell below centre row j — corner
      !! (i,j) is the SW corner of cell (i,j)).  Bit-identical to
      !! `metrics_fill_coriolis`'s beta-plane corner fill.  Call after
      !! `init_vertex`, before `enter_data`.
      class(ocean_kappa_shear_t), intent(inout) :: this
      type(hgrid_t), intent(in) :: grid
      real(wp), intent(in) :: f_0, beta, y_ref
      integer :: i, j, ng
      real(wp) :: y

      ng = grid%nghost
      do j = 1, size(this%f_corner, 2)
         y = real(j + grid%j_offset_global - 1 - ng, wp)*grid%dy
         do i = 1, size(this%f_corner, 1)
            this%f_corner(i, j) = f_0 + beta*(y - y_ref)
         end do
      end do
   end subroutine ocean_kappa_shear_set_f_corner