Re: is real*8 a standard declaration style?
- From: Gib Bogle <g.bogle@xxxxxxxxxxxxxx>
- Date: Sun, 30 Oct 2011 10:18:33 +1300
On 30/10/2011 1:59 a.m., Daniel Carrera wrote:
It is not standard. It is an extension to Fortran 77 which happened to
be adopted fairly universally, but not consistently. In other words,
"REAL*8" is can mean different things in different compilers.
With modern Fortran you should use the "KIND" parameter, and the
selected_real_kind() variable. Like this:
integer, parameter :: double = selected_real_kind(12)
This will give you a REAL kind with at least 12 digits of precision. You
can then use it in your program with:
real(kind=double) :: foo
The "kind" parameter can be omitted, so if you prefer you can write:
real(double) :: foo
In some compilers, "double" will be 8, and in other compilers it will be
In my working life I've never met a compiler for which it is something else, and I'm pretty confident that in what remains of it I will never meet one.
- Prev by Date: Re: is real*8 a standard declaration style?
- Next by Date: Re: is real*8 a standard declaration style?
- Previous by thread: Re: is real*8 a standard declaration style?
- Next by thread: Re: is real*8 a standard declaration style?