bt_rem_wave_drag_open_impl Subroutine

private pure subroutine bt_rem_wave_drag_open_impl(nx, ny, nz, h_layer, open_u, open_v, lwd_u, lwd_v, dt_inner, bt_rem_u, bt_rem_v)

compute_bt_rem_wave_drag under &vcoord_nml zfixed_closed_faces: MULTIPLIES H/(H + r_H·dt_inner) into bt_rem with the OPEN-column face depth H = Σ_k h_face·open (the bt_rem_open_impl depth). H <= 0 (every layer closed) ⇒ unmodified, MOM6’s guard.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
real(kind=wp), intent(in) :: h_layer(nx,ny,nz)
real(kind=wp), intent(in) :: open_u(nx+1,ny,nz)
real(kind=wp), intent(in) :: open_v(nx,ny+1,nz)
real(kind=wp), intent(in) :: lwd_u(nx+1,ny)
real(kind=wp), intent(in) :: lwd_v(nx,ny+1)
real(kind=wp), intent(in) :: dt_inner
real(kind=wp), intent(inout) :: bt_rem_u(nx+1,ny)
real(kind=wp), intent(inout) :: bt_rem_v(nx,ny+1)

Calls

proc~~bt_rem_wave_drag_open_impl~~CallsGraph proc~bt_rem_wave_drag_open_impl bt_rem_wave_drag_open_impl local local proc~bt_rem_wave_drag_open_impl->local

Called by

proc~~bt_rem_wave_drag_open_impl~~CalledByGraph proc~bt_rem_wave_drag_open_impl bt_rem_wave_drag_open_impl proc~compute_bt_rem_wave_drag compute_bt_rem_wave_drag proc~compute_bt_rem_wave_drag->proc~bt_rem_wave_drag_open_impl proc~run_stage_split run_stage_split proc~run_stage_split->proc~compute_bt_rem_wave_drag proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_stage_split 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
real(kind=wp), private :: htot_face
integer, private :: i
integer, private :: j
integer, private :: k

Source Code

   pure subroutine bt_rem_wave_drag_open_impl(nx, ny, nz, h_layer, open_u, open_v, &
                                              lwd_u, lwd_v, dt_inner, bt_rem_u, bt_rem_v)
      !! `compute_bt_rem_wave_drag` under `&vcoord_nml zfixed_closed_faces`:
      !! MULTIPLIES `H/(H + r_H·dt_inner)` into `bt_rem` with the OPEN-column
      !! face depth `H = Σ_k h_face·open` (the `bt_rem_open_impl` depth).
      !! `H <= 0` (every layer closed) ⇒ unmodified, MOM6's guard.
      integer, intent(in) :: nx, ny, nz
      real(wp), intent(in) :: h_layer(nx, ny, nz)
      real(wp), intent(in) :: open_u(nx + 1, ny, nz), open_v(nx, ny + 1, nz)
      real(wp), intent(in) :: lwd_u(nx + 1, ny), lwd_v(nx, ny + 1)
      real(wp), intent(in) :: dt_inner
      real(wp), intent(inout) :: bt_rem_u(nx + 1, ny), bt_rem_v(nx, ny + 1)
      integer :: i, j, k
      real(wp) :: htot_face

      do concurrent(j=1:ny, i=2:nx) local(k, htot_face)
         htot_face = 0.0_wp
         do k = 1, nz
            htot_face = htot_face + &
                        0.5_wp*(h_layer(i - 1, j, k) + h_layer(i, j, k))*open_u(i, j, k)
         end do
         if (htot_face > 0.0_wp) then
            bt_rem_u(i, j) = bt_rem_u(i, j)*(htot_face/(htot_face + lwd_u(i, j)*dt_inner))
         end if
      end do

      do concurrent(j=2:ny, i=1:nx) local(k, htot_face)
         htot_face = 0.0_wp
         do k = 1, nz
            htot_face = htot_face + &
                        0.5_wp*(h_layer(i, j - 1, k) + h_layer(i, j, k))*open_v(i, j, k)
         end do
         if (htot_face > 0.0_wp) then
            bt_rem_v(i, j) = bt_rem_v(i, j)*(htot_face/(htot_face + lwd_v(i, j)*dt_inner))
         end if
      end do
   end subroutine bt_rem_wave_drag_open_impl