Shared tail of every 3D P2 getter: base-address c_loc, actual
array extents (never assumed from grid metadata — read straight
off the pointer), and the generation stamp. arr must already be
pointer-associated with a live, non-empty state array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(out) | :: | ptr | |||
| integer(kind=c_int), | intent(out) | :: | nx | |||
| integer(kind=c_int), | intent(out) | :: | ny | |||
| integer(kind=c_int), | intent(out) | :: | nz | |||
| integer(kind=c_int), | intent(out) | :: | gen | |||
| real(kind=wp), | intent(in), | pointer | :: | arr(:,:,:) | ||
| integer, | intent(in) | :: | step |
subroutine fill_getter_3d(ptr, nx, ny, nz, gen, arr, step) !! Shared tail of every 3D P2 getter: base-address `c_loc`, actual !! array extents (never assumed from grid metadata — read straight !! off the pointer), and the generation stamp. `arr` must already be !! pointer-associated with a live, non-empty state array. type(c_ptr), intent(out) :: ptr integer(c_int), intent(out) :: nx, ny, nz, gen real(wp), pointer, intent(in) :: arr(:, :, :) integer, intent(in) :: step ptr = c_loc(arr(1, 1, 1)) nx = int(size(arr, 1), c_int) ny = int(size(arr, 2), c_int) nz = int(size(arr, 3), c_int) gen = int(step, c_int) end subroutine fill_getter_3d