| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public, | allocatable | :: | data(:,:,:) |
The scratch storage. Access in a kernel as
|
||
| logical, | public | :: | is_init | = | .false. |
True between |
|
| integer, | public | :: | n1 | = | 0 |
First-dim size, typically |
|
| integer, | public | :: | n2 | = | 0 |
Second-dim size, typically |
|
| integer, | public | :: | n3 | = | 0 |
Third-dim size, typically |
|
| character(len=32), | public | :: | name | = | "" |
Human-readable tag for diagnostics + debug guard messages (“kpp_bulk_ri_scratch”, “ppm_h_face_left_x”, …). |
Counted allocatable footprint of the 3D scratch buffer slot (0 when unallocated).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(scratch_3d_buffer_t), | intent(in) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(scratch_3d_buffer_t), | intent(inout) | :: | this |
Type-bound wrapper — keeps buf%enter_data() call sites working.
Delegates to the non-polymorphic impl so the OpenMP map base is
the heap object (see the impl + the public-decl comment above).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(scratch_3d_buffer_t), | intent(inout) | :: | this |
Type-bound wrapper — see scratch_3d_buffer_enter_data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(scratch_3d_buffer_t), | intent(inout) | :: | this |
Allocate the host-side storage at (n1, n2, n3), zero-filled.
GPU attachment is a separate step via enter_data —
init runs before the device exists in the typical
init-then-enter-data sequence.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(scratch_3d_buffer_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | n1 | |||
| integer, | intent(in) | :: | n2 | |||
| integer, | intent(in) | :: | n3 | |||
| character(len=*), | intent(in), | optional | :: | name |
type :: scratch_3d_buffer_t logical :: is_init = .false. !! True between `init` and `destroy`. Prefer this to !! `allocated(this%data)` — tracks GPU device attachment too. ! ---- Declared shape ---- integer :: n1 = 0 !! First-dim size, typically `stride` (or `stride+1` on !! face-located buffers). integer :: n2 = 0 !! Second-dim size, typically `stride`. integer :: n3 = 0 !! Third-dim size, typically `nz_ml` (or `nz_ml+1` for !! layer-interface buffers). ! ---- Payload ---- real(wp), allocatable :: data(:, :, :) !! The scratch storage. Access in a kernel as !! `slot%scratch%data(i, j, k)`. Note: this is a *single* !! derived type (not array-of-derived-types), so the !! `!$acc` indirection bug from the array-of-DT pattern !! does not apply. ! ---- Optional name ---- character(len=32) :: name = "" !! Human-readable tag for diagnostics + debug guard !! messages ("kpp_bulk_ri_scratch", "ppm_h_face_left_x", ...). contains procedure, non_overridable :: init => scratch_3d_buffer_init procedure, non_overridable :: destroy => scratch_3d_buffer_destroy procedure, non_overridable :: enter_data => scratch_3d_buffer_enter_data procedure, non_overridable :: exit_data => scratch_3d_buffer_exit_data ! Phase 6+: procedure :: assert_finite — debug-mode invariant procedure, non_overridable :: bytes => scratch_3d_buffer_bytes end type scratch_3d_buffer_t