> "real*8" was never part of any standard.
Right.
> Use "double precision" if that's what you want,
Right.
> or "real(kind(0.0d0))"
I would recommend avoiding this. It has EXACTLY the same effect as
DOUBLE PRECISION, but is less clear. It has no advantages over DOUBLE
PRECISION.
> or "integer, parameter :: WP = kind(0.0d0)" followed by "real(wp)"
This has the advantage that, if one wants to change the precision, one
has to do it only once by changing "integer, parameter :: WP =
kind(0.0d0)" to some other value; all the "real(wp)" statements can
stay.
> or "integer, parameter :: WP = selected_real_kind(14)" etc.
Ditto. This is good if one actually knows what precision one needs. On
the other hand, if one just wants a default real kind, or DOUBLE
PRECISION, then it is clearer to specify it as such (though using kind,
as in the example above).
|