ndm, mmaxx => ndmx ; 0:ndm => ndmx (starting from 0 no longer needed)

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@815 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2004-04-23 17:10:44 +00:00
parent f7784bbfbf
commit d198ebad0c
31 changed files with 110 additions and 114 deletions

View File

@ -82,17 +82,16 @@
complex(kind=8), intent(in) :: eigr(ngw,nas,nsp)
complex(kind=8), intent(out):: wfc(ngw,n_atomic_wfc)
!
integer natwfc, is, ia, ir, nb, l, m, lm, i
integer natwfc, ndm, is, ia, ir, nb, l, m, lm, i
real(kind=8), allocatable:: ylm(:,:), q(:), jl(:), vchi(:), &
& chiq(:)
!
!
allocate(ylm(ngw,(lmaxkb+1)**2))
call ylmr2 ((lmaxkb+1)**2, ngw, gx, g, ylm)
allocate(q(ngw))
allocate(jl(mmaxx))
allocate(vchi(mmaxx))
allocate(chiq(ngw))
ndm = MAXVAL(mesh(1:nsp))
allocate(jl(ndm), vchi(ndm))
allocate(q(ngw), chiq(ngw))
!
do i=1,ngw
q(i) = sqrt(g(i))*tpiba
@ -131,11 +130,7 @@
if (natwfc.ne.n_atomic_wfc) &
& call errore('atomic_wfc','unexpected error',natwfc)
!
deallocate(chiq)
deallocate(vchi)
deallocate(jl)
deallocate(q)
deallocate(ylm)
deallocate(q, chiq, vchi, jl, ylm)
!
return
end
@ -5008,12 +5003,12 @@
! Output parameters in module "ncprm"
! info on DFT level in module "dft"
!
use parameters, only: nsx, natx, lqmax
use parameters, only: nsx, natx, lqmax, ndmx
use ncprm, only: rscore, nqlc, qfunc, rucore, r, rab, rinner, &
qrl, qqq, nbeta, nbrx, ifpcor, mesh, betar, &
dion, lll, kkbeta
use funct, only: dft, iexch, icorr, igcx, igcc
use wfc_atomic, only: lchi, chi, nchi, nchix, mmaxx
use wfc_atomic, only: lchi, chi, nchi, nchix
use ions_base, only: zv
use io_global, only: stdout
!
@ -5051,7 +5046,7 @@
!
real(kind=8) xmin, zmesh, dx,&! mesh parameters
& oc(nchix,nsx), &! occupancies
& rsatom(mmaxx) ! charge density of pseudoatom
& rsatom(ndmx) ! charge density of pseudoatom
integer mfxcx, mfxcc, &!
& mgcx, mgcc, &! exch-corr functional indices
& exfact, &
@ -5088,7 +5083,7 @@
read( iunps, '(4e17.11,i5)',err=100, iostat=ios ) &
& xmin,rdum,zmesh,dx,mesh(is)
!
if (mesh(is).gt.mmaxx.or. mesh(is).lt.0) &
if (mesh(is) > ndmx .or. mesh(is) < 0) &
& call errore('readAdC', 'wrong mesh',is)
!
read( iunps, '(2i5)', err=100, iostat=ios ) nchi(is), nbeta(is)
@ -5274,7 +5269,7 @@
!
!
use kinds, only: DP
use parameters, only: nchix, lmaxx, nbrx, mmaxx, nsx, lqmax, nqfx
use parameters, only: nchix, lmaxx, nbrx, ndmx, nsx, lqmax, nqfx
use ncprm, only: qfunc, qfcoef, qqq, betar, dion, rucore, cmesh, &
qrl, rab, rscore, r, mesh, ifpcor, &
rinner, kkbeta, lll, nbeta, nqf, nqlc
@ -5307,8 +5302,8 @@
& eee(nbrx), &! energies of the beta function
& ddd(nbrx,nbrx),&! the screened D_{\mu,\nu} parameters
& rcloc, &! the cut-off radius of the local potential
& vloc0(mmaxx), &! the screened local potential
& rsatom(mmaxx), &! the charge density of pseudoatom
& vloc0(ndmx), &! the screened local potential
& rsatom(ndmx), &! the charge density of pseudoatom
& z(nsx) ! atomic charge
integer &
& iver(3), &! contains the version of the code
@ -5371,7 +5366,7 @@
& call errore( 'readvan', 'increase nchix', nchi(is) )
if ( nchi(is).lt. 1 ) &
& call errore( 'readvan', 'wrong nchi ', is )
if ( mesh(is).gt.mmaxx .or. mesh(is).lt.0 ) &
if ( mesh(is) > ndmx .or. mesh(is) < 0 ) &
& call errore( 'readvan','wrong mesh', is )
!
! nnlz, wwnl, ee give info (not used) on pseudo eigenstates

View File

@ -228,7 +228,7 @@
& fpibg, gps, sfp, xg, dsfp, dgps, r2new, r2max, r21, &
& r22, r2l
real(kind=8), external :: erf
integer is, irmax, ir, ig, ib
integer is, irmax, ir, ig, ib, ndm
real(kind=8), allocatable:: df(:), dfigl(:)
!
! ==================================================================
@ -245,12 +245,13 @@
endif
1200 format(2x,'formf: eself=',f10.5)
!
ndm = MAXVAL (mesh(1:nsp))
allocate(figl(ngs))
allocate(f(mmaxx))
allocate(vscr(mmaxx))
allocate(f(ndm))
allocate(vscr(ndm))
if (tpre) then
allocate(dfigl(ngs))
allocate(df(mmaxx))
allocate(df(ndm))
end if
!
! ==================================================================

View File

@ -138,14 +138,14 @@ end module gvec
module ncprm
use parameters, only: nsx, mmaxx, nqfx, nbrx, lqmax
use parameters, only: nsx, ndmx, nqfx, nbrx, lqmax
implicit none
save
!
! lqmax: maximum angular momentum of Q (Vanderbilt augmentation charges)
! nqfx : maximum number of coefficients in Q smoothing
! nbrx : maximum number of distinct radial beta functions
! mmaxx: maximum number of points in the radial grid
! ndmx: maximum number of points in the radial grid
!
! ifpcor 1 if "partial core correction" of louie, froyen,
@ -174,14 +174,14 @@ module ncprm
! angular momentum (for r<rinner)
! rucore bare local potential
real(kind=8) :: rscore(mmaxx,nsx), dion(nbrx,nbrx,nsx), &
betar(mmaxx,nbrx,nsx), qqq(nbrx,nbrx,nsx), &
qfunc(mmaxx,nbrx,nbrx,nsx), rucore(mmaxx,nbrx,nsx), &
real(kind=8) :: rscore(ndmx,nsx), dion(nbrx,nbrx,nsx), &
betar(ndmx,nbrx,nsx), qqq(nbrx,nbrx,nsx), &
qfunc(ndmx,nbrx,nbrx,nsx), rucore(ndmx,nbrx,nsx), &
qfcoef(nqfx,lqmax,nbrx,nbrx,nsx), rinner(lqmax,nsx)
!
! qrl q(r) functions
!
real(kind=8) :: qrl(mmaxx,nbrx,nbrx,lqmax,nsx)
real(kind=8) :: qrl(ndmx,nbrx,nbrx,lqmax,nsx)
! mesh number of radial mesh points
! r logarithmic radial mesh
@ -189,7 +189,7 @@ module ncprm
! cmesh used only for Herman-Skillman mesh (old format)
integer :: mesh(nsx)
real(kind=8) :: r(mmaxx,nsx), rab(mmaxx,nsx), cmesh(nsx)
real(kind=8) :: r(ndmx,nsx), rab(ndmx,nsx), cmesh(nsx)
end module ncprm
module pseu
@ -227,7 +227,7 @@ end module qradb_mod
module wfc_atomic
use parameters, only:nsx
use ncprm, only:mmaxx
use ncprm, only:ndmx
implicit none
save
! nchix= maximum number of pseudo wavefunctions
@ -236,7 +236,7 @@ module wfc_atomic
! chi = atomic (pseudo-)wavefunctions
integer :: nchix
parameter (nchix=6)
real(kind=8) :: chi(mmaxx,nchix,nsx)
real(kind=8) :: chi(ndmx,nchix,nsx)
integer :: lchi(nchix,nsx), nchi(nsx)
end module wfc_atomic

View File

@ -49,7 +49,7 @@ subroutine read_pseudo (is, iunps, ierr)
call which_dft (upf%dft)
!
mesh(is) = upf%mesh
if (mesh(is) > mmaxx) call errore('read_pseudo','increase mmaxx',mesh(is))
if (mesh(is) > ndmx ) call errore('read_pseudo','increase mmaxx',mesh(is))
!
nchi(is) = upf%nwfc
lchi(1:upf%nwfc, is) = upf%lchi(1:upf%nwfc)

View File

@ -74,7 +74,7 @@ subroutine cg_setup
call init_vloc
!
call convert_to_num &
& (ntyp,numeric,ndm,mesh,r,lmaxx,lmax,lloc,nnl,aps,alps,vnl)
& (ntyp,numeric,ndmx,mesh,r,lmaxx,lmax,lloc,nnl,aps,alps,vnl)
!
call init_us_1
!

View File

@ -23,7 +23,7 @@ MODULE parameters
npk = 40000, &! max number of k-points
lmaxx = 3, &! max non local angular momentum
nchix = 6, &! max number of atomic wavefunctions per atom
ndm = 2000 ! max number of points in the atomic radial mesh
ndmx = 2000 ! max number of points in the atomic radial mesh
INTEGER, PARAMETER :: &
nbrx = 8, &! max number of beta functions
@ -34,7 +34,6 @@ MODULE parameters
! ... More parameter for the CP codes
!
INTEGER, PARAMETER :: mmaxx = ndm ! maximum mesh size for pseudo
INTEGER, PARAMETER :: cp_lmax = lmaxx + 1 ! maximum number of channels
! (s,p,d,f)
INTEGER, PARAMETER :: nacx = 10 ! maximum number of averaged

