Best way to declare a double precision in Fortran?

You can disagree with me, that’s fine. All I wanted to say in that post was that use of real32, real64 etc. was little better than real(4) and real(8). If you’re aware that all you’re doing is asking for a physical storage size (and no other properties), and document that, then OK. But I would be happier to see a module that defines constants using selected_real_kind() - you need do this only once.

Of course, if you’re interfacing with C, then use the kinds from ISO_C_BINDING.

P.S. Thank you for reading my blog posts!

10 Likes