Skip to content

[CI] Generalize kill-zone/tracer limits; size streamfunction zones adaptively#1

Closed
hdrake wants to merge 1 commit into
mainfrom
generalize-killzone-tracer-limits
Closed

[CI] Generalize kill-zone/tracer limits; size streamfunction zones adaptively#1
hdrake wants to merge 1 commit into
mainfrom
generalize-killzone-tracer-limits

Conversation

@hdrake

@hdrake hdrake commented Jun 22, 2026

Copy link
Copy Markdown
Owner

CI validation mirror of upstream TRACMASS#16 (fork PRs to upstream require maintainer approval to run Actions). Same single commit; see that PR for the full description.

The streamfunction flux arrays and their per-zone loops were hard-coded to
a fixed 21 kill zones, and the kill-zone (10) and tracer (10) capacities
were scattered as bare literals across many files (including per-project
kill_zones.F90). This generalizes those limits and sizes the streamfunction
allocation to the zones a run actually uses.

- Add named capacity constants in mod_precdef: MAXGEOZONES, MAXTRACERS, and
  MAXZONES = 1 + MAXTRACERS + MAXGEOZONES, used to dimension the kill-zone
  and tracer configuration arrays.
- Compute maxlbas (the actual streamfunction zone count) from the run:
  namelist geographic zones + subdomain wall zones + tracer kill zones,
  finalised in init_subdomain once exitType and all zones are known. The
  flux arrays (offline) and the compute_stream loop now size to maxlbas
  instead of a fixed 21.
- Derive runtime loop bounds and the subdomain "last 4" wall slots from
  SIZE() of the arrays, removing the hard-coded slot numbers (7-10) in
  mod_subdomain and the 1,10 loops in kill_zones.F90 (x5), mod_diffusion,
  and mod_init.
- Initialise ienw/iene/jens/jenn to 0 so undefined slots are well-defined.

Fixes a latent out-of-bounds when the configured zone count differs from
21, and an under-allocation when an exitType=2 run uses a subdomain (which
promotes exitType to 3 and adds geographic walls). Behaviour is otherwise
unchanged: streamfunction output now contains the actual number of zone
blocks, verified byte-identical to the previous output for the real zones.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hdrake hdrake closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant