rdb_ocean_boundary_types Module

Type taxonomy + per-edge BC config + the composed slot on ocean_state_t. Six BC types implemented end-to-end (WALL, OPEN, TIDAL, CLAMPED, SPONGE, CHAPMAN); INFLOW/DISCHARGE/NESTED tags are declared for cross-backend alignment but error stop if encountered. Per-edge granularity: each of the four outer edges carries one ocean_bc_face_tag_t, read independently by the dispatch helpers in rdb_ocean_boundary.


Uses

  • module~~rdb_ocean_boundary_types~~UsesGraph module~rdb_ocean_boundary_types rdb_ocean_boundary_types iso_fortran_env iso_fortran_env module~rdb_ocean_boundary_types->iso_fortran_env module~rdb_constants rdb_constants module~rdb_ocean_boundary_types->module~rdb_constants module~rdb_grid rdb_grid module~rdb_ocean_boundary_types->module~rdb_grid module~rdb_mem_report rdb_mem_report module~rdb_ocean_boundary_types->module~rdb_mem_report module~rdb_ocean_status rdb_ocean_status module~rdb_ocean_boundary_types->module~rdb_ocean_status module~rdb_ocean_tide_astro rdb_ocean_tide_astro module~rdb_ocean_boundary_types->module~rdb_ocean_tide_astro pic_ascii pic_ascii module~rdb_ocean_boundary_types->pic_ascii pic_logger pic_logger module~rdb_ocean_boundary_types->pic_logger pic_types pic_types module~rdb_constants->pic_types module~rdb_grid->module~rdb_constants module~rdb_mem_report->iso_fortran_env module~rdb_mem_report->module~rdb_constants module~rdb_mem_report->pic_logger pic_strings pic_strings module~rdb_mem_report->pic_strings module~rdb_ocean_tide_astro->iso_fortran_env module~rdb_ocean_tide_astro->module~rdb_constants

