You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many old codes set variables that never changed and could be named constants using the DATA statement. I suggest that Fortitude warn about such code and eventually have the ability to fix it by declaring the variables as parameter. An example of code that could be rewritten this way is at https://github.com/UoA-Stars-And-Supernovae/STARS/blob/master/src/diffusion2.f -- variables BARYN AND MIZZ could have the parameter attribute.
The text was updated successfully, but these errors were encountered:
I guess we can do this in the case where the variable isn't used in a common block, doesn't appear on the left hand side of an assignment, and also isn't passed to any subroutine or function calls -- in the future, if we have more semantic information, we might be able to check the intents, and follow uses through common blocks.
At that point, we might also be able to do similar analysis for all variables (although potentially this is an expensive check!)
Many old codes set variables that never changed and could be named constants using the
DATA
statement. I suggest that Fortitude warn about such code and eventually have the ability to fix it by declaring the variables asparameter
. An example of code that could be rewritten this way is at https://github.com/UoA-Stars-And-Supernovae/STARS/blob/master/src/diffusion2.f -- variablesBARYN
ANDMIZZ
could have theparameter
attribute.The text was updated successfully, but these errors were encountered: