chksum_loc_extents Subroutine

public pure subroutine chksum_loc_extents(grid, loc, nx, ny)

Map a grid-location tag (LOC_{H,U,V,Q}) to the field’s 2D extents on the Arakawa-C grid — u/v faces carry the extra wall-normal row/column, the corner both. This is the single place the C-grid extent convention lives; call sites pass loc.

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
integer, intent(in) :: loc
integer, intent(out) :: nx
integer, intent(out) :: ny

Called by

proc~~chksum_loc_extents~~CalledByGraph proc~chksum_loc_extents chksum_loc_extents proc~rdb_debug_chksum_2d rdb_debug_chksum_2d proc~rdb_debug_chksum_2d->proc~chksum_loc_extents proc~rdb_debug_chksum_3d rdb_debug_chksum_3d proc~rdb_debug_chksum_3d->proc~chksum_loc_extents interface~rdb_debug_chksum rdb_debug_chksum interface~rdb_debug_chksum->proc~rdb_debug_chksum_2d interface~rdb_debug_chksum->proc~rdb_debug_chksum_3d proc~chksum_bt chksum_bt proc~chksum_bt->interface~rdb_debug_chksum proc~chksum_state chksum_state proc~chksum_state->interface~rdb_debug_chksum proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~chksum_state proc~run_stage_split run_stage_split proc~ocean_dyn_step_split->proc~run_stage_split proc~run_stage_split->proc~chksum_bt proc~run_stage_split->proc~chksum_state proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step_split

Source Code

   pure subroutine chksum_loc_extents(grid, loc, nx, ny)
      !! Map a grid-location tag (`LOC_{H,U,V,Q}`) to the field's 2D
      !! extents on the Arakawa-C grid — u/v faces carry the extra
      !! wall-normal row/column, the corner both.  This is the single
      !! place the C-grid extent convention lives; call sites pass `loc`.
      type(hgrid_t), intent(in) :: grid
      integer, intent(in) :: loc
      integer, intent(out) :: nx, ny

      select case (loc)
      case (LOC_U)
         nx = grid%nx_total + 1
         ny = grid%ny_total
      case (LOC_V)
         nx = grid%nx_total
         ny = grid%ny_total + 1
      case (LOC_Q)
         nx = grid%nx_total + 1
         ny = grid%ny_total + 1
      case default
         ! LOC_H (and any unknown tag) => cell-centre extents.
         nx = grid%nx_total
         ny = grid%ny_total
      end select
   end subroutine chksum_loc_extents