fill_h_layer_ghosts Subroutine

private pure subroutine fill_h_layer_ghosts(h_layer, nx_total, ny_total, nz, i_w, i_e, j_s, j_n, nghost, bc_w, bc_e, bc_s, bc_n)

Zero-gradient fill of h_layer ghosts at open-ish edges.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: h_layer(nx_total,ny_total,nz)
integer, intent(in) :: nx_total
integer, intent(in) :: ny_total
integer, intent(in) :: nz
integer, intent(in) :: i_w
integer, intent(in) :: i_e
integer, intent(in) :: j_s
integer, intent(in) :: j_n
integer, intent(in) :: nghost
integer, intent(in) :: bc_w
integer, intent(in) :: bc_e
integer, intent(in) :: bc_s
integer, intent(in) :: bc_n

Calls

proc~~fill_h_layer_ghosts~~CallsGraph proc~fill_h_layer_ghosts fill_h_layer_ghosts proc~is_open_ish is_open_ish proc~fill_h_layer_ghosts->proc~is_open_ish

Called by

proc~~fill_h_layer_ghosts~~CalledByGraph proc~fill_h_layer_ghosts fill_h_layer_ghosts proc~ocean_obc_fill_ghosts ocean_obc_fill_ghosts proc~ocean_obc_fill_ghosts->proc~fill_h_layer_ghosts proc~run_continuity_chain run_continuity_chain proc~run_continuity_chain->proc~ocean_obc_fill_ghosts proc~run_stage_split run_stage_split proc~run_stage_split->proc~run_continuity_chain 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

Variables

Type Visibility Attributes Name Initial
integer, private :: g
integer, private :: i
integer, private :: j
integer, private :: k

Source Code

   pure subroutine fill_h_layer_ghosts(h_layer, nx_total, ny_total, nz, &
                                       i_w, i_e, j_s, j_n, nghost, &
                                       bc_w, bc_e, bc_s, bc_n)
      !! Zero-gradient fill of h_layer ghosts at open-ish edges.
      integer, intent(in) :: nx_total, ny_total, nz, nghost
      real(wp), intent(inout) :: h_layer(nx_total, ny_total, nz)
      integer, intent(in) :: i_w, i_e, j_s, j_n
      integer, intent(in) :: bc_w, bc_e, bc_s, bc_n

      integer :: i, j, k, g

      ! West ghosts: copy first interior column (i_w) into ghost columns
      if (is_open_ish(bc_w)) then
         do concurrent(k=1:nz, j=1:ny_total, g=1:nghost)
            h_layer(g, j, k) = h_layer(i_w, j, k)
         end do
      end if
      ! East ghosts
      if (is_open_ish(bc_e)) then
         do concurrent(k=1:nz, j=1:ny_total, g=1:nghost)
            h_layer(nx_total - g + 1, j, k) = h_layer(i_e, j, k)
         end do
      end if
      ! South ghosts
      if (is_open_ish(bc_s)) then
         do concurrent(k=1:nz, j=1:nghost, i=1:nx_total)
            h_layer(i, j, k) = h_layer(i, j_s, k)
         end do
      end if
      ! North ghosts
      if (is_open_ish(bc_n)) then
         do concurrent(k=1:nz, g=1:nghost, i=1:nx_total)
            h_layer(i, ny_total - g + 1, k) = h_layer(i, j_n, k)
         end do
      end if
   end subroutine fill_h_layer_ghosts