Fix 3/2 integer division in W3FLD1#1474
Merged
mingchen-NOAA merged 2 commits intoJul 28, 2025
Merged
Conversation
**(3/2): Warning: Integer division truncated to constant '1' [-Winteger-division]
NickSzapiro-NOAA
approved these changes
Jul 25, 2025
Collaborator
|
Regression tests and matrix comparisons on Hercules Intel: I can reproduce the output that ww3_ufs1.1 differs are expected due to the FLD1. |
Collaborator
|
I further explored the NetCDF output differs in ww3_ufs1.1. As expected, the differs are small and acceptable when applying FLD1. ww3_ufs1.1/work_unstr_a/ww3.2021.nc: ww3_ufs1.1/work_unstr_b/ww3.2021.nc: ww3_ufs1.1/work_unstr_b/ww3.2021.nc: |
mingchen-NOAA
approved these changes
Jul 28, 2025
Collaborator
|
Regression tests and matrix comparisons are done and passed. I have merged the PR. Thank you @JessicaMeixner-NOAA @NickSzapiro-NOAA ! |
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.
Pull Request Summary
Address compiler warning and bug that (x)**(3/2) is truncated to (x)**1 from integer division
This is pulling the code update form #1431 which was targeting dev/ufs-weather-model and bringing it into develop.
The author of the code changes is @NickSzapiro-NOAA , I just pulled them into a PR to develop & ran the tests.
Description
Fix compiler warning (and integer division bug)
As wind stress BC is not used in coupling, this is a bit-for-bit change in UFS GEFS regression test and presumably others as well.
For full testing and commit queue, can combine with #1423 and others
Issue(s) addressed
Part of ufs-community/ufs-weather-model#2703
Commit Message
Fix 3/2 integer division in W3FLD1
Check list
Testing
Any test using FLD1 flag. The FLD1 flag is used in the following switch files:
I only got diffs in the following regtests because of FLD1:
Note the expected diffs in ufs1.1 and ufs.12 (unexpected). On closer examinations these diffs are:
ww3_grid_aoc_9km.out differ.
ww3_grid_gnh_10m.out differ.
ww3_grid_gsh_15m.out differ.
and not actual answer diffs.