resolve_ocean_pending Function

private function resolve_ocean_pending(c_handle, h) result(status)

P2.5: resolve + verify a handle is a live, PENDING (not yet finalised) ocean simulation — the window every rdb_ocean_stage_* geometry-injection call requires. Mirrors resolve_ocean’s shape, checking is_pending instead of is_initialised.

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: c_handle
type(ocean_handle_t), intent(out), pointer :: h

Return Value integer(kind=c_int)


Calls

proc~~resolve_ocean_pending~~CallsGraph proc~resolve_ocean_pending resolve_ocean_pending proc~handle_check handle_check proc~resolve_ocean_pending->proc~handle_check

Called by

proc~~resolve_ocean_pending~~CalledByGraph proc~resolve_ocean_pending resolve_ocean_pending proc~rdb_ocean_stage_bathymetry rdb_ocean_stage_bathymetry proc~rdb_ocean_stage_bathymetry->proc~resolve_ocean_pending proc~rdb_ocean_stage_metrics rdb_ocean_stage_metrics proc~rdb_ocean_stage_metrics->proc~resolve_ocean_pending proc~rdb_ocean_stage_topology rdb_ocean_stage_topology proc~rdb_ocean_stage_topology->proc~resolve_ocean_pending

Variables

Type Visibility Attributes Name Initial
integer, private :: hstat

Source Code

   function resolve_ocean_pending(c_handle, h) result(status)
      !! P2.5: resolve + verify a handle is a live, PENDING (not yet
      !! finalised) ocean simulation — the window every
      !! `rdb_ocean_stage_*` geometry-injection call requires. Mirrors
      !! `resolve_ocean`'s shape, checking `is_pending` instead of
      !! `is_initialised`.
      type(c_ptr), intent(in) :: c_handle
      type(ocean_handle_t), pointer, intent(out) :: h
      integer(c_int) :: status

      integer :: hstat

      hstat = handle_check(c_handle, h)
      if (hstat /= HANDLE_OK) then
         h => null()
         status = int(OCEAN_STATUS_ERR_BAD_HANDLE, c_int)
         return
      end if
      if (.not. h%is_pending) then
         h => null()
         status = int(OCEAN_STATUS_ERR_NOT_PENDING, c_int)
         return
      end if
      status = int(OCEAN_STATUS_OK, c_int)
   end function resolve_ocean_pending