Skip to content

A dummy with a non-unit lower bound gets the upper bound as its extent, on both sides of the gate #24

Description

@chenyueqi

CLUBB's banded solvers declare their matrix `real( kind = core_rknd ), intent(inout), dimension(-2:2,ngrdcol,ndim) :: lhs` (penta_bicgstab_solver; `-1:1` in tridiag_lu_solver, `-2:2` in penta_lu_solver). The interface records the axis as `{lb: '-2', ub: '2'}`, and everything downstream reads only `ub`: `differential.bitexact` samples the argument with shape `(2, ngrdcol, ndim)` (`_resolve_extent(d.get('ub'), dims)`), and the flat adapter's `_declare` spells the dummy `lhs(2, ngrdcol, ndim)`. The candidate indexes `lhs[(0) - (-2), ...]` = row 2 of a 2-row array and raises `IndexError: index 2 is out of bounds for axis 0 with size 2`; the Fortran side reads past its (mis-declared) array and says nothing.

The extent of an axis declared `lb:ub` is `ub - lb + 1`, and the adapter should declare the dummy with its original bounds so the callee sees the layout it was written for. Related to #18, whose `t_above:t_below` axis is the same shape of problem with named bounds.

Found 2026-09-03 on the recast-clubb tier-0 units (bicgstab_solvers).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:flattenflat adapters for derived-type interfaces (flatten, recorder, plans)area:verifierthe gates: static.rwset, differential.bitexact/tolerance, oraclesbugSomething isn't workingfixed-in-prfixed on a branch, awaiting the PR's mergefound-by:clubbsurfaced by the recast-clubb extension on CLUBB_core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions