rdb_ocean_get_tracer_count Function

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

Number of registered tracers (S, T, + any passive tracers) — bounds for rdb_ocean_list_tracers’s index argument.

Arguments

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

Return Value integer(kind=c_int)


Calls

proc~~rdb_ocean_get_tracer_count~~CallsGraph proc~rdb_ocean_get_tracer_count rdb_ocean_get_tracer_count proc~resolve_ocean resolve_ocean proc~rdb_ocean_get_tracer_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_tracer_count(c_handle, count_out) result(status) &
      bind(c, name="rdb_ocean_get_tracer_count")
      !! Number of registered tracers (S, T, + any passive tracers) —
      !! bounds for `rdb_ocean_list_tracers`'s index argument.
      type(c_ptr), intent(in), value :: c_handle
      integer(c_int), intent(out) :: count_out
      integer(c_int) :: status

      type(ocean_handle_t), pointer :: h

      count_out = 0
      status = resolve_ocean(c_handle, h)
      if (status /= OCEAN_STATUS_OK) return
      if (allocated(h%state%multilayer%tracers)) then
         count_out = int(size(h%state%multilayer%tracers), c_int)
      end if
   end function rdb_ocean_get_tracer_count