Skip to content

Conversation

bartgol
Copy link
Contributor

@bartgol bartgol commented Jul 14, 2025

One bug was introduced by PR #7397 , while two other bugs was pre-dating that PR.


@cjvogl If you don't like the nano fix to your ZonalMean diag, another possible solution would be to make the bins span [-90.001,90.001], to ensure that ALL points are inside the bins (and avoid the call to max). I think that for even values of ne, unit tests using np4 (gll) grid for physics will always get a column at the north/south poles. Of course, production grids are virtually always using pg2, for which is impossible to get a col exactly at the pole (it would be possible for pg3, but we don't use that).

Fixes #7511

@bartgol bartgol requested review from mahf708 and cjvogl July 14, 2025 18:37
@bartgol bartgol self-assigned this Jul 14, 2025
@bartgol bartgol added bug fix PR BFB PR leaves answers BFB EAMxx Issues related to EAMxx labels Jul 14, 2025
@bartgol
Copy link
Contributor Author

bartgol commented Jul 14, 2025

@cjvogl I just realized this may conflict with #7481 . If you address the issue of ensuring that lat=90N is not causing to go OOB with the bin idx, then I can wait until your PR is merged, and rebase this on master, removing the commit that touches the ZM diag.

Copy link
Contributor

@mahf708 mahf708 left a comment

Choose a reason for hiding this comment

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

thanks!

Copy link
Contributor

@cjvogl cjvogl left a comment

Choose a reason for hiding this comment

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

This looks good to me! I did indeed neglect to consider when a column would have a lat value exactly at the poles when deciding a bin would be "open" at the upper bound. The same issue is present in #7481, although it will manifest in a different way (namely that the column at the pole will be ignored)... so I'm glad you caught this now!

As far as the conflict with #7481, my vote is to merge this PR as-is to address the bug while #7481 is reviewed.

@bartgol
Copy link
Contributor Author

bartgol commented Jul 16, 2025

The failures in xyz_run_and_cmp are unrelated, and currently under investigation separately. I am going to merge this as I think the bug fix in the abstract grid method may impact other PRs.

bartgol added a commit that referenced this pull request Jul 16, 2025
One bug was introduced by PR #7397, while two other were pre-dating that PR.

[BFB]
@bartgol bartgol merged commit 8c5bed9 into master Jul 16, 2025
13 of 19 checks passed
@bartgol bartgol deleted the bartgol/eamxx/zonal-mean-bug-fixes branch July 16, 2025 16:39
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 Issues related to EAMxx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EAMxx: zonal avg appears to be broken due to IO restructuring
3 participants