ocean_diag_enter_data Subroutine

private 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).

Type Bound

ocean_diag_t

Arguments

Type IntentOptional Attributes Name
class(ocean_diag_t), intent(inout) :: this

Calls

proc~~ocean_diag_enter_data~~CallsGraph proc~ocean_diag_enter_data ocean_diag_t%ocean_diag_enter_data proc~ocean_diag_enter_data_impl ocean_diag_enter_data_impl proc~ocean_diag_enter_data->proc~ocean_diag_enter_data_impl

Source Code

   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