rdb_ocean_get_step_count Function

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

Outer-step counter. Reads dyn%outer_step_count directly (the kernel’s own bookkeeping) rather than keeping a second counter on the handle, so there is exactly one source of truth.

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in), value :: c_handle
integer(kind=c_int), intent(out) :: step_out

Return Value integer(kind=c_int)


Calls

proc~~rdb_ocean_get_step_count~~CallsGraph proc~rdb_ocean_get_step_count rdb_ocean_get_step_count proc~resolve_ocean resolve_ocean proc~rdb_ocean_get_step_count->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_get_step_count(c_handle, step_out) result(status) &
      bind(c, name="rdb_ocean_get_step_count")
      !! Outer-step counter. Reads `dyn%outer_step_count` directly (the
      !! kernel's own bookkeeping) rather than keeping a second counter on
      !! the handle, so there is exactly one source of truth.
      type(c_ptr), intent(in), value :: c_handle
      integer(c_int), intent(out) :: step_out
      integer(c_int) :: status

      type(ocean_handle_t), pointer :: h

      step_out = 0_c_int
      status = resolve_ocean(c_handle, h)
      if (status /= OCEAN_STATUS_OK) return
      step_out = int(h%state%dyn%outer_step_count, c_int)
   end function rdb_ocean_get_step_count