-
Notifications
You must be signed in to change notification settings - Fork 449
EAMxx: add support for rank-0 fields in compute_mask #7913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for rank-0 (scalar) fields in the compute_mask function, which is needed for IO operations when outputting 0-dimensional fields. The implementation is marked as bit-for-bit (BFB) and addresses issue #7912.
- Added rank-0 field handling in the contiguous case with appropriate Kokkos parallel_for implementation
- Updated error message checks to allow rank-0 fields (changed
f.rank()>0 and f.rank()<=6tof.rank()<=6) - Enhanced error messages with field names and rank information for better debugging
- Added comprehensive test coverage for rank-0 fields testing all comparison operations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| components/eamxx/src/share/field/utils/compute_mask.cpp | Implements rank-0 field support in the compute_mask template function, relaxes rank validation to allow rank 0, improves error messages with field metadata, and adds case 0 handlers for all data types |
| components/eamxx/src/share/field/tests/compute_mask.cpp | Adds comprehensive test coverage for rank-0 fields, including field identifiers for 0d cases and a new test section that validates all comparison operations (EQ, NE, GT, GE, LT, LE) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
It is needed in IO when outputing 0d fields.
[BFB]
Fixes #7912