mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 22:25:32 -04:00
Atom code: read and process UPF files (norm-conserving, local and
semi-local pseudos only) and ECP potentials. svn-origin-rev: 16617
This commit is contained in:
parent
b783c36dbb
commit
5f09bbb297
17 changed files with 11255 additions and 52 deletions
5979
data/ECP_POTENTIALS
Normal file
5979
data/ECP_POTENTIALS
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -15,8 +15,9 @@ MODULE atom_electronic_structure
|
|||
atom_print_state,&
|
||||
atom_print_zmp_iteration
|
||||
USE atom_types, ONLY: &
|
||||
GTH_PSEUDO, NO_PSEUDO, atom_type, create_opgrid, create_opmat, &
|
||||
opgrid_type, opmat_type, release_opgrid, release_opmat, set_atom
|
||||
atom_type, create_opgrid, create_opmat, ecp_pseudo, gth_pseudo, &
|
||||
no_pseudo, opgrid_type, opmat_type, release_opgrid, release_opmat, &
|
||||
set_atom, upf_pseudo
|
||||
USE atom_utils, ONLY: &
|
||||
atom_denmat, atom_density, atom_read_external_density, &
|
||||
atom_read_external_vxc, atom_read_zmp_restart, atom_solve, atom_trace, &
|
||||
|
|
@ -200,7 +201,7 @@ CONTAINS
|
|||
CASE (do_dkh0_atom, do_dkh1_atom,do_dkh2_atom,do_dkh3_atom,do_dkh4_atom,do_dkh5_atom)
|
||||
hcore%op = atom%integrals%hdkh
|
||||
END SELECT
|
||||
CASE (GTH_PSEUDO)
|
||||
CASE (gth_pseudo, upf_pseudo, ecp_pseudo)
|
||||
hcore%op = atom%integrals%kin + atom%integrals%core + atom%integrals%hnl
|
||||
END SELECT
|
||||
! add confinement potential (not included in relativistic transformations)
|
||||
|
|
@ -261,10 +262,10 @@ CONTAINS
|
|||
SELECT CASE (atom%potential%ppot_type)
|
||||
CASE DEFAULT
|
||||
CPABORT("")
|
||||
CASE (NO_PSEUDO)
|
||||
CASE (no_pseudo)
|
||||
atom%energy%eploc = 0._dp
|
||||
atom%energy%epnl = 0._dp
|
||||
CASE (GTH_PSEUDO)
|
||||
CASE (gth_pseudo, upf_pseudo, ecp_pseudo)
|
||||
atom%energy%eploc = atom_trace(atom%integrals%core,atom%orbitals%pmat)
|
||||
atom%energy%epnl = atom_trace(atom%integrals%hnl,atom%orbitals%pmat)
|
||||
END SELECT
|
||||
|
|
@ -512,7 +513,7 @@ CONTAINS
|
|||
SELECT CASE (atom%potential%ppot_type)
|
||||
CASE DEFAULT
|
||||
CPABORT("")
|
||||
CASE (NO_PSEUDO)
|
||||
CASE (no_pseudo)
|
||||
SELECT CASE (reltyp)
|
||||
CASE DEFAULT
|
||||
CPABORT("")
|
||||
|
|
@ -523,12 +524,14 @@ CONTAINS
|
|||
CASE (do_dkh0_atom, do_dkh1_atom,do_dkh2_atom,do_dkh3_atom,do_dkh4_atom,do_dkh5_atom)
|
||||
hcore%op = atom%integrals%hdkh
|
||||
END SELECT
|
||||
CASE (GTH_PSEUDO)
|
||||
CASE (gth_pseudo)
|
||||
hcore%op = atom%integrals%kin + atom%integrals%core + atom%integrals%hnl
|
||||
IF(atom%potential%gth_pot%lsdpot) THEN
|
||||
lsdpot=.TRUE.
|
||||
hlsd%op = atom%integrals%clsd
|
||||
END IF
|
||||
CASE (upf_pseudo, ecp_pseudo)
|
||||
hcore%op = atom%integrals%kin + atom%integrals%core + atom%integrals%hnl
|
||||
END SELECT
|
||||
! add confinement potential (not included in relativistic transformations)
|
||||
IF ( atom%potential%confinement ) THEN
|
||||
|
|
@ -602,10 +605,10 @@ CONTAINS
|
|||
SELECT CASE (atom%potential%ppot_type)
|
||||
CASE DEFAULT
|
||||
CPABORT("")
|
||||
CASE (NO_PSEUDO)
|
||||
CASE (no_pseudo)
|
||||
atom%energy%eploc = 0._dp
|
||||
atom%energy%epnl = 0._dp
|
||||
CASE (GTH_PSEUDO)
|
||||
CASE (gth_pseudo, upf_pseudo, ecp_pseudo)
|
||||
atom%energy%eploc = atom_trace(atom%integrals%core,atom%orbitals%pmat)
|
||||
atom%energy%epnl = atom_trace(atom%integrals%hnl,atom%orbitals%pmat)
|
||||
END SELECT
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ MODULE atom_energy
|
|||
atom_print_potential,&
|
||||
atom_write_pseudo_param
|
||||
USE atom_types, ONLY: &
|
||||
GTH_PSEUDO, atom_basis_type, atom_gthpot_type, atom_integrals, &
|
||||
atom_basis_type, atom_gthpot_type, atom_integrals, &
|
||||
atom_optimization_type, atom_orbitals, atom_p_type, &
|
||||
atom_potential_type, atom_state, atom_type, create_atom_orbs, &
|
||||
create_atom_type, init_atom_basis, init_atom_potential, &
|
||||
create_atom_type, gth_pseudo, init_atom_basis, init_atom_potential, &
|
||||
read_atom_opt_section, release_atom_basis, release_atom_potential, &
|
||||
release_atom_type, set_atom
|
||||
USE atom_utils, ONLY: &
|
||||
|
|
@ -426,7 +426,7 @@ CONTAINS
|
|||
CALL cp_print_key_finished_output(iw,logger,atom_section,"PRINT%RESPONSE_BASIS")
|
||||
|
||||
! generate a UPF file
|
||||
iw = cp_print_key_unit_nr(logger,atom_section,"PRINT%UPF_FILE",extension=".upf",&
|
||||
iw = cp_print_key_unit_nr(logger,atom_section,"PRINT%UPF_FILE",extension=".upf",&
|
||||
file_position="REWIND")
|
||||
IF (iw>0) THEN
|
||||
CALL atom_write_upf(atom_info(in,im)%atom,iw)
|
||||
|
|
@ -596,6 +596,7 @@ CONTAINS
|
|||
WRITE(iw,'(" ",79("*"))')
|
||||
|
||||
END SUBROUTINE atom_response_basis
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param atom ...
|
||||
|
|
@ -621,7 +622,7 @@ CONTAINS
|
|||
TYPE(atom_gthpot_type), POINTER :: pot
|
||||
|
||||
IF(.NOT.atom%pp_calc) RETURN
|
||||
IF(atom%potential%ppot_type /= GTH_PSEUDO) RETURN
|
||||
IF(atom%potential%ppot_type /= gth_pseudo) RETURN
|
||||
pot => atom%potential%gth_pot
|
||||
CPASSERT(.NOT.pot%lsdpot)
|
||||
|
||||
|
|
@ -896,7 +897,6 @@ CONTAINS
|
|||
WRITE(string,"(A,A2,A,A1)") TRIM(ADJUSTL(tag)),'="',TRIM(ADJUSTL(str)),'"'
|
||||
END IF
|
||||
END IF
|
||||
|
||||
END SUBROUTINE compose
|
||||
! *****************************************************************************
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,10 @@ MODULE atom_operators
|
|||
sg_kinnuc, sg_nuclear, sg_overlap, sg_proj_ol, sto_kinetic, &
|
||||
sto_nuclear, sto_overlap
|
||||
USE atom_types, ONLY: &
|
||||
CGTO_BASIS, GTH_PSEUDO, GTO_BASIS, NO_PSEUDO, NUM_BASIS, STO_BASIS, &
|
||||
atom_basis_type, atom_integrals, atom_potential_type, atom_state
|
||||
atom_basis_gridrep, atom_basis_type, atom_integrals, &
|
||||
atom_potential_type, atom_state, cgto_basis, ecp_pseudo, gth_pseudo, &
|
||||
gto_basis, no_pseudo, num_basis, release_atom_basis, sto_basis, &
|
||||
upf_pseudo
|
||||
USE atom_utils, ONLY: atom_solve,&
|
||||
coulomb_potential_numeric,&
|
||||
integrate_grid,&
|
||||
|
|
@ -373,12 +375,12 @@ CONTAINS
|
|||
CASE (GTO_BASIS)
|
||||
|
||||
SELECT CASE (potential%ppot_type)
|
||||
CASE (NO_PSEUDO)
|
||||
CASE (no_pseudo, ecp_pseudo)
|
||||
DO l=0,3
|
||||
n = integrals%n(l)
|
||||
CALL sg_nuclear ( integrals%core(1:n,1:n,l), l, basis%am(1:n,l), basis%am(1:n,l) )
|
||||
END DO
|
||||
CASE (GTH_PSEUDO)
|
||||
CASE (gth_pseudo)
|
||||
alpha = 1._dp/potential%gth_pot%rc/SQRT(2._dp)
|
||||
DO l=0,3
|
||||
n = integrals%n(l)
|
||||
|
|
@ -426,6 +428,8 @@ CONTAINS
|
|||
|
||||
DEALLOCATE (omat,spmat)
|
||||
END DO
|
||||
CASE (upf_pseudo)
|
||||
CALL upfint_setup(integrals,basis,potential)
|
||||
CASE DEFAULT
|
||||
CPABORT("")
|
||||
END SELECT
|
||||
|
|
@ -433,7 +437,7 @@ CONTAINS
|
|||
CASE (CGTO_BASIS)
|
||||
|
||||
SELECT CASE (potential%ppot_type)
|
||||
CASE (NO_PSEUDO)
|
||||
CASE (no_pseudo, ecp_pseudo)
|
||||
DO l=0,3
|
||||
n = integrals%n(l)
|
||||
m = basis%nprim(l)
|
||||
|
|
@ -444,7 +448,7 @@ CONTAINS
|
|||
|
||||
DEALLOCATE (omat)
|
||||
END DO
|
||||
CASE (GTH_PSEUDO)
|
||||
CASE (gth_pseudo)
|
||||
alpha = 1._dp/potential%gth_pot%rc/SQRT(2._dp)
|
||||
DO l=0,3
|
||||
n = integrals%n(l)
|
||||
|
|
@ -499,6 +503,8 @@ CONTAINS
|
|||
DEALLOCATE (omat,spmat,xmat)
|
||||
END IF
|
||||
END DO
|
||||
CASE (upf_pseudo)
|
||||
CALL upfint_setup(integrals,basis,potential)
|
||||
CASE DEFAULT
|
||||
CPABORT("")
|
||||
END SELECT
|
||||
|
|
@ -506,13 +512,13 @@ CONTAINS
|
|||
CASE (STO_BASIS)
|
||||
|
||||
SELECT CASE (potential%ppot_type)
|
||||
CASE (NO_PSEUDO)
|
||||
CASE (no_pseudo, ecp_pseudo)
|
||||
DO l=0,3
|
||||
n = integrals%n(l)
|
||||
CALL sto_nuclear ( integrals%core(1:n,1:n,l), basis%ns(1:n,l), basis%as(1:n,l),&
|
||||
basis%ns(1:n,l), basis%as(1:n,l) )
|
||||
END DO
|
||||
CASE (GTH_PSEUDO)
|
||||
CASE (gth_pseudo)
|
||||
rad => basis%grid%rad
|
||||
m = basis%grid%nr
|
||||
ALLOCATE (cpot(1:m))
|
||||
|
|
@ -582,6 +588,8 @@ CONTAINS
|
|||
|
||||
DEALLOCATE (cpot)
|
||||
|
||||
CASE (upf_pseudo)
|
||||
CALL upfint_setup(integrals,basis,potential)
|
||||
CASE DEFAULT
|
||||
CPABORT("")
|
||||
END SELECT
|
||||
|
|
@ -590,6 +598,39 @@ CONTAINS
|
|||
CPABORT("")
|
||||
END SELECT
|
||||
|
||||
! add ecp_pseudo using numerical representation of basis
|
||||
IF(potential%ppot_type == ecp_pseudo) THEN
|
||||
! scale 1/r potential
|
||||
integrals%core = -potential%ecp_pot%zion*integrals%core
|
||||
! local potential
|
||||
m = basis%grid%nr
|
||||
rad => basis%grid%rad
|
||||
ALLOCATE (cpot(1:m))
|
||||
cpot = 0._dp
|
||||
DO k=1,potential%ecp_pot%nloc
|
||||
n = potential%ecp_pot%nrloc(k)
|
||||
alpha = potential%ecp_pot%bloc(k)
|
||||
cpot(:) = cpot + potential%ecp_pot%aloc(k)*rad**(n-2) * EXP(-alpha*rad**2)
|
||||
END DO
|
||||
CALL numpot_matrix(integrals%core,cpot,basis,0)
|
||||
! non local pseudopotential
|
||||
DO l=0,MIN(potential%ecp_pot%lmax,3)
|
||||
cpot = 0._dp
|
||||
DO k=1,potential%ecp_pot%npot(l)
|
||||
n = potential%ecp_pot%nrpot(k,l)
|
||||
alpha = potential%ecp_pot%bpot(k,l)
|
||||
cpot(:) = cpot + potential%ecp_pot%apot(k,l)*rad**(n-2) * EXP(-alpha*rad**2)
|
||||
END DO
|
||||
DO i=1,basis%nbas(l)
|
||||
DO j=i,basis%nbas(l)
|
||||
integrals%hnl(i,j,l) = integrate_grid(cpot,basis%bf(:,i,l),basis%bf(:,j,l),basis%grid)
|
||||
integrals%hnl(j,i,l) = integrals%hnl(i,j,l)
|
||||
END DO
|
||||
END DO
|
||||
END DO
|
||||
DEALLOCATE(cpot)
|
||||
END IF
|
||||
|
||||
END IF
|
||||
|
||||
CALL timestop(handle)
|
||||
|
|
@ -599,6 +640,74 @@ CONTAINS
|
|||
!> \brief ...
|
||||
!> \param integrals ...
|
||||
!> \param basis ...
|
||||
!> \param potential ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE upfint_setup(integrals,basis,potential)
|
||||
TYPE(atom_integrals), INTENT(INOUT) :: integrals
|
||||
TYPE(atom_basis_type), INTENT(INOUT) :: basis
|
||||
TYPE(atom_potential_type), INTENT(IN) :: potential
|
||||
|
||||
CHARACTER(len=*), PARAMETER :: routineN = 'upfint_setup', &
|
||||
routineP = moduleN//':'//routineN
|
||||
|
||||
CHARACTER(len=4) :: ptype
|
||||
INTEGER :: i, j, k1, k2, la, lb, m, n
|
||||
REAL(KIND=dp), ALLOCATABLE, &
|
||||
DIMENSION(:, :) :: spmat
|
||||
TYPE(atom_basis_type) :: gbasis
|
||||
|
||||
! get basis representation on UPF grid
|
||||
|
||||
CALL atom_basis_gridrep(basis,gbasis,potential%upf_pot%r,potential%upf_pot%rab)
|
||||
|
||||
! local pseudopotential
|
||||
integrals%core = 0._dp
|
||||
CALL numpot_matrix(integrals%core,potential%upf_pot%vlocal,gbasis,0)
|
||||
|
||||
ptype = ADJUSTL(TRIM(potential%upf_pot%pseudo_type))
|
||||
IF(ptype(1:2) == "NC") THEN
|
||||
! non local pseudopotential
|
||||
n = MAXVAL(integrals%n(:))
|
||||
m = potential%upf_pot%number_of_proj
|
||||
ALLOCATE (spmat(n,m))
|
||||
spmat = 0.0_dp
|
||||
DO i=1,m
|
||||
la = potential%upf_pot%lbeta(i)
|
||||
DO j=1,gbasis%nbas(la)
|
||||
spmat(j,i) = integrate_grid(potential%upf_pot%beta(:,i),gbasis%bf(:,j,la),gbasis%grid)
|
||||
END DO
|
||||
END DO
|
||||
DO i=1,m
|
||||
la = potential%upf_pot%lbeta(i)
|
||||
DO j=1,m
|
||||
lb = potential%upf_pot%lbeta(j)
|
||||
IF(la==lb) THEN
|
||||
DO k1=1,gbasis%nbas(la)
|
||||
DO k2=1,gbasis%nbas(la)
|
||||
integrals%hnl(k1,k2,la) = integrals%hnl(k1,k2,la) + &
|
||||
spmat(k1,i)*potential%upf_pot%dion(i,j)*spmat(k2,j)
|
||||
END DO
|
||||
END DO
|
||||
END IF
|
||||
END DO
|
||||
END DO
|
||||
DEALLOCATE (spmat)
|
||||
ELSE IF(ptype(1:2) == "SL") THEN
|
||||
DO la=0,potential%upf_pot%l_max
|
||||
CALL numpot_matrix(integrals%core,potential%upf_pot%vsemi(:,la+1),gbasis,0)
|
||||
END DO
|
||||
ELSE
|
||||
CPABORT("")
|
||||
END IF
|
||||
|
||||
! release basis representation on UPF grid
|
||||
CALL release_atom_basis(gbasis)
|
||||
|
||||
END SUBROUTINE upfint_setup
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param integrals ...
|
||||
!> \param basis ...
|
||||
!> \param reltyp ...
|
||||
!> \param zcore ...
|
||||
!> \param alpha ...
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
! *****************************************************************************
|
||||
MODULE atom_output
|
||||
USE atom_types, ONLY: &
|
||||
CGTO_BASIS, GTH_PSEUDO, GTO_BASIS, NO_PSEUDO, NUM_BASIS, STO_BASIS, &
|
||||
atom_basis_type, atom_gthpot_type, atom_potential_type, atom_state, &
|
||||
atom_type
|
||||
atom_type, cgto_basis, ecp_pseudo, gth_pseudo, gto_basis, no_pseudo, &
|
||||
num_basis, sto_basis, upf_pseudo
|
||||
USE atom_utils, ONLY: get_maxl_occ,&
|
||||
get_maxn_occ
|
||||
USE cp_files, ONLY: close_file,&
|
||||
|
|
@ -598,9 +598,9 @@ CONTAINS
|
|||
INTEGER :: i, j, k, l
|
||||
|
||||
SELECT CASE (potential%ppot_type)
|
||||
CASE (NO_PSEUDO)
|
||||
CASE (no_pseudo)
|
||||
WRITE(iw,'(/," ",28("*"),A,27("*"))') " All Electron Potential "
|
||||
CASE (GTH_PSEUDO)
|
||||
CASE (gth_pseudo)
|
||||
WRITE(iw,'(/," ",29("*"),A,29("*"))') " GTH Pseudopotential "
|
||||
WRITE(iw,'(T10,A,T76,F5.1)') " Core Charge ",potential%gth_pot%zion
|
||||
WRITE(iw,'(T10,A,T66,F15.6)') " Rc ",potential%gth_pot%rc
|
||||
|
|
@ -637,6 +637,30 @@ CONTAINS
|
|||
END DO
|
||||
END IF
|
||||
END DO
|
||||
CASE (upf_pseudo)
|
||||
WRITE(iw,'(/," ",29("*"),A,29("*"))') " UPF Pseudopotential "
|
||||
DO k=1,potential%upf_pot%maxinfo
|
||||
WRITE(iw,'(A80)') potential%upf_pot%info(k)
|
||||
END DO
|
||||
CASE (ecp_pseudo)
|
||||
WRITE(iw,'(/," ",26("*"),A,27("*"))') " Effective Core Potential "
|
||||
WRITE(iw,'(T10,A,T76,F5.1)') " Core Charge ",potential%ecp_pot%zion
|
||||
DO k=1,potential%ecp_pot%nloc
|
||||
IF(k==1) THEN
|
||||
WRITE(iw,'(T10,A,T40,I3,T49,2F16.8)') " Local Potential ",potential%ecp_pot%nrloc(k),&
|
||||
potential%ecp_pot%bloc(k),potential%ecp_pot%aloc(k)
|
||||
ELSE
|
||||
WRITE(iw,'(T40,I3,T49,2F16.8)') potential%ecp_pot%nrloc(k),&
|
||||
potential%ecp_pot%bloc(k),potential%ecp_pot%aloc(k)
|
||||
END IF
|
||||
END DO
|
||||
DO l=0,potential%ecp_pot%lmax
|
||||
WRITE(iw,'(T10,A,I3)') " ECP l-value ",l
|
||||
DO k=1,potential%ecp_pot%npot(l)
|
||||
WRITE(iw,'(T40,I3,T49,2F16.8)') potential%ecp_pot%nrpot(k,l),&
|
||||
potential%ecp_pot%bpot(k,l),potential%ecp_pot%apot(k,l)
|
||||
END DO
|
||||
END DO
|
||||
CASE DEFAULT
|
||||
CPABORT("")
|
||||
END SELECT
|
||||
|
|
|
|||
346
src/atom_types.F
346
src/atom_types.F
|
|
@ -11,23 +11,22 @@
|
|||
!>
|
||||
! *****************************************************************************
|
||||
MODULE atom_types
|
||||
USE atom_upf, ONLY: atom_read_upf,&
|
||||
atom_upfpot_type
|
||||
USE cp_linked_list_val, ONLY: cp_sll_val_next,&
|
||||
cp_sll_val_type
|
||||
USE cp_parser_methods, ONLY: parser_get_next_line,&
|
||||
parser_get_object,&
|
||||
parser_read_line,&
|
||||
parser_search_string,&
|
||||
parser_test_next_token
|
||||
USE cp_parser_types, ONLY: cp_parser_type,&
|
||||
parser_create,&
|
||||
parser_release
|
||||
USE input_constants, ONLY: barrier_conf,&
|
||||
contracted_gto,&
|
||||
gaussian,&
|
||||
geometrical_gto,&
|
||||
no_conf,&
|
||||
numerical,&
|
||||
poly_conf,&
|
||||
slater
|
||||
USE input_constants, ONLY: &
|
||||
barrier_conf, contracted_gto, do_gapw_log, ecp_pseudo, gaussian, &
|
||||
geometrical_gto, gth_pseudo, no_conf, no_pseudo, numerical, poly_conf, &
|
||||
slater, upf_pseudo
|
||||
USE input_section_types, ONLY: section_vals_get,&
|
||||
section_vals_get_subs_vals,&
|
||||
section_vals_list_get,&
|
||||
|
|
@ -40,7 +39,8 @@ MODULE atom_types
|
|||
USE mathconstants, ONLY: dfac,&
|
||||
fac,&
|
||||
pi
|
||||
USE periodic_table, ONLY: ptable
|
||||
USE periodic_table, ONLY: get_ptable_info,&
|
||||
ptable
|
||||
USE qs_grid_atom, ONLY: allocate_grid_atom,&
|
||||
create_grid_atom,&
|
||||
deallocate_grid_atom,&
|
||||
|
|
@ -59,8 +59,6 @@ MODULE atom_types
|
|||
CGTO_BASIS=101,&
|
||||
STO_BASIS=102,&
|
||||
NUM_BASIS=103
|
||||
INTEGER, PARAMETER :: NO_PSEUDO=0,&
|
||||
GTH_PSEUDO=1
|
||||
|
||||
!> Provides all information about a basis set
|
||||
! *****************************************************************************
|
||||
|
|
@ -116,6 +114,22 @@ MODULE atom_types
|
|||
REAL(KIND = dp), DIMENSION(4,10) :: cval_lpot
|
||||
END TYPE atom_gthpot_type
|
||||
|
||||
TYPE atom_ecppot_type
|
||||
CHARACTER (LEN=2) :: symbol
|
||||
CHARACTER (LEN=default_string_length) :: pname
|
||||
INTEGER, DIMENSION(0:3) :: econf
|
||||
REAL(dp) :: zion
|
||||
INTEGER :: lmax
|
||||
INTEGER :: nloc ! # terms
|
||||
INTEGER, DIMENSION(1:10) :: nrloc ! r**(n-2)
|
||||
REAL(dp), DIMENSION(1:10) :: aloc ! coefficient
|
||||
REAL(dp), DIMENSION(1:10) :: bloc ! exponent
|
||||
INTEGER, DIMENSION(0:10) :: npot ! # terms
|
||||
INTEGER, DIMENSION(1:10,0:10) :: nrpot ! r**(n-2)
|
||||
REAL(dp), DIMENSION(1:10,0:10) :: apot ! coefficient
|
||||
REAL(dp), DIMENSION(1:10,0:10) :: bpot ! exponent
|
||||
END TYPE atom_ecppot_type
|
||||
|
||||
TYPE atom_potential_type
|
||||
INTEGER :: ppot_type
|
||||
LOGICAL :: confinement
|
||||
|
|
@ -124,6 +138,8 @@ MODULE atom_types
|
|||
REAL(dp) :: rcon
|
||||
REAL(dp) :: scon
|
||||
TYPE(atom_gthpot_type) :: gth_pot
|
||||
TYPE(atom_ecppot_type) :: ecp_pot
|
||||
TYPE(atom_upfpot_type) :: upf_pot
|
||||
END TYPE atom_potential_type
|
||||
|
||||
!> Provides all information on states and occupation
|
||||
|
|
@ -230,6 +246,7 @@ MODULE atom_types
|
|||
LOGICAL :: do_zmp, doread, read_vxc, dm
|
||||
CHARACTER(LEN=default_string_length) :: ext_file, ext_vxc_file, &
|
||||
zmp_restart_file
|
||||
!
|
||||
INTEGER :: method_type
|
||||
INTEGER :: relativistic
|
||||
INTEGER :: coulomb_integral_type
|
||||
|
|
@ -238,6 +255,7 @@ MODULE atom_types
|
|||
REAL(KIND=dp) :: lambda
|
||||
REAL(KIND=dp) :: rho_diff_integral
|
||||
REAL(KIND=dp) :: weight, zmpgrid_tol, zmpvxcgrid_tol
|
||||
!
|
||||
TYPE(atom_basis_type), POINTER :: basis
|
||||
TYPE(atom_potential_type), POINTER :: potential
|
||||
TYPE(atom_state), POINTER :: state
|
||||
|
|
@ -258,14 +276,14 @@ MODULE atom_types
|
|||
PUBLIC :: atom_optimization_type
|
||||
PUBLIC :: create_atom_type, release_atom_type, set_atom
|
||||
PUBLIC :: create_atom_orbs
|
||||
PUBLIC :: init_atom_basis, release_atom_basis
|
||||
PUBLIC :: init_atom_basis, atom_basis_gridrep, release_atom_basis
|
||||
PUBLIC :: init_atom_potential, release_atom_potential
|
||||
PUBLIC :: read_atom_opt_section
|
||||
PUBLIC :: Clementi_geobas
|
||||
PUBLIC :: GTO_BASIS, CGTO_BASIS, STO_BASIS, NUM_BASIS
|
||||
PUBLIC :: opmat_type, create_opmat, release_opmat
|
||||
PUBLIC :: opgrid_type, create_opgrid, release_opgrid
|
||||
PUBLIC :: NO_PSEUDO, GTH_PSEUDO
|
||||
PUBLIC :: no_pseudo, gth_pseudo, upf_pseudo, ecp_pseudo
|
||||
|
||||
! *****************************************************************************
|
||||
|
||||
|
|
@ -661,6 +679,143 @@ CONTAINS
|
|||
|
||||
END SUBROUTINE init_atom_basis
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param basis ...
|
||||
!> \param gbasis ...
|
||||
!> \param r ...
|
||||
!> \param rab ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE atom_basis_gridrep(basis,gbasis,r,rab)
|
||||
TYPE(atom_basis_type), INTENT(IN) :: basis
|
||||
TYPE(atom_basis_type), INTENT(INOUT) :: gbasis
|
||||
REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: r, rab
|
||||
|
||||
CHARACTER(len=*), PARAMETER :: routineN = 'atom_basis_gridrep', &
|
||||
routineP = moduleN//':'//routineN
|
||||
|
||||
INTEGER :: i, j, k, l, m, n1, n2, n3, &
|
||||
ngp, nl, nr, quadtype
|
||||
REAL(KIND=dp) :: al, ear, pf, rk
|
||||
|
||||
NULLIFY(gbasis%am,gbasis%cm,gbasis%as,gbasis%ns,gbasis%bf,gbasis%dbf,gbasis%ddbf)
|
||||
|
||||
! copy basis info
|
||||
gbasis%basis_type = basis%basis_type
|
||||
gbasis%nbas(0:3) = basis%nbas(0:3)
|
||||
gbasis%nprim(0:3) = basis%nprim(0:3)
|
||||
IF(ASSOCIATED(basis%am)) THEN
|
||||
n1 = SIZE(basis%am,1)
|
||||
n2 = SIZE(basis%am,2)
|
||||
ALLOCATE(gbasis%am(n1,0:n2-1))
|
||||
gbasis%am = basis%am
|
||||
END IF
|
||||
IF(ASSOCIATED(basis%cm)) THEN
|
||||
n1 = SIZE(basis%cm,1)
|
||||
n2 = SIZE(basis%cm,2)
|
||||
n3 = SIZE(basis%cm,3)
|
||||
ALLOCATE(gbasis%cm(n1,n2,0:n3-1))
|
||||
gbasis%cm = basis%cm
|
||||
END IF
|
||||
IF(ASSOCIATED(basis%as)) THEN
|
||||
n1 = SIZE(basis%as,1)
|
||||
n2 = SIZE(basis%as,2)
|
||||
ALLOCATE(gbasis%as(n1,0:n2-1))
|
||||
gbasis%as = basis%as
|
||||
END IF
|
||||
IF(ASSOCIATED(basis%ns)) THEN
|
||||
n1 = SIZE(basis%ns,1)
|
||||
n2 = SIZE(basis%ns,2)
|
||||
ALLOCATE(gbasis%ns(n1,0:n2-1))
|
||||
gbasis%ns = basis%ns
|
||||
END IF
|
||||
gbasis%eps_eig = basis%eps_eig
|
||||
gbasis%geometrical = basis%geometrical
|
||||
gbasis%aval = basis%aval
|
||||
gbasis%cval = basis%cval
|
||||
gbasis%start(0:3) = basis%start(0:3)
|
||||
|
||||
! get information on quadrature type and number of grid points
|
||||
! allocate and initialize the atomic grid
|
||||
NULLIFY(gbasis%grid)
|
||||
CALL allocate_grid_atom(gbasis%grid)
|
||||
ngp = SIZE(r)
|
||||
quadtype = do_gapw_log
|
||||
IF(ngp <= 0)&
|
||||
CPABORT("# point radial grid < 0")
|
||||
CALL create_grid_atom(gbasis%grid,ngp,1,1,0,quadtype)
|
||||
gbasis%grid%nr = ngp
|
||||
gbasis%grid%rad(:) = r(:)
|
||||
gbasis%grid%rad2(:) = r(:)*r(:)
|
||||
gbasis%grid%wr(:) = rab(:)*gbasis%grid%rad2(:)
|
||||
|
||||
! initialize basis function on a radial grid
|
||||
nr = gbasis%grid%nr
|
||||
m = MAXVAL(gbasis%nbas)
|
||||
ALLOCATE (gbasis%bf(nr,m,0:3))
|
||||
ALLOCATE (gbasis%dbf(nr,m,0:3))
|
||||
ALLOCATE (gbasis%ddbf(nr,m,0:3))
|
||||
gbasis%bf = 0._dp
|
||||
gbasis%dbf = 0._dp
|
||||
gbasis%ddbf = 0._dp
|
||||
|
||||
SELECT CASE (gbasis%basis_type)
|
||||
CASE DEFAULT
|
||||
CPABORT("")
|
||||
CASE (GTO_BASIS)
|
||||
DO l=0,3
|
||||
DO i=1,gbasis%nbas(l)
|
||||
al = gbasis%am(i,l)
|
||||
DO k=1,nr
|
||||
rk = gbasis%grid%rad(k)
|
||||
ear = EXP(-al*gbasis%grid%rad(k)**2)
|
||||
gbasis%bf(k,i,l) = rk**l * ear
|
||||
gbasis%dbf(k,i,l) = ( REAL(l,dp)*rk**(l-1) - 2._dp*al*rk**(l+1) ) * ear
|
||||
gbasis%ddbf(k,i,l) = ( REAL(l*(l-1),dp)*rk**(l-2) - &
|
||||
2._dp*al*REAL(2*l+1,dp)*rk**(l) + 4._dp*al*rk**(l+2)) * ear
|
||||
END DO
|
||||
END DO
|
||||
END DO
|
||||
CASE (CGTO_BASIS)
|
||||
DO l=0,3
|
||||
DO i=1,gbasis%nprim(l)
|
||||
al = gbasis%am(i,l)
|
||||
DO k=1,nr
|
||||
rk = gbasis%grid%rad(k)
|
||||
ear = EXP(-al*gbasis%grid%rad(k)**2)
|
||||
DO j=1,gbasis%nbas(l)
|
||||
gbasis%bf(k,j,l) = gbasis%bf(k,j,l) + rk**l * ear*gbasis%cm(i,j,l)
|
||||
gbasis%dbf(k,j,l) = gbasis%dbf(k,j,l) &
|
||||
+ ( REAL(l,dp)*rk**(l-1) - 2._dp*al*rk**(l+1) ) * ear*gbasis%cm(i,j,l)
|
||||
gbasis%ddbf(k,j,l) = gbasis%ddbf(k,j,l) + ( REAL(l*(l-1),dp)*rk**(l-2) - &
|
||||
2._dp*al*REAL(2*l+1,dp)*rk**(l) + 4._dp*al*rk**(l+2)) * ear*gbasis%cm(i,j,l)
|
||||
END DO
|
||||
END DO
|
||||
END DO
|
||||
END DO
|
||||
CASE (STO_BASIS)
|
||||
DO l=0,3
|
||||
DO i=1,gbasis%nbas(l)
|
||||
al = gbasis%as(i,l)
|
||||
nl = gbasis%ns(i,l)
|
||||
pf = (2._dp*al)**nl * SQRT(2._dp*al/fac(2*nl))
|
||||
DO k=1,nr
|
||||
rk = gbasis%grid%rad(k)
|
||||
ear = rk**(nl-1) * EXP(-al*rk)
|
||||
gbasis%bf(k,i,l) = pf * ear
|
||||
gbasis%dbf(k,i,l) = pf * ( REAL(nl-1,dp)/rk - al ) * ear
|
||||
gbasis%ddbf(k,i,l) = pf * ( REAL( (nl-2)*(nl-1),dp)/rk/rk &
|
||||
- al*REAL( 2*(nl-1),dp)/rk + al*al ) * ear
|
||||
END DO
|
||||
END DO
|
||||
END DO
|
||||
CASE (NUM_BASIS)
|
||||
gbasis%basis_type = NUM_BASIS
|
||||
CPABORT("")
|
||||
END SELECT
|
||||
|
||||
END SUBROUTINE atom_basis_gridrep
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param basis ...
|
||||
|
|
@ -2039,7 +2194,8 @@ CONTAINS
|
|||
CHARACTER(LEN=default_string_length) :: pseudo_fn, pseudo_name
|
||||
INTEGER :: ic
|
||||
REAL(dp), DIMENSION(:), POINTER :: convals
|
||||
TYPE(section_vals_type), POINTER :: gth_potential_section
|
||||
TYPE(section_vals_type), POINTER :: ecp_potential_section, &
|
||||
gth_potential_section
|
||||
|
||||
IF ( zval > 0 ) THEN
|
||||
CALL section_vals_val_get(potential_section,"PSEUDO_TYPE",i_val=potential%ppot_type)
|
||||
|
|
@ -2051,6 +2207,17 @@ CONTAINS
|
|||
gth_potential_section => section_vals_get_subs_vals(potential_section,"GTH_POTENTIAL")
|
||||
CALL read_gth_potential(ptable(zval)%symbol,potential%gth_pot,&
|
||||
pseudo_name,pseudo_fn,gth_potential_section)
|
||||
CASE (ecp_pseudo)
|
||||
CALL section_vals_val_get(potential_section,"POTENTIAL_FILE_NAME",c_val=pseudo_fn)
|
||||
CALL section_vals_val_get(potential_section,"POTENTIAL_NAME",c_val=pseudo_name)
|
||||
ecp_potential_section => section_vals_get_subs_vals(potential_section,"ECP")
|
||||
CALL read_ecp_potential(ptable(zval)%symbol,potential%ecp_pot,&
|
||||
pseudo_name,pseudo_fn,ecp_potential_section)
|
||||
CASE (upf_pseudo)
|
||||
CALL section_vals_val_get(potential_section,"POTENTIAL_FILE_NAME",c_val=pseudo_fn)
|
||||
CALL section_vals_val_get(potential_section,"POTENTIAL_NAME",c_val=pseudo_name)
|
||||
CALL atom_read_upf(potential%upf_pot,pseudo_fn)
|
||||
potential%upf_pot%pname = pseudo_name
|
||||
CASE (no_pseudo)
|
||||
! do nothing
|
||||
CASE DEFAULT
|
||||
|
|
@ -2433,5 +2600,156 @@ CONTAINS
|
|||
|
||||
END SUBROUTINE read_gth_potential
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param element_symbol ...
|
||||
!> \param potential ...
|
||||
!> \param pseudo_name ...
|
||||
!> \param pseudo_file ...
|
||||
!> \param potential_section ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE read_ecp_potential(element_symbol,potential,pseudo_name,pseudo_file,&
|
||||
potential_section)
|
||||
|
||||
CHARACTER(LEN=*), INTENT(IN) :: element_symbol
|
||||
TYPE(atom_ecppot_type), INTENT(INOUT) :: potential
|
||||
CHARACTER(LEN=*), INTENT(IN) :: pseudo_name, pseudo_file
|
||||
TYPE(section_vals_type), POINTER :: potential_section
|
||||
|
||||
CHARACTER(len=*), PARAMETER :: routineN = 'read_ecp_potential', &
|
||||
routineP = moduleN//':'//routineN
|
||||
|
||||
CHARACTER(LEN=240) :: line
|
||||
CHARACTER(len=5*default_string_length) :: line_att
|
||||
CHARACTER(LEN=LEN(element_symbol)) :: symbol
|
||||
CHARACTER(LEN=LEN(pseudo_name)) :: apname
|
||||
INTEGER :: i, ic, l, ncore, nel
|
||||
LOGICAL :: found, is_ok, read_from_input
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
TYPE(cp_sll_val_type), POINTER :: list
|
||||
TYPE(val_type), POINTER :: val
|
||||
|
||||
apname = pseudo_name
|
||||
symbol = element_symbol
|
||||
CALL get_ptable_info(symbol,number=ncore)
|
||||
|
||||
potential%symbol = symbol
|
||||
potential%pname = apname
|
||||
potential%econf = 0
|
||||
potential%zion = 0
|
||||
potential%lmax = -1
|
||||
potential%nloc = 0
|
||||
potential%nrloc = 0
|
||||
potential%aloc = 0.0_dp
|
||||
potential%bloc = 0.0_dp
|
||||
potential%npot = 0
|
||||
potential%nrpot = 0
|
||||
potential%apot = 0.0_dp
|
||||
potential%bpot = 0.0_dp
|
||||
|
||||
read_from_input = .FALSE.
|
||||
CALL section_vals_get(potential_section,explicit=read_from_input)
|
||||
IF (read_from_input) THEN
|
||||
CALL section_vals_list_get(potential_section,"_DEFAULT_KEYWORD_",list=list)
|
||||
! number of electrons (mandatory line)
|
||||
is_ok=cp_sll_val_next(list,val)
|
||||
CPASSERT(is_ok)
|
||||
CALL val_get(val,c_val=line_att)
|
||||
CALL remove_word(line_att)
|
||||
CALL remove_word(line_att)
|
||||
! read number of electrons
|
||||
READ(line_att,*) nel
|
||||
potential%zion = REAL(ncore - nel,KIND=dp)
|
||||
! local potential (mandatory block)
|
||||
is_ok=cp_sll_val_next(list,val)
|
||||
CPASSERT(is_ok)
|
||||
CALL val_get(val,c_val=line_att)
|
||||
DO i=1,10
|
||||
IF(.NOT.cp_sll_val_next(list,val)) EXIT
|
||||
CALL val_get(val,c_val=line_att)
|
||||
IF(INDEX(line_att,element_symbol) == 0) THEN
|
||||
potential%nloc = potential%nloc+1
|
||||
ic = potential%nloc
|
||||
READ(line_att,*) potential%nrloc(ic),potential%bloc(ic),potential%aloc(ic)
|
||||
ELSE
|
||||
EXIT
|
||||
END IF
|
||||
END DO
|
||||
! read potentials
|
||||
DO
|
||||
CALL val_get(val,c_val=line_att)
|
||||
IF(INDEX(line_att,element_symbol) == 0) THEN
|
||||
potential%npot(l) = potential%npot(l)+1
|
||||
ic = potential%npot(l)
|
||||
READ(line_att,*) potential%nrpot(ic,l),potential%bpot(ic,l),potential%apot(ic,l)
|
||||
ELSE
|
||||
potential%lmax = potential%lmax+1
|
||||
l = potential%lmax
|
||||
END IF
|
||||
IF(.NOT.cp_sll_val_next(list,val)) EXIT
|
||||
END DO
|
||||
|
||||
ELSE
|
||||
|
||||
NULLIFY(parser)
|
||||
CALL parser_create(parser,pseudo_file)
|
||||
|
||||
search_loop: DO
|
||||
CALL parser_search_string(parser,TRIM(apname),.TRUE.,found,line)
|
||||
IF (found) THEN
|
||||
match_loop: DO
|
||||
CALL parser_get_object(parser,line,newline=.TRUE.)
|
||||
IF(TRIM(line) == element_symbol) THEN
|
||||
CALL parser_get_object(parser,line,lower_to_upper=.TRUE.)
|
||||
CPASSERT(TRIM(line) == "NELEC")
|
||||
! read number of electrons
|
||||
CALL parser_get_object(parser,nel)
|
||||
potential%zion = REAL(ncore - nel,KIND=dp)
|
||||
! read local potential flag line "<XX> ul"
|
||||
CALL parser_get_object(parser,line,newline=.TRUE.)
|
||||
! read local potential
|
||||
DO i=1,10
|
||||
CALL parser_read_line(parser,1)
|
||||
IF(parser_test_next_token(parser)=="STR") EXIT
|
||||
potential%nloc = potential%nloc+1
|
||||
ic = potential%nloc
|
||||
CALL parser_get_object(parser,potential%nrloc(ic))
|
||||
CALL parser_get_object(parser,potential%bloc(ic))
|
||||
CALL parser_get_object(parser,potential%aloc(ic))
|
||||
END DO
|
||||
! read potentials (start with l loop)
|
||||
DO l=0,10
|
||||
CALL parser_get_object(parser,symbol)
|
||||
IF(symbol == element_symbol) THEN
|
||||
! new l block
|
||||
potential%lmax = potential%lmax+1
|
||||
DO i=1,10
|
||||
CALL parser_read_line(parser,1)
|
||||
IF(parser_test_next_token(parser)=="STR") EXIT
|
||||
potential%npot(l) = potential%npot(l)+1
|
||||
ic = potential%npot(l)
|
||||
CALL parser_get_object(parser,potential%nrpot(ic,l))
|
||||
CALL parser_get_object(parser,potential%bpot(ic,l))
|
||||
CALL parser_get_object(parser,potential%apot(ic,l))
|
||||
END DO
|
||||
ELSE
|
||||
EXIT
|
||||
END IF
|
||||
END DO
|
||||
EXIT search_loop
|
||||
ELSE IF(line == "END") THEN
|
||||
CPABORT("Element not found in ECP library")
|
||||
END IF
|
||||
END DO match_loop
|
||||
ELSE
|
||||
CPABORT("ECP type not found in library")
|
||||
END IF
|
||||
|
||||
END DO search_loop
|
||||
|
||||
CALL parser_release(parser)
|
||||
END IF
|
||||
|
||||
END SUBROUTINE read_ecp_potential
|
||||
! *****************************************************************************
|
||||
|
||||
END MODULE atom_types
|
||||
|
|
|
|||
892
src/atom_upf.F
Normal file
892
src/atom_upf.F
Normal file
|
|
@ -0,0 +1,892 @@
|
|||
!-----------------------------------------------------------------------------!
|
||||
! CP2K: A general program to perform molecular dynamics simulations !
|
||||
! Copyright (C) 2000 - 2016 CP2K developers group !
|
||||
!-----------------------------------------------------------------------------!
|
||||
|
||||
! *****************************************************************************
|
||||
MODULE atom_upf
|
||||
USE cp_parser_methods, ONLY: parser_get_next_line,&
|
||||
parser_get_object,&
|
||||
parser_test_next_token
|
||||
USE cp_parser_types, ONLY: cp_parser_type,&
|
||||
parser_create,&
|
||||
parser_release
|
||||
USE kinds, ONLY: default_string_length,&
|
||||
dp
|
||||
#include "./base/base_uses.f90"
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
TYPE atom_upfpot_type
|
||||
CHARACTER (LEN=2) :: symbol
|
||||
CHARACTER (LEN=default_string_length) :: pname
|
||||
INTEGER, DIMENSION(0:3) :: econf
|
||||
REAL(dp) :: zion
|
||||
CHARACTER (LEN=default_string_length) :: version
|
||||
! <INFO>
|
||||
INTEGER :: maxinfo=100
|
||||
CHARACTER (LEN=default_string_length), DIMENSION(100) &
|
||||
:: info
|
||||
! <HEADER>
|
||||
CHARACTER (LEN=default_string_length) :: generated
|
||||
CHARACTER (LEN=default_string_length) :: author
|
||||
CHARACTER (LEN=default_string_length) :: date
|
||||
CHARACTER (LEN=default_string_length) :: comment
|
||||
CHARACTER (LEN=4) :: pseudo_type
|
||||
CHARACTER (LEN=15) :: relativistic
|
||||
CHARACTER (LEN=default_string_length) :: functional
|
||||
LOGICAL :: is_ultrasoft=.FALSE.
|
||||
LOGICAL :: is_paw=.FALSE.
|
||||
LOGICAL :: is_coulomb=.FALSE.
|
||||
LOGICAL :: has_so=.FALSE.
|
||||
LOGICAL :: has_wfc=.FALSE.
|
||||
LOGICAL :: has_gipaw=.FALSE.
|
||||
LOGICAL :: paw_as_gipaw=.FALSE.
|
||||
LOGICAL :: core_correction=.FALSE.
|
||||
REAL(dp) :: total_psenergy
|
||||
REAL(dp) :: wfc_cutoff
|
||||
REAL(dp) :: rho_cutoff
|
||||
INTEGER :: l_max
|
||||
INTEGER :: l_max_rho
|
||||
INTEGER :: l_local
|
||||
INTEGER :: mesh_size
|
||||
INTEGER :: number_of_wfc
|
||||
INTEGER :: number_of_proj
|
||||
! <MESH>
|
||||
REAL(dp) :: dx
|
||||
REAL(dp) :: xmin
|
||||
REAL(dp) :: rmax
|
||||
REAL(dp) :: zmesh
|
||||
REAL(dp),DIMENSION(:),ALLOCATABLE :: r, rab
|
||||
! <NLCC>
|
||||
REAL(dp),DIMENSION(:),ALLOCATABLE :: rho_nlcc
|
||||
! <LOCAL>
|
||||
REAL(dp),DIMENSION(:),ALLOCATABLE :: vlocal
|
||||
! <NONLOCAL>
|
||||
REAL(dp),DIMENSION(:,:),ALLOCATABLE :: dion
|
||||
REAL(dp),DIMENSION(:,:),ALLOCATABLE :: beta
|
||||
INTEGER,DIMENSION(:),ALLOCATABLE :: lbeta
|
||||
! <SEMILOCAL>
|
||||
REAL(dp),DIMENSION(:,:),ALLOCATABLE :: vsemi
|
||||
END TYPE atom_upfpot_type
|
||||
|
||||
PRIVATE
|
||||
PUBLIC :: atom_read_upf, atom_upfpot_type
|
||||
|
||||
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'atom_upf'
|
||||
|
||||
! *****************************************************************************
|
||||
|
||||
CONTAINS
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param pot ...
|
||||
!> \param upf_filename ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE atom_read_upf(pot,upf_filename)
|
||||
|
||||
TYPE(atom_upfpot_type) :: pot
|
||||
CHARACTER(len=*), INTENT(IN) :: upf_filename
|
||||
|
||||
CHARACTER(len=*), PARAMETER :: routineN = 'atom_read_upf', &
|
||||
routineP = moduleN//':'//routineN
|
||||
|
||||
CHARACTER(LEN=default_string_length) :: nametag
|
||||
INTEGER :: ib, ntag
|
||||
LOGICAL :: at_end
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
|
||||
ntag = 0
|
||||
NULLIFY(parser)
|
||||
CALL parser_create(parser,upf_filename)
|
||||
DO
|
||||
at_end = .FALSE.
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
IF ( at_end ) EXIT
|
||||
CALL parser_get_object(parser,nametag,lower_to_upper=.TRUE.)
|
||||
IF(nametag(1:1) /= "<") CYCLE
|
||||
IF (ntag == 0) THEN
|
||||
! we are looking for UPF tag
|
||||
IF(nametag(2:4)=="UPF") THEN
|
||||
CALL parser_get_object(parser,nametag,lower_to_upper=.TRUE.)
|
||||
! read UPF file version
|
||||
CALL parser_get_object(parser,nametag,lower_to_upper=.TRUE.)
|
||||
pot%version=TRIM(nametag)
|
||||
CPASSERT(nametag(2:6)=="2.0.1")
|
||||
CALL parser_get_object(parser,nametag,lower_to_upper=.TRUE.)
|
||||
CPASSERT(nametag(1:1)==">")
|
||||
ntag = 1
|
||||
ENDIF
|
||||
ELSE IF (ntag == 1) THEN
|
||||
! we are looking for 1st level tags
|
||||
IF(nametag(2:8)=="PP_INFO") THEN
|
||||
CPASSERT(nametag(9:9)==">")
|
||||
CALL upf_info_section(parser,pot)
|
||||
ELSEIF(nametag(2:10)=="PP_HEADER") THEN
|
||||
IF(.NOT.(nametag(11:11)==">")) THEN
|
||||
CALL upf_header_option(parser,pot)
|
||||
END IF
|
||||
ELSEIF(nametag(2:8)=="PP_MESH") THEN
|
||||
IF(.NOT.(nametag(9:9)==">")) THEN
|
||||
CALL upf_mesh_option(parser,pot)
|
||||
END IF
|
||||
CALL upf_mesh_section(parser,pot)
|
||||
ELSEIF(nametag(2:8)=="PP_NLCC") THEN
|
||||
IF(nametag(9:9)==">") THEN
|
||||
CALL upf_nlcc_section(parser,pot,.FALSE.)
|
||||
ELSE
|
||||
CALL upf_nlcc_section(parser,pot,.TRUE.)
|
||||
END IF
|
||||
ELSEIF(nametag(2:9)=="PP_LOCAL") THEN
|
||||
IF(nametag(10:10)==">") THEN
|
||||
CALL upf_local_section(parser,pot,.FALSE.)
|
||||
ELSE
|
||||
CALL upf_local_section(parser,pot,.TRUE.)
|
||||
END IF
|
||||
ELSEIF(nametag(2:12)=="PP_NONLOCAL") THEN
|
||||
CPASSERT(nametag(13:13)==">")
|
||||
CALL upf_nonlocal_section(parser,pot)
|
||||
ELSEIF(nametag(2:13)=="PP_SEMILOCAL") THEN
|
||||
CALL upf_semilocal_section(parser,pot)
|
||||
ELSEIF(nametag(2:9)=="PP_PSWFC") THEN
|
||||
! skip section for now
|
||||
ELSEIF(nametag(2:11)=="PP_RHOATOM") THEN
|
||||
! skip section for now
|
||||
ELSEIF(nametag(2:7)=="PP_PAW") THEN
|
||||
! skip section for now
|
||||
ELSEIF(nametag(2:6)=="/UPF>") THEN
|
||||
EXIT
|
||||
ENDIF
|
||||
END IF
|
||||
END DO
|
||||
CALL parser_release(parser)
|
||||
|
||||
CPASSERT(ntag>0)
|
||||
|
||||
! rescale projectors
|
||||
IF(ALLOCATED(pot%beta)) THEN
|
||||
DO ib=1,pot%number_of_proj
|
||||
pot%beta(:,ib) = pot%beta(:,ib)/pot%r(:)
|
||||
END DO
|
||||
END IF
|
||||
|
||||
END SUBROUTINE atom_read_upf
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param parser ...
|
||||
!> \param pot ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE upf_info_section(parser,pot)
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
TYPE(atom_upfpot_type) :: pot
|
||||
|
||||
CHARACTER(LEN=default_string_length) :: line, string
|
||||
INTEGER :: icount, iline
|
||||
LOGICAL :: at_end
|
||||
|
||||
icount = 0
|
||||
DO
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
iline = parser%buffer%present_line_number
|
||||
line = TRIM(parser%buffer%input_lines(iline))
|
||||
CALL parser_get_object(parser,string)
|
||||
IF(string(1:10)=="</PP_INFO>") EXIT
|
||||
icount = icount + 1
|
||||
IF(icount > pot%maxinfo) CYCLE
|
||||
pot%info(icount) = line
|
||||
END DO
|
||||
pot%maxinfo = icount
|
||||
|
||||
END SUBROUTINE upf_info_section
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param parser ...
|
||||
!> \param pot ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE upf_header_option(parser,pot)
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
TYPE(atom_upfpot_type) :: pot
|
||||
|
||||
CHARACTER(LEN=default_string_length) :: line, string
|
||||
INTEGER :: il
|
||||
LOGICAL :: at_end
|
||||
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
END IF
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
IF(string=="/>") EXIT
|
||||
SELECT CASE (string)
|
||||
CASE ("GENERATED")
|
||||
CALL parser_get_object(parser,pot%generated)
|
||||
CASE ("AUTHOR")
|
||||
CALL parser_get_object(parser,pot%author)
|
||||
CASE ("DATE")
|
||||
CALL parser_get_object(parser,pot%date)
|
||||
CASE ("COMMENT")
|
||||
CALL parser_get_object(parser,pot%comment)
|
||||
CASE ("ELEMENT")
|
||||
CALL parser_get_object(parser,line)
|
||||
pot%symbol = line(2:3)
|
||||
CASE ("PSEUDO_TYPE")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
pot%pseudo_type = line(2:il-1)
|
||||
CASE ("RELATIVISTIC")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
pot%relativistic = line(2:il-1)
|
||||
CASE ("IS_ULTRASOFT")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%is_ultrasoft
|
||||
CASE ("IS_PAW")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%is_paw
|
||||
CASE ("IS_COULOMB")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%is_coulomb
|
||||
CASE ("HAS_SO")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%has_so
|
||||
CASE ("HAS_WFC")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%has_wfc
|
||||
CASE ("HAS_GIPAW")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%has_gipaw
|
||||
CASE ("PAW_AS_GIPAW")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%paw_as_gipaw
|
||||
CASE ("CORE_CORRECTION")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%core_correction
|
||||
CASE ("FUNCTIONAL")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
pot%functional = line(2:il-1)
|
||||
CASE ("Z_VALENCE")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%zion
|
||||
CASE ("TOTAL_PSENERGY")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%total_psenergy
|
||||
CASE ("WFC_CUTOFF")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%wfc_cutoff
|
||||
CASE ("RHO_CUTOFF")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%rho_cutoff
|
||||
CASE ("L_MAX")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%l_max
|
||||
CASE ("L_MAX_RHO")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%l_max_rho
|
||||
CASE ("L_LOCAL")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%l_local
|
||||
CASE ("MESH_SIZE")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%mesh_size
|
||||
CASE ("NUMBER_OF_WFC")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%number_of_wfc
|
||||
CASE ("NUMBER_OF_PROJ")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%number_of_proj
|
||||
CASE DEFAULT
|
||||
CPASSERT(.FALSE.)
|
||||
END SELECT
|
||||
END DO
|
||||
|
||||
END SUBROUTINE upf_header_option
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param parser ...
|
||||
!> \param pot ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE upf_mesh_option(parser,pot)
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
TYPE(atom_upfpot_type) :: pot
|
||||
|
||||
CHARACTER(LEN=default_string_length) :: line, string
|
||||
INTEGER :: il, jj
|
||||
LOGICAL :: at_end
|
||||
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
END IF
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
IF(string==">") EXIT
|
||||
SELECT CASE (string)
|
||||
CASE ("DX")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%dx
|
||||
CASE ("XMIN")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%xmin
|
||||
CASE ("RMAX")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%rmax
|
||||
CASE ("MESH")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) jj
|
||||
CPASSERT(pot%mesh_size == jj)
|
||||
CASE ("ZMESH")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) pot%zmesh
|
||||
CASE DEFAULT
|
||||
CPASSERT(.FALSE.)
|
||||
END SELECT
|
||||
|
||||
END DO
|
||||
|
||||
END SUBROUTINE upf_mesh_option
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param parser ...
|
||||
!> \param pot ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE upf_mesh_section(parser,pot)
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
TYPE(atom_upfpot_type) :: pot
|
||||
|
||||
CHARACTER(LEN=default_string_length) :: line, string, string2
|
||||
INTEGER :: icount, il, m, mc, ms
|
||||
LOGICAL :: at_end
|
||||
|
||||
DO
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
SELECT CASE (string)
|
||||
CASE ("<PP_R")
|
||||
m = pot%mesh_size
|
||||
ms = pot%mesh_size
|
||||
mc = 1
|
||||
IF(string(6:6)/=">") THEN
|
||||
! options
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
END IF
|
||||
CALL parser_get_object(parser,string2,lower_to_upper=.TRUE.)
|
||||
IF(string2==">") EXIT
|
||||
SELECT CASE (string2)
|
||||
CASE ("TYPE")
|
||||
CALL parser_get_object(parser,line,lower_to_upper=.TRUE.)
|
||||
CPASSERT(line=='"REAL"')
|
||||
CASE ("SIZE")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) ms
|
||||
CPASSERT(ms <= m)
|
||||
CASE ("COLUMNS")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) mc
|
||||
CASE DEFAULT
|
||||
CPASSERT(.FALSE.)
|
||||
END SELECT
|
||||
END DO
|
||||
END IF
|
||||
ALLOCATE(pot%r(m))
|
||||
pot%r = 0.0_dp
|
||||
icount = 1
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
ELSE IF(parser_test_next_token(parser) == "FLT") THEN
|
||||
CALL parser_get_object(parser,pot%r(icount))
|
||||
icount = icount + 1
|
||||
END IF
|
||||
IF(icount > ms) EXIT
|
||||
END DO
|
||||
CASE ("<PP_RAB")
|
||||
IF(string(6:6)/=">") THEN
|
||||
! options
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
END IF
|
||||
CALL parser_get_object(parser,string2,lower_to_upper=.TRUE.)
|
||||
IF(string2==">") EXIT
|
||||
SELECT CASE (string2)
|
||||
CASE ("TYPE")
|
||||
CALL parser_get_object(parser,line,lower_to_upper=.TRUE.)
|
||||
CPASSERT(line=='"REAL"')
|
||||
CASE ("SIZE")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) ms
|
||||
CPASSERT(ms <= m)
|
||||
CASE ("COLUMNS")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) mc
|
||||
CASE DEFAULT
|
||||
CPASSERT(.FALSE.)
|
||||
END SELECT
|
||||
END DO
|
||||
END IF
|
||||
ALLOCATE(pot%rab(m))
|
||||
pot%rab = 0.0_dp
|
||||
icount = 1
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
ELSE IF(parser_test_next_token(parser) == "FLT") THEN
|
||||
CALL parser_get_object(parser,pot%rab(icount))
|
||||
icount = icount + 1
|
||||
END IF
|
||||
IF(icount > ms) EXIT
|
||||
END DO
|
||||
CASE ("</PP_MESH>")
|
||||
EXIT
|
||||
CASE DEFAULT
|
||||
!
|
||||
END SELECT
|
||||
END DO
|
||||
|
||||
END SUBROUTINE upf_mesh_section
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param parser ...
|
||||
!> \param pot ...
|
||||
!> \param options ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE upf_nlcc_section(parser,pot,options)
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
TYPE(atom_upfpot_type) :: pot
|
||||
LOGICAL, INTENT(IN) :: options
|
||||
|
||||
CHARACTER(LEN=default_string_length) :: line, string
|
||||
INTEGER :: icount, il, m, mc, ms
|
||||
LOGICAL :: at_end
|
||||
|
||||
m = pot%mesh_size
|
||||
ms = m
|
||||
mc = 1
|
||||
IF(options) THEN
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
END IF
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
IF(string==">") EXIT
|
||||
SELECT CASE (string)
|
||||
CASE ("TYPE")
|
||||
CALL parser_get_object(parser,line,lower_to_upper=.TRUE.)
|
||||
CPASSERT(line=='"REAL"')
|
||||
CASE ("SIZE")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) ms
|
||||
CPASSERT(ms <= m)
|
||||
CASE ("COLUMNS")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) mc
|
||||
CASE DEFAULT
|
||||
CPASSERT(.FALSE.)
|
||||
END SELECT
|
||||
END DO
|
||||
END IF
|
||||
|
||||
ALLOCATE(pot%rho_nlcc(m))
|
||||
pot%rho_nlcc = 0.0_dp
|
||||
icount = 1
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
ELSE IF(parser_test_next_token(parser) == "FLT") THEN
|
||||
CALL parser_get_object(parser,pot%rho_nlcc(icount))
|
||||
icount = icount + 1
|
||||
END IF
|
||||
IF(icount > ms) EXIT
|
||||
END DO
|
||||
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
CPASSERT(string=="</PP_NLCC>")
|
||||
|
||||
END SUBROUTINE upf_nlcc_section
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param parser ...
|
||||
!> \param pot ...
|
||||
!> \param options ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE upf_local_section(parser,pot,options)
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
TYPE(atom_upfpot_type) :: pot
|
||||
LOGICAL, INTENT(IN) :: options
|
||||
|
||||
CHARACTER(LEN=default_string_length) :: line, string
|
||||
INTEGER :: icount, il, m, mc, ms
|
||||
LOGICAL :: at_end
|
||||
|
||||
m = pot%mesh_size
|
||||
ms = m
|
||||
mc = 1
|
||||
IF(options) THEN
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
END IF
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
IF(string==">") EXIT
|
||||
SELECT CASE (string)
|
||||
CASE ("TYPE")
|
||||
CALL parser_get_object(parser,line,lower_to_upper=.TRUE.)
|
||||
CPASSERT(line=='"REAL"')
|
||||
CASE ("SIZE")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) ms
|
||||
CPASSERT(ms <= m)
|
||||
CASE ("COLUMNS")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) mc
|
||||
CASE DEFAULT
|
||||
CPASSERT(.FALSE.)
|
||||
END SELECT
|
||||
END DO
|
||||
END IF
|
||||
|
||||
ALLOCATE(pot%vlocal(m))
|
||||
pot%vlocal = 0.0_dp
|
||||
icount = 1
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
ELSE IF(parser_test_next_token(parser) == "FLT") THEN
|
||||
CALL parser_get_object(parser,pot%vlocal(icount))
|
||||
icount = icount + 1
|
||||
END IF
|
||||
IF(icount > ms) EXIT
|
||||
END DO
|
||||
|
||||
! Ry -> Hartree
|
||||
pot%vlocal = 0.5_dp * pot%vlocal
|
||||
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
CPASSERT(string=="</PP_LOCAL>")
|
||||
|
||||
END SUBROUTINE upf_local_section
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param parser ...
|
||||
!> \param pot ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE upf_nonlocal_section(parser,pot)
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
TYPE(atom_upfpot_type) :: pot
|
||||
|
||||
CHARACTER(LEN=default_string_length) :: line, string
|
||||
INTEGER :: i1, i2, ibeta, icount, il, &
|
||||
la, m, mc, ms, nbeta
|
||||
LOGICAL :: at_end
|
||||
|
||||
m = pot%mesh_size
|
||||
nbeta = pot%number_of_proj
|
||||
ALLOCATE(pot%dion(nbeta,nbeta),pot%beta(m,nbeta),pot%lbeta(nbeta))
|
||||
pot%dion = 0.0_dp
|
||||
pot%beta = 0.0_dp
|
||||
pot%lbeta = -1
|
||||
|
||||
ibeta = 0
|
||||
DO
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
IF(string(1:8) == "<PP_BETA") THEN
|
||||
ms = m
|
||||
ibeta = ibeta + 1
|
||||
i1 = ibeta
|
||||
la = 0
|
||||
CPASSERT(ibeta <= nbeta)
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
END IF
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
IF(string==">") EXIT
|
||||
SELECT CASE (string)
|
||||
CASE ("TYPE")
|
||||
CALL parser_get_object(parser,line,lower_to_upper=.TRUE.)
|
||||
CPASSERT(line=='"REAL"')
|
||||
CASE ("SIZE")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) ms
|
||||
CPASSERT(ms <= m)
|
||||
CASE ("COLUMNS")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) mc
|
||||
CASE ("INDEX")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) i1
|
||||
CPASSERT(i1 <= nbeta)
|
||||
CASE ("ANGULAR_MOMENTUM")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) la
|
||||
CASE ("LABEL")
|
||||
CALL parser_get_object(parser,line)
|
||||
! not used currently
|
||||
CASE ("CUTOFF_RADIUS_INDEX")
|
||||
CALL parser_get_object(parser,line)
|
||||
! not used currently
|
||||
CASE ("CUTOFF_RADIUS")
|
||||
CALL parser_get_object(parser,line)
|
||||
! not used currently
|
||||
CASE ("ULTRASOFT_CUTOFF_RADIUS")
|
||||
CALL parser_get_object(parser,line)
|
||||
! not used currently
|
||||
CASE DEFAULT
|
||||
CPASSERT(.FALSE.)
|
||||
END SELECT
|
||||
END DO
|
||||
pot%lbeta(i1) = la
|
||||
icount = 1
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
ELSE IF(parser_test_next_token(parser) == "FLT") THEN
|
||||
CALL parser_get_object(parser,pot%beta(icount,i1))
|
||||
icount = icount + 1
|
||||
END IF
|
||||
IF(icount > ms) EXIT
|
||||
END DO
|
||||
ELSE IF(string(1:7) == "<PP_DIJ") THEN
|
||||
ms = nbeta*nbeta
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
END IF
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
IF(string==">") EXIT
|
||||
SELECT CASE (string)
|
||||
CASE ("TYPE")
|
||||
CALL parser_get_object(parser,line,lower_to_upper=.TRUE.)
|
||||
CPASSERT(line=='"REAL"')
|
||||
CASE ("SIZE")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) ms
|
||||
CPASSERT(ms <= m)
|
||||
CASE ("COLUMNS")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) mc
|
||||
CASE DEFAULT
|
||||
CPASSERT(.FALSE.)
|
||||
END SELECT
|
||||
END DO
|
||||
icount = 1
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
ELSE IF(parser_test_next_token(parser) == "FLT") THEN
|
||||
i1=(icount-1)/nbeta + 1
|
||||
i2=MOD(icount-1,nbeta) + 1
|
||||
CALL parser_get_object(parser,pot%dion(i1,i2))
|
||||
icount = icount + 1
|
||||
END IF
|
||||
IF(icount > ms) EXIT
|
||||
END DO
|
||||
ELSE IF(string(1:7) == "<PP_QIJ") THEN
|
||||
! skip this option
|
||||
ELSE IF(string(1:14) == "</PP_NONLOCAL>") THEN
|
||||
EXIT
|
||||
END IF
|
||||
END DO
|
||||
|
||||
! change units and scaling, beta is still r*beta
|
||||
pot%dion = 2.0_dp * pot%dion
|
||||
pot%beta = 0.5_dp * pot%beta
|
||||
|
||||
END SUBROUTINE upf_nonlocal_section
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief ...
|
||||
!> \param parser ...
|
||||
!> \param pot ...
|
||||
! *****************************************************************************
|
||||
SUBROUTINE upf_semilocal_section(parser,pot)
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
TYPE(atom_upfpot_type) :: pot
|
||||
|
||||
CHARACTER(LEN=default_string_length) :: line, string
|
||||
INTEGER :: i1, ib, icount, il, la, lmax, &
|
||||
m, mc, ms
|
||||
LOGICAL :: at_end
|
||||
|
||||
m = pot%mesh_size
|
||||
lmax = pot%l_max
|
||||
ALLOCATE(pot%vsemi(m,lmax+1))
|
||||
pot%vsemi = 0.0_dp
|
||||
|
||||
ib = 0
|
||||
DO
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
SELECT CASE (string)
|
||||
CASE ("<PP_VNL")
|
||||
ms = m
|
||||
ib = ib + 1
|
||||
i1 = ib
|
||||
la = 0
|
||||
CPASSERT(ib <= lmax+1)
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
END IF
|
||||
CALL parser_get_object(parser,string,lower_to_upper=.TRUE.)
|
||||
IF(string==">") EXIT
|
||||
SELECT CASE (string)
|
||||
CASE ("TYPE")
|
||||
CALL parser_get_object(parser,line,lower_to_upper=.TRUE.)
|
||||
CPASSERT(line=='"REAL"')
|
||||
CASE ("SIZE")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) ms
|
||||
CPASSERT(ms <= m)
|
||||
CASE ("COLUMNS")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) mc
|
||||
CASE ("L")
|
||||
CALL parser_get_object(parser,line)
|
||||
line = ADJUSTL(line)
|
||||
il = LEN_TRIM(line)
|
||||
READ(line(2:il-1),*) la
|
||||
CASE DEFAULT
|
||||
CPASSERT(.FALSE.)
|
||||
END SELECT
|
||||
END DO
|
||||
i1 = la+1
|
||||
icount = 1
|
||||
DO
|
||||
IF(parser_test_next_token(parser) == "EOL") THEN
|
||||
CALL parser_get_next_line(parser,1,at_end)
|
||||
CPASSERT(.NOT.at_end)
|
||||
ELSE IF(parser_test_next_token(parser) == "FLT") THEN
|
||||
CALL parser_get_object(parser,pot%vsemi(icount,i1))
|
||||
icount = icount + 1
|
||||
END IF
|
||||
IF(icount > ms) EXIT
|
||||
END DO
|
||||
CASE ("</PP_SEMILOCAL>")
|
||||
EXIT
|
||||
CASE DEFAULT
|
||||
!
|
||||
END SELECT
|
||||
END DO
|
||||
! Ry -> Hartree
|
||||
pot%vsemi = 0.5_dp*pot%vsemi
|
||||
|
||||
END SUBROUTINE upf_semilocal_section
|
||||
|
||||
! *****************************************************************************
|
||||
|
||||
END MODULE atom_upf
|
||||
|
|
@ -8,9 +8,11 @@
|
|||
!> for the atomic code
|
||||
! *****************************************************************************
|
||||
MODULE atom_xc
|
||||
USE atom_types, ONLY: GTH_PSEUDO,&
|
||||
atom_type,&
|
||||
opmat_type
|
||||
|
||||
USE atom_types, ONLY: atom_type,&
|
||||
gth_pseudo,&
|
||||
opmat_type,&
|
||||
upf_pseudo
|
||||
! ZMP added coulomb_potential_numeric
|
||||
USE atom_utils, ONLY: atom_core_density,&
|
||||
atom_density,&
|
||||
|
|
@ -219,7 +221,7 @@ CONTAINS
|
|||
CALL timeset(routineN,handle)
|
||||
|
||||
nlcc=.FALSE.
|
||||
IF ( atom%potential%ppot_type==GTH_PSEUDO ) THEN
|
||||
IF ( atom%potential%ppot_type==gth_pseudo ) THEN
|
||||
nlcc = atom%potential%gth_pot%nlcc
|
||||
END IF
|
||||
|
||||
|
|
@ -407,8 +409,10 @@ CONTAINS
|
|||
CALL timeset(routineN,handle)
|
||||
|
||||
nlcc=.FALSE.
|
||||
IF ( atom%potential%ppot_type==GTH_PSEUDO ) THEN
|
||||
IF ( atom%potential%ppot_type==gth_pseudo ) THEN
|
||||
nlcc = atom%potential%gth_pot%nlcc
|
||||
ELSE IF ( atom%potential%ppot_type==upf_pseudo ) THEN
|
||||
CPABORT("")
|
||||
END IF
|
||||
|
||||
IF ( ASSOCIATED(xc_section) ) THEN
|
||||
|
|
|
|||
|
|
@ -163,7 +163,9 @@ MODULE input_constants
|
|||
|
||||
! Pseudopotential type for Atom Code
|
||||
INTEGER, PARAMETER, PUBLIC :: no_pseudo=0,&
|
||||
gth_pseudo=1
|
||||
gth_pseudo=1,&
|
||||
upf_pseudo=2,&
|
||||
ecp_pseudo=3
|
||||
! Confinement type for Atom Code
|
||||
INTEGER, PARAMETER, PUBLIC :: no_conf=0,&
|
||||
poly_conf=1,&
|
||||
|
|
|
|||
|
|
@ -19,8 +19,9 @@ MODULE input_cp2k_atom
|
|||
do_dkh2_atom, do_dkh3_atom, do_dkh4_atom, do_dkh5_atom, do_gapw_gcs, &
|
||||
do_gapw_gct, do_gapw_log, do_nonrel_atom, do_numeric, do_rhf_atom, &
|
||||
do_rks_atom, do_rohf_atom, do_sczoramp_atom, do_semi_analytic, &
|
||||
do_uhf_atom, do_uks_atom, do_zoramp_atom, gaussian, geometrical_gto, &
|
||||
gth_pseudo, no_conf, no_pseudo, numerical, poly_conf, slater
|
||||
do_uhf_atom, do_uks_atom, do_zoramp_atom, ecp_pseudo, gaussian, &
|
||||
geometrical_gto, gth_pseudo, no_conf, no_pseudo, numerical, poly_conf, &
|
||||
slater, upf_pseudo
|
||||
USE input_cp2k_xc, ONLY: create_xc_section
|
||||
USE input_keyword_types, ONLY: keyword_create,&
|
||||
keyword_release,&
|
||||
|
|
@ -818,13 +819,17 @@ CONTAINS
|
|||
|
||||
CALL keyword_create(keyword, name="PSEUDO_TYPE",&
|
||||
description="Pseudopotential type",&
|
||||
usage="PSEUDO_TYPE (NONE|GTH)",&
|
||||
usage="PSEUDO_TYPE (NONE|GTH|UPF|ECP)",&
|
||||
default_i_val=no_pseudo,&
|
||||
enum_c_vals=(/"NONE ",&
|
||||
"GTH "/),&
|
||||
enum_i_vals= (/ no_pseudo, gth_pseudo /),&
|
||||
"GTH ",&
|
||||
"UPF ",&
|
||||
"ECP "/),&
|
||||
enum_i_vals= (/ no_pseudo, gth_pseudo, upf_pseudo, ecp_pseudo /),&
|
||||
enum_desc=s2a("Do not use pseudopotentials",&
|
||||
"Use Goedecker-Teter-Hutter pseudopotentials"))
|
||||
"Use Goedecker-Teter-Hutter pseudopotentials",&
|
||||
"Use UPF norm-conserving pseudopotentials",&
|
||||
"Use ECP semi-local pseudopotentials"))
|
||||
CALL section_add_keyword(section,keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
|
|
@ -845,6 +850,9 @@ CONTAINS
|
|||
NULLIFY(subsection)
|
||||
CALL create_gthpotential_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
NULLIFY(subsection)
|
||||
CALL create_ecp_section(subsection)
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
|
||||
END SUBROUTINE create_potential_section
|
||||
|
|
@ -873,6 +881,30 @@ CONTAINS
|
|||
CALL keyword_release(keyword)
|
||||
END SUBROUTINE create_gthpotential_section
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief Creates the &ECP section
|
||||
!> \param section the section to create
|
||||
!> \author jgh
|
||||
! *****************************************************************************
|
||||
SUBROUTINE create_ecp_section(section)
|
||||
TYPE(section_type), POINTER :: section
|
||||
|
||||
CHARACTER(len=*), PARAMETER :: routineN = 'create_ecp_section', &
|
||||
routineP = moduleN//':'//routineN
|
||||
|
||||
TYPE(keyword_type), POINTER :: keyword
|
||||
|
||||
CALL section_create(section,name="ECP",&
|
||||
description="Section used to specify ECP's.",&
|
||||
n_keywords=1, n_subsections=0, repeats=.FALSE.)
|
||||
NULLIFY(keyword)
|
||||
CALL keyword_create(keyword, name="_DEFAULT_KEYWORD_",&
|
||||
description="Effective Core Potentials definition",&
|
||||
repeats=.TRUE.,type_of_var=lchar_t)
|
||||
CALL section_add_keyword(section,keyword)
|
||||
CALL keyword_release(keyword)
|
||||
END SUBROUTINE create_ecp_section
|
||||
|
||||
! *****************************************************************************
|
||||
!> \brief Creates the &BASIS section
|
||||
!> \param section the section to create
|
||||
|
|
|
|||
1961
tests/ATOM/regtest-pseudo/C.blyp-hgh.UPF
Normal file
1961
tests/ATOM/regtest-pseudo/C.blyp-hgh.UPF
Normal file
File diff suppressed because it is too large
Load diff
1728
tests/ATOM/regtest-pseudo/C.pbe-mt_fhi.UPF
Normal file
1728
tests/ATOM/regtest-pseudo/C.pbe-mt_fhi.UPF
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -7,4 +7,8 @@ C_nlcc_1.inp 35 1.e-12
|
|||
C_nlcc_2.inp 35 1.e-12 -6.886838336582
|
||||
C_nlcc_3.inp 61 4.e-03 0.0163108099
|
||||
C_nlcc_4.inp 61 2.e-05 0.1345846267
|
||||
upf1.inp 35 1.e-12 -5.352864657647
|
||||
upf2.inp 35 1.e-12 -7.123642611762
|
||||
ecp1.inp 35 1.e-12 -5.362932801634
|
||||
ecp2.inp 35 1.e-12 -5.362932801634
|
||||
#EOF
|
||||
|
|
|
|||
46
tests/ATOM/regtest-pseudo/ecp1.inp
Normal file
46
tests/ATOM/regtest-pseudo/ecp1.inp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
&GLOBAL
|
||||
PROGRAM_NAME ATOM
|
||||
&END GLOBAL
|
||||
&ATOM
|
||||
ELEMENT C
|
||||
|
||||
RUN_TYPE ENERGY
|
||||
|
||||
ELECTRON_CONFIGURATION CORE 2s2 2p2
|
||||
CORE [He]
|
||||
|
||||
MAX_ANGULAR_MOMENTUM 1
|
||||
|
||||
&METHOD
|
||||
METHOD_TYPE KOHN-SHAM
|
||||
&XC
|
||||
&XC_FUNCTIONAL PBE
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END METHOD
|
||||
|
||||
&OPTIMIZATION
|
||||
MAX_ITER 100
|
||||
EPS_SCF 1.e-6
|
||||
&END
|
||||
&PRINT
|
||||
&POTENTIAL
|
||||
&END POTENTIAL
|
||||
&END PRINT
|
||||
|
||||
&POTENTIAL
|
||||
PSEUDO_TYPE ECP
|
||||
&ECP
|
||||
C nelec 2
|
||||
C ul
|
||||
2 1.000000000 0.000000000
|
||||
C S
|
||||
2 6.401052000 33.121638000
|
||||
C P
|
||||
2 7.307747000 -1.986257000
|
||||
C D
|
||||
2 5.961796000 -9.454318000
|
||||
&END ECP
|
||||
&END POTENTIAL
|
||||
|
||||
&END ATOM
|
||||
37
tests/ATOM/regtest-pseudo/ecp2.inp
Normal file
37
tests/ATOM/regtest-pseudo/ecp2.inp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
&GLOBAL
|
||||
PROGRAM_NAME ATOM
|
||||
&END GLOBAL
|
||||
&ATOM
|
||||
ELEMENT C
|
||||
|
||||
RUN_TYPE ENERGY
|
||||
|
||||
ELECTRON_CONFIGURATION CORE 2s2 2p2
|
||||
CORE [He]
|
||||
|
||||
MAX_ANGULAR_MOMENTUM 1
|
||||
|
||||
&METHOD
|
||||
METHOD_TYPE KOHN-SHAM
|
||||
&XC
|
||||
&XC_FUNCTIONAL PBE
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END METHOD
|
||||
|
||||
&OPTIMIZATION
|
||||
MAX_ITER 100
|
||||
EPS_SCF 1.e-6
|
||||
&END
|
||||
&PRINT
|
||||
&POTENTIAL
|
||||
&END POTENTIAL
|
||||
&END PRINT
|
||||
|
||||
&POTENTIAL
|
||||
PSEUDO_TYPE ECP
|
||||
POTENTIAL_NAME Stuttgart_RLC_ECP
|
||||
POTENTIAL_FILE_NAME ECP_POTENTIALS
|
||||
&END POTENTIAL
|
||||
|
||||
&END ATOM
|
||||
32
tests/ATOM/regtest-pseudo/upf1.inp
Normal file
32
tests/ATOM/regtest-pseudo/upf1.inp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
&GLOBAL
|
||||
PROGRAM_NAME ATOM
|
||||
&END GLOBAL
|
||||
&ATOM
|
||||
ELEMENT C
|
||||
|
||||
RUN_TYPE ENERGY
|
||||
|
||||
ELECTRON_CONFIGURATION CORE 2s2 2p2
|
||||
CORE [He]
|
||||
|
||||
MAX_ANGULAR_MOMENTUM 1
|
||||
|
||||
&METHOD
|
||||
METHOD_TYPE KOHN-SHAM
|
||||
&XC
|
||||
&XC_FUNCTIONAL BLYP
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END METHOD
|
||||
|
||||
&OPTIMIZATION
|
||||
MAX_ITER 100
|
||||
EPS_SCF 1.e-6
|
||||
&END
|
||||
|
||||
&POTENTIAL
|
||||
PSEUDO_TYPE UPF
|
||||
POTENTIAL_FILE_NAME C.blyp-hgh.UPF
|
||||
&END POTENTIAL
|
||||
|
||||
&END ATOM
|
||||
32
tests/ATOM/regtest-pseudo/upf2.inp
Normal file
32
tests/ATOM/regtest-pseudo/upf2.inp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
&GLOBAL
|
||||
PROGRAM_NAME ATOM
|
||||
&END GLOBAL
|
||||
&ATOM
|
||||
ELEMENT C
|
||||
|
||||
RUN_TYPE ENERGY
|
||||
|
||||
ELECTRON_CONFIGURATION CORE 2s2 2p2
|
||||
CORE [He]
|
||||
|
||||
MAX_ANGULAR_MOMENTUM 1
|
||||
|
||||
&METHOD
|
||||
METHOD_TYPE KOHN-SHAM
|
||||
&XC
|
||||
&XC_FUNCTIONAL PBE
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END METHOD
|
||||
|
||||
&OPTIMIZATION
|
||||
MAX_ITER 100
|
||||
EPS_SCF 1.e-6
|
||||
&END
|
||||
|
||||
&POTENTIAL
|
||||
PSEUDO_TYPE UPF
|
||||
POTENTIAL_FILE_NAME C.pbe-mt_fhi.UPF
|
||||
&END POTENTIAL
|
||||
|
||||
&END ATOM
|
||||
Loading…
Add table
Add a link
Reference in a new issue