View File

@ -15,7 +15,7 @@
! together with their allocation/deallocation routines
USE kinds, ONLY: dbl
USE parameters, ONLY: mmaxx, cp_lmax
USE parameters, ONLY: ndmx, cp_lmax
IMPLICIT NONE
SAVE
@ -72,17 +72,17 @@
INTEGER :: igau
INTEGER :: lloc
INTEGER :: lnl
INTEGER :: indl(mmaxx)
INTEGER :: indl(ndmx)
INTEGER :: nchan
INTEGER :: mesh
REAL(dbl) :: zv
REAL(dbl) :: raggio
REAL(dbl) :: dx ! r(i) = cost * EXP( xmin + dx * (i-1) )
REAL(dbl) :: rab(mmaxx)
REAL(dbl) :: rw(mmaxx)
REAL(dbl) :: vnl(mmaxx, cp_lmax)
REAL(dbl) :: vloc(mmaxx)
REAL(dbl) :: vrps(mmaxx, cp_lmax)
REAL(dbl) :: rab(ndmx)
REAL(dbl) :: rw(ndmx)
REAL(dbl) :: vnl(ndmx, cp_lmax)
REAL(dbl) :: vloc(ndmx)
REAL(dbl) :: vrps(ndmx, cp_lmax)
REAL(dbl) :: wgv(cp_lmax)
REAL(dbl) :: rc(2)
REAL(dbl) :: wrc(2)
@ -92,8 +92,8 @@
INTEGER :: nrps ! number of atomic wave function
INTEGER :: lrps(cp_lmax) ! angular momentum
REAL(dbl) :: oc(cp_lmax) ! occupation for each rps
REAL(dbl) :: rps(mmaxx, cp_lmax) ! atomic pseudo wave function
REAL(dbl) :: rhoc(mmaxx) ! core charge
REAL(dbl) :: rps(ndmx, cp_lmax) ! atomic pseudo wave function
REAL(dbl) :: rhoc(ndmx) ! core charge
END TYPE pseudo_ncpp
! ----------------------------------------------

View File

@ -7,7 +7,7 @@ subroutine compute_qdipol
USE constants, ONLY: fpi
USE atom, ONLY: r, rab
USE ions_base, ONLY: ntyp => nsp
USE us, only: nbrx, ndm, tvanp, nbeta, lll, kkbeta, qfunc, rinner, &
USE us, only: nbrx, tvanp, nbeta, lll, kkbeta, qfunc, rinner, &
qfcoef, nh, nhtol, nhtom, nqf, indv
USE uspp, ONLY: nlx, ap
USE phus, ONLY: dpqq
@ -16,9 +16,10 @@ subroutine compute_qdipol
real(kind=dp), allocatable :: qrad2(:,:,:), qtot(:,:,:), aux(:)
real(kind=dp) :: fact
integer :: nt, l, ir, nb, mb, ilast, ipol, ih, ivl, jh, jvl, lp
integer :: nt, l, ir, nb, mb, ilast, ipol, ih, ivl, jh, jvl, lp, ndm
call start_clock('cmpt_qdipol')
ndm = MAXVAL (kkbeta(1:ntyp))
allocate (qrad2( nbrx , nbrx, ntyp))
allocate (aux( ndm))
allocate (qtot( ndm, nbrx, nbrx))

View File

