2003-01-20 05:58:50 +08:00
|
|
|
!
|
2005-05-17 03:19:04 +08:00
|
|
|
! Copyright (C) 2002-2005 FPMD-CPV groups
|
2003-01-20 05:58:50 +08:00
|
|
|
! This file is distributed under the terms of the
|
|
|
|
! GNU General Public License. See the file `License'
|
|
|
|
! in the root directory of the present distribution,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
!
|
|
|
|
module bhs
|
|
|
|
! analytical BHS pseudopotential parameters
|
2003-03-03 07:19:44 +08:00
|
|
|
use parameters, only: nsx
|
2003-08-25 06:25:53 +08:00
|
|
|
implicit none
|
|
|
|
save
|
2005-08-28 22:09:42 +08:00
|
|
|
real(8) :: rc1(nsx), rc2(nsx), wrc1(nsx), wrc2(nsx), &
|
2003-01-20 05:58:50 +08:00
|
|
|
rcl(3,nsx,3), al(3,nsx,3), bl(3,nsx,3)
|
2004-02-17 17:53:14 +08:00
|
|
|
integer :: lloc(nsx)
|
2003-01-20 05:58:50 +08:00
|
|
|
end module bhs
|
|
|
|
|
2005-04-15 05:08:53 +08:00
|
|
|
! f = occupation numbers
|
|
|
|
! qbac = background neutralizing charge
|
|
|
|
! nspin = number of spins (1=no spin, 2=LSDA)
|
|
|
|
! nel(nspin) = number of electrons (up, down)
|
|
|
|
! nupdwn= number of states with spin up (1) and down (2)
|
|
|
|
! iupdwn= first state with spin (1) and down (2)
|
|
|
|
! n = total number of electronic states
|
|
|
|
! nx = if n is even, nx=n ; if it is odd, nx=n+1
|
|
|
|
! nx is used only to dimension arrays
|
|
|
|
! ispin = spin of each state
|
|
|
|
!
|
2003-06-16 18:41:12 +08:00
|
|
|
|
2005-04-15 05:08:53 +08:00
|
|
|
! tpiba = 2*pi/alat
|
|
|
|
! tpiba2 = (2*pi/alat)**2
|
|
|
|
! ng = number of G vectors for density and potential
|
|
|
|
! ngl = number of shells of G
|
2003-06-16 18:41:12 +08:00
|
|
|
|
2005-04-15 05:08:53 +08:00
|
|
|
! G-vector quantities for the thick grid - see also doc in ggen
|
|
|
|
! g = G^2 in increasing order (in units of tpiba2=(2pi/a)^2)
|
|
|
|
! gl = shells of G^2 ( " " " " " )
|
|
|
|
! gx = G-vectors ( " " " tpiba =(2pi/a) )
|
|
|
|
!
|
|
|
|
! g2_g = all G^2 in increasing order, replicated on all procs
|
|
|
|
! mill_g = miller index of G vecs (increasing order), replicated on all procs
|
|
|
|
! mill_l = miller index of G vecs local to the processors
|
|
|
|
! ig_l2g = "l2g" means local to global, this array convert a local
|
|
|
|
! G-vector index into the global index, in other words
|
|
|
|
! the index of the G-v. in the overall array of G-vectors
|
|
|
|
! bi? = base vector used to generate the reciprocal space
|
|
|
|
!
|
|
|
|
! np = fft index for G>
|
|
|
|
! nm = fft index for G<
|
|
|
|
! mill_l = G components in crystal axis
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
!
|
2004-04-14 05:49:51 +08:00
|
|
|
! lqmax: maximum angular momentum of Q (Vanderbilt augmentation charges)
|
2003-01-20 05:58:50 +08:00
|
|
|
! nqfx : maximum number of coefficients in Q smoothing
|
|
|
|
! nbrx : maximum number of distinct radial beta functions
|
2004-04-24 01:10:44 +08:00
|
|
|
! ndmx: maximum number of points in the radial grid
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
|
|
|
|
! nbeta number of beta functions (sum over all l)
|
|
|
|
! kkbeta last radial mesh point used to describe functions
|
|
|
|
! which vanish outside core
|
|
|
|
! nqf coefficients in Q smoothing
|
|
|
|
! nqlc angular momenta present in Q smoothing
|
|
|
|
! lll lll(j) is l quantum number of j'th beta function
|
2004-06-01 01:52:55 +08:00
|
|
|
! lmaxq highest angular momentum that is present in Q functions
|
2004-04-20 04:35:42 +08:00
|
|
|
! lmaxkb highest angular momentum that is present in beta functions
|
2003-01-20 05:58:50 +08:00
|
|
|
! dion bare pseudopotential D_{\mu,\nu} parameters
|
|
|
|
! (ionic and screening parts subtracted out)
|
|
|
|
! betar the beta function on a r grid (actually, r*beta)
|
|
|
|
! qqq Q_ij matrix
|
|
|
|
! qfunc Q_ij(r) function (for r>rinner)
|
|
|
|
! rinner radius at which to cut off partial core or Q_ij
|
|
|
|
!
|
|
|
|
! qfcoef coefficients to pseudize qfunc for different total
|
|
|
|
! angular momentum (for r<rinner)
|
2004-04-26 23:02:25 +08:00
|
|
|
! vloc_at local potential for each atom
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2005-05-19 05:01:05 +08:00
|
|
|
|
|
|
|
module local_pseudo
|
2003-08-25 06:25:53 +08:00
|
|
|
implicit none
|
|
|
|
save
|
2005-05-19 05:01:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
! rhops = ionic pseudocharges (for Ewald term)
|
|
|
|
! vps = local pseudopotential in G space for each species
|
2005-05-19 05:01:05 +08:00
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
real(8), allocatable:: rhops(:,:), vps(:,:)
|
2005-05-19 05:01:05 +08:00
|
|
|
!
|
|
|
|
! drhops = derivative of rhops respect to G^2
|
|
|
|
! dvps = derivative of vps respect to G^2
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
real(8),allocatable:: dvps(:,:), drhops(:,:)
|
2005-05-19 05:01:05 +08:00
|
|
|
!
|
2004-02-16 17:53:00 +08:00
|
|
|
contains
|
2005-05-19 05:01:05 +08:00
|
|
|
!
|
|
|
|
subroutine allocate_local_pseudo( ng, nsp )
|
|
|
|
integer, intent(in) :: ng, nsp
|
|
|
|
call deallocate_local_pseudo()
|
|
|
|
ALLOCATE( rhops( ng, nsp ) )
|
|
|
|
ALLOCATE( vps( ng, nsp ) )
|
|
|
|
ALLOCATE( drhops( ng, nsp ) )
|
|
|
|
ALLOCATE( dvps( ng, nsp ) )
|
|
|
|
end subroutine
|
|
|
|
!
|
|
|
|
subroutine deallocate_local_pseudo
|
2004-02-16 17:53:00 +08:00
|
|
|
IF( ALLOCATED( rhops ) ) DEALLOCATE( rhops )
|
|
|
|
IF( ALLOCATED( vps ) ) DEALLOCATE( vps )
|
2005-05-19 05:01:05 +08:00
|
|
|
IF( ALLOCATED( dvps ) ) DEALLOCATE( dvps )
|
|
|
|
IF( ALLOCATED( drhops ) ) DEALLOCATE( drhops )
|
|
|
|
end subroutine
|
|
|
|
!
|
|
|
|
end module local_pseudo
|
2003-01-20 05:58:50 +08:00
|
|
|
|
|
|
|
module qgb_mod
|
2003-08-25 06:25:53 +08:00
|
|
|
implicit none
|
|
|
|
save
|
2005-08-28 22:09:42 +08:00
|
|
|
complex(8), allocatable :: qgb(:,:,:)
|
2004-02-16 17:53:00 +08:00
|
|
|
contains
|
|
|
|
subroutine deallocate_qgb_mod
|
|
|
|
IF( ALLOCATED( qgb ) ) DEALLOCATE( qgb )
|
2005-05-18 17:10:54 +08:00
|
|
|
end subroutine deallocate_qgb_mod
|
2003-01-20 05:58:50 +08:00
|
|
|
end module qgb_mod
|
|
|
|
|
|
|
|
module qradb_mod
|
2003-08-25 06:25:53 +08:00
|
|
|
implicit none
|
|
|
|
save
|
2006-03-07 18:15:27 +08:00
|
|
|
real(8), allocatable:: qradb(:,:,:,:)
|
2004-02-16 17:53:00 +08:00
|
|
|
contains
|
|
|
|
subroutine deallocate_qradb_mod
|
|
|
|
IF( ALLOCATED( qradb ) ) DEALLOCATE( qradb )
|
2005-05-18 17:10:54 +08:00
|
|
|
end subroutine deallocate_qradb_mod
|
2003-01-20 05:58:50 +08:00
|
|
|
end module qradb_mod
|
|
|
|
|
|
|
|
! Variable cell
|
|
|
|
module derho
|
2003-08-25 06:25:53 +08:00
|
|
|
implicit none
|
|
|
|
save
|
2005-08-28 22:09:42 +08:00
|
|
|
complex(8),allocatable:: drhog(:,:,:,:)
|
|
|
|
real(8),allocatable:: drhor(:,:,:,:)
|
2004-02-16 17:53:00 +08:00
|
|
|
contains
|
|
|
|
subroutine deallocate_derho
|
|
|
|
IF( ALLOCATED( drhog ) ) DEALLOCATE( drhog )
|
|
|
|
IF( ALLOCATED( drhor ) ) DEALLOCATE( drhor )
|
2005-05-18 17:10:54 +08:00
|
|
|
end subroutine deallocate_derho
|
2003-01-20 05:58:50 +08:00
|
|
|
end module derho
|
|
|
|
|
2005-07-14 02:22:42 +08:00
|
|
|
MODULE metagga !metagga
|
|
|
|
!the variables needed for meta-GGA
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(8), ALLOCATABLE :: &
|
2005-07-14 02:22:42 +08:00
|
|
|
kedtaus(:,:), &! KineticEnergyDensity in real space,smooth grid
|
|
|
|
kedtaur(:,:), &! real space, density grid
|
|
|
|
crosstaus(:,:,:), &!used by stress tensor,in smooth grid
|
|
|
|
dkedtaus(:,:,:,:) !derivative of kedtau wrt h on smooth grid
|
2005-08-28 22:09:42 +08:00
|
|
|
COMPLEX(8) , ALLOCATABLE :: &
|
2005-07-14 02:22:42 +08:00
|
|
|
kedtaug(:,:), & !KineticEnergyDensity in G space
|
|
|
|
gradwfc(:,:) !used by stress tensor
|
|
|
|
contains
|
|
|
|
subroutine deallocate_metagga
|
|
|
|
IF( ALLOCATED(crosstaus))DEALLOCATE(crosstaus)
|
|
|
|
IF( ALLOCATED(dkedtaus)) DEALLOCATE(dkedtaus)
|
|
|
|
IF( ALLOCATED(gradwfc)) DEALLOCATE(gradwfc)
|
|
|
|
end subroutine deallocate_metagga
|
|
|
|
END MODULE metagga !end metagga
|
|
|
|
|
2006-04-10 07:38:56 +08:00
|
|
|
MODULE dener
|
|
|
|
USE kinds, ONLY: DP
|
|
|
|
IMPLICIT NONE
|
|
|
|
SAVE
|
|
|
|
REAL(DP) :: dekin(3,3)
|
|
|
|
REAL(DP) :: dh(3,3)
|
|
|
|
REAL(DP) :: dps(3,3)
|
|
|
|
REAL(DP) :: denl(3,3)
|
|
|
|
REAL(DP) :: dxc(3,3)
|
|
|
|
REAL(DP) :: dsr(3,3)
|
|
|
|
REAL(DP) :: detot(3,3)
|
|
|
|
END MODULE dener
|
2003-01-20 05:58:50 +08:00
|
|
|
|
|
|
|
module dqgb_mod
|
2003-08-25 06:25:53 +08:00
|
|
|
implicit none
|
|
|
|
save
|
2005-08-28 22:09:42 +08:00
|
|
|
complex(8),allocatable:: dqgb(:,:,:,:,:)
|
2004-02-16 17:53:00 +08:00
|
|
|
contains
|
|
|
|
subroutine deallocate_dqgb_mod
|
|
|
|
IF( ALLOCATED( dqgb ) ) DEALLOCATE( dqgb )
|
2005-05-18 17:10:54 +08:00
|
|
|
end subroutine deallocate_dqgb_mod
|
2003-01-20 05:58:50 +08:00
|
|
|
end module dqgb_mod
|
|
|
|
|
2006-04-01 23:43:55 +08:00
|
|
|
MODULE cdvan
|
|
|
|
USE kinds, ONLY: DP
|
|
|
|
IMPLICIT NONE
|
|
|
|
SAVE
|
|
|
|
REAL(DP), ALLOCATABLE :: dbeta(:,:,:,:,:), dbec(:,:,:,:), &
|
2003-01-20 05:58:50 +08:00
|
|
|
drhovan(:,:,:,:,:)
|
2006-04-01 23:43:55 +08:00
|
|
|
CONTAINS
|
|
|
|
SUBROUTINE deallocate_cdvan
|
2004-02-16 17:53:00 +08:00
|
|
|
IF( ALLOCATED( dbeta ) ) DEALLOCATE( dbeta )
|
|
|
|
IF( ALLOCATED( dbec ) ) DEALLOCATE( dbec )
|
|
|
|
IF( ALLOCATED( drhovan ) ) DEALLOCATE( drhovan )
|
2006-04-01 23:43:55 +08:00
|
|
|
END SUBROUTINE deallocate_cdvan
|
|
|
|
END MODULE cdvan
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
MODULE ncpp
|
|
|
|
!
|
|
|
|
! norm-conserving pseudo-potentials, Kleinman-Bylander factors
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
USE kinds, ONLY: DP
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
IMPLICIT NONE
|
|
|
|
SAVE
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE :: wsg(:,:) ! inverse of Kleinman-Bylander
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
! denominators
|
|
|
|
! <Y phi | V | phi Y>**(-1)
|
|
|
|
! first index: orbital
|
|
|
|
! second index: atomic species
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE :: wnl(:,:,:,:) ! Kleinman-Bylander products
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
! <Y phi | V | exp(i(k+G) dot r)>
|
|
|
|
! first index: G vector
|
|
|
|
! second index: orbital
|
|
|
|
! third index: atomic species
|
|
|
|
! fourth index: k point
|
|
|
|
CONTAINS
|
|
|
|
|
|
|
|
SUBROUTINE allocate_ncpp( nsp, ngw, nbetax, nhm, nk )
|
|
|
|
INTEGER, INTENT(IN) :: nsp, nbetax, nhm, ngw, nk
|
|
|
|
INTEGER :: ierr
|
|
|
|
|
|
|
|
ALLOCATE( wnl( ngw, nbetax, nsp, nk ), STAT=ierr)
|
|
|
|
IF( ierr /= 0 ) CALL errore(' allocate_ncpp ', ' allocating wnl ', ierr )
|
|
|
|
ALLOCATE( wsg( nhm, nsp ), STAT=ierr)
|
|
|
|
IF( ierr /= 0 ) CALL errore(' allocate_ncpp ', ' allocating wsg ', ierr )
|
|
|
|
RETURN
|
|
|
|
END SUBROUTINE allocate_ncpp
|
|
|
|
|
|
|
|
SUBROUTINE deallocate_ncpp
|
|
|
|
IF( ALLOCATED( wsg ) ) DEALLOCATE( wsg )
|
|
|
|
IF( ALLOCATED( wnl ) ) DEALLOCATE( wnl )
|
|
|
|
RETURN
|
|
|
|
END SUBROUTINE deallocate_ncpp
|
|
|
|
|
|
|
|
END MODULE ncpp
|
|
|
|
|
|
|
|
module cvan
|
|
|
|
|
|
|
|
! this file contains common subroutines and modules between
|
|
|
|
! CP and FPMD
|
|
|
|
|
|
|
|
! ionic pseudo-potential variables
|
|
|
|
use parameters, only: nsx
|
|
|
|
implicit none
|
|
|
|
save
|
|
|
|
integer nvb, ish(nsx)
|
|
|
|
! nvb = number of species with Vanderbilt PPs
|
|
|
|
! ish(is)= used for indexing the nonlocal projectors betae
|
|
|
|
! with contiguous indices inl=ish(is)+(iv-1)*na(is)+1
|
|
|
|
! where "is" is the species and iv=1,nh(is)
|
|
|
|
!
|
|
|
|
! indlm: indlm(ind,is)=Y_lm for projector ind
|
|
|
|
integer, allocatable:: indlm(:,:)
|
|
|
|
contains
|
|
|
|
|
|
|
|
subroutine allocate_cvan( nind, ns )
|
|
|
|
integer, intent(in) :: nind, ns
|
|
|
|
allocate( indlm( nind, ns ) )
|
|
|
|
end subroutine allocate_cvan
|
|
|
|
|
|
|
|
subroutine deallocate_cvan( )
|
|
|
|
if( allocated(indlm) ) deallocate( indlm )
|
|
|
|
end subroutine deallocate_cvan
|
|
|
|
|
|
|
|
end module cvan
|
|
|
|
|
|
|
|
|