Used by

  • module~~rdb_ocean_boundary_types~~UsedByGraph module~rdb_ocean_boundary_types rdb_ocean_boundary_types module~rdb_barotropic_coupling rdb_barotropic_coupling module~rdb_barotropic_coupling->module~rdb_ocean_boundary_types module~rdb_barotropic_substep rdb_barotropic_substep module~rdb_barotropic_substep->module~rdb_ocean_boundary_types module~rdb_ocean_halo rdb_ocean_halo module~rdb_barotropic_substep->module~rdb_ocean_halo module~rdb_continuity rdb_continuity module~rdb_continuity->module~rdb_ocean_boundary_types module~rdb_ocean_fold_apply rdb_ocean_fold_apply module~rdb_continuity->module~rdb_ocean_fold_apply module~rdb_ocean_mle rdb_ocean_mle module~rdb_continuity->module~rdb_ocean_mle module~rdb_ocean_periodic rdb_ocean_periodic module~rdb_continuity->module~rdb_ocean_periodic module~rdb_continuity->module~rdb_ocean_halo module~rdb_ice_evp rdb_ice_evp module~rdb_ice_evp->module~rdb_ocean_boundary_types module~rdb_ice_evp->module~rdb_ocean_periodic module~rdb_ice_evp->module~rdb_ocean_halo module~rdb_ice_ocean_coupler rdb_ice_ocean_coupler module~rdb_ice_ocean_coupler->module~rdb_ocean_boundary_types module~rdb_ocean_halo_state rdb_ocean_halo_state module~rdb_ice_ocean_coupler->module~rdb_ocean_halo_state module~rdb_ice_transport rdb_ice_transport module~rdb_ice_transport->module~rdb_ocean_boundary_types module~rdb_ice_transport->module~rdb_continuity module~rdb_ice_transport->module~rdb_ocean_halo_state module~rdb_ice_transport->module~rdb_ocean_halo module~rdb_ocean_boundary_data rdb_ocean_boundary_data module~rdb_ocean_boundary_data->module~rdb_ocean_boundary_types module~rdb_ocean_bt_wide rdb_ocean_bt_wide module~rdb_ocean_bt_wide->module~rdb_ocean_boundary_types module~rdb_ocean_bt_wide->module~rdb_barotropic_substep module~rdb_ocean_bt_wide->module~rdb_ocean_halo module~rdb_ocean_data_forcing rdb_ocean_data_forcing module~rdb_ocean_data_forcing->module~rdb_ocean_boundary_types module~rdb_ocean_data_forcing->module~rdb_ocean_halo_state module~rdb_ocean_dyn rdb_ocean_dyn module~rdb_ocean_dyn->module~rdb_ocean_boundary_types module~rdb_ocean_dyn->module~rdb_barotropic_coupling module~rdb_ocean_dyn->module~rdb_barotropic_substep module~rdb_ocean_dyn->module~rdb_continuity module~rdb_ocean_dyn->module~rdb_ocean_bt_wide module~rdb_ocean_dyn->module~rdb_ocean_fold_apply module~rdb_ocean_dyn->module~rdb_ocean_halo_state module~rdb_ocean_hdiff_tracer rdb_ocean_hdiff_tracer module~rdb_ocean_dyn->module~rdb_ocean_hdiff_tracer module~rdb_ocean_dyn->module~rdb_ocean_mle module~rdb_ocean_obc_baroclinic rdb_ocean_obc_baroclinic module~rdb_ocean_dyn->module~rdb_ocean_obc_baroclinic module~rdb_ocean_dyn->module~rdb_ocean_periodic module~rdb_ocean_redi rdb_ocean_redi module~rdb_ocean_dyn->module~rdb_ocean_redi module~rdb_ocean_sponge rdb_ocean_sponge module~rdb_ocean_dyn->module~rdb_ocean_sponge module~rdb_ocean_dyn->module~rdb_ocean_halo module~rdb_ocean_engine rdb_ocean_engine module~rdb_ocean_engine->module~rdb_ocean_boundary_types module~rdb_ocean_engine->module~rdb_ice_evp module~rdb_ocean_engine->module~rdb_ice_ocean_coupler module~rdb_ocean_engine->module~rdb_ice_transport module~rdb_ocean_engine->module~rdb_ocean_boundary_data module~rdb_ocean_engine->module~rdb_ocean_data_forcing module~rdb_ocean_engine->module~rdb_ocean_dyn module~rdb_ocean_engine->module~rdb_ocean_fold_apply module~rdb_ocean_engine->module~rdb_ocean_halo_state module~rdb_ocean_engine->module~rdb_ocean_periodic module~rdb_ocean_setup rdb_ocean_setup module~rdb_ocean_engine->module~rdb_ocean_setup module~rdb_ocean_engine->module~rdb_ocean_sponge module~rdb_ocean_state rdb_ocean_state module~rdb_ocean_engine->module~rdb_ocean_state module~rdb_ocean_diag_derived rdb_ocean_diag_derived module~rdb_ocean_engine->module~rdb_ocean_diag_derived module~rdb_ocean_diag_fills rdb_ocean_diag_fills module~rdb_ocean_engine->module~rdb_ocean_diag_fills module~rdb_ocean_engine->module~rdb_ocean_halo module~rdb_ocean_fold_apply->module~rdb_ocean_boundary_types module~rdb_ocean_halo_state->module~rdb_ocean_boundary_types module~rdb_ocean_halo_state->module~rdb_ocean_fold_apply module~rdb_ocean_halo_state->module~rdb_ocean_periodic module~rdb_ocean_halo_state->module~rdb_ocean_halo module~rdb_ocean_hdiff_tracer->module~rdb_ocean_boundary_types module~rdb_ocean_mle->module~rdb_ocean_boundary_types module~rdb_ocean_obc_baroclinic->module~rdb_ocean_boundary_types module~rdb_ocean_periodic->module~rdb_ocean_boundary_types module~rdb_ocean_redi->module~rdb_ocean_boundary_types module~rdb_ocean_setup->module~rdb_ocean_boundary_types module~rdb_ocean_setup->module~rdb_ocean_dyn module~rdb_ocean_setup->module~rdb_ocean_fold_apply module~rdb_ocean_setup->module~rdb_ocean_halo_state module~rdb_ocean_setup->module~rdb_ocean_sponge module~rdb_ocean_setup->module~rdb_ocean_state module~rdb_ocean_setup->module~rdb_ocean_halo module~rdb_ocean_sponge->module~rdb_ocean_boundary_types module~rdb_ocean_state->module~rdb_ocean_boundary_types module~rdb_ocean_state->module~rdb_continuity module~rdb_ocean_state->module~rdb_ocean_data_forcing module~rdb_ocean_state->module~rdb_ocean_dyn module~rdb_ocean_state->module~rdb_ocean_hdiff_tracer module~rdb_ocean_state->module~rdb_ocean_mle module~rdb_ocean_state->module~rdb_ocean_periodic module~rdb_ocean_state->module~rdb_ocean_redi module~rdb_ocean_state->module~rdb_ocean_sponge proc~validate_config validate_config proc~validate_config->module~rdb_ocean_boundary_types module~rdb_driver rdb_driver module~rdb_driver->module~rdb_ocean_dyn module~rdb_driver->module~rdb_ocean_engine module~rdb_driver->module~rdb_ocean_state module~rdb_handle rdb_handle module~rdb_handle->module~rdb_ocean_engine module~rdb_handle->module~rdb_ocean_state module~rdb_ocean_api rdb_ocean_api module~rdb_ocean_api->module~rdb_ocean_dyn module~rdb_ocean_api->module~rdb_ocean_engine module~rdb_ocean_api->module~rdb_ocean_fold_apply module~rdb_ocean_api->module~rdb_ocean_periodic module~rdb_ocean_api->module~rdb_handle module~rdb_ocean_api->module~rdb_ocean_diag_derived module~rdb_ocean_api->module~rdb_ocean_diag_fills module~rdb_ocean_diag_derived->module~rdb_ocean_state module~rdb_ocean_diag_derived->module~rdb_ocean_diag_fills module~rdb_ocean_diag_fills->module~rdb_ocean_state module~rdb_ocean_halo->module~rdb_ocean_periodic

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: OBC_CHAPMAN = 9

Orlanski radiation on η with implicit phase-speed estimation. Uses persistent eta_old_<edge> state across timesteps.

integer, public, parameter :: OBC_CLAMPED = 7

Hard Dirichlet on η + u + v + per-tracer values, sourced from data_*.

integer, public, parameter :: OBC_DISCHARGE = 6

Prescribed volume flux. Cross-backend symmetry only.

integer, public, parameter :: OBC_INFLOW = 5

Prescribed normal velocity + tracer. Cross-backend symmetry only.

integer, public, parameter :: OBC_INVALID = -1

Sentinel returned by ocean_bc_type_from_string for an unrecognised edge string (PR-6 fail-loud). A misspelled edge must NOT silently close the boundary to a wall — the user asked for a specific (often open) boundary and a wall reflects every outgoing gravity wave, a materially different model with no message. validate_config rejects it before configure_ocean_bc ever consumes the parse result.

integer, public, parameter :: OBC_MAX_TIDAL_CONSTITUENTS = 8
integer, public, parameter :: OBC_NESTED = 4

Two-way nesting (not yet implemented). Behaves like OPEN to kernels.

integer, public, parameter :: OBC_OPEN = 2

Flather radiation — gravity-wave outflow + η clamped to a reference (zero by default, supplied via data_eta_*).

integer, public, parameter :: OBC_PERIODIC = 10

Ghost-wrap periodic boundary: ghost columns/rows hold copies of the opposite interior so kernels see a seamless domain. Requires nghost >= 3 (PPM + biharmonic stencil) and must be paired (west ⟺ east; south ⟺ north). Cannot combine with OBC_SPONGE on the same edge. Keep tag in sync with coastal rdb_boundary_types.F90.

integer, public, parameter :: OBC_SPONGE = 8

Relaxation band — BC kernel falls through to WALL at the outer face; the sponge kernel relaxes the interior band toward data_* targets. Every no-normal-flow closure keyed on OBC_WALL must read the tag through ocean_bc_outer_face_tag, which maps SPONGE to WALL.

integer, public, parameter :: OBC_TIDAL = 3

Prescribed multi-constituent η; composed into data_eta_*.

real(kind=wp), public, parameter :: OBC_TIDE_MATCH_TOL = 1.0e-4_wp

Relative tolerance for matching an OBC edge constituent’s angular frequency to a catalog entry (rdb_ocean_tide_astro::TIDE_OMEGA). The catalog ω’s are well separated (min gap S2↔K2 ≈ 0.3 %), so any physical constituent resolves unambiguously; a farther-than-tol nearest match signals an unknown constituent (fail-loud at setup).

