Merge branch 'devel-upflib' into 'develop'

Alignment to upflib

See merge request QEF/q-e!1365
This commit is contained in:
giannozz 2021-03-29 19:56:10 +00:00
commit 083a81a3da
29 changed files with 110 additions and 148 deletions

View File

@ -90,7 +90,7 @@
use kinds, only: dp
use electrons_base, only: nudx, nspin, nupdwn, iupdwn, nx => nbspx, n => nbsp
use uspp_param, only: nh, upf
use uspp, only :nkb, nkbus, qq_nt, indv_ijkb0
use uspp, only : nkb, qq_nt, indv_ijkb0
use gvecw, only: ngw
use ions_base, only: nat, ityp
USE cp_main_variables, ONLY: idesc
@ -338,7 +338,7 @@ subroutine pc2(a,beca,b,becb)
use mp, only: mp_sum, mp_bcast
use electrons_base, only: n => nbsp, ispin
use uspp_param, only: nh, upf
use uspp, only :nkb,qq_nt,nkbus, indv_ijkb0
use uspp, only :nkb,qq_nt, indv_ijkb0
use io_global, ONLY: ionode, ionode_id
implicit none

View File

@ -36,7 +36,7 @@ subroutine dforceb(c0, i, betae, ipol, bec0, ctabin, gqq, gqqm, qmat, dq2, df)
use ions_base, only : nat, nax, nsp, ityp
use cell_base, only: at, alat
use uspp_param, only: nh, nhm, upf
use uspp, only : nkb, nkbus, indv_ijkb0
use uspp, only : nkb, indv_ijkb0
use efield_module, ONLY : ctabin_missing_1,ctabin_missing_2,n_g_missing_m,&
& ctabin_missing_rev_1,ctabin_missing_rev_2
use mp_global, only: intra_bgrp_comm, nproc_bgrp

View File

@ -11,8 +11,6 @@ SUBROUTINE gram_bgrp( betae, bec_bgrp, nkbx, cp_bgrp, ngwx )
!-----------------------------------------------------------------------
! gram-schmidt orthogonalization of the set of wavefunctions cp
!
USE uspp, ONLY : nkb, nkbus
USE uspp, ONLY : qq_nt
USE gvecw, ONLY : ngw
USE electrons_base, ONLY : nbspx_bgrp, ibgrp_g2l, nupdwn, iupdwn, nbspx, iupdwn_bgrp, nspin
USE kinds, ONLY : DP
@ -153,7 +151,7 @@ CONTAINS
! on output: bec(i) is recalculated
!
USE ions_base, ONLY: na, nat, ityp
USE uspp, ONLY: nkb, nkbus, qq_nt, indv_ijkb0
USE uspp, ONLY: qq_nt, indv_ijkb0
USE uspp_param, ONLY: nh, upf
USE electrons_base, ONLY: ispin, ispin_bgrp, nbspx_bgrp, ibgrp_g2l, iupdwn, nupdwn, nbspx
USE gvecw, ONLY: ngw

View File

@ -62,9 +62,9 @@
use uspp_param, only: upf, &!
lmaxkb, &!
nhm, &!
nbetam, &!
nh, &!
lmaxq !
lmaxq, &!
init_uspp_dims
use uspp, only: nhtol, &!
nhtolm, &!
indv, &!
@ -75,30 +75,23 @@
!
INTEGER :: is, iv, ind, il, lm, ih, jh, ijv, ijkb0, ia
!
! find number of beta functions per species and max l
! ------------------------------------------------------------------
! find number of beta functions per species, max dimensions,
! total number of beta functions (all and Vanderbilt only)
CALL init_uspp_dims ()
!
! find total number of beta functions (all and Vanderbilt only)
! ------------------------------------------------------------------
lmaxkb = -1
nkb = 0
nkbus = 0
!
do is = 1, nsp
ind = 0
do iv = 1, upf(is)%nbeta
lmaxkb = max( lmaxkb, upf(is)%lll( iv ) )
ind = ind + 2 * upf(is)%lll( iv ) + 1
end do
nh(is) = ind
! next variable no longer used or existing
! ish(is)=nkb
nkb = nkb + na(is) * nh(is)
if( upf(is)%tvanp ) nkbus = nkbus + na(is) * nh(is)
end do
nhm = MAXVAL( nh(1:nsp) )
nbetam = MAXVAL( upf(1:nsp)%nbeta )
if (lmaxkb > lmaxx) call errore(' pseudopotential_indexes ',' l > lmax ',lmaxkb)
lmaxq = 2*lmaxkb + 1
!
! the following prevents an out-of-bound error: nqlc(is)=2*lmax+1
! but in some versions of the PP files lmax is not set to the maximum

