Single source of truth for the BT march-in exclusion set (mirrors the
explicit-bt_halo > 0 fail-loud checks in validate_config). Reports
whether ANY exclusion is active and names the first one (for the AUTO
resolution log). When none is active, reason is “”.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(config_t), | intent(in) | :: | cfg | |||
| logical, | intent(out) | :: | excluded | |||
| character(len=:), | intent(out), | allocatable | :: | reason |
pure subroutine bt_halo_auto_exclusion(cfg, excluded, reason) !! Single source of truth for the BT march-in exclusion set (mirrors the !! explicit-`bt_halo > 0` fail-loud checks in `validate_config`). Reports !! whether ANY exclusion is active and names the first one (for the AUTO !! resolution log). When none is active, `reason` is "". type(config_t), intent(in) :: cfg logical, intent(out) :: excluded character(len=:), allocatable, intent(out) :: reason reason = "" if (cfg%ocean%wetdry%enable) then reason = "wetdry enable" else if (cfg%ocean%bt%use_cont_type) then reason = "use_cont_type" else if (cfg%ocean%bt%upstream_h_face) then reason = "upstream_h_face" else if (cfg%ocean%tides%enable) then reason = "tides enable" else if (cfg%ocean%psurf%enable) then ! Surface-pressure loading rides the SAME `eta_forcing` seam as ! the body tide, and the wide BT clone carries no copy of it: ! `run_stage_split` `error stop`s on `bt_halo > 0` with an ! `eta_forcing` actual. Must exclude alongside tides. reason = "psurf enable" else if (cfg%ocean%porous%enable) then reason = "porous enable" else if (cfg%ocean%cavity_dyn%enable) then ! The wide BT clone rebuilds `metrics_w` from the grid formula and ! carries no `z_draft`, so its reference depth would be the BED — ! it would solve a 1000 m ocean where the cavity has 500 m of ! water under 500 m of ice. `validate_config` refuses an EXPLICIT ! `bt_halo > 0`; AUTO must resolve to 0 here or a multi-rank ! cavity run manufactures a width the user never asked for and ! then trips that abort. reason = "cavity_dyn enable" else if (trim(cfg%ocean%grid%grid_config) == "supergrid" .or. & trim(cfg%ocean%grid%grid_config) == "tripolar") then reason = "grid_config='"//trim(cfg%ocean%grid%grid_config)//"'" end if excluded = len_trim(reason) > 0 end subroutine bt_halo_auto_exclusion