fill_f_corner_seam_ghosts Subroutine

private subroutine fill_f_corner_seam_ghosts(grid, f_corner)

Periodic-x wrap + north-fold (scalar copy) of the static corner Coriolis array for a tripolar grid. f is reflection-invariant (same latitude at the conjugate corner), so negate=.false.

Decomposed: only an axis this tile holds WHOLE is wrapped, and only the tile that owns the north edge folds (the seed_wrap_static_2d rule). Every other seam ghost was already filled by the generator from the global-slice geography (metrics_fill_tripolar), which is exactly the neighbour’s corner value.

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
real(kind=wp), intent(inout) :: f_corner(:,:)

Calls

proc~~fill_f_corner_seam_ghosts~~CallsGraph proc~fill_f_corner_seam_ghosts fill_f_corner_seam_ghosts interface~fold_north_corner fold_north_corner proc~fill_f_corner_seam_ghosts->interface~fold_north_corner proc~fold_north_corner_2d fold_north_corner_2d interface~fold_north_corner->proc~fold_north_corner_2d local local proc~fold_north_corner_2d->local

Called by

proc~~fill_f_corner_seam_ghosts~~CalledByGraph proc~fill_f_corner_seam_ghosts fill_f_corner_seam_ghosts proc~configure_ocean_forcing configure_ocean_forcing proc~configure_ocean_forcing->proc~fill_f_corner_seam_ghosts proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_forcing proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j
integer, private :: ng
integer, private :: ni

Source Code

   subroutine fill_f_corner_seam_ghosts(grid, f_corner)
      !! Periodic-x wrap + north-fold (scalar copy) of the static corner
      !! Coriolis array for a tripolar grid.  f is reflection-invariant
      !! (same latitude at the conjugate corner), so negate=.false.
      !!
      !! Decomposed: only an axis this tile holds WHOLE is wrapped, and only
      !! the tile that owns the north edge folds (the `seed_wrap_static_2d`
      !! rule).  Every other seam ghost was already filled by the generator
      !! from the global-slice geography (`metrics_fill_tripolar`), which is
      !! exactly the neighbour's corner value.
      type(hgrid_t), intent(in) :: grid
      real(wp), intent(inout) :: f_corner(:, :)
      integer :: ng, ni, i, j
      ng = grid%nghost
      ni = grid%nx_phys
      ! px > 1: x ghosts come from the generator; the fold runs later, in
      ! engine_setup, through the distributed exchange (needs its plan).
      if (grid%nx_phys /= grid%nx_global) return
      ! Periodic-x ghost columns (corner/Bu face-type: physical i=ng+1..ng+ni+1).
      do j = 1, size(f_corner, 2)
         do i = 1, ng
            f_corner(i, j) = f_corner(i + ni, j)
            f_corner(ng + ni + 1 + i, j) = f_corner(ng + 1 + i, j)
         end do
      end do
      ! North fold (copy) — the north-edge tile only.
      if (grid%j_offset_global + grid%ny_phys /= grid%ny_global) return
      call fold_north_corner(f_corner, grid%nx_total + 1, grid%ny_total + 1, &
                             grid%nx_phys, grid%ny_phys, grid%nghost, negate=.false.)
   end subroutine fill_f_corner_seam_ghosts