View File

@ -24,7 +24,7 @@ SUBROUTINE atomic_wfc_nc_proj (ik, wfcatom)
USE gvect, ONLY : mill, eigts1, eigts2, eigts3, g
USE klist, ONLY : xk, ngk, igk_k
USE wvfct, ONLY : npwx, nbnd
USE uspp_param, ONLY : upf
USE uspp_param, ONLY : upf, nwfcm
USE noncollin_module, ONLY : noncolin, npol, angle1, angle2
USE spin_orb, ONLY : lspinorb, rot_ylm, fcoef, lmaxx
!
@ -33,8 +33,7 @@ SUBROUTINE atomic_wfc_nc_proj (ik, wfcatom)
INTEGER, INTENT(in) :: ik
COMPLEX(DP), INTENT(out) :: wfcatom (npwx, npol, natomwfc)
!
INTEGER :: n_starting_wfc, lmax_wfc, nt, l, nb, na, m, lm, ig, iig, &
nwfcm, npw
INTEGER :: n_starting_wfc, lmax_wfc, nt, l, nb, na, m, lm, ig, iig, npw
real(DP), ALLOCATABLE :: qg(:), ylm (:,:), chiq (:,:,:), gk (:,:)
COMPLEX(DP), ALLOCATABLE :: sk (:), aux(:)
COMPLEX(DP) :: kphase, lphase
@ -48,7 +47,6 @@ SUBROUTINE atomic_wfc_nc_proj (ik, wfcatom)
lmax_wfc = max ( lmax_wfc, maxval (upf(nt)%lchi(1:upf(nt)%nwfc) ) )
ENDDO
!
nwfcm = maxval ( upf(1:ntyp)%nwfc )
npw = ngk(ik)
!
ALLOCATE ( ylm (npw,(lmax_wfc+1)**2), chiq(npw,nwfcm,ntyp), &

View File

@ -13,8 +13,7 @@ SUBROUTINE allocate_nlpot
!! pseudopotential for each atom or atomic species.
!
!! Requires in input:
!! * dimensions: nhm, nsp, nat, lmaxkb, nbetam, nspin
!! * pseudopot info: upf%nwfc
!! * dimensions: nhm, nsp, nat, lmaxkb, nbetam, nwfcm, nspin
!! * parameters: ecutrho, qnorm, dq, ecutwfc, cell_factor
!! * options: tqr, noncolin, lspinorb, spline_ps
!
@ -33,11 +32,9 @@ SUBROUTINE allocate_nlpot
USE gvecw, ONLY : ecutwfc
USE uspp_data, ONLY : dq, nqx, nqxq, spline_ps, allocate_uspp_data
USE uspp, ONLY : allocate_uspp
USE uspp_param, ONLY : upf, lmaxq, lmaxkb, nh, nhm, nsp, nbetam
USE uspp_param, ONLY : upf, lmaxq, lmaxkb, nh, nhm, nsp, nbetam, nwfcm
IMPLICIT NONE
!
INTEGER :: nwfcm
!
! Note: computation of the number of beta functions for
! each atomic type and the maximum number of beta functions
! and the number of beta functions of the solid has been
@ -53,13 +50,11 @@ SUBROUTINE allocate_nlpot
! allocate an array that includes q+G vectors up to |q+G|_max <= |Gmax|+|q|
!
nqxq = INT( ( (SQRT(ecutrho) + qnorm) / dq + 4) * cell_factor )
lmaxq = 2*lmaxkb+1
!
! Calculate dimensions for array tab (including a possible factor
! coming from cell contraction during variable cell relaxation/MD)
!
nqx = INT( (SQRT(ecutwfc) / dq + 4) * cell_factor )
nwfcm = MAXVAL( upf(1:nsp)%nwfc )
!
! uspp_data actual allocation
!

View File

@ -20,7 +20,7 @@ SUBROUTINE atomic_wfc( ik, wfcatom )
USE gvect, ONLY : mill, eigts1, eigts2, eigts3, g
USE klist, ONLY : xk, igk_k, ngk
USE wvfct, ONLY : npwx
USE uspp_param, ONLY : upf
USE uspp_param, ONLY : upf, nwfcm
USE noncollin_module, ONLY : noncolin, npol, angle1, angle2
USE spin_orb, ONLY : lspinorb, rot_ylm, fcoef, lmaxx, domag, &
starting_spin_angle
@ -34,7 +34,7 @@ SUBROUTINE atomic_wfc( ik, wfcatom )
! ... local variables
!
INTEGER :: n_starting_wfc, lmax_wfc, nt, l, nb, na, m, lm, ig, iig, &
i0, i1, i2, i3, nwfcm, npw
i0, i1, i2, i3, npw
REAL(DP), ALLOCATABLE :: qg(:), ylm (:,:), chiq (:,:,:), gk (:,:)
COMPLEX(DP), ALLOCATABLE :: sk (:), aux(:)
COMPLEX(DP) :: kphase, lphase
@ -48,7 +48,6 @@ SUBROUTINE atomic_wfc( ik, wfcatom )
lmax_wfc = MAX( lmax_wfc, MAXVAL( upf(nt)%lchi(1:upf(nt)%nwfc) ) )
END DO
!
nwfcm = MAXVAL( upf(1:ntyp)%nwfc )
npw = ngk(ik)
!
ALLOCATE( ylm (npw,(lmax_wfc+1)**2), chiq(npw,nwfcm,ntyp), &

View File

@ -21,7 +21,7 @@ SUBROUTINE atomic_wfc_gpu( ik, wfcatom_d )
USE gvect_gpum, ONLY : mill_d, eigts1_d, eigts2_d, eigts3_d, g_d
USE klist, ONLY : xk, ngk, igk_k_d !, igk_k
USE wvfct, ONLY : npwx
USE uspp_param, ONLY : upf
USE uspp_param, ONLY : upf, nwfcm
USE noncollin_module, ONLY : noncolin, npol, angle1, angle2
USE spin_orb, ONLY : lspinorb, rot_ylm, fcoef, lmaxx, domag, &
starting_spin_angle
@ -36,7 +36,7 @@ SUBROUTINE atomic_wfc_gpu( ik, wfcatom_d )
! ... local variables
!
INTEGER :: n_starting_wfc, lmax_wfc, nt, l, nb, na, m, lm, ig, iig, &
i0, i1, i2, i3, nwfcm, npw
i0, i1, i2, i3, npw
COMPLEX(DP) :: kphase, lphase
REAL(DP) :: arg, px, ux, vx, wx
INTEGER :: mil1, mil2, mil3
@ -58,7 +58,6 @@ SUBROUTINE atomic_wfc_gpu( ik, wfcatom_d )
lmax_wfc = MAX( lmax_wfc, MAXVAL( upf(nt)%lchi(1:upf(nt)%nwfc) ) )
END DO
!
nwfcm = MAXVAL( upf(1:ntyp)%nwfc )
npw = ngk(ik)
!
ALLOCATE( ylm_d(npw,(lmax_wfc+1)**2), gk_d(3,npw), qg_d(npw) )

View File

@ -22,7 +22,7 @@ SUBROUTINE gen_at_dj( ik, dwfcat )
USE klist, ONLY: xk, ngk, igk_k
USE gvect, ONLY: mill, eigts1, eigts2, eigts3, g
USE wvfct, ONLY: npwx
USE uspp_param, ONLY: upf
USE uspp_param, ONLY: upf, nwfcm
USE basis, ONLY: natomwfc
!
IMPLICIT NONE
@ -34,14 +34,13 @@ SUBROUTINE gen_at_dj( ik, dwfcat )
!
! ... local variables
!
INTEGER :: l, na, nt, nb, iatw, iig, ig, m, lm, nwfcm, lmax_wfc, npw
INTEGER :: l, na, nt, nb, iatw, iig, ig, m, lm, lmax_wfc, npw
REAL(DP) :: arg
COMPLEX(DP) :: phase, pref
REAL(DP), ALLOCATABLE :: gk(:,:), q(:), ylm(:,:), djl(:,:,:)
COMPLEX(DP), ALLOCATABLE :: sk(:)
!
npw = ngk(ik)
nwfcm = MAXVAL( upf(1:ntyp)%nwfc )
! calculate max angular momentum required in wavefunctions
lmax_wfc = 0
do nt = 1, ntyp

View File

@ -22,7 +22,7 @@ SUBROUTINE gen_at_dy( ik, u, dwfcat )
USE klist, ONLY: xk, ngk, igk_k
USE gvect, ONLY: mill, eigts1, eigts2, eigts3, g
USE wvfct, ONLY: npwx
USE uspp_param, ONLY: upf
USE uspp_param, ONLY: upf, nwfcm
USE basis, ONLY : natomwfc
!
IMPLICIT NONE
@ -37,7 +37,7 @@ SUBROUTINE gen_at_dy( ik, u, dwfcat )
! ... local variables
!
INTEGER :: ig, na, nt, nb, l, lm, m, iig, ipol, iatw, &
lmax_wfc, nwfcm, npw
lmax_wfc, npw
REAL(DP) :: arg
COMPLEX(DP) :: phase, pref
!
@ -46,7 +46,6 @@ SUBROUTINE gen_at_dy( ik, u, dwfcat )
COMPLEX(DP), ALLOCATABLE :: sk(:)
!
npw = ngk(ik)
nwfcm = MAXVAL( upf(1:ntyp)%nwfc )
! calculate max angular momentum required in wavefunctions
lmax_wfc = 0
do nt = 1, ntyp

View File

@ -173,32 +173,12 @@ SUBROUTINE pre_init()
!----------------------------------------------------------------------------
!
USE ions_base, ONLY : nat, nsp, ityp
USE uspp_param, ONLY : upf, lmaxkb, nh, nhm, nbetam
USE uspp_param, ONLY : upf, nh, init_uspp_dims
USE uspp, ONLY : nkb, nkbus
IMPLICIT NONE
INTEGER :: na, nt, nb
!
! calculate the number of beta functions for each atomic type
!
lmaxkb = - 1
DO nt = 1, nsp
!
nh (nt) = 0
!
! do not add any beta projector if pseudo in 1/r fmt (AF)
IF ( upf(nt)%tcoulombp ) CYCLE
!
DO nb = 1, upf(nt)%nbeta
nh (nt) = nh (nt) + 2 * upf(nt)%lll(nb) + 1
lmaxkb = MAX (lmaxkb, upf(nt)%lll(nb) )
ENDDO
!
ENDDO
!
! calculate the maximum number of beta functions
!
nhm = MAXVAL (nh (1:nsp))
nbetam = MAXVAL (upf(:)%nbeta)
CALL init_uspp_dims ( )
!
! calculate the number of beta functions of the solid
!
@ -209,6 +189,5 @@ SUBROUTINE pre_init()
nkb = nkb + nh (nt)
if (upf(nt)%tvanp) nkbus = nkbus + nh (nt)
enddo
!
END SUBROUTINE pre_init

View File

@ -298,9 +298,9 @@ SUBROUTINE atomic_wfc_nc_updown( ik, wfcatom )
USE gvect, ONLY : mill, eigts1, eigts2, eigts3, g
USE klist, ONLY : xk, ngk, igk_k
USE wvfct, ONLY : npwx, nbnd
USE uspp_param, ONLY : upf
USE uspp_param, ONLY : upf, nwfcm
USE noncollin_module, ONLY : noncolin, npol, angle1, angle2
USE spin_orb, ONLY : lspinorb, rot_ylm, fcoef, lmaxx, domag, &
USE spin_orb, ONLY : lspinorb, rot_ylm, fcoef, domag, &
starting_spin_angle
!
IMPLICIT NONE
@ -312,8 +312,7 @@ SUBROUTINE atomic_wfc_nc_updown( ik, wfcatom )
!
! ... local variables
!
INTEGER :: n_starting_wfc, lmax_wfc, nt, l, nb, na, m, lm, ig, iig, &
nwfcm, npw
INTEGER :: n_starting_wfc, lmax_wfc, nt, l, nb, na, m, lm, ig, iig, npw
REAL(DP), ALLOCATABLE :: qg(:), ylm(:,:), chiq(:,:,:), gk(:,:)
COMPLEX(DP), ALLOCATABLE :: sk(:), aux(:)
COMPLEX(DP) :: kphase
@ -328,7 +327,6 @@ SUBROUTINE atomic_wfc_nc_updown( ik, wfcatom )
lmax_wfc = MAX( lmax_wfc, MAXVAL(upf(nt)%lchi(1:upf(nt)%nwfc)) )
ENDDO
!
nwfcm = MAXVAL( upf(1:ntyp)%nwfc )
npw = ngk(ik)
ALLOCATE ( ylm (npw,(lmax_wfc+1)**2), chiq(npw,nwfcm,ntyp), &
gk(3,npw), qg(npw) )

View File

@ -1141,7 +1141,7 @@ MODULE pw_restart_new
lspinorb, domag, tot_magnetization )
!
bfield = 0.d0
CALL set_spin_vars( lsda, noncolin, lspinorb, domag, &
CALL set_spin_vars( lsda, noncolin, domag, &
npol, nspin, nspin_lsda, nspin_mag, nspin_gga, current_spin )
!! Information for generating k-points and occupations
CALL qexsd_copy_kpoints( output_obj%band_structure, &

View File

@ -462,7 +462,7 @@ MODULE spin_orb
!
!! Variables needed for calculations with spin-orbit
!
USE upf_spinorb, ONLY : lspinorb, rot_ylm, fcoef, lmaxx, lqmax
USE upf_spinorb, ONLY : lspinorb, rot_ylm, fcoef, lmaxx
!
SAVE
LOGICAL :: lforcet

View File

@ -6,13 +6,13 @@
! or http://www.gnu.org/copyleft/gpl.txt .
!
!------------------------------------------------------------------------
SUBROUTINE set_spin_vars( lsda, noncolin, lspinorb, domag, &
SUBROUTINE set_spin_vars( lsda, noncolin, domag, &
npol, nspin, nspin_lsda, nspin_mag, nspin_gga, current_spin )
!------------------------------------------------------------------------
!
! Set various spin-related variables
!
LOGICAL, INTENT(IN) :: lsda, noncolin, lspinorb, domag
LOGICAL, INTENT(IN) :: lsda, noncolin, domag
INTEGER, INTENT(OUT) :: npol, nspin, nspin_lsda, nspin_mag, nspin_gga
INTEGER, INTENT(OUT) :: current_spin
!

View File

@ -218,7 +218,7 @@ SUBROUTINE setup()
!
! Set the different spin indices
!
CALL set_spin_vars( lsda, noncolin, lspinorb, domag, &
CALL set_spin_vars( lsda, noncolin, domag, &
npol, nspin, nspin_lsda, nspin_mag, nspin_gga, current_spin )
!
! time reversal operation is set up to 0 by default

View File

@ -54,14 +54,13 @@ END MODULE geomcell_cond
!
!
MODULE orbcell_cond
USE upf_params, only: npsx
use radial_grids, only: ndmx
USE kinds, only : DP
!
! description of nonlocal orbitals
SAVE
!
INTEGER, PARAMETER :: nbrx = 14
INTEGER, PARAMETER :: nbrx = 14, npsx = 10
!
INTEGER :: &
norbl, & ! number of orbitals for the left lead

View File

@ -23,7 +23,6 @@ cond_restart.o : ../../UtilXlib/mp.o
cond_restart.o : condcom.o
condcom.o : ../../Modules/kind.o
condcom.o : ../../upflib/radial_grids.o
condcom.o : ../../upflib/upf_params.o
condmain.o : ../../Modules/mp_global.o
do_cond.o : ../../Modules/cell_base.o
do_cond.o : ../../Modules/check_stop.o
@ -156,7 +155,6 @@ save_cond.o : ../../Modules/kind.o
save_cond.o : ../../Modules/noncol.o
save_cond.o : ../../PW/src/pwcom.o
save_cond.o : ../../upflib/radial_grids.o
save_cond.o : ../../upflib/upf_params.o
save_cond.o : condcom.o
scat_states_plot.o : ../../FFTXlib/fft_scalar.o
scat_states_plot.o : ../../FFTXlib/scatter_mod.o
@ -180,7 +178,6 @@ scatter_forw.o : ../../Modules/constants.o
scatter_forw.o : ../../Modules/mp_pools.o
scatter_forw.o : ../../Modules/noncol.o
scatter_forw.o : ../../upflib/radial_grids.o
scatter_forw.o : ../../upflib/upf_params.o
scatter_forw.o : condcom.o
summary_band.o : ../../Modules/io_global.o
summary_band.o : ../../Modules/noncol.o

View File

@ -1,4 +1,3 @@
!
! Copyright (C) 2003 A. Smogunov
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
@ -12,7 +11,6 @@ subroutine save_cond (lwrite, lsr, ef, nrz, nocros, noins, &
! so that the punch file from PW calculations is not needed.
!
use kinds, only : DP
USE upf_params, only: npsx
use radial_grids, only: ndmx
USE cell_base, ONLY : alat, tpiba, tpiba2, at, bg
use lsda_mod, only: nspin
@ -21,7 +19,7 @@ subroutine save_cond (lwrite, lsr, ef, nrz, nocros, noins, &
use cond, only : sarea, nrx, nry, norbf, tblml, crosl, taunewl, &
zpseul, zpseul_nc, zl, vppotl, tblms, cross, taunews, zpseus,&
zpseus_nc, zs, vppots, tblmr, crosr, taunewr, zpseur, &
zpseur_nc, zr, vppotr, iofspin, nbrx, save_file
zpseur_nc, zr, vppotr, iofspin, nbrx, npsx, save_file
implicit none

View File

@ -22,7 +22,6 @@ subroutine scatter_forw(nrz, nrzp, z, psiper, zk, norb, tblm, cros, &
! Phi_alpha over beta-functions inside the unit cell.
!
USE constants, ONLY : tpi
USE upf_params, ONLY : npsx
use radial_grids, ONLY : ndmx
USE cell_base, ONLY : tpiba
USE noncollin_module, ONLY : npol

View File

@ -16,12 +16,12 @@ set(src_upflib
read_cpmd.f90
read_fhi.f90
read_ncpp.f90
read_ps.f90
read_upf_new.f90
read_upf_v1.f90
read_uspp.f90
splinelib.f90
simpsn.f90
upf.f90
upf_auxtools.f90
upf_const.f90
upf_error.f90

View File

@ -25,12 +25,12 @@ radial_grids.o \
read_cpmd.o \
read_fhi.o \
read_ncpp.o \
read_ps.o \
read_upf_new.o \
read_upf_v1.o \
read_uspp.o \
splinelib.o \
simpsn.o \
upf.o \
upf_auxtools.o \
upf_const.o \
upf_error.o \

View File

@ -17,11 +17,11 @@
* TO BE DONE:
- set the correct value of nsp in uspp_param when allocate_uspp is called,
use it ONLY inside upflib, remove link of nsp in ions_base to uspp_param
- nh should be dynamically allocated together with upf(:), or at the very
beginning anyway. It seems to me that it belongs to the upf structure,
but it is used in too many places. Then, npsx can be removed.
- pre_init, in PW/src/init_run.f90, should be moved to upflib.
Same for pseudopotential_indexes from CPV/src/pseudopot_sub.f90.
- nh(:) is allocated in init_uspp_dims, but maybe it should allocated
together with upf(:), when upf is read? Or maybe nh should be part of upf?
It is used in many many places, though!
- Merge pseudopotential_indexes from CPV/src/pseudopot_sub.f90 with the
uspp initialization in upflib (init_us_1 etc)
- upf_ions now contains just a function n_atom_wfc: move somewhere else?
- upf_spinorb contains just two variables: merge into uspp?

View File

@ -80,6 +80,15 @@ read_ncpp.o : pseudo_types.o
read_ncpp.o : upf_const.o
read_ncpp.o : upf_kinds.o
read_ncpp.o : upf_params.o
read_ps.o : gth.o
read_ps.o : pseudo_types.o
read_ps.o : read_cpmd.o
read_ps.o : read_fhi.o
read_ps.o : read_upf_new.o
read_ps.o : read_upf_v1.o
read_ps.o : read_uspp.o
read_ps.o : upf_auxtools.o
read_ps.o : upf_to_internal.o
read_upf_new.o : pseudo_types.o
read_upf_new.o : upf_kinds.o
read_upf_new.o : upf_utils.o
@ -95,16 +104,6 @@ read_uspp.o : upf_kinds.o
read_uspp.o : upf_params.o
simpsn.o : upf_kinds.o
splinelib.o : upf_kinds.o
upf.o : gth.o
upf.o : pseudo_types.o
upf.o : read_cpmd.o
upf.o : read_fhi.o
upf.o : read_upf_new.o
upf.o : read_upf_v1.o
upf.o : read_uspp.o
upf.o : upf_auxtools.o
upf.o : upf_kinds.o
upf.o : upf_to_internal.o
upf_auxtools.o : pseudo_types.o
upf_auxtools.o : upf_const.o
upf_auxtools.o : upf_io.o
@ -120,7 +119,6 @@ upf_to_internal.o : radial_grids.o
upf_to_internal.o : upf_kinds.o
upfconv.o : casino_pp.o
upfconv.o : pseudo_types.o
upfconv.o : upf.o
upfconv.o : upf_const.o
upfconv.o : upf_utils.o
upfconv.o : write_upf_new.o
@ -133,7 +131,6 @@ uspp.o : upf_spinorb.o
uspp_data.o : upf_kinds.o
virtual_v2.o : pseudo_types.o
virtual_v2.o : splinelib.o
virtual_v2.o : upf.o
virtual_v2.o : upf_io.o
virtual_v2.o : upf_kinds.o
virtual_v2.o : upf_utils.o

View File

@ -1,31 +1,14 @@
! Copyright (C) 2008 Quantum ESPRESSO group
!
! Copyright (C) 2008-2021 Quantum ESPRESSO group
! 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 upf_module
!=----------------------------------------------------------------------------=!
!! author: Unknown
!! this module handles reading of unified pseudopotential format (UPF)
!! in either v1 or v2 or schema format.
!! @Note
!! 14/11/17 Pietro Delugas: new revision passed from iotk to FoX lib,
!! added support for new schema format
!
USE upf_kinds, ONLY: DP
!
IMPLICIT NONE
PRIVATE
PUBLIC :: read_ps
!
CONTAINS
!
SUBROUTINE read_ps ( filein, upf_in )
!
! stripped-down version of readpp in Modules/read_pseudo.f90:
! for serial execution only
! stripped-down version of readpp in Modules/read_pseudo.f90
! for serial execution only and for usage in conversion codes
!
USE read_upf_v1_module, ONLY: read_upf_v1
USE read_upf_new_module,ONLY: read_upf_new
@ -128,7 +111,3 @@ SUBROUTINE read_ps ( filein, upf_in )
!
RETURN
END SUBROUTINE read_ps
!=----------------------------------------------------------------------------=!
END MODULE upf_module
!=----------------------------------------------------------------------------=!

View File

@ -12,7 +12,6 @@ MODULE upf_params
SAVE
INTEGER, PARAMETER :: &
npsx = 10, &! max number of different PPs
lmaxx = 3, &! max non local angular momentum (l=0 to lmaxx)
lqmax= 2*lmaxx+1 ! max number of angular momenta of Q

View File

@ -27,7 +27,6 @@ PROGRAM upfconv
!
USE pseudo_types, ONLY : pseudo_upf, deallocate_pseudo_upf
USE casino_pp, ONLY : conv_upf2casino, write_casino_tab
USE upf_module, ONLY : read_ps
USE write_upf_new,ONLY : write_upf
!
IMPLICIT NONE

View File

@ -1,5 +1,5 @@
!
! Copyright (C) 2004-2011 Quantum ESPRESSO group
! Copyright (C) 2004-2021 Quantum ESPRESSO group
! 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,
@ -10,26 +10,65 @@ MODULE uspp_param
! ... Ultrasoft and Norm-Conserving pseudopotential parameters
!
USE pseudo_types, ONLY : pseudo_upf
USE upf_params, ONLY : npsx
IMPLICIT NONE
SAVE
!
INTEGER :: nsp = 0
TYPE (pseudo_upf), ALLOCATABLE, TARGET :: upf(:)
!! the upf structure contains all info on atomic pseudopotential parameters
INTEGER, ALLOCATABLE :: nh(:)
!! number of beta functions, with angular parts, per atomic type
INTEGER :: nhm
!! max number of beta functions, including angular parts, across atoms
INTEGER :: nbetam
!! max number of radial beta functions
INTEGER :: nwfcm
!! max number of radial atomic wavefunctions across atoms
INTEGER :: lmaxkb
!! max angular momentum of beta functions
INTEGER :: lmaxq
!! max angular momentum + 1 for Q functions
!
CONTAINS
!
SUBROUTINE init_uspp_dims ()
!
!! calculates the number of beta functions for each atomic type
!
IMPLICIT NONE
!
INTEGER :: nt, nb
!
! Check is needed, may be called more than once (but it shouldn't be!)
! Maybe nh should be allocated when upf is, when upf is read ?
!
IF ( .NOT. ALLOCATED(nh) ) ALLOCATE ( nh(nsp) )
!
lmaxkb = - 1
DO nt = 1, nsp
!
nh (nt) = 0
!
! do not add any beta projector if pseudo in 1/r fmt (AF)
!
IF ( upf(nt)%tcoulombp ) CYCLE
!
DO nb = 1, upf(nt)%nbeta
nh (nt) = nh (nt) + 2 * upf(nt)%lll(nb) + 1
lmaxkb = MAX (lmaxkb, upf(nt)%lll(nb) )
ENDDO
!
ENDDO
lmaxq = 2*lmaxkb+1
!
! calculate max numbers of beta functions and of atomic wavefunctions
!
nhm = MAXVAL (nh (1:nsp))
nbetam = MAXVAL (upf(1:nsp)%nbeta)
nwfcm = MAXVAL (upf(1:nsp)%nwfc)
!
END SUBROUTINE init_uspp_dims
!
INTEGER :: &
nh(npsx), &! number of beta functions per atomic type
nhm, &! max number of different beta functions per atom
nbetam ! max number of beta functions
INTEGER :: &
lmaxkb, &! max angular momentum
lmaxq ! max angular momentum + 1 for Q functions
! INTEGER :: &
! nvb, &! number of species with Vanderbilt PPs (CPV)
! ish(npsx) ! for each specie the index of the first beta
! ! function: ish(1)=1, ish(i)=1+SUM(nh(1:i-1))
! the two variables above are no longer used in CP
END MODULE uspp_param
!
!

View File

@ -28,7 +28,6 @@ PROGRAM virtual_test
USE upf_kinds, ONLY: dp
USE pseudo_types, ONLY : pseudo_upf, deallocate_pseudo_upf
USE upf_module, ONLY : read_ps
USE write_upf_new, ONLY : write_upf
USE upf_io, ONLY : stdin, stdout
!