@ -104,7 +104,7 @@ SUBROUTINE phq_init()
!
! ... for the analytic potentials we need to convert in a radial mesh
!
CALL convert_to_num( ntyp, numeric, ndm, mesh, r, lmaxx, lmax, &
CALL convert_to_num( ntyp, numeric, ndmx, mesh, r, lmaxx, lmax, &
lloc, nnl, aps, alps, vnl )
!
! ... then we compute the denominators of the KB types, or the

View File

@ -25,10 +25,10 @@ subroutine set_drhoc (q)
integer :: ir, ng, nt
! counter on radial mesh points
! conuter on plane waves
! counter on plane waves
! counter on atomic types
! .true. if some nlcc-pseudo is numeric
logical :: some_numeric
! .true. if some nlcc-pseudo is numeric
! in this case an auxiliary vector is needed
real(kind=DP), allocatable :: aux (:)
@ -39,11 +39,11 @@ subroutine set_drhoc (q)
some_numeric = .false.
do nt = 1, ntyp
some_numeric = some_numeric.or. (nlcc (nt) .and.numeric (nt) )
if (nlcc (nt) .and.numeric (nt) .and.msh (nt) .gt.ndm) call errore &
if (nlcc (nt) .and. numeric (nt) .and. msh (nt) > ndmx) call errore &
('set_drhoc', 'too many mesh points', msh (nt) )
enddo
if (some_numeric) allocate (aux ( ndm))
if (some_numeric) allocate (aux ( ndmx))
drc (:,:) = (0.d0, 0.d0)
do ng = 1, ngm
gq2 = (g (1, ng) + q (1) ) **2 + (g (2, ng) + q (2) ) **2 + &

View File

@ -23,7 +23,6 @@ subroutine atomic_rho (rhoa, nspina)
!
#include "machine.h"
USE kinds, ONLY: DP
USE parameters, ONLY: ndm
USE io_global, ONLY : stdout
USE atom, ONLY: r, rab, msh, rho_at
USE basis, ONLY: ntyp
@ -45,7 +44,7 @@ subroutine atomic_rho (rhoa, nspina)
real(kind=DP) :: rhoneg, rhorea, rhoima, gx
real(kind=DP), allocatable :: rhocgnt (:), aux (:)
complex(kind=DP), allocatable :: rhocg (:,:)
integer :: ir, is, ig, igl, nt
integer :: ir, is, ig, igl, nt, ndm
!
! superposition of atomic charges contained in the array rho_at
! (read from pseudopotential files)
@ -53,7 +52,8 @@ subroutine atomic_rho (rhoa, nspina)
! allocate work space (psic must already be allocated)
!
allocate (rhocg( ngm, nspina))
allocate (aux( ndm))
ndm = MAXVAL ( msh(1:ntyp) )
allocate (aux(ndm))
allocate (rhocgnt( ngl))
rhoa(:,:) = 0.d0
rhocg(:,:) = (0.d0,0.d0)

View File

@ -16,7 +16,7 @@ subroutine atomic_wfc (ik, wfcatom)
#include "machine.h"
USE kinds, ONLY: DP
USE parameters, ONLY: ndm, nchix
USE parameters, ONLY: nchix
USE atom, ONLY: nchi, lchi, chi, oc, r, rab, msh
USE constants, ONLY: tpi, fpi
USE cell_base, ONLY: omega, tpiba
@ -41,7 +41,7 @@ subroutine atomic_wfc (ik, wfcatom)
call start_clock ('atomic_wfc')
allocate (qg(npw),chiq(npw,nchix,ntyp),gk(3,npw),aux(ndm),vchi(ndm),sk(npw))
allocate ( qg(npw), chiq(npw,nchix,ntyp), gk(3,npw), sk(npw))
! calculate max angular momentum required in wavefunctions
lmax_wfc = 0
@ -132,7 +132,7 @@ subroutine atomic_wfc (ik, wfcatom)
if (n_starting_wfc.ne.natomwfc) call errore ('atomic_wfc', &
'something wrong', 1)
deallocate(qg, chiq ,gk ,aux ,vchi ,sk ,ylm)
deallocate(qg, chiq ,gk, sk ,ylm)
call stop_clock ('atomic_wfc')
return

View File

@ -9,7 +9,7 @@
use atom, only: r, rab, dx
use basis, only: ntyp
use cell_base, only: omega
USE parameters, only: ndm, nbrx
USE parameters, only: ndmx, nbrx
USE kinds, only: DP
use constants, only: fpi
use us, only: lqx, tvanp, qfunc, qfcoef, nqf, rinner, lll, nbeta, &
@ -18,7 +18,7 @@
implicit none
integer :: ik, msh_bp, i, np, m, k, l
integer :: n,idbes,ilmin,ilmax,iv,jv
real(DP) :: jl(ndm), ql, sum, jlp1(ndm), aux(ndm), &
real(DP) :: jl(ndmx), ql, sum, jlp1(ndmx), aux(ndmx), &
qr_k(nbrx,nbrx,lqx,ntyp)
! declaration readvan quantities

View File

@ -19,7 +19,6 @@ subroutine force_corr (forcescc)
!
#include "machine.h"
USE kinds, ONLY: DP
USE parameters, ONLY : ndm
USE constants, ONLY: tpi
USE atom, ONLY: rho_at, msh, r, rab
USE basis, ONLY: nat, ntyp, ityp, tau
@ -38,7 +37,7 @@ subroutine force_corr (forcescc)
! work space
real(kind=DP) :: gx, arg, fact
! temp factors
integer :: ir, isup, isdw, ig, igl0, nt, na, ipol
integer :: ir, isup, isdw, ig, igl0, nt, na, ipol, ndm
! counters
!
! vnew is V_out - V_in, psic is the temp space
@ -51,6 +50,7 @@ subroutine force_corr (forcescc)
psic(:) = (vnew (:, isup) + vnew (:, isdw)) * 0.5d0
end if
!
ndm = MAXVAL ( msh(1:ntyp) )
allocate ( aux(ndm), rhocgnt(ngl) )
forcescc(:,:) = 0.d0

View File

@ -15,7 +15,7 @@ subroutine gen_at_dj ( kpoint, natw, lmax_wfc, dwfcat )
!
#include "machine.h"
USE kinds, ONLY: DP
USE parameters, ONLY: ndm, nchix
USE parameters, ONLY: nchix
USE io_global, ONLY : stdout
USE constants, ONLY: tpi, fpi
USE atom, ONLY: msh, r, rab, lchi, nchi, oc, chi
@ -35,7 +35,7 @@ subroutine gen_at_dj ( kpoint, natw, lmax_wfc, dwfcat )
! local variables
!
integer :: l, na, nt, nb, iatw, iig, i, ig, i0, i1, i2 ,i3, m, lm
real (kind=DP) :: jl(ndm), jlm1(ndm), eps, dv, qt, arg, px, ux, vx, wx
real (kind=DP) :: eps, dv, qt, arg, px, ux, vx, wx
parameter (eps=1.0e-8)
complex (kind=DP) :: phase, pref
real (kind=DP), allocatable :: gk(:,:), q(:), ylm(:,:), djl(:,:,:)

View File

@ -15,7 +15,7 @@ subroutine gen_at_dy ( ik, natw, lmax_wfc, u, dwfcat )
!
#include "machine.h"
USE kinds, ONLY: DP
USE parameters, ONLY: ndm, nchix
USE parameters, ONLY: nchix
USE io_global, ONLY : stdout
USE constants, ONLY: tpi, fpi
USE atom, ONLY: msh, r, rab, lchi, nchi, oc, chi
@ -50,7 +50,7 @@ subroutine gen_at_dy ( ik, natw, lmax_wfc, u, dwfcat )
complex (kind=DP), allocatable :: sk(:)
! sk(npw)
allocate ( q(npw), gk(3,npw), auxjl(ndm), vchi(ndm), chiq(npwx,nchix,ntyp) )
allocate ( q(npw), gk(3,npw), chiq(npwx,nchix,ntyp) )
dwfcat(:,:) = (0.d0,0.d0)
@ -136,7 +136,7 @@ subroutine gen_at_dy ( ik, natw, lmax_wfc, u, dwfcat )
deallocate (sk)
deallocate (dylm_u)
deallocate ( q, gk, auxjl, vchi, chiq )
deallocate ( q, gk, chiq )
return
end subroutine gen_at_dy

View File

@ -14,7 +14,7 @@ subroutine gen_us_dj (ik, dvkb)
!
#include "machine.h"
USE kinds, ONLY: DP
USE parameters, ONLY: ndm, nbrx
USE parameters, ONLY: nbrx
USE constants, ONLY: tpi
USE basis, ONLY: nat, ntyp, tau, ityp
USE cell_base, ONLY: tpiba
@ -46,7 +46,7 @@ subroutine gen_us_dj (ik, dvkb)
integer :: na, i, m, l, iig, lm
real(kind=DP), allocatable :: djl (:,:,:), ylm (:,:), q (:), gk (:,:)
real(kind=DP) :: jl (ndm), jlm1 (ndm), qt, dv, eps
real(kind=DP) :: qt, dv, eps
parameter (eps = 1.0e-8)
complex(kind=DP), allocatable :: sk (:)

View File

@ -14,7 +14,7 @@ subroutine gen_us_dy (ik, u, dvkb)
!
#include "machine.h"
USE kinds, ONLY: DP
USE parameters, ONLY: ndm, nbrx
USE parameters, ONLY: nbrx
USE io_global, ONLY : stdout
USE constants, ONLY: tpi
USE basis, ONLY: nat, ntyp, tau, ityp

View File

@ -11,7 +11,7 @@ subroutine hinit0
!
! configuration-independent hamiltonian initialization
!
USE parameters, ONLY: ndm, lmaxx
USE parameters, ONLY: ndmx, lmaxx
USE atom, ONLY: numeric, mesh, r, vnl
USE basis, ONLY: nat, ntyp, ityp, tau, startingconfig
USE cell_base, ONLY: at, bg, omega, tpiba2
@ -33,7 +33,7 @@ subroutine hinit0
!
! bring analytic potentials into numerical form on a radial mesh
!
call convert_to_num (ntyp, numeric, ndm, mesh, r, lmaxx, lmax, &
call convert_to_num (ntyp, numeric, ndmx, mesh, r, lmaxx, lmax, &
lloc, nnl, aps, alps, vnl)
!
! k-point independent parameters of non-local pseudopotentials

View File

@ -15,7 +15,7 @@ subroutine init_at_1
!
#include "machine.h"
USE parameters, ONLY: ndm, nchix
USE parameters, ONLY: nchix
USE kinds, ONLY: dp
USE atom, ONLY: nchi, lchi, chi, oc, r, rab, msh
USE constants, ONLY: fpi
@ -24,13 +24,14 @@ subroutine init_at_1
USE us, ONLY: tab_at, nqx, dq, newpseudo
implicit none
!
integer :: n_starting_wfc, nt, nb, iq, ir, l, startq, lastq
integer :: n_starting_wfc, nt, nb, iq, ir, l, startq, lastq, ndm
!
real(kind=DP), allocatable :: aux (:), vchi (:)
real(kind=DP) :: vqint, pref, q
call start_clock ('init_at_1')
ndm = MAXVAL (msh(1:ntyp))
allocate (aux(ndm),vchi(ndm))
!

View File

@ -15,7 +15,7 @@ subroutine init_paw_1
!
#include "machine.h"
USE kinds , only: dp
use parameters , only : lqmax , nbrx, lmaxx, ndm
use parameters , only : lqmax , nbrx, lmaxx
use cell_base , only : omega
use basis , only : ntyp, nat, ityp
use constants , only : fpi
@ -31,7 +31,7 @@ subroutine init_paw_1
!
integer :: nt, ih, jh, nb, mb, nmb, l, m, ir, iq, is, startq, &
lastq, ilast, na, j, n1, n2
lastq, ilast, na, j, n1, n2, ndm
! various counters
real(kind=DP), allocatable :: aux (:), aux1 (:), besr (:), qtot (:,:,:)
! various work space
@ -51,7 +51,7 @@ subroutine init_paw_1
!
! Initialization of the variables
!
ndm = MAXVAL (msh(1:ntyp))
paw_nhm = 0
paw_nh = 0
paw_lmaxkb = 0
@ -63,8 +63,6 @@ subroutine init_paw_1
if (paw_nh (nt) .gt.paw_nhm) paw_nhm = paw_nh (nt)
enddo
allocate (aux ( ndm))
allocate (aux1( ndm))
allocate (besr( ndm))

View File

@ -28,7 +28,7 @@ subroutine init_us_1
!
#include "machine.h"
USE kinds, ONLY: DP
USE parameters, ONLY: lmaxx, ndm, nbrx, lqmax
USE parameters, ONLY: lmaxx, nbrx, lqmax
USE constants, ONLY: fpi
USE atom, ONLY: r, rab, vnl, chi, msh
USE basis, ONLY: ntyp
@ -46,7 +46,7 @@ subroutine init_us_1
!
integer :: nt, ih, jh, nb, mb, nmb, l, m, ir, iq, is, startq, &
lastq, ilast
lastq, ilast, ndm
! various counters
real(kind=DP), allocatable :: aux (:), aux1 (:), besr (:), qtot (:,:,:)
! various work space
@ -65,6 +65,7 @@ subroutine init_us_1
!
! Initialization of the variables
!
ndm = MAXVAL (msh(1:ntyp))
allocate (aux ( ndm))
allocate (aux1( ndm))
allocate (besr( ndm))

View File

@ -113,7 +113,7 @@ end subroutine setup2
subroutine memory_estimate ( )
!-----------------------------------------------------------------------
USE kinds, ONLY: DP
USE parameters, ONLY: ndm, npsx, lmaxx, nchix, nbrx, nqfx, lqmax
USE parameters, ONLY: ndmx, npsx, lmaxx, nchix, nbrx, nqfx, lqmax
USE basis, ONLY: nat, ntyp, natomwfc
USE cellmd,ONLY: lmovecell
USE klist, ONLY: npk, nks, nkstot
@ -149,8 +149,8 @@ subroutine memory_estimate ( )
real_size * 2 * 3 * nat + int_size * nat + & ! tau force ityp
int_size * 48 * nat + int_size * 4 * ntetra + & ! irt tetra
real_size * 4 * npk + int_size * 2 * npk + & ! xk wk ngk isk
real_size * (ndm+1) * npsx * (4+(lmaxx+1)+nchix)+ & ! atomic PP
real_size * (ndm+1) * npsx * (nbrx + nbrx*nbrx) + & ! atomic USPP
real_size * ndmx * npsx * (4+(lmaxx+1)+nchix)+ & ! atomic PP
real_size * ndmx * npsx * (nbrx + nbrx*nbrx) + & ! atomic USPP
real_size * nqfx * lqmax * nbrx * nbrx * npsx ! qfcoef
!
! dynamically allocated memory that does not scale with N CPUs

View File

@ -1,14 +1,14 @@
MODULE paw
USE kinds, ONLY: DP
USE parameters, ONLY: nbrx, npsx, ndm
USE parameters, ONLY: nbrx, npsx, ndmx
!
! ... These parameters are needed for the paw variables
!
SAVE
!
REAL(KIND=DP) :: &
paw_betar(0:ndm,nbrx,npsx) ! radial beta_{mu} functions
paw_betar(ndmx,nbrx,npsx) ! radial beta_{mu} functions
INTEGER :: &
paw_nh(npsx), &! number of beta functions per atomic type
paw_nbeta(npsx), &! number of beta functions

View File

@ -238,7 +238,7 @@ MODULE atom
! ... The variables needed to describe the atoms and related quantities
!
USE kinds, ONLY : DP
USE parameters, ONLY : npsx, ndm, lmaxx, nchix
USE parameters, ONLY : npsx, ndmx, lmaxx, nchix
!
SAVE
!
@ -246,13 +246,13 @@ MODULE atom
zmesh(npsx), &! the atomic charge for mesh generation
xmin(npsx), &! initial linear mesh point
dx(npsx), &! linear interval for logaritmic mesh
r(0:ndm,npsx), &! radial logaritmic mesh
rab(0:ndm,npsx), &! derivative of the radial mesh
vnl(0:ndm,0:lmaxx,npsx), &! non local radial potential (KB type)
chi(0:ndm,nchix,npsx), &! radial atomic orbitals
r(ndmx,npsx), &! radial logaritmic mesh
rab(ndmx,npsx), &! derivative of the radial mesh
vnl(ndmx,0:lmaxx,npsx), &! non local radial potential (KB type)
chi(ndmx,nchix,npsx), &! radial atomic orbitals
oc(nchix,npsx), &! atomic level occupation
rho_at(0:ndm,npsx), &! radial atomic charge density
rho_atc(0:ndm,npsx) ! radial core charge density
rho_at(ndmx,npsx), &! radial atomic charge density
rho_atc(ndmx,npsx) ! radial core charge density
INTEGER :: &
mesh(npsx), &! number of mesh points
msh(npsx), &! the point at rcut
@ -492,7 +492,7 @@ MODULE us
! ... These parameters are needed with the US pseudopotentials
!
USE kinds, ONLY : DP
USE parameters, ONLY : lmaxx, lqmax, nbrx, npsx, nqfx, ndm
USE parameters, ONLY : lmaxx, lqmax, nbrx, npsx, nqfx, ndmx
!
SAVE
!
@ -501,10 +501,10 @@ MODULE us
REAL(KIND=DP) :: &
dion(nbrx,nbrx,npsx), &! D_{mu,nu} parameters (in the
! atomic case)
betar(0:ndm,nbrx,npsx), &! radial beta_{mu} functions
betar(ndmx,nbrx,npsx), &! radial beta_{mu} functions
qqq(nbrx,nbrx,npsx), &! q_{mu,nu} parameters (in the
! atomic case)
qfunc(0:ndm,nbrx,nbrx,npsx), &! Q_{mu,nu}(|r|) function for
qfunc(ndmx,nbrx,nbrx,npsx), &! Q_{mu,nu}(|r|) function for
! |r|> r_L
qfcoef(nqfx,lqmax,nbrx,nbrx,npsx), &! coefficients for Q in region
! |r|<r_L

View File

@ -13,7 +13,7 @@ PROGRAM pwscf
! ... Plane Wave Self-Consistent Field code
!
USE io_global, ONLY : stdout
USE parameters, ONLY : ntypx, npk, lmaxx, nchix, ndm, nqfx, nbrx
USE parameters, ONLY : ntypx, npk, lmaxx, nchix, ndmx, nqfx, nbrx
USE global_version, ONLY : version_number
USE wvfct, ONLY : gamma_only
USE noncollin_module, ONLY : noncolin
@ -45,7 +45,7 @@ PROGRAM pwscf
FMT = '(/5X,"Ultrasoft (Vanderbilt) Pseudopotentials")')
!
WRITE( unit = stdout, FMT = 9010 ) &
ntypx, npk, lmaxx, nchix, ndm, nbrx, nqfx
ntypx, npk, lmaxx, nchix, ndmx, nbrx, nqfx
!
END IF
!
@ -117,6 +117,6 @@ PROGRAM pwscf
!
9010 FORMAT( /5X,'Current dimensions of program pwscf are:' &
/5X,'ntypx =',I2,' npk =',I5,' lmax =',I2 &
/5X,'nchix =',I2,' ndim =',I5,' nbrx =',I2,' nqfx =',I2 )
/5X,'nchix =',I2,' ndmx =',I5,' nbrx =',I2,' nqfx =',I2 )
!
END PROGRAM pwscf

