redi_open_window Subroutine

private pure subroutine redi_open_window(nz, ok, kb, kt)

A face’s OPEN WINDOW from its per-layer ok flags (open .and. live on both sides; module header): kt the topmost ok layer, kb..kt the contiguous ok run counted down from it. No ok layer ⇒ kb = 1, kt = 0 (an empty window, kt < kb).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nz
logical, intent(in) :: ok(NZ_STACK_MAX)
integer, intent(out) :: kb
integer, intent(out) :: kt

Called by

proc~~redi_open_window~~CalledByGraph proc~redi_open_window redi_open_window proc~redi_open_windows_x redi_open_windows_x proc~redi_open_windows_x->proc~redi_open_window proc~redi_open_windows_y redi_open_windows_y proc~redi_open_windows_y->proc~redi_open_window proc~redi_calc_coeffs redi_calc_coeffs proc~redi_calc_coeffs->proc~redi_open_windows_x proc~redi_calc_coeffs->proc~redi_open_windows_y 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

Variables

Type Visibility Attributes Name Initial
integer, private :: k

Source Code

   pure subroutine redi_open_window(nz, ok, kb, kt)
      !$acc routine seq
      !! A face's OPEN WINDOW from its per-layer `ok` flags (`open .and.`
      !! live on both sides; module header): `kt` the topmost `ok` layer,
      !! `kb..kt` the contiguous `ok` run counted down from it.  No `ok`
      !! layer ⇒ `kb = 1`, `kt = 0` (an empty window, `kt < kb`).
      integer, intent(in) :: nz
      logical, intent(in) :: ok(NZ_STACK_MAX)
      integer, intent(out) :: kb, kt
      integer :: k

      kt = 0
      do k = nz, 1, -1
         if (ok(k)) then
            kt = k
            exit
         end if
      end do
      kb = 1
      if (kt > 0) then
         kb = kt
         do k = kt - 1, 1, -1
            if (.not. ok(k)) exit
            kb = k
         end do
      end if
   end subroutine redi_open_window