Attach each registered var’s per-buffer allocatables to the device.
Called by ocean_state_enter_data after register_default_diags
has populated vars(:) — buffers are sized at register time, so
the descriptors here are valid.
Per-var bookkeeping (dt_accum, n_accum, time_op, …) stays on host; the manager step loop is host code that dispatches device kernels via the outer-shim + flat-impl pattern. Only the bulk buffers (output_buffer, accumulator, layer_buffer, mask weight) need device residency. Type-bound wrapper — delegates to the non-polymorphic impl so the map base is the heap object, not a polymorphic stack box (AMD libomptarget cross-slot-overlap fix).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_diag_t), | intent(inout) | :: | this |
subroutine ocean_diag_enter_data(this) !! Attach each registered var's per-buffer allocatables to the device. !! Called by `ocean_state_enter_data` after `register_default_diags` !! has populated `vars(:)` — buffers are sized at register time, so !! the descriptors here are valid. !! !! Per-var bookkeeping (dt_accum, n_accum, time_op, ...) stays on !! host; the manager step loop is host code that dispatches device !! kernels via the outer-shim + flat-impl pattern. Only the bulk !! buffers (output_buffer, accumulator, layer_buffer, mask weight) !! need device residency. !! Type-bound wrapper — delegates to the non-polymorphic impl so the !! map base is the heap object, not a polymorphic stack box (AMD !! libomptarget cross-slot-overlap fix). class(ocean_diag_t), intent(inout) :: this select type (this) type is (ocean_diag_t) call ocean_diag_enter_data_impl(this) end select end subroutine ocean_diag_enter_data