View File

@ -11,7 +11,7 @@ subroutine read_ncpp (np, iunps)
!-----------------------------------------------------------------------
!
USE kinds, only: dp
USE parameters, ONLY: nchix, lmaxx, ndm
USE parameters, ONLY: nchix, lmaxx, ndmx
use atom, only: zmesh, mesh, xmin, dx, r, rab, vnl, chi, oc, nchi, &
lchi, rho_at, rho_atc, numeric
use char, only: psd
@ -64,7 +64,7 @@ subroutine read_ncpp (np, iunps)
endif
read (iunps, *, err=300, iostat=ios) zmesh(np), xmin(np), dx(np), &
mesh(np), nchi(np)
if (mesh(np).gt.ndm .or. mesh(np).le.0) &
if (mesh(np) > ndmx .or. mesh(np) <= 0) &
call errore ('read_ncpp', 'mesh too big', np)
if ( nchi(np).gt.nchix .or. &
(nchi(np).lt.lmax(np) .and. lloc(np).eq.lmax(np)) .or. &

View File

@ -15,7 +15,7 @@ subroutine readnewvan (is, iunps)
! It is compatible only with the ld1 atomic code
!
USE kinds, only: dp
USE parameters, ONLY: nchix, lmaxx, nbrx, ndm, npsx, lqmax
USE parameters, ONLY: nchix, lmaxx, nbrx, ndmx, npsx, lqmax
use constants, only: fpi
use atom, only: zmesh, mesh, xmin, dx, r, rab, vnl, chi, oc, nchi, &
lchi, rho_at, rho_atc
@ -78,7 +78,7 @@ subroutine readnewvan (is, iunps)
rdum, zmesh (is) , dx (is) , mesh (is)
if (mesh (is) .gt.ndm) call errore ('readnewvan', 'mesh is too big', 1)
if (mesh (is) > ndmx) call errore ('readnewvan', 'mesh is too big', 1)
read (iunps, '(2i5)', err = 100, iostat = ios) nwfs, nbeta (is)
if (nbeta (is) .gt.nbrx) call errore ('readnewvan', 'nbeta is too large', 1)

View File

@ -18,7 +18,7 @@ subroutine readvan (is, iunps)
! It assume multiple rinner values.
!
USE kinds, only: dp
USE parameters, ONLY: nchix, lmaxx, nbrx, ndm, npsx, nqfx, lqmax
USE parameters, ONLY: nchix, lmaxx, nbrx, ndmx, npsx, nqfx, lqmax
use atom, only: zmesh, mesh,dx, r, rab, vnl, chi, oc, nchi, lchi, &
rho_at, rho_atc
use char, only: psd
@ -42,7 +42,7 @@ subroutine readvan (is, iunps)
!
real(kind=DP) :: exfact, etotpseu, wwnl (nchix), ee (nchix), eloc, &
dummy, rc (lmaxx + 1), eee (nbrx), ddd (nbrx, nbrx), rcloc, ru (0:ndm)
dummy, rc (lmaxx + 1), eee (nbrx), ddd (nbrx, nbrx), rcloc, ru(ndmx)
! index of the exchange and correlation use
! total pseudopotential energy
! the occupation of the valence states
@ -112,7 +112,7 @@ subroutine readvan (is, iunps)
if (nchi (is) .gt.nchix) call errore ('readvan', 'nchi> nchix', &
nchi (is) )
if (nchi (is) .lt.0) call errore ('readvan', 'wrong nchi ', is)
if (mesh (is) .gt.ndm.or.mesh (is) .lt.0) call errore ('readvan', &
if (mesh (is) > ndmx .or. mesh (is) <= 0) call errore ('readvan', &
'wrong mesh', is)
if (zp (is) .le.0.d0) call errore ('readvan', 'wrong zp', is)
!

View File

@ -492,7 +492,7 @@ subroutine readfile_new( what, ndr, et_g, wg_g, kunit, nsizwfc, iunitwfc, ierr )
! programs.
!
!
USE parameters, only: npk, nchix, ndm, nbrx, lqmax, nqfx
USE parameters, only: npk, nchix, ndmx, nbrx, lqmax, nqfx
USE constants, ONLY: pi
USE io_files, ONLY : iunwfc, nwordwfc, prefix, tmp_dir
USE kinds, ONLY: DP
@ -814,11 +814,11 @@ subroutine readfile_new( what, ndr, et_g, wg_g, kunit, nsizwfc, iunitwfc, ierr )
if( tupf ) then
ALLOCATE( upf%els( nchix ), upf%lchi( nchix ), upf%oc( nchix ), &
upf%r( 0:ndm ), upf%rab( 0:ndm ), upf%rho_atc( 0:ndm ), upf%vloc( 0:ndm ), &
upf%lll( 1:nbrx ), upf%kkbeta( 1:nbrx ), upf%beta( 0:ndm, 1:nbrx ), &
upf%r( ndmx ), upf%rab( ndmx ), upf%rho_atc( ndmx ), upf%vloc( ndmx ), &
upf%lll( 1:nbrx ), upf%kkbeta( 1:nbrx ), upf%beta( ndmx, 1:nbrx ), &
upf%dion( 1:nbrx, 1:nbrx ), upf%rinner( 1:lqmax ), upf%qqq( 1:nbrx, 1:nbrx ), &
upf%qfunc( 0:ndm, 1:nbrx, 1:nbrx ), upf%qfcoef( 1:nqfx, 1:lqmax, 1:nbrx, 1:nbrx ), &
upf%chi( 0:ndm, nchix ), upf%rho_at( 0:ndm ) )
upf%qfunc( ndmx, 1:nbrx, 1:nbrx ), upf%qfcoef( 1:nqfx, 1:lqmax, 1:nbrx, 1:nbrx ), &
upf%chi( ndmx, nchix ), upf%rho_at( ndmx ) )
CALL read_restart_pseudo( ndr, &
upf%generated, upf%date_author, upf%comment, upf%psd, upf%typ, upf%tvanp, &

View File

@ -47,10 +47,10 @@ implicit none
complex(kind=DP), allocatable :: wadd(:,:)
allocate( x1(0:ndm) )
allocate( x2(0:ndm) )
allocate( x3(0:ndm) )
allocate( x4(0:ndm) )
allocate( x1(0:ndmx) )
allocate( x2(0:ndmx) )
allocate( x3(0:ndmx) )
allocate( x4(0:ndmx) )
allocate( fx1( nz1 ) )
allocate( fx2( nz1 ) )
allocate( fx3( nz1 ) )