redi_open_windows_x Subroutine

private pure subroutine redi_open_windows_x(nx, ny, nz, h_layer, open_u, uKb, uKt)

Fill every interior u-face’s OPEN WINDOW (&vcoord_nml zfixed_closed_faces; module header): ok(k) = open_u .and. live on both sides (rdb_vl_is_live), then redi_open_window.

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)

Per-layer 0/1 u-face open mask (metrics%open_u, full size).

integer, intent(inout) :: uKb(nx+1,ny)
integer, intent(inout) :: uKt(nx+1,ny)

Calls

proc~~redi_open_windows_x~~CallsGraph proc~redi_open_windows_x redi_open_windows_x local local proc~redi_open_windows_x->local proc~redi_open_window redi_open_window proc~redi_open_windows_x->proc~redi_open_window rdb_vl_is_live rdb_vl_is_live proc~redi_open_windows_x->rdb_vl_is_live

Called by

proc~~redi_open_windows_x~~CalledByGraph proc~redi_open_windows_x redi_open_windows_x proc~redi_calc_coeffs redi_calc_coeffs proc~redi_calc_coeffs->proc~redi_open_windows_x proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~redi_calc_coeffs 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 proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j
integer, private :: k
integer, private :: kb
integer, private :: kt
logical, private :: ok(NZ_STACK_MAX)

Source Code

   pure subroutine redi_open_windows_x(nx, ny, nz, h_layer, open_u, uKb, uKt)
      !! Fill every interior u-face's OPEN WINDOW (`&vcoord_nml
      !! zfixed_closed_faces`; module header): `ok(k) = open_u .and.` live
      !! on both sides (`rdb_vl_is_live`), then `redi_open_window`.
      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)
         !! Per-layer 0/1 u-face open mask (`metrics%open_u`, full size).
      integer, intent(inout) :: uKb(nx + 1, ny), uKt(nx + 1, ny)
      integer :: i, j, k, kb, kt
      logical :: ok(NZ_STACK_MAX)

      do concurrent(j=1:ny, i=2:nx) local(k, kb, kt, ok)
         do k = 1, nz
            ok(k) = open_u(i, j, k) > 0.5_wp .and. &
                    rdb_vl_is_live(h_layer(i - 1, j, k)) .and. &
                    rdb_vl_is_live(h_layer(i, j, k))
         end do
         call redi_open_window(nz, ok, kb, kt)
         uKb(i, j) = kb
         uKt(i, j) = kt
      end do
   end subroutine redi_open_windows_x