Confusing double precision real in Fortran

Personally I now write

use, intrinsic :: iso_fortran_env

which includes parameters such as int32,real64 which have the obvious meanings, and can be used like this:

real(real64) :: a_64_bit_real_scalar

Note that kind=8 is not guaranteed, by the standard, to deliver an 8-byte kind. The values that kind parameters take are not standardised and do vary from compiler to compiler.

You could, if you want, write statements such as

use, intrinsic :: iso_fortran_env, dp=>real64
...
real(dp) :: a_64_bit_real_scalar

Leave a Comment