integer, public, parameter :: OBC_TRIPOLAR_FOLD = 11

Tripolar north-fold seam (Murray 1996). NORTH edge only. The fold exchange (rdb_ocean_fold) halo-fills the north ghost rows (reversed-i, sign-flipped for vector normals) and antisymmetrically projects the on-line v/corner row. Requires grid_config="tripolar" and periodic west/east (fold reads already-wrapped corner columns).

integer, public, parameter :: OBC_WALL = 1

Closed wall (hard-zero). Default for every edge.


Derived Types

type, public ::  ocean_bc_face_tag_t

Configuration for one outer edge. Defaults yield a closed wall.

Components

Type Visibility Attributes Name Initial
integer, public :: bc_type = OBC_WALL
real(kind=wp), public :: clamped_eta = 0.0_wp
real(kind=wp), public, allocatable :: clamped_tracer(:)

Per-tracer Dirichlet values for CLAMPED inflow. Size n_tracers; only consulted on inflow faces.

real(kind=wp), public :: clamped_u = 0.0_wp
real(kind=wp), public :: clamped_v = 0.0_wp
integer, public :: n_tidal_constituents = 0
logical, public :: sponge_relax_tracers = .false.

When .true. the legacy band sponge relaxes tracer hTr (concentration held toward clamped_tracer(:), mass h_layer left untouched) in the edge band. Default .false. is bit-identical. h_layer relaxation is a separate, map-driven capability gated by &ocean_sponge_nml relax_h (PR-23b), restricted to VCOORD_LAGRANGIAN — see rdb_ocean_sponge.F90.

real(kind=wp), public :: sponge_strength = 0.0_wp
integer, public :: sponge_width = 0
real(kind=wp), public :: tidal_amp(OBC_MAX_TIDAL_CONSTITUENTS) = 0.0_wp
real(kind=wp), public :: tidal_arg(OBC_MAX_TIDAL_CONSTITUENTS) = 0.0_wp

Equilibrium + nodal phase (V_c + u_c) (rad) per edge constituent.

real(kind=wp), public :: tidal_fnodal(OBC_MAX_TIDAL_CONSTITUENTS) = 1.0_wp

18.6-yr nodal amplitude factor f_c per edge constituent.

real(kind=wp), public :: tidal_omega(OBC_MAX_TIDAL_CONSTITUENTS) = 0.0_wp
real(kind=wp), public :: tidal_phase(OBC_MAX_TIDAL_CONSTITUENTS) = 0.0_wp

type, public ::  ocean_bc_state_t

Per-state OBC bookkeeping. Composed onto ocean_state_t; the dispatch helpers in rdb_ocean_boundary consume it via class(*) polymorphism, keeping kernels decoupled from the full state.

Components

Type Visibility Attributes Name Initial
real(kind=wp), public, allocatable :: data_eta_east(:)
real(kind=wp), public, allocatable :: data_eta_north(:)
real(kind=wp), public, allocatable :: data_eta_south(:)
real(kind=wp), public, allocatable :: data_eta_west(:)
real(kind=wp), public, allocatable :: data_tracer_east(:,:,:)
real(kind=wp), public, allocatable :: data_tracer_north(:,:,:)

(ny|nx, nz_ml, n_tracers).

real(kind=wp), public, allocatable :: data_tracer_south(:,:,:)

(ny|nx, nz_ml, n_tracers).

real(kind=wp), public, allocatable :: data_tracer_west(:,:,:)
real(kind=wp), public, allocatable :: data_u_east(:,:)
real(kind=wp), public, allocatable :: data_u_west(:,:)
real(kind=wp), public, allocatable :: data_v_north(:,:)
real(kind=wp), public, allocatable :: data_v_south(:,:)
type(ocean_bc_face_tag_t), public :: east
real(kind=wp), public :: eta_old_chapman_e = 0.0_wp
real(kind=wp), public :: eta_old_chapman_n = 0.0_wp
real(kind=wp), public :: eta_old_chapman_s = 0.0_wp
real(kind=wp), public :: eta_old_chapman_w = 0.0_wp
real(kind=wp), public, allocatable :: eta_old_east(:)
real(kind=wp), public, allocatable :: eta_old_north(:)
real(kind=wp), public, allocatable :: eta_old_south(:)
real(kind=wp), public, allocatable :: eta_old_west(:)
real(kind=wp), public :: ext_u_east = 0.0_wp

Exterior barotropic u, east (m/s).

real(kind=wp), public :: ext_u_west = 0.0_wp

Exterior barotropic u, west (m/s).

real(kind=wp), public :: ext_v_north = 0.0_wp

Exterior barotropic v, north (m/s).

real(kind=wp), public :: ext_v_south = 0.0_wp

Exterior barotropic v, south (m/s).

logical, public :: has_east = .true.

False when the east edge of this subdomain is an MPI seam; true when it is a physical domain edge. (analogous to has_west)

logical, public :: has_north = .true.

False when the north edge of this subdomain is an MPI seam; true when it is a physical domain edge. (analogous to has_west)

logical, public :: has_south = .true.

False when the south edge of this subdomain is an MPI seam; true when it is a physical domain edge. (analogous to has_west)

logical, public :: has_west = .true.

False when the west edge of this subdomain is an MPI seam (a neighbouring rank owns the cells beyond it), true when it is a physical domain edge. Set from decomp%has_west at BC configure. Default .true. => single-rank / physical-edge behaviour (bit-identical to the pre-decomp code).

logical, public :: is_init = .false.
integer, public :: n_tracers = 0
integer, public :: nghost = 0
type(ocean_bc_face_tag_t), public :: north
logical, public :: north_fold = .false.

True when THIS RANK applies the tripolar north fold: the north edge is OBC_TRIPOLAR_FOLD AND this subdomain owns the physical north edge (has_north). Gates every fold exchange in the dyn loop + BT substep + continuity + setup wraps. On a north-south split (px = 1, py > 1) only the north rank row folds; every other rank’s north ghosts are an MPI seam the halo exchange fills, and folding them would overwrite that with a mirror of the rank’s own tile. (ocean_bc_state_set_edges re-derives it once the decomposition is known.) Default .false. is bit-identical.

real(kind=wp), public :: nudge_tau_in = 0.0_wp

Inflow nudging timescale (s, Marchesiello et al. 2001). 0 = off.

real(kind=wp), public :: nudge_tau_out = 0.0_wp

Outflow nudging timescale (s). 0 = off.

integer, public :: nx_phys = 0
integer, public :: nx_total = 0
integer, public :: ny_phys = 0
integer, public :: ny_total = 0
integer, public :: nz_ml = 0
real(kind=wp), public :: orlanski_gamma = 1.0_wp

Running-mean weight. 1.0 = no running mean (instant rx).

real(kind=wp), public :: orlanski_rx_max = 10.0_wp

Upper clamp on the nondimensional phase speed (Orlanski 1976).

logical, public :: periodic_x = .false.

True when west and east edges are both OBC_PERIODIC.

logical, public :: periodic_y = .false.

True when south and north edges are both OBC_PERIODIC.

integer, public :: radiation_scheme = 0

0 = anomaly (default); 1 = orlanski.

real(kind=wp), public :: res_lscale_in = 0.0_wp

Inflow reservoir length scale (m). 0 ⇒ instantaneous inflow.

real(kind=wp), public :: res_lscale_out = 0.0_wp

Outflow reservoir length scale (m). 0 ⇒ instantaneous outflow.

real(kind=wp), public, allocatable :: rx_east(:,:)

Running-mean rx, east edge.

real(kind=wp), public, allocatable :: rx_north(:,:)

Running-mean rx, north edge.

real(kind=wp), public, allocatable :: rx_south(:,:)

Running-mean rx, south edge.

real(kind=wp), public, allocatable :: rx_west(:,:)

Running-mean rx, west edge.

type(ocean_bc_face_tag_t), public :: south
logical, public :: tidal_nodal = .false.

Global switch (capability C3): apply the 18.6-yr nodal factor f_c + equilibrium/nodal phase (V_c + u_c) to the OBC tidal elevation forcing. Baked into the per-edge tidal_fnodal/tidal_arg at setup from the shared &ocean_tides_nml reference epoch. Cached into the barotropic substep like periodic_x. Default .false. ⇒ bit-identical legacy static-phase sum. When .true. the phase convention flips: the Greenwich phase tidal_phase becomes a LAG (subtracted).

real(kind=wp), public, allocatable :: tres_east(:,:,:)

East reservoir concentration

real(kind=wp), public, allocatable :: tres_north(:,:,:)

North reservoir concentration

real(kind=wp), public, allocatable :: tres_south(:,:,:)

South reservoir concentration

real(kind=wp), public, allocatable :: tres_west(:,:,:)

West reservoir concentration

real(kind=wp), public, allocatable :: u_prev_east(:,:)

Prev-call u at first interior face, east.

real(kind=wp), public, allocatable :: u_prev_north(:,:)

Prev-call v at first interior face, north.

real(kind=wp), public, allocatable :: u_prev_south(:,:)

Prev-call v at first interior face, south.

real(kind=wp), public, allocatable :: u_prev_west(:,:)

Prev-call u at first interior face, west.

logical, public :: use_full_flather = .false.

.false. = legacy (default, bit-identical); .true. = full Flather (Flather 1976 half-characteristic form with exterior velocity).

type(ocean_bc_face_tag_t), public :: west

Type-Bound Procedures

procedure, public, non_overridable :: bytes => ocean_bc_state_bytes

Functions

public pure function obc_match_constituent(omega) result(ic)

Resolve an OBC edge constituent’s angular frequency omega (rad/s) to the tide catalog index (rdb_ocean_tide_astro::TIDE_OMEGA) whose frequency matches within the relative tolerance OBC_TIDE_MATCH_TOL. Returns 0 when no catalog entry is within tolerance (unknown constituent) or when omega <= 0 — the caller (OBC setup) converts a 0 to a fail-loud error stop, keeping this function pure.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: omega

Return Value integer

public pure function ocean_bc_outer_face_tag(bc_type) result(tag)

The tag an edge’s OUTER FACE behaves as for the no-normal-flow closures (mass-flux zeroing in the continuity, the uhbt/vhbt wall reconciliation, the lateral tracer-diffusion walls).

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: bc_type

Raw per-edge tag (ocean_bc_face_tag_t%bc_type).

Return Value integer

public pure function ocean_bc_type_from_string(name) result(bc_type)

Convert a config-namelist edge string → integer OBC tag. Case-INSENSITIVE (to_lower), so “OPEN”/”Open”/”open” all parse to OBC_OPEN. An unrecognised name returns OBC_INVALID (PR-6 fail-loud): a typo must NOT silently close the boundary to a wall. validate_config rejects OBC_INVALID (naming the edge) before configure_ocean_bc consumes any parse result, so no production caller ever sees the sentinel at a live edge.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Return Value integer

private pure function ocean_bc_state_bytes(this) result(nbytes)

Counted allocatable footprint of the boundary state slot (0 when unallocated).

Arguments

Type IntentOptional Attributes Name
class(ocean_bc_state_t), intent(in) :: this

Return Value integer(kind=int64)


Subroutines

public pure subroutine obc_tide_nodal_fill(face, f_all, u_all, v_all, ierr)

Bake the nodal/astronomical correction into one edge’s per-constituent tidal_fnodal / tidal_arg. For each of face%n_tidal_constituents, resolve the constituent by frequency (obc_match_constituent) and set tidal_fnodal(nc) = f_all(ic), tidal_arg(nc) = v_all(ic) + u_all(ic). f_all / u_all come from nodal_fu, v_all from equilibrium_arguments, all sized TIDES_CATALOG_SIZE. On an unmatched constituent it leaves that entry untouched and returns ierr = nc (the 1-based edge slot that failed) so the caller can fail loud; ierr = 0 on success. pure — no logging / no error stop.

Arguments

Type IntentOptional Attributes Name
type(ocean_bc_face_tag_t), intent(inout) :: face
real(kind=wp), intent(in) :: f_all(TIDES_CATALOG_SIZE)
real(kind=wp), intent(in) :: u_all(TIDES_CATALOG_SIZE)
real(kind=wp), intent(in) :: v_all(TIDES_CATALOG_SIZE)
integer, intent(out) :: ierr

public subroutine ocean_bc_state_destroy(this)

Arguments

Type IntentOptional Attributes Name
type(ocean_bc_state_t), intent(inout) :: this

public subroutine ocean_bc_state_enter_data(this)

GPU mapping for ocean_bc_state_t.

Read more…

Arguments

Type IntentOptional Attributes Name
type(ocean_bc_state_t), intent(inout) :: this

public subroutine ocean_bc_state_exit_data(this)

GPU unmapping — components first, parent last (reverse of enter_data).

Arguments

Type IntentOptional Attributes Name
type(ocean_bc_state_t), intent(inout) :: this

public subroutine ocean_bc_state_init(this, grid, nz_ml, n_tracers)

Cache grid extents and derive periodic flags. Data buffers stay unallocated until a data source asks for them. Call ocean_bc_validate_periodic after setting per-edge tags if any edge is OBC_PERIODIC; init itself only derives the convenience flags.

Arguments

Type IntentOptional Attributes Name
type(ocean_bc_state_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
integer, intent(in) :: nz_ml
integer, intent(in), optional :: n_tracers

public pure subroutine ocean_bc_state_set_edges(this, has_west, has_east, has_south, has_north)

Set the physical-domain-edge flags from a decomposition descriptor. Called once by the driver after configure_ocean_bc so kernels can gate wall / BC / periodic closures on physical edges (a subdomain seam is never a wall), and re-derives the rank-local north_fold (the fold is applied only by the rank that owns the north edge). Default .true. keeps single-rank bit-identity.

Arguments

Type IntentOptional Attributes Name
type(ocean_bc_state_t), intent(inout) :: this
logical, intent(in) :: has_west

True when the west edge is a physical domain edge, false at an MPI seam.

logical, intent(in) :: has_east

True when the east edge is a physical domain edge, false at an MPI seam.

logical, intent(in) :: has_south

True when the south edge is a physical domain edge, false at an MPI seam.

logical, intent(in) :: has_north

True when the north edge is a physical domain edge, false at an MPI seam.

public subroutine ocean_bc_state_set_topology(this, periodic_x, periodic_y, ierr)

Pre-create GRID TOPOLOGY injection (Python runtime API plan, P2.5): force per-dimension periodicity the Oceananigans way (docs/ocean_python_api_plan.md S5b) — “the grid owns periodicity”, not the per-edge &ocean_bc_nml tags. Sets periodic_x/periodic_y directly and back-fills the edge tags on every axis the caller marks periodic (both edges together, so a west/east — or south/north — mismatch is structurally unrepresentable through this entry point, unlike the namelist path which needs ocean_bc_validate_periodic to catch one). An axis the caller does NOT mark periodic is left untouched: its edge tags keep whatever physical BC configure_ocean_bc already derived from &ocean_bc_nml — periodicity is a GRID property, but the wall/open/clamped/… physics for a Bounded dimension stays the namelist’s job.

Read more…

Arguments

Type IntentOptional Attributes Name
type(ocean_bc_state_t), intent(inout) :: this
logical, intent(in) :: periodic_x
logical, intent(in) :: periodic_y
integer, intent(out), optional :: ierr

Non-zero (OCEAN_STATUS_ERR_SETUP) when a requested periodic axis violates the nghost >= 3 PPM/biharmonic stencil-depth requirement (ocean_bc_validate_periodic’s rule (c), mirrored here since this entry point bypasses that routine) when present; absent behaves as today (error stop).

public subroutine ocean_bc_validate_fold(this, ierr)

Validate the tripolar north-fold tag. Call after all per-edge tags are set and after ocean_bc_state_init. Refreshes north_fold and stops with a diagnostic if any rule fails.

Read more…

Arguments

Type IntentOptional Attributes Name
type(ocean_bc_state_t), intent(inout) :: this
integer, intent(out), optional :: ierr

Non-zero on a tripolar-fold configuration violation when present; absent behaves as today (error stop).

public subroutine ocean_bc_validate_periodic(this, ierr)

Validate periodic pairing + ghost-width + sponge incompatibility. Call after all per-edge tags are set and after ocean_bc_state_init. Derives periodic_x / periodic_y from the final tags and stops with a diagnostic message if any rule is violated.

Read more…

Arguments

Type IntentOptional Attributes Name
type(ocean_bc_state_t), intent(inout) :: this
integer, intent(out), optional :: ierr

Non-zero on a periodic-BC pairing/ghost-width violation when present; absent behaves as today (error stop).