Skip to content

Conversation

@bartgol
Copy link
Contributor

@bartgol bartgol commented Dec 2, 2025

It is needed in IO when outputing 0d fields.

[BFB]


Fixes #7912

@bartgol bartgol requested review from bogensch and mahf708 December 2, 2025 20:02
@bartgol bartgol self-assigned this Dec 2, 2025
@bartgol bartgol added bug fix PR BFB PR leaves answers BFB EAMxx C++ based E3SM atmosphere model (aka SCREAM) labels Dec 2, 2025
@mahf708 mahf708 requested a review from Copilot December 2, 2025 20:36
Copilot finished reviewing on behalf of mahf708 December 2, 2025 20:39
Copy link
Contributor

Copilot AI left a 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()<=6 to f.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.

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

Labels

BFB PR leaves answers BFB bug fix PR EAMxx C++ based E3SM atmosphere model (aka SCREAM)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EAMxx: _horiz_avg reducer not working with select level output

3 participants