Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Compiler errors gfortran:-fimplicit none不会绕过错误_Compiler Errors_Fortran_Gfortran_Fortran90_Compiler Flags - Fatal编程技术网

Compiler errors gfortran:-fimplicit none不会绕过错误

Compiler errors gfortran:-fimplicit none不会绕过错误,compiler-errors,fortran,gfortran,fortran90,compiler-flags,Compiler Errors,Fortran,Gfortran,Fortran90,Compiler Flags,我试图编译一个Fortran代码,其中使用了隐式none。这就是我试图编译的代码 module qe_p_psi ! ! Get the <p_i|psi> or <beta_i|psi> from Quantum Espresso ! Get the mapping of the projectors index ! use kinds, ONLY : dp use ions_base, ONLY : nat, ity

我试图编译一个Fortran代码,其中使用了
隐式none
。这就是我试图编译的代码

module qe_p_psi
!
! Get the <p_i|psi> or <beta_i|psi> from Quantum Espresso
! Get the mapping of the projectors index
!
use kinds,                ONLY : dp
use ions_base,            ONLY : nat, ityp, ntyp => nsp
use cell_base,            ONLY : at, tpiba2
use constants,            ONLY : rytoev
use gvect,                ONLY : g, ngm
use lsda_mod,             ONLY : nspin
#if defined __QE6
use klist,                ONLY : xk, nks, nkstot, ngk, igk_k
#elif defined __QE512 || __QE54
use klist,                ONLY : xk, nks, nkstot
#endif
use io_files,             ONLY : iunpun, nwordwfc, iunwfc
#if defined __QE6
use wvfct,                ONLY : nbnd, et, npw, npwx, g2kin
use gvecw,                ONLY : ecutwfc
#elif defined __QE54
use wvfct,                ONLY : nbnd, et, igk, npw, npwx, g2kin
use gvecw,                ONLY : ecutwfc
#elif defined __QE512
use wvfct,                ONLY : nbnd, et, ecutwfc, igk, npw, npwx, g2kin
#endif
use uspp,                 ONLY : nkb, vkb, qq
use uspp_param,           ONLY : upf, nh, nhm, nbetam
use noncollin_module,     ONLY : noncolin, npol
use wavefunctions_module, ONLY : evc
use io_global,            ONLY : ionode, ionode_id, stdout
use becmod,               ONLY : calbec, bec_type, allocate_bec_type, deallocate_bec_type

!   use mp,                   ONLY : mp_bcast
!   use mp_world,             ONLY : world_comm

implicit none
!   integer, allocatable, public :: p_index(:,:) ! QE projector index mapping back to atom and lm

    type(bec_type), public, allocatable :: becp(:)  ! <p|\psi>
    public                 :: p_psi ! Subroutine

private
contains

    subroutine p_psi()
    implicit none

        integer :: ik

        allocate( becp(1:nks) )

        do ik = 1, nks
            call allocate_bec_type(nkb, nbnd, becp(ik))
            !
            ! get the k+G vectors for the ik k-point
            !
#if defined __QE512 || __QE54
            call gk_sort (xk (1, ik), ngm, g, ecutwfc / tpiba2, npw, igk, g2kin)
#else
            npw = ngk(ik)
#endif

            !
            !   read eigenfunctions
            !
            call davcio (evc, 2*nwordwfc, iunwfc, ik, - 1)

            !
            ! calculate becp = <psi|beta>
            !

#if defined __QE512 || __QE54
            call init_us_2 (npw, igk, xk (1, ik), vkb)
#else
            call init_us_2 (npw, igk_k(1,ik), xk(1,ik), vkb)
#endif
            call calbec ( npw, vkb, evc, becp(ik) )

!        IF (noncolin) &
!           CALL compute_sigma_avg(sigma_avg(1,1,ik),becp%nc,ik,lsigma)

        enddo

    !
    ! Mapping of indexes l and m for each type of atom nt -> nh(nt) in the following way:
    !
    !do it = 1, ntyp
    !   ih = 1
    !   do ib = 1, upf(it)%nbeta
    !      do im = 1, 2 * upf(it)%lll (ib) + 1
    !         ih = ih + 1
    !      enddo
    !enddo
    !enddo

    !
    ! Mapping of all atoms projectors index nh index into a jkb index continously and
    ! ordered by type of atom.
    ! Recalculating that here and storing it
    !

    !jkb = 7*nbetam
    !allocate( p_index( 1:nat, 1:jkb ) )

    !jkb = 0
    !do it=1, ntyp
    !   do ia=1, nat
    !      if ( ityp(ia) .eq. it ) then
    !         do ih = 1, nh (it)
    !            jkb = jkb + 1
    !            p_index(ia,ih) = jkb  ! Projectors
    !         enddo
    !     endif
    !  enddo
    !enddo

    end subroutine p_psi

end module qe_p_psi
mpif90 -fdollar-ok -ffree-line-length-none -O3 -fopenmp -fPIC -cpp -u -ffixed-form -fimplicit-none -I../../../qe/6.0-mpi/Modules -I../../../qe/6.0-mpi/PW/src -I../src ../../../qe/6.0-mpi/PW/src/libpw.a ../../../qe/6.0-mpi/Modules/libqemod.a ../../../qe/6.0-mpi/FFTXlib/libqefft.a ../../../qe/6.0-mpi/LAXlib/libqela.a -Wall -c qe_p_psi.f90 -o qe_p_psi.o 
但我收到以下错误消息 qe_p_psi.f90:79:41:

          call allocate_bec_type(nkb, nbnd, becp(ik))
                                         1
Error: Symbol ‘nbnd’ at (1) has no IMPLICIT type
qe_p_psi.f90:76:26:

       allocate( becp(1:nks) )
                          1
Error: Symbol ‘nks’ at (1) has no IMPLICIT type
qe_p_psi.f90:86:12:

          npw = ngk(ik)
            1
Error: Symbol ‘npw’ at (1) has no IMPLICIT type
qe_p_psi.f90:86:15:

          npw = ngk(ik)
               1
Error: Function ‘ngk’ at (1) has no IMPLICIT type
Makefile.for-qe-6.0:82: recipe for target 'qe_p_psi.o' failed
make[1]: *** [qe_p_psi.o] Error 1
make[1]: Leaving directory '/media/anhvt89/seagateRepo/qe/6.0-mpi/kgec-v2.1/for-qe-6.0-mpi'
Makefile:66: recipe for target 'all' failed
make: *** [all] Error 1
我试图使用
-fimplicit none
编译器标志绕过
gfortran
编译器,但代码仍然不起作用。我有什么遗漏吗

$ mpif90 --version
GNU Fortran (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010
Copyright (C) 2015 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

-fimplicit none
意味着必须定义所有变量(无隐式类型),显然有些变量没有定义。看起来您需要定义一些预处理器宏。只有您的代码安装指南/文档会告诉您是哪个。@albert是否有与此
-fimplicit none
标志相反的标志?即使有允许重写
隐式none
的标志,您希望程序有什么用?它显然不会以任何有意义的方式正确?它看起来像是三个标志之一,
\uuqe6
\uqe512
\uqe54
是要设置的,而您没有设置任何标志。