Skip to content

Feature/wdboggs/#4288 test geom aspect#4483

Open
darianboggs wants to merge 18 commits intorelease/MAPL-v3from
feature/wdboggs/#4288_test_geom_aspect
Open

Feature/wdboggs/#4288 test geom aspect#4483
darianboggs wants to merge 18 commits intorelease/MAPL-v3from
feature/wdboggs/#4288_test_geom_aspect

Conversation

@darianboggs
Copy link
Contributor

Types of change(s)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)
  • Refactor (no functional changes, no api changes)

Checklist

  • Tested this change with a run of GEOSgcm
  • Ran the Unit Tests (make tests)

Description

Unit tests for the update_payload and update_from_payload methods of GeomAspect

Related Issue

#4288

darianboggs and others added 18 commits March 3, 2026 23:15
…ts (#4447)

* Task 1.5: Add is_conservative() methods to regridder parameters and VerticalGridAspect

- Add is_conservative() to RoutehandleParam to check regrid method
- Add is_conservative() wrapper to EsmfRegridderParam
- Add is_conservative() to VerticalGridAspect to check vertical regrid method
- All aspects remain decoupled - no cross-aspect dependencies introduced
- Prepares infrastructure for conservative regridding validation in Phase 2

* Task 1.7: Add 2D conservative regridding tests (horizontal only)

- Created Test_2DConservativeRegrid.pf with 4 test cases:
  1. Verify is_conservative() method works
  2. Create 2D field with QuantityTypeMetadata
  3. Verify pressure field metadata
  4. Simple 2D conservative regrid test for extensive quantity

- Tests validate horizontal conservative regridding infrastructure
- Vertical conservative regridding deferred to Phase 2
- Added test file to CMakeLists.txt

Note: Tests not yet validated due to NAG compiler license issues

* Fix Test_2DConservativeRegrid test failures

- test_pressure_field_metadata: Explicitly set conservative_regridable and
  normalization_type since automatic derivation is in QuantityTypeAspect (Phase 2)
- test_simple_2d_conservative_regrid: Simplified to just test is_conservative()
  method rather than full ESMF regridding (which requires complex grid setup)
- Fixed import to use single use statement for regridder_mgr types

Tests now validate the infrastructure without requiring full ESMF grid setup.

* Fix compilation errors in Test_2DConservativeRegrid

- Import RoutehandleParam from mapl3g_RoutehandleParam module directly
- Remove unused variables from test_pressure_field_metadata()
…4369)

* Python bridge original code + README

* Exposing `MAPL.python_bridge` to larger `MAPL` + forward API

* Fix bad import when opt-out of the bridge + clean up

* Update CHANGELOG

* Defend `ieee` checks against odd compiler faults.
Restrict it to known SIGFPE issue on numpy import

* Evolve API to get a 1 call to MAPL_GetPointer within Python

* Add `associated` check leading to buffer being `None`
Docstrings

* Export init/finalize user code hooks
Replace GridComp by MaplComp

* Fix ABC use for user code base class
Add a larger bypass IEEE importer with other packages used in DSL

* Fix MAPLPy user API memory retrieval

* Expose `GetResource` to `MAPLPy`

* Expose basic grid infos

* Add hook for RUN with `INTERNAL` state

* Expose `named_run_with_internal` to public API

* Fixing implicit `stdlib.h` import for uptight apple-clang

* Rename files & move under the `Python` directory

* Rename MAPL_PythonBridge -> PythonBridge

---------

