And here a nitpick: real(kind=8) may fail or, perhaps worse, mean something else than you expect, because the kind numbers, like 8 above, are not fixed between compilers. @Beliavsky showed a way to achieve double precision that ought to work with any compiler. Others exist as well.
The adagium is: never use literal constants for kinds, but use instead parameters.
2 Likes