[Pw_forum] QHA Compile: Using gfortran instead of ifort

Axel Kohlmeyer akohlmey at gmail.com
Fri Nov 28 10:13:24 CET 2014


On Fri, Nov 28, 2014 at 1:23 AM, W2AGZ <w2agz at w2agz.com> wrote:
> Alex, thanks for your quick and wise response!
>
> I did a cursory pass through of the source code, matdyn.f90 and lambda.f90,
> used in QHA (matdyn) and the general phonon packages within QE, and didn't

i don't understand this statement. the two files you mention are part
of the standard build and compile fine with gfortran. when people
complain about QHA not being compiled with gfortran, they usually
refer to the files in the QHA package and they quote error messages
that indicated such illegal coding.

> find any obvious uses of floating point loop variables.  Frankly, I can't
> imagine why such assignments would ever be done!  On the other hand,

most of the time, this would happen "unintentionally" through with
implicit variable declarations. the files in the QHA packages have
this in spades:

[akohlmey at zero QHA]$ find ./ -name \*.f90 -or -name \*.f -or -name *.h
| xargs grep -i implicit
./SRC/Partial_phonon_DOS.f90: implicit real*8(a-h,o-z)
./SRC/Ghost_DOS.f90: implicit real*8(a-h,o-z)
./SRC/Atom_projected_properties.f90:  implicit none
./SRC/F_QHA.f90:  implicit none
./SRC/Mean_square_displacement.f90:  implicit none
./Debye/Debye.f90:!  implicit none
./Debye/Debye.f90:  implicit real*8(a-h,o-z)
./Debye/Debye_T.f: implicit real*8(a-h,o-z)
./Phonon_DOS/parameters.h:        implicit real*8(a-h,o-z)

they are also full of other things that were accepted programming
style when i learned fortran, but are in dire need of refactoring into
modern fortran (now here is a self-contradicting description. ;-) )
these days.

> occasionally posted on the forum are reports of NaN errors embedded in
> phonon calculation output.  I wonder if such result from the "very bad"
> programming practices you describe.

there are plenty possible reasons for NaNs. using floating point math
for loops can lead to too few or too many loop iterations. that would
more likely lead to slightly different results, not likely to NaNs
(unless there is some rounding error involved leading to negative
numbers when positive numbers are required (e.g. when taking a
logarithm or a square root).

> Hope to see you at the March Meeting upcoming in San Antonio.

*very* unlikely.

axel.


> -Paul
> -----Original Message-----
> From: pw_forum-bounces at pwscf.org [mailto:pw_forum-bounces at pwscf.org] On
> Behalf Of Axel Kohlmeyer
> Sent: Thursday, November 27, 2014 6:24 AM
> To: PWSCF Forum
> Subject: Re: [Pw_forum] QHA Compile: Using gfortran instead of ifort
>
> On Wed, Nov 26, 2014 at 11:27 PM, W2AGZ <w2agz at w2agz.com> wrote:
>> To the Community:
>>
>>
>>
>> I believe I may have raised this question in the far distant past.
>>
>>
>>
>> It appears that under QE-5.1.1, it is still necessary to compile the
>> source code within QHA using ifort.  Are any in the QE community aware
>> of a QHA package compile-able with gfortran, or object code resulting
>> from such?  Is there an equivalent to QHA somewhere within the QE
>> package (or outside!) capable of yielding similar results such as, e.g.,
> Debye temperatures?
>>
>>
>>
>> As always, thanks for any advice/guidance.
>
> for the most part it seems as if all it needs is somebody with a little bit
> to time to sit down and replace the loops using floating point variables
> with the equivalent using integral loop variables.
>
> using floating point loop variables is very, *very*, *VERY* bad programming
> style (due to limitations of floating point math) and as of the last decade
> removed from the fortran standard.
>
> not really rocket science...
>
> axel.
>
>>
>>
>>
>> Paul Michael Grant, PhD
>>
>> Physicist and Science Writer
>>
>> Senior Life Fellow, American Physical Society
>>
>> Fellow, Institute of Physics, United Kingdom
>>
>> w2agz at w2agz.com
>>
>> http://www.w2agz.com
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Pw_forum mailing list
>> Pw_forum at pwscf.org
>> http://pwscf.org/mailman/listinfo/pw_forum
>
>
>
> --
> Dr. Axel Kohlmeyer  akohlmey at gmail.com  http://goo.gl/1wk0 College of
> Science & Technology, Temple University, Philadelphia PA, USA International
> Centre for Theoretical Physics, Trieste. Italy.
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://pwscf.org/mailman/listinfo/pw_forum
>
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://pwscf.org/mailman/listinfo/pw_forum



-- 
Dr. Axel Kohlmeyer  akohlmey at gmail.com  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.



More information about the users mailing list