-
Notifications
You must be signed in to change notification settings - Fork 19
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
Bugfix/atrayano/maxmin support for nan #3290
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atrayano
added
the
0 Diff
The changes in this pull request have verified to be zero-diff with the target branch.
label
Jan 7, 2025
tclune
reviewed
Jan 7, 2025
tclune
reviewed
Jan 7, 2025
tclune
requested changes
Jan 7, 2025
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.
A couple of minor suggestions - feel free to ignore.
mathomp4
reviewed
Jan 7, 2025
`any(a/=a)` is standard conforming and concise. But also a bit obcure. Using `ieee_is_nan()` is better, but is technically less portable, as IEEE support is optional. (In practice it is supported though.) I just tend to forget the details of IEEE procedures since we use them rarely and would have needed to look them up.
I’d vote for using the ieee procedure for clarity. But it is not worth further modification at this time.
* Tom
From: Matt Thompson ***@***.***>
Date: Tuesday, January 7, 2025 at 1:22 PM
To: GEOS-ESM/MAPL ***@***.***>
Cc: Clune, Thomas L. (GSFC-6101) ***@***.***>, Mention ***@***.***>
Subject: [EXTERNAL] [BULK] Re: [GEOS-ESM/MAPL] Bugfix/atrayano/maxmin support for nan (PR #3290)
CAUTION: This email originated from outside of NASA. Please take care when clicking links or opening attachments. Use the "Report Message" button to report suspicious messages to the NASA SOC.
@mathomp4 commented on this pull request.
________________________________
In base/MAPL_MaxMinMod.F90<#3290 (comment)>:
- pmax = max(pmax, a(i,j))
- pmin = min(pmin, a(i,j))
- enddo
- qmax(j) = pmax
- qmin(j) = pmin
- enddo
-!
-! Now find max/min of amax/amin
-!
- pmax = qmax(1)
- pmin = qmin(1)
- do j=2,jt
- pmax = max(pmax, qmax(j))
- pmin = min(pmin, qmin(j))
- enddo
+ has_nans = any(a /= a)
Query for @tclune<https://github.com/tclune>: What is the best way to figure out if there are NaNs? This? Or should we do:
has_nans=any(ieee_is_nan(a))
That is, is any(a /= a) perhaps more "generic" than using ieee_is_nan()?
—
Reply to this email directly, view it on GitHub<#3290 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABPP7YC5SYEUWU5XJAZNFBL2JQLOTAVCNFSM6AAAAABUX3X7YWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMZVGA4TANRRGY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
tclune
reviewed
Jan 7, 2025
tclune
approved these changes
Jan 7, 2025
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types of change(s)
Checklist
make tests
)Description
This PR fixes the behavior of MAPL_MaxMin in presence of NaN
Related Issue
#3289