rdb_ocean_refresh_host Function

public function rdb_ocean_refresh_host(c_handle) result(status) bind(c, name="rdb_ocean_refresh_host")

Lazy device->host refresh of every P2-exposed leaf array, gated on host_is_current (a second call with nothing new on device is a cheap flag check, not a re-copy). !$acc update self runs on LEAF component names only, via associate — never the aggregate ocean_state_t/sub-state derived type (the documented rdb_ocean_dyn.F90:2949 segfault: an aggregate D->H copy overwrites the host allocatable descriptors with DEVICE addresses). Inert on a host-only build (no !$acc support) — see CLAUDE.md’s GPU-verification caveat.

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in), value :: c_handle

Return Value integer(kind=c_int)


Calls

proc~~rdb_ocean_refresh_host~~CallsGraph proc~rdb_ocean_refresh_host rdb_ocean_refresh_host proc~ocean_handle_refresh_host ocean_handle_refresh_host proc~rdb_ocean_refresh_host->proc~ocean_handle_refresh_host proc~resolve_ocean resolve_ocean proc~rdb_ocean_refresh_host->proc~resolve_ocean proc~handle_check handle_check proc~resolve_ocean->proc~handle_check

Variables

Type Visibility Attributes Name Initial
type(ocean_handle_t), private, pointer :: h

Source Code

   function rdb_ocean_refresh_host(c_handle) result(status) &
      bind(c, name="rdb_ocean_refresh_host")
      !! Lazy device->host refresh of every P2-exposed leaf array, gated on
      !! `host_is_current` (a second call with nothing new on device is a
      !! cheap flag check, not a re-copy). `!$acc update self` runs on
      !! LEAF component names only, via `associate` — never the aggregate
      !! `ocean_state_t`/sub-state derived type (the documented
      !! `rdb_ocean_dyn.F90:2949` segfault: an aggregate D->H copy
      !! overwrites the host allocatable descriptors with DEVICE
      !! addresses). Inert on a host-only build (no `!$acc` support) —
      !! see CLAUDE.md's GPU-verification caveat.
      type(c_ptr), intent(in), value :: c_handle
      integer(c_int) :: status

      type(ocean_handle_t), pointer :: h

      status = resolve_ocean(c_handle, h)
      if (status /= OCEAN_STATUS_OK) return
      call ocean_handle_refresh_host(h)
      status = int(OCEAN_STATUS_OK, c_int)
   end function rdb_ocean_refresh_host