DOUBLE PRECISION COMPLEX does not exist but this does:
COMPLEX(KIND(1D0)) Z
which ensures that the real and imaginary parts of Z will be double
precision. REAL64 is the same as KIND(1D0) in many machines, including
all three that I have access to, but it is apparently the same as
KIND(1E0) in some.
On Wed, 5 Apr 2017, Vipul Parekh wrote:
> Date: Wed, 5 Apr 2017 09:21:29 -0400
> From: Vipul Parekh <[log in to unmask]>
> Reply-To: Fortran 90 List <[log in to unmask]>
> To: [log in to unmask]
> Subject: Re: REAL64 what is it good for!
>
> Phillip,
>
> You ask, "Why not just write DOUBLE PRECISION if that is what you mean?"
> Note the standard only states the following about DOUBLE PRECISION:
>
> 1) "The decimal precision of the double precision real approximation method
> shall be greater than that of the default real method."
> 2) "The decimal precision of double precision real shall be at least 10,
> and its decimal exponent range shall be at 37. It is recommended that the
> decimal precision of default real be at least 6, and that its decimal
> exponent range be at least 37."
>
> And I think DOUBLE PRECISION has the same underlying issues as referred to
> in the blog in the first note of this chain, it's probably viewed to be
> worse and its use seems widely deprecated (even if not officially so) since
> the introduction of Fortran 90 back in 1991.
>
> Regards,
> Vipul
>
>
>
> On Wed, Apr 5, 2017 at 5:29 AM, Phillip Helbig <[log in to unmask]> wrote:
>
>>> use, intrinsic:: ISO_FORTRAN_ENV, only: REAL32, REAL64
>>>
>>> implicit none
>>> private
>>>
>>> interface goo
>>> module procedure goo_s
>>> module procedure goo_d
>>> end interface
>>> public :: goo
>>>
>>> contains
>>>
>>> subroutine goo_s (x)
>>> real(kind=REAL32), intent(..) :: x
>>> include 'goo_source.inc'
>>> end subroutine goo_s
>>> subroutine goo_d (x)
>>> real(kind=REAL64), intent(..) :: x
>>> include 'goo_source.inc'
>>> end subroutine goo_d
>>
>> What is the essential difference between this and using REAL and DOUBLE
>> PRECISION?
>>
>> I understand the motivation for KIND. However, many people use
>> SELECTED_REAL_KIND with 1.0D0 or whatever to find the "double-precision
>> KIND". Why not just write DOUBLE PRECISION if that is what you mean?
>>
>
-- John Harper, School of Mathematics and Statistics
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail [log in to unmask] phone (+64)(4)463 5276 fax (+64)(4)463 5045
|