Fortran 202x will have
‘SIMPLE’ procedures: PURE procedures with no writing or referencing beyond their
arguments
and many functions I write are SIMPLE, but it will be a while before all the currently developed Fortran compilers support the SIMPLE
designation. If modern Fortranners adopt a common style to designate SIMPLE functions in comments, in the future a tool could be written to change the PURE designation to SIMPLE. A guideline could be added for the stdlib project that procedures should be commented as SIMPLE when they meet the conditions. Two commenting styles are
pure function twice(x) result(y) !! SIMPLE
real, intent(in) :: x
real :: y
y = 2*x
end function twice
which I prefer since it does not add a line and
pure function twice(x) result(y)
!! SIMPLE
real, intent(in) :: x
real :: y
y = 2*x
end function twice
How do people think SIMPLE functions should be designated until compilers support the label?