More cleanup; update on what is left to do

This commit is contained in:
Paolo Giannozzi 2021-02-26 14:44:58 +00:00
parent 8cec26b2d9
commit e69ebf31e8
6 changed files with 17 additions and 22 deletions

View File

@ -77,7 +77,8 @@ MODULE cp_restart_new
USE mp, ONLY : mp_sum, mp_barrier
USE fft_base, ONLY : dfftp, dffts, dfftb
USE fft_rho, ONLY : rho_r2g
USE upf_ions, ONLY : n_atom_wfc, upf
USE upf_ions, ONLY : n_atom_wfc
USE uspp_param, ONLY : upf
USE london_module, ONLY : scal6, lon_rcut, in_c6
USE tsvdw_module, ONLY : vdw_isolated, vdw_econv_thr
USE wrappers, ONLY : f_copy

View File

@ -11,7 +11,7 @@
USE kinds, ONLY : DP
USE parameters, ONLY : ntypx
USE upf_ions, ONLY : nsp
USE uspp_param, ONLY : nsp
!
IMPLICIT NONE
SAVE

View File

@ -157,7 +157,7 @@ io_files.o : kind.o
io_files.o : mp_images.o
io_files.o : parameters.o
io_files.o : wrappers.o
ions_base.o : ../upflib/upf_ions.o
ions_base.o : ../upflib/uspp.o
ions_base.o : cell_base.o
ions_base.o : constants.o
ions_base.o : io_global.o

View File

@ -67,7 +67,8 @@ SUBROUTINE setup()
lbands, use_para_diag, gamma_only, &
restart, use_gpu
USE cellmd, ONLY : calc
USE upf_ions, ONLY : upf, n_atom_wfc
USE upf_ions, ONLY : n_atom_wfc
USE uspp_param, ONLY : upf
USE uspp, ONLY : okvan
USE ldaU, ONLY : lda_plus_u, init_lda_plus_u
USE bp, ONLY : gdir, lberry, nppstr, lelfield, lorbm, nx_el,&

View File

@ -15,20 +15,13 @@
- constants => upf_const
* TO BE DONE:
- ions_base points to upf_ions for variables na(npsx), nax, nat, ityp, nsp.
The latter points to uspp for nsp and to upf_params for npsx (this is
similar to but not exactly the same as variables ntypx in ions_base)
These variables are however used in a very few places inside upflib:
init_at_1.f90: USE upf_ions, ONLY : ntyp => nsp
init_us_1.f90: USE upf_ions, ONLY : ntyp => nsp, ityp, nat
init_us_1.f90: USE upf_ions, ONLY : ntyp => nsp
init_us_2_base.f90: USE upf_ions, ONLY : nat, ntyp => nsp, ityp
init_us_2_base_gpu.f90: USE upf_ions, ONLY : nat, ntyp => nsp, ityp
while na, nax are never used
- first step: pass ntyp, nat, ityp as arguments, remove reference to upf_ions
DONE
- second step: nsp becomes an internal variable, not to be exported
- finally, upf_ions can be deleted and its variables moved back to ions_base
- ions_base points to uspp_param for variable nsp: is this desirable?
There are two variables, ntyp (number of types of atoms) and nsp
(number of types of pseudopotentials), that are not exactly the same
but they are in practice. Same for ntypx/nspx. Should we always pass
ntyp/nsp as argument, or always use the value in the module, or what?
Now there is a mixture of the two cases.
- upf_ions now contains just a function n_atom_wfc: move somewhere else?
- upf_spinorb contains just two variables: merge into uspp?
* upflib restructuring:

View File

@ -8,11 +8,9 @@
!
MODULE upf_ions
!
USE uspp_param, ONLY : nsp, upf
IMPLICIT NONE
SAVE
! nsp = number of species
!
PRIVATE
PUBLIC :: n_atom_wfc
CONTAINS
!
@ -22,6 +20,8 @@ CONTAINS
!
! ... Find number of starting atomic orbitals
!
USE uspp_param, ONLY : upf
!
IMPLICIT NONE
!
INTEGER, INTENT(IN) :: nat, ityp(nat)