metrics_periodic_y_2d Subroutine

private subroutine metrics_periodic_y_2d(arr, grid)

South/north ghost rows of a T-array by periodic wrap (the y analogue of metrics_periodic_x_2d). Only used by the land-mask ghost fill; the metric tripolar path wraps x only.

Arguments

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

Called by

proc~~metrics_periodic_y_2d~~CalledByGraph proc~metrics_periodic_y_2d metrics_periodic_y_2d proc~metrics_apply_land_mask metrics_apply_land_mask proc~metrics_apply_land_mask->proc~metrics_periodic_y_2d proc~configure_ocean_land_mask configure_ocean_land_mask proc~configure_ocean_land_mask->proc~metrics_apply_land_mask proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_land_mask 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 :: nj

Source Code

   subroutine metrics_periodic_y_2d(arr, grid)
      !! South/north ghost rows of a T-array by periodic wrap (the y
      !! analogue of `metrics_periodic_x_2d`).  Only used by the land-mask
      !! ghost fill; the metric tripolar path wraps x only.
      real(wp), intent(inout) :: arr(:, :)
      type(hgrid_t), intent(in) :: grid
      integer :: ng, nj, i, j
      ng = grid%nghost
      nj = grid%ny_phys
      do j = 1, ng
         do i = 1, size(arr, 1)
            arr(i, j) = arr(i, j + nj)
            arr(i, ng + nj + j) = arr(i, ng + j)
         end do
      end do
   end subroutine metrics_periodic_y_2d