[Q-e-developers] [Pw_forum] Bug fix after NAG compilation of QE
Samuel Poncé
samuel.pon at gmail.com
Wed Sep 16 18:05:00 CEST 2015
Dear QE-developers,
I further worked on QE with NAG for the following part of the code:
----------------------------------------------------------------------------------------------------------------------------------
QE/atomic
----------------------------------------------------------------------------------------------------------------------------------
1) Error: find_qi.F90: Argument RJ (no. 2) in reference to COMPUTE_LOG from
FIND_QI is not an array
I guess that the function should be changed to
function compute_log(j1,rj,dx)
use kinds, only : DP
implicit none
real(DP) :: &
compute_log, &
deriv_7pts, &
dx, &
j1(7), &
rj
! compute_log=(j1(2)-j1(1))*2.0_dp/( (rj(2)-rj(1))*(j1(2)+j1(1)) )
compute_log=deriv_7pts(j1,4,rj,dx)/j1(4)
return
end function compute_log
2) Error: grad_log.F90, line 46: Implicit type for NX
! dimensions, method used
integer :: nx, method
! input/output variables
real(DP), intent(in) :: v(nx), rm1(nx), dx
! function, 1/r, dx (step of the log. mesh)
real(DP), intent(out) :: dv(nx)
3) Error: write_results.F90, line 281: Unrecognised statement
Error: write_results.F90, line 281: Syntax error
write(stdout,'(5x,''Ekinc='',f15.6,'' Ry,'',f15.6,'' Ha,'',f15.6,''
eV'')') &
ekinc, ekinc*0.5_dp, ekinc*rytoev_fact
write(stdout,'(5x,''Ekinv='',f15.6,'' Ry,'',f15.6,'' Ha,'',f15.6,''
eV'')') &
ekinv, ekinv*0.5_dp, ekinv*rytoev_fact
4) Error: write_results.F90, line 89: Missing comma in format specification
if (rel==0 .and. .not.relpert) then
write(stdout,'(5x, "1 Ry = ",f12.8, " eV" )') rytoev_fact
else
write(stdout,'(5x, "1 Ry = ",f12.8, " eV, c = ",f12.8 )') rytoev_fact,
&
----------------------------------------------------------------------------------------------------------------------------------
QE/PP
----------------------------------------------------------------------------------------------------------------------------------
1) Error: cube.F90, line 129: Implicit type for NAT
integer, intent(in) :: nat, ityp(nat), ounit, nx, ny, nz
real(dp), intent(in) :: alat, tau(3,nat)
2) Error: partialdos.F90, line 199: Nonstandard format field $: please use
the ADVANCE='NO' specifier instead
WRITE (4,'("#")',advance="no")
There are 23 errors like that.
3) Error: projwfc_box.F90, line 459: Nonstandard format field $: please use
the ADVANCE='NO' specifier instead
:%s/,$)'/)',advance="no"
4) Error: wannier_umatrix_subroutines.F90, line 162: Unknown intrinsic
function DFLOAT
change dfloat by float
! INTRINSIC dfloat
5) Error: plotband.F90, line 199: Nonstandard format field $: please use
the ADVANCE='NO' specifier instead
:%s/,$)'/)',advance="no"
6) Error: plotproj.F90, line 148: Nonstandard format field $: please use
the ADVANCE='NO' specifier instead
7) Error: plotrho.F90, line 101: Nonstandard format field $: please use the
ADVANCE='NO' specifier instead
8) sumpdos.008481.008481.c:(.text+0x6d): undefined reference to `iargc_'
USE F90_UNIX_ENV, ONLY : IARGC,GETARG
9) Error: pw2gw.F90, line 1216: Implicit type for NPW
integer, intent(in) :: ik, npw
real(DP), intent(inout) ::vkb0(1:npw)
10) Error: pw2gw.F90, line 829: Implicit type for DFLOAT
replace dfloat by float
11) Error: wannier_ham.F90, line 288: Implicit type for CDEXP
Replace cdexp by exp
12) Error: molecularpdos.F90, line 335: Nonstandard format field $: please
use the ADVANCE='NO' specifier instead
----------------------------------------------------------------------------------------------------------------------------------
QE/upftools
----------------------------------------------------------------------------------------------------------------------------------
Note that there is usually more than one occurence of the same issue in
each file.
1) Error: cpmd2upf.F90, line 415: Nonstandard format field $: please use
the ADVANCE='NO' specifier instead
2) Error: fhi2upf.F90, line 274: Nonstandard format field $: please use the
ADVANCE='NO' specifier instead
3) Error: oldcp2upf.F90, line 168: Nonstandard format field $: please use
the ADVANCE='NO' specifier instead
4) Error: read_upf_tofile.F90, line 75: Nonstandard format field $: please
use the ADVANCE='NO' specifier instead
5) Error: read_upf.F90, line 107: Nonstandard format field $: please use
the ADVANCE='NO' specifier instead
6) Error: virtual.F90, line 125: Nonstandard format field $: please use the
ADVANCE='NO' specifier instead
7) Error: interpolate.F90, line 113: Nonstandard format field $: please use
the ADVANCE='NO' specifier instead
:%s/,$)/),advance="no"
I now have all the required module that compile with NAG and I can start
working on EPW.
Cheers,
Samuel.
On 16 September 2015 at 14:34, Samuel Poncé <samuel.pon at gmail.com> wrote:
> Hello,
>
> I forgot to mention that the intrinsic function 'system' is non-standard
> in Fortran and should be replace by standard 'execute_command_line' (see
> http://www.nag.co.uk/nagware/np/doc/faq.asp)
>
> For example in PHonon/FD/fd.f90:
> call system('mkdir '//trim(fd_outfile_dir))
>
> should be replace by
> call execute_command_line('mkdir '//trim(fd_outfile_dir))
>
> Best,
>
> Samuel
>
>
> On 16 September 2015 at 13:58, Samuel Poncé <samuel.pon at gmail.com> wrote:
>
>> Dear QE-developers,
>>
>> I've now debug the PH part of QE using NAG. There was only 8 'bugs'
>> therefore I did not do a patch. There should all be safe and minor.
>>
>> 1) Error: find_mode_sym.F90, line 63: Implicit type for NAT
>> ==> swap after definition
>>
>> INTEGER, INTENT(IN) :: &
>> nat, & ! number of atoms
>> nsym, & ! number of symmetries
>> flag, & ! if 1 u are displacements, if 0 u are
>> eigenvectors
>> ntyp, & ! number of atomic types
>> ityp(nat), & ! the type of each atom
>> irt(48,nat) ! the rotated of each atom
>>
>> INTEGER, INTENT(OUT) :: num_rap_mode ( 3 * nat )
>>
>> 2) Error: io_pattern.F90, line 55: Implicit type for NAT
>> INTEGER :: nirr, nat, npert(3*nat), iflag
>>
>> 3) Error: obsolete.F90, line 1737: Implicit type for NAT
>> INTEGER, INTENT(IN) :: &
>> nat, &
>> nsym, &
>> flag, &
>> ntyp, &
>> ityp(nat), &
>> irt(48,nat)
>>
>> CHARACTER(15), INTENT(OUT) :: name_rap_mode( 3 * nat )
>> INTEGER, INTENT(OUT) :: num_rap_mode ( 3 * nat )
>> INTEGER, INTENT(IN) :: nspin_mag
>>
>> 4) Error: transform_int_so.F90, line 203: Implicit type for NPERT
>> INTEGER :: na, npert
>> COMPLEX(DP) :: int3(nhm,nhm,npert,nat,nspin_mag)
>>
>> 5) Error: transform_int_nc.F90, line 162: Implicit type for NPERT
>> INTEGER :: na, npert
>> COMPLEX(DP) :: int3(nhm,nhm,npert,nat,nspin_mag)
>>
>> 6) Error: transform_dbecsum_so.F90, line 61: Implicit type for MODES
>> INTEGER :: na, modes
>> COMPLEX(DP) :: dbecsum_nc( nhm, nhm, nat, nspin, modes)
>> COMPLEX(DP) :: dbecsum( nhm*(nhm+1)/2, nat, nspin_mag, modes)
>>
>> 7) Error: fqha.F90, line 54: Nonstandard format field $: please use the
>> ADVANCE='NO' specifier instead
>> + other errors (comma missing):
>> write (*,"('File containing the dos >>> ')",advance="no")
>> write (*,"('Output file for the Free energy >>> ')",advance="no")
>> write (*,"('Temperature (K) >>> ')",advance="no")
>> write(*,"('Check: 3*Nat = ',f8.4,5x,'zero-point energy (Ry)=',f15.8)")
>> norm,F0
>>
>> 8) q2qstar.028286.028286.c:(.text+0x73): undefined reference to `iargc_'
>> q2qstar.028286.028286.c:(.text+0xde): undefined reference to `getarg_'
>>
>> Intrinsic functions should not be declared:
>> USE F90_UNIX_ENV, ONLY : iargc, getarg
>> ! INTEGER :: iargc ! intrinsic function
>>
>> Best Regards,
>>
>> Samuel
>>
>>
>> On 15 September 2015 at 21:40, Filippo Spiga <spiga.filippo at gmail.com>
>> wrote:
>>
>>> Dear Samuel,
>>>
>>> thank you very much for the patch! I suggest not to commit anything too
>>> destruptive this week because we are going to release a minor on
>>> Saturday/Sunday. Better be safe. In the meanwhile I will also try to sort
>>> out a temporary NAG license for testing, we do not have it in Cambridge at
>>> the moment...
>>>
>>> This "NAG thing" is top list next Monday.
>>>
>>> --
>>> Mr. Filippo SPIGA, M.Sc.
>>> Quantum ESPRESSO Foundation
>>> http://fspiga.github.io ~ skype: filippo.spiga
>>>
>>> *****
>>> Disclaimer: "Please note this message and any attachments are
>>> CONFIDENTIAL and may be privileged or otherwise protected from disclosure.
>>> The contents are not to be disclosed to anyone other than the addressee.
>>> Unauthorized recipients are requested to preserve this confidentiality and
>>> to advise the sender immediately of any error in transmission."
>>>
>>> > On Sep 15, 2015, at 8:24 PM, Samuel Poncé <samuel.pon at gmail.com>
>>> wrote:
>>> >
>>> > Dear QE developer,
>>> >
>>> > We've recently purchase a NAG licence (latest version) and ran it on
>>> QE.
>>> >
>>> > Here is a list of changes/bug fix to make NAG happy (we have only
>>> solve the error, not
>>> > the warnings).
>>> >
>>> > 1) lapack-3.2/make.inc
>>> > Although my environment is set up for nagfor, the configure is not
>>> able to modify
>>> > the install/make_lapack.inc correctly. Therefore we have to change
>>> manually the following:
>>> > FORTRAN = nagfor
>>> > OPTS = -O0 -kind=byte -dcfuns -mismatch
>>> > DRVOPTS = -O0 -kind=byte -dcfuns -mismatch
>>> > NOOPT = -O0 -g
>>> > LOADER = nagfor
>>> > LOADOPTS = -g
>>> >
>>> > The same has to be done for install/make_blas.inc
>>> >
>>> > 2) The "pthread" option is not accepted by NAG.
>>> > This is not really a bug, just to say we had to remove this option
>>> from the make.sys file
>>> > of QE.
>>> >
>>> > Additionally, NAG doesn't have a great internal fortran preprocessor,
>>> > so use CPP (from make.sys):
>>> > .f90.o:
>>> > $(CPP) $(CPPFLAGS) $< -o $*.F90
>>> > $(MPIF90) $(F90FLAGS) -c $*.F90 -o $*.o
>>> >
>>> > Also on the make.sys file, NAG does not support -x options, therefore
>>> change
>>> > to. Also notice the -kind=byte option to tell NAG that KIND(4) and
>>> KIND(8) is
>>> > the convention in QE.
>>> > The -mismatch option is to make NAG less strict and -dcfuncs is to
>>> allow non standard casting variable like dcmplx
>>> >
>>> > CFLAGS = -O0 $(DFLAGS) $(IFLAGS)
>>> > F90FLAGS = $(FFLAGS) $(FDFLAGS) $(IFLAGS) $(MODFLAGS)
>>> > FFLAGS = -O0 -kind=byte -dcfuns -mismatch
>>> >
>>> > 3) It would be usefull to have a macro
>>> > !#ifdef NAG
>>> > USE F90_UNIX_ENV, ONLY : IARGC,GETARG
>>> >
>>> > The Wannier90 code does have a ifdef NAG macro.
>>> >
>>> > 4) The main corrections are related to
>>> > - change $ which is depreciated by advance="NO"
>>> > - small bug (an interface was defined with optional argument but the
>>> subroutine
>>> > called was not)
>>> > - swapping order of variable declaration so that the variable is first
>>> declared
>>> > and then used
>>> > - Change X by 1X
>>> >
>>> > Join to this email is a patch of the difference (to be applied on the
>>> QE-r11723):
>>> >
>>> > patch -p1 < diff-nag.patch
>>> >
>>> > Note: This only solves the problems to "make pw". Other parts like ph
>>> are not done yet.
>>> >
>>> > Best Regards,
>>> >
>>> > Samuel and Henry
>>> >
>>> > <diff-nag.patch>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20150916/c5735283/attachment.html>
More information about the developers
mailing list