[Pw_forum] gfortran-4.6.0 and 4.3b

balducci at univ.trieste.it balducci at univ.trieste.it
Tue Mar 29 12:35:44 CEST 2011


Hello,

apologies if I am missing some blatant point.

Just tried to build 4.3b with the very recently released
gfortran-4.6.0 (gfortran-4.5.2 works fine, but for the small bug
already fixed by Check-in 8582).

gfortran-4.6.0 chokes on pw2gw.f90 with:

    gfortran -O3 -g -x f95-cpp-input -D__FFTW3 -I../include -I../iotk/src -I../Modules -I../PW -I. -c pw2gw.f90
    pw2gw.f90:460.26:

              CALL gen_us_vkb0(ik,npw,vkb0,size_tab,vec_tab,spline_ps,vec_tab_d2y)
                              1
    Error: Dummy argument 'vec_tab_d2y' of procedure 'gen_us_vkb0' at (1) has an attribute that requires an explicit interface for this procedure


As far as I seem to understand (and this is the reason for my report),
looks like it is right: my fortran 90/95 book says that "a calling
program unit must have an _explicit interface_ to a procedure if it is
to use advanced fortran features such as keyword arguments or optional
arguments" and vec_tab_d2y is declared as optional.

As a matter of fact, this quick and dirty patch fixes the error:

    diff -c PP/pw2gw.f90.ORIG PP/pw2gw.f90
    *** PP/pw2gw.f90.ORIG	Tue Mar 29 11:51:03 2011
    --- PP/pw2gw.f90	Tue Mar 29 11:51:03 2011
    ***************
    *** 126,131 ****
    --- 126,156 ----

        IMPLICIT NONE

    + INTERFACE
    +    subroutine gen_us_vkb0 (ik,npw,vkb0,size_tab,vec_tab, spline_ps, vec_tab_d2y)
    +      USE kinds,     ONLY : DP, sgl
    +      real(DP), intent(inout) ::vkb0(1:npw)
    +      integer, intent(in) :: ik, npw
    +      integer, intent(in) :: size_tab
    +      real(DP), intent(in) :: vec_tab(1:size_tab)
    +      real(DP), optional, intent(in) :: vec_tab_d2y(1:size_tab)
    +      logical :: spline_ps
    +    end subroutine gen_us_vkb0
    + END INTERFACE
    + 
    + INTERFACE
    +    subroutine gen_us_djl (ik,npw,djl,size_tab,vec_tab, spline_ps, vec_tab_d2y)
    +      USE kinds,     ONLY : DP, sgl
    +      real(DP), intent(inout) ::djl(1:npw)
    +      integer, intent(in) :: ik, npw
    +      integer, intent(in) :: size_tab
    +      real(DP), intent(in) :: vec_tab(1:size_tab)
    +      real(DP), optional, intent(in) :: vec_tab_d2y(1:size_tab)
    +      logical :: spline_ps
    +    end subroutine gen_us_djl
    + END INTERFACE
    + 
    + 
        LOGICAL, INTENT(in) :: use_gmaps

        INTEGER :: ii(16), ngw, nkpt, ig, ik, ir, n, i,j,k, io = 98, iband1, iband2


although my fortran book deprecates the use of INTERFACE in favor of
stuffing the subroutine into a module.


I report this in the hope of being of any use.


(However, after fixing this, gfortran-4.6.0 crashes on fpmd2upf.f90
with:
    fpmd2upf.f90: In function 'fpmd2upf':
    fpmd2upf.f90:872:0: internal compiler error: Segmentation fault
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <http://gcc.gnu.org/bugs.html> for instructions.

OUCH!)


thanks a lot for making q-e publicly available

ciao
gabriele

-- 
Gabriele Balducci - Dipartimento di Scienze Chimiche - Via L. Giorgieri 1
I-34127 TRIESTE tel: I-040-5583957 fax: I-040-5583903 e-mail: balducci at units.it
Please, if possible, don't send me MS Word or PowerPoint attachments
Why? See: http://www.gnu.org/philosophy/no-word-attachments.html



More information about the users mailing list