Skip to Content.
Sympa Menu

forum - Re: [abinit-forum] real*16 for double precision

forum@abinit.org

Subject: The ABINIT Users Mailing List ( CLOSED )

List archive

Re: [abinit-forum] real*16 for double precision


Chronological Thread 
  • From: Tobias Burnus <burnus@net-b.de>
  • To: forum@abinit.org
  • Subject: Re: [abinit-forum] real*16 for double precision
  • Date: Thu, 19 Nov 2009 17:15:26 +0100

On 11/19/2009 10:34 AM, nathan@lstc.com wrote:
> Intel FORTRAN has an option causing doubles to be real*16.

I want to remark that on x86/x86-64 (contrary to e.g. PowerPC) the
hardware does not support 128bit floating point numbers ("real(16)")
(while thanks to the x87 legacy 80bit ("real(10)") are supported). Thus
the Intel Fortran compiler emulates real-16 in software (which is better
than it sounds as some operations work relatively fast). [By contrast
gfortran offers "real(10)" for 80bit floating point numbers.]

Regarding "causing doubles to be real*16": It sounds as if you use
"-real-size 128". Note that then only "double precision" and "1.0d0"
will be promoted to 128 bit while "1.0_dp" and "real(dp)" will remain at
the "dp" kind. Depending on how "dp" is set, it may or may not be
affected (e.g. dp = selected_real_kind(14) keeps it at double precision
while "dp = kind(0.0d0)" promotes it to quadruple precision).

Admittedly, I have not studied the Abinit source code in detail, but I
wouldn't be surprised if there were assumptions that kind(0.0d0) and
selected_real_kind(14) and C's "double" are _all_ the same. Thus it
might break due to violating such an assumption. You may also need to
re-compile all libraries which are invoked, such as BLAS/LAPACK - and if
there is a library written in C, you need to convert real(16) into
real(8) before calling it. (In principle, real(10)/real(c_long_double) =
"long double" would work for some C functions, though I do not know
whether ifort supports this by now)

Tobias



Archive powered by MHonArc 2.6.16.

Top of Page