bt_rem_open_impl Subroutine

private pure subroutine bt_rem_open_impl(nx, ny, nz, h_layer, open_u, open_v, drag_dt, bt_rem_u, bt_rem_v)

compute_bt_rem under &vcoord_nml zfixed_closed_faces: the same H/(H + r·hbbl·dt_inner) with H = Σ_k h_face·open (the OPEN-column centred face depth, the weight face_depth_mean_* uses). A face whose every layer is closed has H = 0 and keeps bt_rem = 1, exactly like a dry face on the original path (it carries no barotropic transport: dy_cu_bt = 0 there).

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) :: drag_dt

r_linear·hbbl·dt_inner (m).

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_open_impl~~CallsGraph proc~bt_rem_open_impl bt_rem_open_impl local local proc~bt_rem_open_impl->local

Called by

proc~~bt_rem_open_impl~~CalledByGraph proc~bt_rem_open_impl bt_rem_open_impl proc~compute_bt_rem compute_bt_rem proc~compute_bt_rem->proc~bt_rem_open_impl proc~run_stage_split run_stage_split proc~run_stage_split->proc~compute_bt_rem 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_open_impl(nx, ny, nz, h_layer, open_u, open_v, drag_dt, &
                                    bt_rem_u, bt_rem_v)
      !! `compute_bt_rem` under `&vcoord_nml zfixed_closed_faces`: the
      !! same `H/(H + r·hbbl·dt_inner)` with `H = Σ_k h_face·open` (the
      !! OPEN-column centred face depth, the weight `face_depth_mean_*`
      !! uses).  A face whose every layer is closed has `H = 0` and keeps
      !! `bt_rem = 1`, exactly like a dry face on the original path (it
      !! carries no barotropic transport: `dy_cu_bt = 0` there).
      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) :: drag_dt
         !! `r_linear·hbbl·dt_inner` (m).
      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) = htot_face/(htot_face + drag_dt)
         else
            bt_rem_u(i, j) = 1.0_wp
         end if
      end do
      do concurrent(j=1:ny)
         bt_rem_u(1, j) = 1.0_wp
         bt_rem_u(nx + 1, j) = 1.0_wp
      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) = htot_face/(htot_face + drag_dt)
         else
            bt_rem_v(i, j) = 1.0_wp
         end if
      end do
      do concurrent(i=1:nx)
         bt_rem_v(i, 1) = 1.0_wp
         bt_rem_v(i, ny + 1) = 1.0_wp
      end do
   end subroutine bt_rem_open_impl