The really difficult part of your question is that it mixes three
different stories:
- Fortran legacy concepts (double precision) with
- IEC60559 standard for floating point numbers and
- modern Fortran.
My advice:
forget everything else and stay with the approach of modern Fortran: there
is no "single" or double precision, no 32 or 64 bit standards to worry
about or other technicalities. Only the number of significant figures and
range of "real" data you are interested in actually matters! This way you
decouple forever your code from all possible choices and changes of
floating point technology and you stay with what should be the main
concern of any computational scientist: range and precision (as opposite
to bit, bites, binary representation etc.).
If one cannot survive without "double precision", it is enough to start
from the assumption that the current 32 bit IEC60559 standard guarantees 6
significant decimal figures to consider 12 significant decimal figures
as "double precision". Thus, defining a kind value through
selected_real_kind(12) should already be enough to provide double
precision.
Giorgio Pastore
|