Skip to content

Conversation

mahf708
Copy link
Contributor

@mahf708 mahf708 commented Sep 2, 2025

persist cosp-computed fields when cosp in not run, properly handle fill-value treatment for night indices, and update docs to reflect new behavior.

[NBFB]

@mahf708 mahf708 added EAMxx Issues related to EAMxx COSP labels Sep 2, 2025
@mahf708 mahf708 linked an issue Sep 2, 2025 that may be closed by this pull request
@mahf708 mahf708 requested review from bartgol and removed request for Copilot September 2, 2025 13:16
@mahf708 mahf708 added the non-BFB PR makes roundoff changes to answers. label Sep 2, 2025
Copy link

github-actions bot commented Sep 2, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://E3SM-Project.github.io/E3SM/pr-preview/pr-7652/

Built to branch gh-pages at 2025-09-08 14:59 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@mahf708 mahf708 force-pushed the mahf708/eamxx/cosp-expected-behavior branch 2 times, most recently from 7c539a9 to df0c09f Compare September 2, 2025 13:38
@mahf708
Copy link
Contributor Author

mahf708 commented Sep 2, 2025

@whannah1 @bartgol @AaronDonahue pls take a look at the last commit 94ee77a. I decided to add it because I wanted to simplify the amount of work being done here; there's really only one sunlit_mask, and it is a mask as it is defined, so we make all these fields (including aodvis) just point to it as their mask. So, recycling it. It seems to work well in my testing.

After your review, I (with help from Ben) will do a few prod-like tests to ensure this is not going rogue. In my few simple tests, this seems to be working well... but somethings may show up out of nowhere, so we will test some more

@@ -133,6 +134,8 @@ TEST_CASE("aodvis") {
if(SCREAM_BFB_TESTING) {
REQUIRE(views_are_equal(aod_hf, aod_tf));
}
// Ensure the masks are identical (should be pointing exactly to each other)
REQUIRE(views_are_equal(aod_mask, sunlit));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want, you can be more strict: rather than checking that the two store the same values, you could/should verify that the two fields are the same, by doing REQUIRE(aod_mask.is_aliasing(sunlit));. This checks that the two fields point to the same data in memory, and that the two headers are aliases (which include the case where the two header ptr point to the same obj).

This would guard against accidental changes of the diagnostic class, where we create a separate field (e.g., setting the mask to be a clone of the sunlit field).

@bartgol
Copy link
Contributor

bartgol commented Sep 4, 2025

Baseline diff is expected. I will merge.

Edit: merging to next only, as it will cause diffs.

bartgol added a commit that referenced this pull request Sep 4, 2025
persist cosp-computed fields when cosp in not run,
properly handle fill-value treatment for night indices,
and update docs to reflect new behavior.

[NBFB]
@mahf708
Copy link
Contributor Author

mahf708 commented Sep 5, 2025

Baseline diff is expected. I will merge.

Edit: merging to next only, as it will cause diffs.

we are not ready, could you remove from next tmrw? I still would like to test this in an ne4 prod like test

@mahf708 mahf708 force-pushed the mahf708/eamxx/cosp-expected-behavior branch from 88d3532 to 00779f0 Compare September 8, 2025 14:56
@mahf708
Copy link
Contributor Author

mahf708 commented Sep 8, 2025

I verified this worked for my liking and testing, but I couldn't add a good enough test that covers everything. There are a few important caveats, two jump to my head right away:

  1. code-wise: EAMxx: unify usage of "mask_field" and "mask_data" and "set_may_be_filled" #7672
  2. settings-wise: EAMxx: better configuration of fill_threshold when it comes to fillval treatment #7327

These may trip up some users, but that's well beyond the scope of this PR, so as @bartgol recommended privately, we should merge this PR and worry about other stuff later.

@mahf708
Copy link
Contributor Author

mahf708 commented Sep 8, 2025

@bartgol can I ask for an exception regarding the linter or would you like me to make it happy? I can take care of the formatting later in a follow-up PR...

@mahf708 mahf708 marked this pull request as ready for review September 8, 2025 15:05
@bartgol
Copy link
Contributor

bartgol commented Sep 8, 2025

@bartgol can I ask for an exception regarding the linter or would you like me to make it happy? I can take care of the formatting later in a follow-up PR...

Yeah, that's fine.

Baseline diff is expected. I will merge.
Edit: merging to next only, as it will cause diffs.

we are not ready, could you remove from next tmrw? I still would like to test this in an ne4 prod like test

Are we ready now? Can I re-merge to next, or do I need to revert?

@mahf708
Copy link
Contributor Author

mahf708 commented Sep 8, 2025

Yes, note all the failing jobs including linter are expected (various issues, but they are all expected)

And there's no real need to go through next since this only touches EAMxx side of things, but going through next is fine with me for extra caution, etc.

@bartgol
Copy link
Contributor

bartgol commented Sep 8, 2025

Yes, note all the failing jobs including linter are expected (various issues, but they are all expected)

Even the non-eamxx gh/ci test?

Edit: nvm, I see.

bartgol added a commit that referenced this pull request Sep 8, 2025
- Persist cosp-computed fields when cosp in not run
- Properly handle fill-value treatment for night indices
- Update docs to reflect new behavior

[NBFB]
@bartgol bartgol merged commit e8924b7 into master Sep 8, 2025
26 of 48 checks passed
@bartgol bartgol deleted the mahf708/eamxx/cosp-expected-behavior branch September 8, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COSP EAMxx Issues related to EAMxx non-BFB PR makes roundoff changes to answers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] EAMxx: COSP Expected Behavior
6 participants