Co-authored-by: Tom Clune <thomas.l.clune@nasa.gov>
…rchitectural patterns (#4446)

* Saving AI generated plans.

* Refactor quantity type infrastructure following MAPL architectural patterns

- Move QuantityType, NormalizationType to esmf_utils/ to avoid circular dependencies
- Create QuantityTypeMetadata following UngriddedDims pattern for Info serialization
- Integrate quantity_type_metadata into Field/FieldBundle Get/Set APIs
- Implement QuantityTypeAspect using high-level APIs instead of direct Info access
- Add comprehensive unit tests for QuantityType and QuantityTypeAspect

This implements Tasks 1.1 and 1.2 from the conservative regridding implementation plan.

* Update implementation plan progress tracking for tasks 1.1-1.2

* Fix Intel Fortran error: use non-allocatable buffers in make_QuantityTypeMetadata

Intel Fortran requires variables passed to MAPL_InfoGet to be pre-allocated
when using allocatable intent(out). Changed to non-allocatable buffer variables
since values are immediately assigned to non-allocatable struct members anyway.

Fixes: forrtl: severe (408): Attempt to fetch from allocatable variable when not allocated

* Fix validation tests to use @assertExceptionRaised

The validation tests were incorrectly expecting error return codes instead of
exceptions. Updated test_validate_mixing_ratio_requires_basis and
test_validate_volume_basis_requires_molecular_weight to use
@assertExceptionRaised() which is the correct pFUnit pattern for testing
that validation failures throw exceptions.

* Apply suggestions from code review
…ts (#4447)

* Task 1.5: Add is_conservative() methods to regridder parameters and VerticalGridAspect

- Add is_conservative() to RoutehandleParam to check regrid method
- Add is_conservative() wrapper to EsmfRegridderParam
- Add is_conservative() to VerticalGridAspect to check vertical regrid method
- All aspects remain decoupled - no cross-aspect dependencies introduced
- Prepares infrastructure for conservative regridding validation in Phase 2

* Task 1.7: Add 2D conservative regridding tests (horizontal only)

- Created Test_2DConservativeRegrid.pf with 4 test cases:
  1. Verify is_conservative() method works
  2. Create 2D field with QuantityTypeMetadata
  3. Verify pressure field metadata
  4. Simple 2D conservative regrid test for extensive quantity

- Tests validate horizontal conservative regridding infrastructure
- Vertical conservative regridding deferred to Phase 2
- Added test file to CMakeLists.txt

Note: Tests not yet validated due to NAG compiler license issues

* Fix Test_2DConservativeRegrid test failures

- test_pressure_field_metadata: Explicitly set conservative_regridable and
  normalization_type since automatic derivation is in QuantityTypeAspect (Phase 2)
- test_simple_2d_conservative_regrid: Simplified to just test is_conservative()
  method rather than full ESMF regridding (which requires complex grid setup)
- Fixed import to use single use statement for regridder_mgr types

Tests now validate the infrastructure without requiring full ESMF grid setup.

* Fix compilation errors in Test_2DConservativeRegrid

- Import RoutehandleParam from mapl3g_RoutehandleParam module directly
- Remove unused variables from test_pressure_field_metadata()
…rchitectural patterns (#4446)

* Saving AI generated plans.

* Refactor quantity type infrastructure following MAPL architectural patterns

- Move QuantityType, NormalizationType to esmf_utils/ to avoid circular dependencies
- Create QuantityTypeMetadata following UngriddedDims pattern for Info serialization
- Integrate quantity_type_metadata into Field/FieldBundle Get/Set APIs
- Implement QuantityTypeAspect using high-level APIs instead of direct Info access
- Add comprehensive unit tests for QuantityType and QuantityTypeAspect

This implements Tasks 1.1 and 1.2 from the conservative regridding implementation plan.

* Update implementation plan progress tracking for tasks 1.1-1.2

* Fix Intel Fortran error: use non-allocatable buffers in make_QuantityTypeMetadata

Intel Fortran requires variables passed to MAPL_InfoGet to be pre-allocated
when using allocatable intent(out). Changed to non-allocatable buffer variables
since values are immediately assigned to non-allocatable struct members anyway.

Fixes: forrtl: severe (408): Attempt to fetch from allocatable variable when not allocated

* Fix validation tests to use @assertExceptionRaised

The validation tests were incorrectly expecting error return codes instead of
exceptions. Updated test_validate_mixing_ratio_requires_basis and
test_validate_volume_basis_requires_molecular_weight to use
@assertExceptionRaised() which is the correct pFUnit pattern for testing
that validation failures throw exceptions.

* Apply suggestions from code review
@darianboggs darianboggs requested a review from tclune March 4, 2026 18:24
@darianboggs darianboggs self-assigned this Mar 4, 2026
@darianboggs darianboggs requested a review from a team as a code owner March 4, 2026 18:24
@darianboggs darianboggs added 🎁 New Feature This is a new feature 0 Diff The changes in this pull request have verified to be zero-diff with the target branch. 📈 MAPL3 MAPL 3 Related labels Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0 Diff The changes in this pull request have verified to be zero-diff with the target branch. 📈 MAPL3 MAPL 3 Related 🎁 New Feature This is a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants