fold_tile_extent Subroutine

public pure subroutine fold_tile_extent(ni, px, rx, a, w)

First global cell a and width w of tile rx — the decomp_init split (remainder to the WEST tiles), restated here so the plan stays pure and dependency-free (cross-checked against decomp_init by the unit test).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ni

Global physical width of the fold row (cells).

integer, intent(in) :: px

Tiles along the fold row.

integer, intent(in) :: rx

Tile x-coordinate (0-based, 0..px-1).

integer, intent(out) :: a

First global cell of the tile (1-based).

integer, intent(out) :: w

Tile width (cells).


Called by

proc~~fold_tile_extent~~CalledByGraph proc~fold_tile_extent fold_tile_extent proc~fold_plan_build fold_plan_build proc~fold_plan_build->proc~fold_tile_extent proc~fold_receiver_entries fold_receiver_entries proc~fold_plan_build->proc~fold_receiver_entries proc~fold_receiver_entries->proc~fold_tile_extent proc~ocean_fold_exchange_init ocean_fold_exchange_init proc~ocean_fold_exchange_init->proc~fold_plan_build proc~engine_setup engine_setup proc~engine_setup->proc~ocean_fold_exchange_init 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 :: base
integer, private :: rem

Source Code

   pure subroutine fold_tile_extent(ni, px, rx, a, w)
      !! First global cell `a` and width `w` of tile `rx` — the
      !! `decomp_init` split (remainder to the WEST tiles), restated here so
      !! the plan stays pure and dependency-free (cross-checked against
      !! `decomp_init` by the unit test).
      integer, intent(in) :: ni
         !! Global physical width of the fold row (cells).
      integer, intent(in) :: px
         !! Tiles along the fold row.
      integer, intent(in) :: rx
         !! Tile x-coordinate (0-based, `0..px-1`).
      integer, intent(out) :: a
         !! First global cell of the tile (1-based).
      integer, intent(out) :: w
         !! Tile width (cells).

      integer :: base, rem

      base = ni/px
      rem = mod(ni, px)
      if (rx < rem) then
         w = base + 1
         a = rx*(base + 1) + 1
      else
         w = base
         a = rem*(base + 1) + (rx - rem)*base + 1
      end if
   end subroutine fold_tile_extent