-
Notifications
You must be signed in to change notification settings - Fork 158
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
Incorrect check for out-of-bounds in State_SetScalar #838
Closed
SamuelTrahanNOAA opened this issue
May 20, 2024
· 2 comments
· Fixed by ufs-community/ufs-weather-model#2355
Closed
Incorrect check for out-of-bounds in State_SetScalar #838
SamuelTrahanNOAA opened this issue
May 20, 2024
· 2 comments
· Fixed by ufs-community/ufs-weather-model#2355
Labels
bug
Something isn't working
Comments
Pinging @DeniseWorthen, who knows the relevant section of code well. |
zhanglikate
added a commit
to zhanglikate/ufs-weather-model
that referenced
this issue
May 21, 2024
zhanglikate
added a commit
to zhanglikate/ufs-weather-model
that referenced
this issue
May 21, 2024
…c_physics Upp CATChem grib2 output Update configure files for S2S run due to the issue in NOAA-EMC/fv3atm#838
Thanks for the work on this while I was away. I agree the check should be <=0. |
Merged
14 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Bug encountered and investigated by @zhanglikate with debugging help from @DusanJovic-NOAA and myself. Credit goes mostly to zhanglikate who did a fantastic amount of debugging and testing in an impressively short time.
There is an out-of-bounds access (element 0) if one forgets to set these variables in ufs.configure:
flds_scalar_index_nx
flds_scalar_index_ny
flds_scalar_index_ntile
This bug is in
State_SetScalar
here incpl/module_cplscalars.F90
:When one of the three
flds_scalar_index_
variables is missing, scalar_id is 0. The "if" block doesn't catch it because it looks forscalar_id < 0
instead ofscalar_id <= 0
To Reproduce:
What compilers/machines are you seeing this with?
Irrelevant. The bug is clear in the code.
Give explicit steps to reproduce the behavior.
Additional context
The bug started with this commit:
Output
The stack trace:
The text was updated successfully, but these errors were encountered: