NOAA-PSL / stochastic_physics

Contains the stochastic physics pattern generator for the Unified Forecast System
Other
6 stars 41 forks source link

Compiler warnings #73

Closed DusanJovic-NOAA closed 6 months ago

DusanJovic-NOAA commented 10 months ago

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 https://github.com/ufs-community/ufs-weather-model/issues/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 commented 8 months ago

@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 commented 8 months ago

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

pjpegion commented 8 months ago

I will take a look

pjpegion commented 7 months ago

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 commented 7 months ago

@pjpegion Please take a look at these changes:

https://github.com/NOAA-PSL/stochastic_physics/compare/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 commented 7 months ago

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