P2.5 phase 2 of 2: complete a handle started by
rdb_ocean_create_pending (optionally staged with
rdb_ocean_stage_* geometry in between) — runs engine_setup
(consuming any staged geometry) through device mapping, exactly
like the tail of rdb_ocean_create_from_string.
On success, c_handle is unchanged (same pointer value, now fully
initialised) — call the ordinary P2 accessors/rdb_ocean_step
on it from here. On failure, the WHOLE handle is destroyed (F9)
and c_handle is set to c_null_ptr — same out-null convention
as rdb_ocean_destroy, since (unlike create_from_string,
whose caller only ever sees a handle on success) a caller here
already holds a handle value going in.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(inout) | :: | c_handle |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(ocean_handle_t), | private, | pointer | :: | h | |||
| integer, | private | :: | hstat |
function rdb_ocean_create_finalize(c_handle) result(status) & bind(c, name="rdb_ocean_create_finalize") !! P2.5 phase 2 of 2: complete a handle started by !! `rdb_ocean_create_pending` (optionally staged with !! `rdb_ocean_stage_*` geometry in between) — runs `engine_setup` !! (consuming any staged geometry) through device mapping, exactly !! like the tail of `rdb_ocean_create_from_string`. !! !! On success, `c_handle` is unchanged (same pointer value, now fully !! initialised) — call the ordinary P2 accessors/`rdb_ocean_step` !! on it from here. On failure, the WHOLE handle is destroyed (F9) !! and `c_handle` is set to `c_null_ptr` — same out-null convention !! as `rdb_ocean_destroy`, since (unlike `create_from_string`, !! whose caller only ever sees a handle on success) a caller here !! already holds a handle value going in. type(c_ptr), intent(inout) :: c_handle integer(c_int) :: status type(ocean_handle_t), pointer :: h integer :: hstat call error_ring_clear() hstat = handle_check(c_handle, h) if (hstat /= HANDLE_OK) then status = int(OCEAN_STATUS_ERR_BAD_HANDLE, c_int) return end if if (.not. h%is_pending) then call error_ring_push("rdb_ocean_create_finalize: handle is not in the "// & "pending (staging) window — call rdb_ocean_create_pending "// & "first (this handle may already have been finalised)") status = int(OCEAN_STATUS_ERR_NOT_PENDING, c_int) return end if call complete_ocean_create(c_handle, h, status) end function rdb_ocean_create_finalize