Merged
Conversation
When there were NaN values on the dataset, these checks were generating "floating invalid". At least part of the reason this is probably appearing with ifx is because ifx apparently doesn't do short-circuit conditional evaluation: in these cases, stream%mapalgo is *not* 'none', so many other compilers probably were never actually evaluating the comparison between the data and the fillvalue, but ifx is. So I'm fixing this by effectively doing the short-circuit evaluation manually - i.e., only doing the data comparison if stream%mapalgo is 'none'.
Before this change, SMS_D_Ld3_PS.f09_t232.I1850Clm60SpCrujraNoAnthro.derecho_intel.clm-decStart1851_noinitial--clm-nofireemis was failing on one of these changed lines, presumably because ifx doesn't do short-circuit evaluation of conditions, so it was failing when trying to do a comparison on a NaN. This commit refactors conditionals to avoid doing comparisons if we have found that the value is NaN.
Member
Author
|
I want to run some more testing on this; I'll update this PR when that's done. For now marking it as a draft to denote that it's not ready to merge. |
Member
Author
|
I have now run aux_cdeps plus some additional testing; all looks good. I have updated the top-level description to note the testing I ran. |
ekluzek
approved these changes
Feb 27, 2026
Collaborator
ekluzek
left a comment
There was a problem hiding this comment.
This all looks correct to me. And it's a straight-forward breaking up of logic from if statements with '.and.'. And that change makes the code more readable. So I think this is good to go.
Collaborator
|
@billsacks can this be merged? It looks like your testing went fine. And I used it in CTSM for all of the test suites there and it was good to go (in ESCOMP/CTSM#3769). |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of changes
The ifx compiler seems not to do short-circuit evaluation of conditionals. This was leading to failures in some debug tests when there were NaN values on an input file: checks like
if (.not. isnan(x) .and. x /= fillval)were okay if short-circuit evaluation was being done, but are failing now.This PR refactors some conditionals to effectively do this short-circuit evaluation via splitting the conditionals.
Specific notes
Contributors other than yourself, if any:
CDEPS Issues Fixed (include github issue #):
Are there dependencies on other component PRs (if so list): no
Are changes expected to change answers (bfb, different to roundoff, more substantial): bfb
Any User Interface Changes (namelist or namelist defaults changes): no
Testing performed (e.g. aux_cdeps, CESM prealpha, etc):
Ran aux_cdeps plus the following tests in the context of cesm3_0_alpha08e:
All tests passed and were bfb except for one expected failure from the aux_cdeps suite (which also failed in alpha08e:
FAIL SMS_Ld3.f19_g17_rx1.2000_SATM_SLND_SICE_SOCN_DROF%NYF_SGLC_SWAV.derecho_intel CREATE_NEWCASE)Also ran
SMS_D_Ld3_PS.f09_t232.I1850Clm60SpCrujraNoAnthro.derecho_intel.clm-decStart1851_noinitial--clm-nofireemiswith updated ccs_config that switches to ifx; that test failed before these changes and passes with these changes.Hashes used for testing:
cesm3_0_alpha08e