Feature/#4386 vectorbracket basis kind#4387
Merged
tclune merged 6 commits intorelease/MAPL-v3from Feb 12, 2026
Merged
Conversation
This implements issue #4376 by introducing VectorBasisKind to distinguish between NS (North-South/geographic) and GRID (grid-relative) vector components during regridding operations. Key changes: - New VectorBasisKind enum (NS, GRID, INVALID) in esmf_utils - String-based VariableSpec API: vector_basis_kind='NS' or 'GRID' - Field bundle metadata storage via FieldBundleSet/Get - Regridder integration: passes basis kind directly to get_basis() - Validation ensures vector_basis_kind only used with VECTOR bundles - get_basis() refactored with early returns (no nesting) - Comprehensive test suite (12 tests covering all scenarios) User API supports vector_basis_kind='NS' (default for vectors) or 'GRID'. The enum-based internal API ensures type safety throughout the stack.
- VariableSpec: Check allocation before accessing vector_basis_kind - VariableSpec: Default to VECTOR_BASIS_KIND_NS when unallocated - FieldBundleCreate: Auto-set NS basis for VECTOR bundles - Remove unused status variable in verify_deferred_items
Addresses reviewer feedback to use the canonical itemType field instead of heuristics (vector_component_names, standard_name format) to determine if a VariableSpec represents a vector. Changes: - VariableSpec: Check itemType == MAPL_STATEITEM_VECTOR - Removed complex heuristic logic and unused is_vector variable - Test_VectorBasisKind: Added itemtype parameter and import
- Add vector_basis_kind support to VectorBracketClassAspect - Generalize VectorBracket regridding for any even number of fields - Simplify vector_basis_kind validation in VariableSpec - Make vector_basis_kind non-allocatable (always has default value)
Rename MAPL_STATEITEM_VECTOR_BRACKET to MAPL_STATEITEM_VECTORBRACKET for consistency with naming convention MAPL_STATEITEM_<class> where the class is VectorBracket (no underscore in compound name).
atrayano
approved these changes
Feb 12, 2026
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.
Types of change(s)
Checklist
make tests)Description
Summary
Extends vector_basis_kind support (from PR #4376) to VectorBracket regridding and generalizes the regridding code to handle VectorBrackets with any even number of fields (not just 4).
Background
VectorBrackets represent both temporal bracketing and geometric vector aspects, containing vector fields at multiple timesteps. The structure is:
[u(t=0), v(t=0), u(t=1), v(t=1)]The regridding code was hardcoded for 4 fields and didn't propagate the vector_basis_kind metadata needed for rotated vector regridding.
Changes
VectorBracketClassAspect
vector_basis_kindfield (non-allocatable, defaults toVECTOR_BASIS_KIND_NS)vector_basis_kindparametervector_basis_kindin bundle metadata duringcreate()Regridder
vector_basis_kindfrom parent bundle and propagates to temporary vector pair bundlesn_pairs = size(field_list) / 2instead of hardcoded indicesVariableSpec
vector_basis_kindvalidation using_ASSERTandany()VECTOR_BASIS_KIND_NSdefault, then override if specifiedvector_basis_kindto VectorBracketClassAspect constructor when allocatedTesting
Related Issues
Fixes #4386
Builds on #4376
Related Issue