register_boundary Subroutine

private subroutine register_boundary(cfg, schema)

&boundary_nml: per-side BC types, tidal forcing, inflow/ discharge/clamped/sponge/nesting parameters. The four bc_* keys are enums over the bc_type_from_string accepted set.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in), target :: cfg
type(nml_schema_t), intent(inout) :: schema

Calls

proc~~register_boundary~~CallsGraph proc~register_boundary register_boundary proc~group_add nml_group_t%group_add proc~register_boundary->proc~group_add proc~nml_enum nml_enum proc~register_boundary->proc~nml_enum proc~nml_int nml_int proc~register_boundary->proc~nml_int proc~nml_real nml_real proc~register_boundary->proc~nml_real proc~nml_real_array nml_real_array proc~register_boundary->proc~nml_real_array proc~schema_add_group nml_schema_t%schema_add_group proc~register_boundary->proc~schema_add_group error error proc~group_add->error proc~lower lower proc~group_add->proc~lower proc~schema_add_group->error proc~schema_add_group->proc~lower proc~move_group move_group proc~schema_add_group->proc~move_group

Called by

proc~~register_boundary~~CalledByGraph proc~register_boundary register_boundary proc~build_rdb_schema build_rdb_schema proc~build_rdb_schema->proc~register_boundary proc~read_config_from_string_impl read_config_from_string_impl proc~read_config_from_string_impl->proc~build_rdb_schema proc~read_config_impl read_config_impl proc~read_config_impl->proc~build_rdb_schema proc~read_config read_config proc~read_config->proc~read_config_impl proc~read_config_from_string read_config_from_string proc~read_config_from_string->proc~read_config_from_string_impl proc~build_pending_handle build_pending_handle proc~build_pending_handle->proc~read_config_from_string proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~build_pending_handle proc~rdb_ocean_create_pending rdb_ocean_create_pending proc~rdb_ocean_create_pending->proc~build_pending_handle

Variables

Type Visibility Attributes Name Initial
character(len=9), private, parameter :: bc_allowed(*) = [character(len=9)::"wall", "open", "tidal", "nested", "inflow", "discharge", "clamped", "sponge", "chapman"]
type(nml_group_t), private :: g
real(kind=wp), private, pointer :: pa(:)
integer, private, pointer :: pi
real(kind=wp), private, pointer :: pr
character(len=:), private, pointer :: ps

Source Code

   subroutine register_boundary(cfg, schema)
      !! `&boundary_nml`: per-side BC types, tidal forcing, inflow/
      !! discharge/clamped/sponge/nesting parameters.  The four `bc_*`
      !! keys are enums over the bc_type_from_string accepted set.
      type(config_t), target, intent(in) :: cfg
      type(nml_schema_t), intent(inout) :: schema
      type(nml_group_t) :: g
      real(wp), pointer :: pr
      real(wp), pointer :: pa(:)
      integer, pointer :: pi
      character(len=:), pointer :: ps
      character(len=9), parameter :: bc_allowed(*) = &
                                     [character(len=9) :: "wall", "open", "tidal", "nested", "inflow", &
                                                           "discharge", "clamped", "sponge", "chapman"]

      g%name = "boundary"
      g%doc = "Boundary conditions, tidal forcing, inflow/discharge/sponge/nesting."
      ps => cfg%bc_west
      call g%add(nml_enum("bc_west", ps, "West boundary type", allowed=bc_allowed, &
                          dead_on_ocean_path="coastal-legacy: reaches only warn_unknown_bc "// &
                          "and nothing else. The ocean path's edge selector is &ocean_bc_nml "// &
                          "west/east/south/north."))
      ps => cfg%bc_east
      call g%add(nml_enum("bc_east", ps, "East boundary type", allowed=bc_allowed, &
                          dead_on_ocean_path="coastal-legacy: reaches only warn_unknown_bc "// &
                          "and nothing else. The ocean path's edge selector is &ocean_bc_nml "// &
                          "west/east/south/north."))
      ps => cfg%bc_south
      call g%add(nml_enum("bc_south", ps, "South boundary type", allowed=bc_allowed, &
                          dead_on_ocean_path="coastal-legacy: reaches only warn_unknown_bc "// &
                          "and nothing else. The ocean path's edge selector is &ocean_bc_nml "// &
                          "west/east/south/north."))
      ps => cfg%bc_north
      call g%add(nml_enum("bc_north", ps, "North boundary type", allowed=bc_allowed, &
                          dead_on_ocean_path="coastal-legacy: reaches only warn_unknown_bc "// &
                          "and nothing else. The ocean path's edge selector is &ocean_bc_nml "// &
                          "west/east/south/north."))
      pi => cfg%n_tidal_constituents
      call g%add(nml_int("n_tidal_constituents", pi, &
                         "Active tidal constituents (0 = legacy single)", min=0))
      pa => cfg%tidal_amp
      call g%add(nml_real_array("tidal_amp", pa, "Constituent amplitudes", units="m"))
      pa => cfg%tidal_phase
      call g%add(nml_real_array("tidal_phase", pa, "Constituent phases", units="rad"))
      pa => cfg%tidal_omega
      call g%add(nml_real_array("tidal_omega", pa, "Constituent angular frequencies", units="rad/s"))
      pr => cfg%inflow_salinity
      call g%add(nml_real("inflow_salinity", pr, "Inflow salinity (<0 = zero-gradient)", units="PSU", &
                          dead_on_ocean_path="stored onto tracer_t%tr_inflow via "// &
                          "register_default_tracers but tr_inflow is read nowhere on the "// &
                          "ocean path (found by the P4 dead-knob sweep, 2026-09-10)."))
      pr => cfg%inflow_temperature
      call g%add(nml_real("inflow_temperature", pr, "Inflow temperature (<0 = zero-gradient)", units="degC", &
                          dead_on_ocean_path="stored onto tracer_t%tr_inflow via "// &
                          "register_default_tracers but tr_inflow is read nowhere on the "// &
                          "ocean path (found by the P4 dead-knob sweep, 2026-09-10)."))
      pi => cfg%sponge_width
      call g%add(nml_int("sponge_width", pi, "Sponge layer width in cells", min=0))
      pr => cfg%sponge_strength
      call g%add(nml_real("sponge_strength", pr, "Sponge relaxation rate", units="1/s"))
      call schema%add_group(g)
   end subroutine register_boundary