Skip to content
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

Compiler warnings #73

Closed
DusanJovic-NOAA opened this issue Dec 21, 2023 · 6 comments · Fixed by #78
Closed

Compiler warnings #73

DusanJovic-NOAA opened this issue Dec 21, 2023 · 6 comments · Fixed by #78

Comments

@DusanJovic-NOAA
Copy link
Contributor

Currently compiler warnings are suppressed when this repo is compiled as a sub-module in the ufs-weather-model, which is not allowed by NCO (see ufs-community/ufs-weather-model#1984). The following warnings must be fixed before this code is implemented in production:

stochastic_physics/update_ca.F90(398): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [2147483648]
stochastic_physics/update_ca.F90(398): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [4294967296]
stochastic_physics/update_ca.F90(398): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [2147483648]
stochastic_physics/update_ca.F90(709): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [2147483648]
stochastic_physics/update_ca.F90(709): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [4294967296]
stochastic_physics/update_ca.F90(709): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [2147483648]
stochastic_physics/cellular_automata_global.F90(168): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [2147483648]
stochastic_physics/cellular_automata_global.F90(168): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [4294967296]
stochastic_physics/cellular_automata_global.F90(168): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [2147483648]
stochastic_physics/cellular_automata_sgs.F90(297): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [2147483648]
stochastic_physics/cellular_automata_sgs.F90(297): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [4294967296]
stochastic_physics/cellular_automata_sgs.F90(297): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [2147483648]
stochastic_physics/stochy_patterngenerator.F90(162): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [2147483648]
stochastic_physics/stochy_patterngenerator.F90(162): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [4294967296]
stochastic_physics/stochy_patterngenerator.F90(162): warning #8221: This integer constant is outside the default integer range - using INTEGER(8) instead.   [2147483648]
@junwang-noaa
Copy link
Contributor

@pjpegion may I ask if you can take a look at the warning message? We were asked to remove the warnings before we can deliver the code to NCO. Thanks

@junwang-noaa
Copy link
Contributor

@pjpegion May I ask if you have time to take a look at this issue? Thanks

@pjpegion
Copy link
Collaborator

pjpegion commented Mar 4, 2024

I will take a look

@pjpegion
Copy link
Collaborator

pjpegion commented Mar 8, 2024

I do not know who put the logic is to truncate a real8 to real4, so I don't know what the best solution is. Any recommendations? I would just to integer(iseed,4), but this was explicitly not done.

@DusanJovic-NOAA
Copy link
Contributor Author

@pjpegion Please take a look at these changes:

master...DusanJovic-NOAA:stochastic_physics:no_warn

I changed all integer constants that are outside the default integer range to be integer(8), and I also removed unused function (see second commit).

I'm running regression test now to confirm that results are bit-identical to the current baselines.

@pjpegion
Copy link
Collaborator

@DusanJovic-NOAA that change make total sense to me. Thanks for figuring it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants