meke_bbl_speed2 Subroutine

private pure subroutine meke_bbl_speed2(nx, ny, nz, u_face, v_face, k_bot_u, k_bot_v, u_bbl2)

Resolved bed-layer speed² at cell centres: u_bbl2 = u_c² + v_c² with u_c = ½(u_face(i)+u_face(i+1)), v_c = ½(v_face(j)+v_face(j+1)), each face read on ITS OWN bed layer k_bot_u/v (the first layer live on both sides counting up; 1 off z_fixed ⇒ the historical k=1 read). Under z_fixed the layers below are inert fillers whose velocity the closed-face mask has zeroed, so a k = 1 read reported a motionless bed. The bottom eddy velocity the MEKE drag law needs (MOM6 drag_rate_visc).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
real(kind=wp), intent(in) :: u_face(nx+1,ny,nz)
real(kind=wp), intent(in) :: v_face(nx,ny+1,nz)
integer, intent(in) :: k_bot_u(nx+1,ny)
integer, intent(in) :: k_bot_v(nx,ny+1)
real(kind=wp), intent(inout) :: u_bbl2(nx,ny)

Calls

proc~~meke_bbl_speed2~~CallsGraph proc~meke_bbl_speed2 meke_bbl_speed2 local local proc~meke_bbl_speed2->local

Called by

proc~~meke_bbl_speed2~~CalledByGraph proc~meke_bbl_speed2 meke_bbl_speed2 proc~meke_step meke_step proc~meke_step->proc~meke_bbl_speed2 proc~run_meke_step run_meke_step proc~run_meke_step->proc~meke_step proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_meke_step proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step

Variables

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

Source Code

   pure subroutine meke_bbl_speed2(nx, ny, nz, u_face, v_face, k_bot_u, k_bot_v, u_bbl2)
      !! Resolved bed-layer speed² at cell centres:
      !! `u_bbl2 = u_c² + v_c²` with `u_c = ½(u_face(i)+u_face(i+1))`,
      !! `v_c = ½(v_face(j)+v_face(j+1))`, each face read on ITS OWN bed
      !! layer `k_bot_u/v` (the first layer live on both sides counting up;
      !! `1` off `z_fixed` ⇒ the historical k=1 read).  Under `z_fixed` the
      !! layers below are inert fillers whose velocity the closed-face mask
      !! has zeroed, so a `k = 1` read reported a motionless bed.  The
      !! bottom eddy velocity the MEKE drag law needs (MOM6 `drag_rate_visc`).
      integer, intent(in) :: nx, ny, nz
      real(wp), intent(in) :: u_face(nx + 1, ny, nz)
      real(wp), intent(in) :: v_face(nx, ny + 1, nz)
      integer, intent(in) :: k_bot_u(nx + 1, ny)
      integer, intent(in) :: k_bot_v(nx, ny + 1)
      real(wp), intent(inout) :: u_bbl2(nx, ny)
      integer :: i, j
      real(wp) :: u_c, v_c
      do concurrent(j=1:ny, i=1:nx) local(u_c, v_c)
         u_c = 0.5_wp*(u_face(i, j, k_bot_u(i, j)) + u_face(i + 1, j, k_bot_u(i + 1, j)))
         v_c = 0.5_wp*(v_face(i, j, k_bot_v(i, j)) + v_face(i, j + 1, k_bot_v(i, j + 1)))
         u_bbl2(i, j) = u_c*u_c + v_c*v_c
      end do
   end subroutine meke_bbl_speed2