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
There is currently a 'strict' mode which has the effect on turning on additional rules that may be controversial:
Insisting that use some_module is instead use some_module, only: ...
Tell the user off if they put implicit none in a module, and then also put it in contained functions.
A more recent addition also strengthens some rules:
There's a rule that catches accidental loss of precision in statements like real(dp), parameter :: pi = 3.14159265358979, and recommends correcting it to real(dp), parameter :: pi = 3.14159265358979_dp. It only triggers if the floating point literal has at least 6 significant figures. Under strict mode, it will also complain if you type 2.0 instead of 2.0_dp, as this may have serious consequences if you call something like sqrt(2.0) when you intended sqrt(2.0_dp)*.
The line length rule allows the user to set any preferred line length they want. Under strict mode, it caps this to 132 characters, as this is the maximum set by the Fortran standard. However, most modern compilers allow users to bypass this.
An issue with this model is that users may only want a selection of rules to be stricter, but the --strict flag changes the behaviour of all rules with a strict option. It may be better to implement per-rule strictness controls, or to do away with the two-tiered strictness idea entirely. I would argue for the two rules above that the non-strict interpretations aren't safe anyway.
The text was updated successfully, but these errors were encountered:
There is currently a 'strict' mode which has the effect on turning on additional rules that may be controversial:
use some_module
is insteaduse some_module, only: ...
implicit none
in a module, and then also put it in contained functions.A more recent addition also strengthens some rules:
real(dp), parameter :: pi = 3.14159265358979
, and recommends correcting it toreal(dp), parameter :: pi = 3.14159265358979_dp
. It only triggers if the floating point literal has at least 6 significant figures. Under strict mode, it will also complain if you type2.0
instead of2.0_dp
, as this may have serious consequences if you call something likesqrt(2.0)
when you intendedsqrt(2.0_dp)
*.An issue with this model is that users may only want a selection of rules to be stricter, but the
--strict
flag changes the behaviour of all rules with a strict option. It may be better to implement per-rule strictness controls, or to do away with the two-tiered strictness idea entirely. I would argue for the two rules above that the non-strict interpretations aren't safe anyway.The text was updated successfully, but these errors were encountered: