[CI] Generalize kill-zone/tracer limits; size streamfunction zones adaptively#1
Closed
hdrake wants to merge 1 commit into
Closed
[CI] Generalize kill-zone/tracer limits; size streamfunction zones adaptively#1hdrake wants to merge 1 commit into
hdrake wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.