rdb_ocean_stage_topology Function

public function rdb_ocean_stage_topology(c_handle, periodic_x, periodic_y) result(status) bind(c, name="rdb_ocean_stage_topology")

P2.5: stage Oceananigans-style grid topology (per-dimension periodicity — “the grid owns periodicity”, not the per-edge &ocean_bc_nml tags) on the PENDING handle c_handle. Consumed inside rdb_ocean_create_finalize via ocean_bc_state_set_topology, run AFTER the namelist edge tags are parsed and OVERRIDING whatever they derived for periodic_x/periodic_y (an axis NOT marked periodic here keeps whatever physical BC the namelist gave it).

Arguments

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

Nonzero = periodic on that axis.

integer(kind=c_int), intent(in), value :: periodic_y

Nonzero = periodic on that axis.

Return Value integer(kind=c_int)


Calls

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

Variables

Type Visibility Attributes Name Initial
type(ocean_handle_t), private, pointer :: h

Source Code

   function rdb_ocean_stage_topology(c_handle, periodic_x, periodic_y) &
      result(status) bind(c, name="rdb_ocean_stage_topology")
      !! P2.5: stage Oceananigans-style grid topology (per-dimension
      !! periodicity — "the grid owns periodicity", not the per-edge
      !! `&ocean_bc_nml` tags) on the PENDING handle `c_handle`. Consumed
      !! inside `rdb_ocean_create_finalize` via
      !! `ocean_bc_state_set_topology`, run AFTER the namelist edge tags
      !! are parsed and OVERRIDING whatever they derived for
      !! `periodic_x`/`periodic_y` (an axis NOT marked periodic here keeps
      !! whatever physical BC the namelist gave it).
      type(c_ptr), intent(in), value :: c_handle
      integer(c_int), intent(in), value :: periodic_x, periodic_y
         !! Nonzero = periodic on that axis.
      integer(c_int) :: status

      type(ocean_handle_t), pointer :: h

      status = resolve_ocean_pending(c_handle, h)
      if (status /= OCEAN_STATUS_OK) return

      h%engine%staged_periodic_x = (periodic_x /= 0_c_int)
      h%engine%staged_periodic_y = (periodic_y /= 0_c_int)
      h%engine%has_staged_topology = .true.
      status = int(OCEAN_STATUS_OK, c_int)
   end function rdb_ocean_stage_topology