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 | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in), | value | :: | c_handle |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(ocean_handle_t), | private, | pointer | :: | h |
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