58#include "./base/base_uses.f90"
64 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'atom_types'
67 INTEGER,
PARAMETER ::
lmat = 5
74 INTEGER,
PARAMETER :: nmax = 25
80 INTEGER,
DIMENSION(0:lmat) :: nbas = 0
81 INTEGER,
DIMENSION(0:lmat) :: nprim = 0
82 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: am => null()
83 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: cm => null()
84 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: as => null()
85 INTEGER,
DIMENSION(:, :),
POINTER :: ns => null()
86 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: bf => null()
87 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: dbf => null()
88 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: ddbf => null()
89 REAL(kind=
dp) :: eps_eig = 0.0_dp
91 LOGICAL :: geometrical = .false.
92 REAL(kind=
dp) :: aval = 0.0_dp, cval = 0.0_dp
93 INTEGER,
DIMENSION(0:lmat) :: start = 0
99 CHARACTER(LEN=2) :: symbol =
""
100 CHARACTER(LEN=default_string_length) :: pname =
""
101 INTEGER,
DIMENSION(0:lmat) :: econf = 0
102 REAL(
dp) :: zion = 0.0_dp
103 REAL(
dp) :: rc = 0.0_dp
105 REAL(
dp),
DIMENSION(5) :: cl = 0.0_dp
106 INTEGER,
DIMENSION(0:lmat) :: nl = 0
107 REAL(
dp),
DIMENSION(0:lmat) :: rcnl = 0.0_dp
108 REAL(
dp),
DIMENSION(4, 4, 0:lmat) :: hnl = 0.0_dp
110 LOGICAL :: soc = .false.
111 REAL(
dp),
DIMENSION(4, 4, 0:lmat) :: knl = 0.0_dp
114 LOGICAL :: nlcc = .false.
115 INTEGER :: nexp_nlcc = 0
116 REAL(kind=
dp),
DIMENSION(10) :: alpha_nlcc = 0.0_dp
117 INTEGER,
DIMENSION(10) :: nct_nlcc = 0
118 REAL(kind=
dp),
DIMENSION(4, 10) :: cval_nlcc = 0.0_dp
120 LOGICAL :: lsdpot = .false.
121 INTEGER :: nexp_lsd = 0
122 REAL(kind=
dp),
DIMENSION(10) :: alpha_lsd = 0.0_dp
123 INTEGER,
DIMENSION(10) :: nct_lsd = 0
124 REAL(kind=
dp),
DIMENSION(4, 10) :: cval_lsd = 0.0_dp
126 LOGICAL :: lpotextended = .false.
127 INTEGER :: nexp_lpot = 0
128 REAL(kind=
dp),
DIMENSION(10) :: alpha_lpot = 0.0_dp
129 INTEGER,
DIMENSION(10) :: nct_lpot = 0
130 REAL(kind=
dp),
DIMENSION(4, 10) :: cval_lpot = 0.0_dp
134 CHARACTER(LEN=2) :: symbol =
""
135 CHARACTER(LEN=default_string_length) :: pname =
""
136 INTEGER,
DIMENSION(0:lmat) :: econf = 0
137 REAL(
dp) :: zion = 0.0_dp
140 INTEGER,
DIMENSION(1:15) :: nrloc = 0
141 REAL(
dp),
DIMENSION(1:15) :: aloc = 0.0_dp
142 REAL(
dp),
DIMENSION(1:15) :: bloc = 0.0_dp
143 INTEGER,
DIMENSION(0:10) :: npot = 0
144 INTEGER,
DIMENSION(1:15, 0:10) :: nrpot = 0
145 REAL(
dp),
DIMENSION(1:15, 0:10) :: apot = 0.0_dp
146 REAL(
dp),
DIMENSION(1:15, 0:10) :: bpot = 0.0_dp
150 CHARACTER(LEN=2) :: symbol =
""
151 CHARACTER(LEN=default_string_length) :: pname =
""
152 INTEGER,
DIMENSION(0:lmat) :: econf = 0
153 REAL(
dp) :: zion = 0.0_dp
155 LOGICAL :: has_nonlocal = .false.
156 INTEGER :: n_nonlocal = 0
157 LOGICAL,
DIMENSION(0:5) :: is_nonlocal = .false.
158 REAL(kind=
dp),
DIMENSION(nmax) :: a_nonlocal = 0.0_dp
159 REAL(kind=
dp),
DIMENSION(nmax, 0:lmat) :: h_nonlocal = 0.0_dp
160 REAL(kind=
dp),
DIMENSION(nmax, nmax, 0:lmat) :: c_nonlocal = 0.0_dp
161 INTEGER :: n_local = 0
162 REAL(kind=
dp) :: ac_local = 0.0_dp
163 REAL(kind=
dp),
DIMENSION(nmax) :: a_local = 0.0_dp
164 REAL(kind=
dp),
DIMENSION(nmax) :: c_local = 0.0_dp
165 LOGICAL :: has_nlcc = .false.
166 INTEGER :: n_nlcc = 0
167 REAL(kind=
dp),
DIMENSION(nmax) :: a_nlcc = 0.0_dp
168 REAL(kind=
dp),
DIMENSION(nmax) :: c_nlcc = 0.0_dp
172 INTEGER :: ppot_type = 0
173 LOGICAL :: confinement = .false.
174 INTEGER :: conf_type = 0
175 REAL(
dp) :: acon = 0.0_dp
176 REAL(
dp) :: rcon = 0.0_dp
177 REAL(
dp) :: scon = 0.0_dp
188 REAL(kind=
dp) :: scale_coulomb = 0.0_dp
189 REAL(kind=
dp) :: scale_longrange = 0.0_dp
190 REAL(kind=
dp) :: omega = 0.0_dp
191 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: kernel
192 LOGICAL :: do_gh = .false.
199 REAL(kind=
dp),
DIMENSION(0:lmat, 10) :: occ = 0.0_dp
200 REAL(kind=
dp),
DIMENSION(0:lmat, 10) :: core = 0.0_dp
201 REAL(kind=
dp),
DIMENSION(0:lmat, 10) :: occupation = 0.0_dp
202 INTEGER :: maxl_occ = 0
203 INTEGER,
DIMENSION(0:lmat) :: maxn_occ = 0
204 INTEGER :: maxl_calc = 0
205 INTEGER,
DIMENSION(0:lmat) :: maxn_calc = 0
206 INTEGER :: multiplicity = 0
207 REAL(kind=
dp),
DIMENSION(0:lmat, 10) :: occa = 0.0_dp, occb = 0.0_dp
213 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: int => null()
217 INTEGER :: status = 0
218 INTEGER :: ppstat = 0
219 LOGICAL :: eri_coulomb = .false.
220 LOGICAL :: eri_exchange = .false.
221 LOGICAL :: all_nu = .false.
222 INTEGER,
DIMENSION(0:lmat) :: n = 0, nne = 0
223 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: ovlp => null(), kin => null(), core => null(), clsd => null()
224 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: utrans => null(), uptrans => null()
225 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: hnl => null()
226 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: conf => null()
227 TYPE(
eri),
DIMENSION(100) :: ceri =
eri()
228 TYPE(
eri),
DIMENSION(100) :: eeri =
eri()
229 INTEGER :: dkhstat = 0
230 INTEGER :: zorastat = 0
231 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: tzora => null()
232 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: hdkh => null()
238 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: wfn => null(), wfna => null(), wfnb => null()
239 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: pmat => null(), pmata => null(), pmatb => null()
240 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: ener => null(), enera => null(), enerb => null()
241 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: refene => null(), refchg => null(), refnod => null()
242 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: wrefene => null(), wrefchg => null(), wrefnod => null()
243 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: crefene => null(), crefchg => null(), crefnod => null()
244 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: wpsir0 => null(), tpsir0 => null()
245 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: rcmax => null()
246 CHARACTER(LEN=2),
DIMENSION(:, :, :),
POINTER :: reftype => null()
252 INTEGER,
DIMENSION(0:lmat) :: n = 0
253 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: op => null()
259 REAL(kind=
dp),
DIMENSION(:),
POINTER :: op => null()
265 TYPE atom_energy_type
266 REAL(kind=
dp) :: etot = 0.0_dp
267 REAL(kind=
dp) :: eband = 0.0_dp
268 REAL(kind=
dp) :: ekin = 0.0_dp
269 REAL(kind=
dp) :: epot = 0.0_dp
270 REAL(kind=
dp) :: ecore = 0.0_dp
271 REAL(kind=
dp) :: elsd = 0.0_dp
272 REAL(kind=
dp) :: epseudo = 0.0_dp
273 REAL(kind=
dp) :: eploc = 0.0_dp
274 REAL(kind=
dp) :: epnl = 0.0_dp
275 REAL(kind=
dp) :: exc = 0.0_dp
276 REAL(kind=
dp) :: ecoulomb = 0.0_dp
277 REAL(kind=
dp) :: eexchange = 0.0_dp
278 REAL(kind=
dp) :: econfinement = 0.0_dp
279 END TYPE atom_energy_type
284 REAL(kind=
dp) :: damping = 0.0_dp
285 REAL(kind=
dp) :: eps_scf = 0.0_dp
286 REAL(kind=
dp) :: eps_diis = 0.0_dp
287 INTEGER :: max_iter = 0
288 INTEGER :: n_diis = 0
296 LOGICAL :: pp_calc = .false.
298 LOGICAL :: do_zmp = .false., doread = .false., read_vxc = .false., dm = .false.
299 CHARACTER(LEN=default_string_length) :: ext_file =
"", ext_vxc_file =
"", &
300 zmp_restart_file =
""
307 REAL(kind=
dp) :: lambda = 0.0_dp
308 REAL(kind=
dp) :: rho_diff_integral = 0.0_dp
309 REAL(kind=
dp) :: weight = 0.0_dp, zmpgrid_tol = 0.0_dp, zmpvxcgrid_tol = 0.0_dp
316 TYPE(atom_energy_type) :: energy = atom_energy_type()
380 INTEGER,
INTENT(IN) :: zval
381 CHARACTER(LEN=2) :: btyp
383 INTEGER,
PARAMETER :: nua = 40, nup = 16
384 REAL(kind=
dp),
DIMENSION(nua),
PARAMETER :: ugbs = (/0.007299_dp, 0.013705_dp, 0.025733_dp, &
385 0.048316_dp, 0.090718_dp, 0.170333_dp, 0.319819_dp, 0.600496_dp, 1.127497_dp, 2.117000_dp,&
386 3.974902_dp, 7.463317_dp, 14.013204_dp, 26.311339_dp, 49.402449_dp, 92.758561_dp, &
387 174.164456_dp, 327.013024_dp, 614.003114_dp, 1152.858743_dp, 2164.619772_dp, &
388 4064.312984_dp, 7631.197056_dp, 14328.416324_dp, 26903.186074_dp, 50513.706789_dp, &
389 94845.070265_dp, 178082.107320_dp, 334368.848683_dp, 627814.487663_dp, 1178791.123851_dp, &
390 2213310.684886_dp, 4155735.557141_dp, 7802853.046713_dp, 14650719.428954_dp, &
391 27508345.793637_dp, 51649961.080194_dp, 96978513.342764_dp, 182087882.613702_dp, &
392 341890134.751331_dp/)
394 CHARACTER(LEN=default_string_length) :: basis_fn, basis_name
395 INTEGER :: basistype, i, j, k, l, ll, m, ngp, nl, &
397 INTEGER,
DIMENSION(0:lmat) :: starti
398 INTEGER,
DIMENSION(:),
POINTER :: nqm, num_gto, num_slater, sindex
399 REAL(kind=
dp) :: al, amax, aval, cval, ear, pf, rk
400 REAL(kind=
dp),
DIMENSION(:),
POINTER :: expo
408 NULLIFY (basis%am, basis%cm, basis%as, basis%ns, basis%bf, basis%dbf, basis%ddbf)
415 cpabort(
"# point radial grid < 0")
418 basis%geometrical = .false.
425 SELECT CASE (basistype)
432 IF (num_gto(1) < 1)
THEN
434 IF (btyp ==
"AE")
THEN
436 ELSEIF (btyp ==
"PP")
THEN
443 ALLOCATE (basis%am(nu, 0:
lmat))
445 basis%am(1:nu, i) = ugbs(1:nu)
449 DO i = 1,
SIZE(num_gto)
450 basis%nbas(i - 1) = num_gto(i)
452 basis%nprim = basis%nbas
453 m = maxval(basis%nbas)
454 ALLOCATE (basis%am(m, 0:
lmat))
457 IF (basis%nbas(l) > 0)
THEN
461 cpabort(
"Atom Basis")
471 cpassert(
SIZE(expo) >= basis%nbas(l))
472 DO i = 1, basis%nbas(l)
473 basis%am(i, l) = expo(i)
480 m = maxval(basis%nbas)
481 ALLOCATE (basis%bf(nr, m, 0:
lmat))
482 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
483 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
488 DO i = 1, basis%nbas(l)
491 rk = basis%grid%rad(k)
492 ear = exp(-al*basis%grid%rad(k)**2)
493 basis%bf(k, i, l) = rk**l*ear
494 basis%dbf(k, i, l) = (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear
495 basis%ddbf(k, i, l) = (real(l*(l - 1),
dp)*rk**(l - 2) - &
496 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))*ear
504 IF (num_gto(1) < 1)
THEN
505 IF (btyp ==
"AE")
THEN
508 ELSEIF (btyp ==
"PP")
THEN
511 ELSEIF (btyp ==
"AA")
THEN
513 amax = cval**(basis%nbas(0) - 1)
514 basis%nbas(0) = nint((log(amax)/log(1.6_dp)))
517 basis%nbas(1) = basis%nbas(0) - 4
518 basis%nbas(2) = basis%nbas(0) - 8
519 basis%nbas(3) = basis%nbas(0) - 12
520 IF (
lmat > 3) basis%nbas(4:
lmat) = 0
521 ELSEIF (btyp ==
"AP")
THEN
524 basis%nbas = nint((log(amax)/log(1.6_dp)))
531 basis%nprim = basis%nbas
534 DO i = 1,
SIZE(num_gto)
535 basis%nbas(i - 1) = num_gto(i)
537 basis%nprim = basis%nbas
541 DO i = 1,
SIZE(sindex)
542 starti(i - 1) = sindex(i)
543 cpassert(sindex(i) >= 0)
548 m = maxval(basis%nbas)
549 ALLOCATE (basis%am(m, 0:
lmat))
552 DO i = 1, basis%nbas(l)
553 ll = i - 1 + starti(l)
554 basis%am(i, l) = aval*cval**(ll)
558 basis%geometrical = .true.
565 m = maxval(basis%nbas)
566 ALLOCATE (basis%bf(nr, m, 0:
lmat))
567 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
568 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
573 DO i = 1, basis%nbas(l)
576 rk = basis%grid%rad(k)
577 ear = exp(-al*basis%grid%rad(k)**2)
578 basis%bf(k, i, l) = rk**l*ear
579 basis%dbf(k, i, l) = (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear
580 basis%ddbf(k, i, l) = (real(l*(l - 1),
dp)*rk**(l - 2) - &
581 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))*ear
590 CALL read_basis_set(
ptable(zval)%symbol, basis, basis_name, basis_fn, &
595 m = maxval(basis%nbas)
596 ALLOCATE (basis%bf(nr, m, 0:
lmat))
597 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
598 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
603 DO i = 1, basis%nprim(l)
606 rk = basis%grid%rad(k)
607 ear = exp(-al*basis%grid%rad(k)**2)
608 DO j = 1, basis%nbas(l)
609 basis%bf(k, j, l) = basis%bf(k, j, l) + rk**l*ear*basis%cm(i, j, l)
610 basis%dbf(k, j, l) = basis%dbf(k, j, l) &
611 + (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear*basis%cm(i, j, l)
612 basis%ddbf(k, j, l) = basis%ddbf(k, j, l) + &
613 (real(l*(l - 1),
dp)*rk**(l - 2) - 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))* &
614 ear*basis%cm(i, j, l)
623 IF (num_slater(1) < 1)
THEN
627 DO i = 1,
SIZE(num_slater)
628 basis%nbas(i - 1) = num_slater(i)
630 basis%nprim = basis%nbas
631 m = maxval(basis%nbas)
632 ALLOCATE (basis%as(m, 0:
lmat), basis%ns(m, 0:
lmat))
636 IF (basis%nbas(l) > 0)
THEN
640 cpabort(
"Atom Basis")
650 cpassert(
SIZE(expo) >= basis%nbas(l))
651 DO i = 1, basis%nbas(l)
652 basis%as(i, l) = expo(i)
657 cpabort(
"Atom Basis")
667 cpassert(
SIZE(nqm) >= basis%nbas(l))
668 DO i = 1, basis%nbas(l)
669 basis%ns(i, l) = nqm(i)
676 m = maxval(basis%nbas)
677 ALLOCATE (basis%bf(nr, m, 0:
lmat))
678 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
679 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
684 DO i = 1, basis%nbas(l)
687 pf = (2._dp*al)**nl*sqrt(2._dp*al/
fac(2*nl))
689 rk = basis%grid%rad(k)
690 ear = rk**(nl - 1)*exp(-al*rk)
691 basis%bf(k, i, l) = pf*ear
692 basis%dbf(k, i, l) = pf*(real(nl - 1,
dp)/rk - al)*ear
693 basis%ddbf(k, i, l) = pf*(real((nl - 2)*(nl - 1),
dp)/rk/rk &
694 - al*real(2*(nl - 1),
dp)/rk + al*al)*ear
712 INTEGER,
PARAMETER :: nua = 40, nup = 20
713 REAL(kind=
dp),
DIMENSION(nua),
PARAMETER :: ugbs = (/0.007299_dp, 0.013705_dp, 0.025733_dp, &
714 0.048316_dp, 0.090718_dp, 0.170333_dp, 0.319819_dp, 0.600496_dp, 1.127497_dp, 2.117000_dp,&
715 3.974902_dp, 7.463317_dp, 14.013204_dp, 26.311339_dp, 49.402449_dp, 92.758561_dp, &
716 174.164456_dp, 327.013024_dp, 614.003114_dp, 1152.858743_dp, 2164.619772_dp, &
717 4064.312984_dp, 7631.197056_dp, 14328.416324_dp, 26903.186074_dp, 50513.706789_dp, &
718 94845.070265_dp, 178082.107320_dp, 334368.848683_dp, 627814.487663_dp, 1178791.123851_dp, &
719 2213310.684886_dp, 4155735.557141_dp, 7802853.046713_dp, 14650719.428954_dp, &
720 27508345.793637_dp, 51649961.080194_dp, 96978513.342764_dp, 182087882.613702_dp, &
721 341890134.751331_dp/)
723 INTEGER :: i, k, l, m, ngp, nr, nu, quadtype
724 REAL(kind=
dp) :: al, ear, rk
726 NULLIFY (basis%am, basis%cm, basis%as, basis%ns, basis%bf, basis%dbf, basis%ddbf)
734 basis%geometrical = .false.
738 basis%eps_eig = 1.e-12_dp
744 ALLOCATE (basis%am(nu, 0:
lmat))
746 basis%am(1:nu, i) = ugbs(1:nu)
750 m = maxval(basis%nbas)
751 ALLOCATE (basis%bf(nr, m, 0:
lmat))
752 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
753 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
758 DO i = 1, basis%nbas(l)
761 rk = basis%grid%rad(k)
762 ear = exp(-al*basis%grid%rad(k)**2)
763 basis%bf(k, i, l) = rk**l*ear
764 basis%dbf(k, i, l) = (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear
765 basis%ddbf(k, i, l) = (real(l*(l - 1),
dp)*rk**(l - 2) - &
766 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))*ear
783 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: r, rab
785 INTEGER :: i, j, k, l, m, n1, n2, n3, ngp, nl, nr, &
787 REAL(kind=
dp) :: al, ear, pf, rk
789 NULLIFY (gbasis%am, gbasis%cm, gbasis%as, gbasis%ns, gbasis%bf, gbasis%dbf, gbasis%ddbf)
792 gbasis%basis_type = basis%basis_type
793 gbasis%nbas(0:
lmat) = basis%nbas(0:
lmat)
794 gbasis%nprim(0:
lmat) = basis%nprim(0:
lmat)
795 IF (
ASSOCIATED(basis%am))
THEN
796 n1 =
SIZE(basis%am, 1)
797 n2 =
SIZE(basis%am, 2)
798 ALLOCATE (gbasis%am(n1, 0:n2 - 1))
801 IF (
ASSOCIATED(basis%cm))
THEN
802 n1 =
SIZE(basis%cm, 1)
803 n2 =
SIZE(basis%cm, 2)
804 n3 =
SIZE(basis%cm, 3)
805 ALLOCATE (gbasis%cm(n1, n2, 0:n3 - 1))
808 IF (
ASSOCIATED(basis%as))
THEN
809 n1 =
SIZE(basis%as, 1)
810 n2 =
SIZE(basis%as, 2)
811 ALLOCATE (gbasis%as(n1, 0:n2 - 1))
814 IF (
ASSOCIATED(basis%ns))
THEN
815 n1 =
SIZE(basis%ns, 1)
816 n2 =
SIZE(basis%ns, 2)
817 ALLOCATE (gbasis%ns(n1, 0:n2 - 1))
820 gbasis%eps_eig = basis%eps_eig
821 gbasis%geometrical = basis%geometrical
822 gbasis%aval = basis%aval
823 gbasis%cval = basis%cval
824 gbasis%start(0:
lmat) = basis%start(0:
lmat)
828 NULLIFY (gbasis%grid)
833 cpabort(
"# point radial grid < 0")
836 gbasis%grid%rad(:) = r(:)
837 gbasis%grid%rad2(:) = r(:)*r(:)
838 gbasis%grid%wr(:) = rab(:)*gbasis%grid%rad2(:)
842 m = maxval(gbasis%nbas)
843 ALLOCATE (gbasis%bf(nr, m, 0:
lmat))
844 ALLOCATE (gbasis%dbf(nr, m, 0:
lmat))
845 ALLOCATE (gbasis%ddbf(nr, m, 0:
lmat))
850 SELECT CASE (gbasis%basis_type)
855 DO i = 1, gbasis%nbas(l)
858 rk = gbasis%grid%rad(k)
859 ear = exp(-al*gbasis%grid%rad(k)**2)
860 gbasis%bf(k, i, l) = rk**l*ear
861 gbasis%dbf(k, i, l) = (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear
862 gbasis%ddbf(k, i, l) = (real(l*(l - 1),
dp)*rk**(l - 2) - &
863 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))*ear
869 DO i = 1, gbasis%nprim(l)
872 rk = gbasis%grid%rad(k)
873 ear = exp(-al*gbasis%grid%rad(k)**2)
874 DO j = 1, gbasis%nbas(l)
875 gbasis%bf(k, j, l) = gbasis%bf(k, j, l) + rk**l*ear*gbasis%cm(i, j, l)
876 gbasis%dbf(k, j, l) = gbasis%dbf(k, j, l) &
877 + (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear*gbasis%cm(i, j, l)
878 gbasis%ddbf(k, j, l) = gbasis%ddbf(k, j, l) + &
879 (real(l*(l - 1),
dp)*rk**(l - 2) - 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))* &
880 ear*gbasis%cm(i, j, l)
887 DO i = 1, gbasis%nbas(l)
890 pf = (2._dp*al)**nl*sqrt(2._dp*al/
fac(2*nl))
892 rk = gbasis%grid%rad(k)
893 ear = rk**(nl - 1)*exp(-al*rk)
894 gbasis%bf(k, i, l) = pf*ear
895 gbasis%dbf(k, i, l) = pf*(real(nl - 1,
dp)/rk - al)*ear
896 gbasis%ddbf(k, i, l) = pf*(real((nl - 2)*(nl - 1),
dp)/rk/rk &
897 - al*real(2*(nl - 1),
dp)/rk + al*al)*ear
915 IF (
ASSOCIATED(basis%am))
THEN
916 DEALLOCATE (basis%am)
918 IF (
ASSOCIATED(basis%cm))
THEN
919 DEALLOCATE (basis%cm)
921 IF (
ASSOCIATED(basis%as))
THEN
922 DEALLOCATE (basis%as)
924 IF (
ASSOCIATED(basis%ns))
THEN
925 DEALLOCATE (basis%ns)
927 IF (
ASSOCIATED(basis%bf))
THEN
928 DEALLOCATE (basis%bf)
930 IF (
ASSOCIATED(basis%dbf))
THEN
931 DEALLOCATE (basis%dbf)
933 IF (
ASSOCIATED(basis%ddbf))
THEN
934 DEALLOCATE (basis%ddbf)
949 cpassert(.NOT.
ASSOCIATED(
atom))
953 NULLIFY (
atom%zmp_section)
954 NULLIFY (
atom%xc_section)
956 atom%do_zmp = .false.
957 atom%doread = .false.
958 atom%read_vxc = .false.
960 atom%hfx_pot%scale_coulomb = 0.0_dp
961 atom%hfx_pot%scale_longrange = 0.0_dp
962 atom%hfx_pot%omega = 0.0_dp
973 cpassert(
ASSOCIATED(
atom))
976 NULLIFY (
atom%integrals)
977 IF (
ASSOCIATED(
atom%state))
THEN
978 DEALLOCATE (
atom%state)
980 IF (
ASSOCIATED(
atom%orbitals))
THEN
1010 SUBROUTINE set_atom(atom, basis, state, integrals, orbitals, potential, zcore, pp_calc, do_zmp, doread, &
1011 read_vxc, method_type, relativistic, coulomb_integral_type, exchange_integral_type, fmat)
1018 INTEGER,
INTENT(IN),
OPTIONAL :: zcore
1019 LOGICAL,
INTENT(IN),
OPTIONAL :: pp_calc, do_zmp, doread, read_vxc
1020 INTEGER,
INTENT(IN),
OPTIONAL :: method_type, relativistic, &
1021 coulomb_integral_type, &
1022 exchange_integral_type
1025 cpassert(
ASSOCIATED(
atom))
1027 IF (
PRESENT(basis))
atom%basis => basis
1028 IF (
PRESENT(state))
atom%state => state
1029 IF (
PRESENT(integrals))
atom%integrals => integrals
1030 IF (
PRESENT(orbitals))
atom%orbitals => orbitals
1031 IF (
PRESENT(potential))
atom%potential => potential
1032 IF (
PRESENT(zcore))
atom%zcore = zcore
1033 IF (
PRESENT(pp_calc))
atom%pp_calc = pp_calc
1035 IF (
PRESENT(do_zmp))
atom%do_zmp = do_zmp
1036 IF (
PRESENT(doread))
atom%doread = doread
1037 IF (
PRESENT(read_vxc))
atom%read_vxc = read_vxc
1039 IF (
PRESENT(method_type))
atom%method_type = method_type
1040 IF (
PRESENT(relativistic))
atom%relativistic = relativistic
1041 IF (
PRESENT(coulomb_integral_type))
atom%coulomb_integral_type = coulomb_integral_type
1042 IF (
PRESENT(exchange_integral_type))
atom%exchange_integral_type = exchange_integral_type
1044 IF (
PRESENT(fmat))
THEN
1059 INTEGER,
INTENT(IN) :: mbas, mo
1061 cpassert(.NOT.
ASSOCIATED(orbs))
1065 ALLOCATE (orbs%wfn(mbas, mo, 0:
lmat), orbs%wfna(mbas, mo, 0:
lmat), orbs%wfnb(mbas, mo, 0:
lmat))
1070 ALLOCATE (orbs%pmat(mbas, mbas, 0:
lmat), orbs%pmata(mbas, mbas, 0:
lmat), orbs%pmatb(mbas, mbas, 0:
lmat))
1075 ALLOCATE (orbs%ener(mo, 0:
lmat), orbs%enera(mo, 0:
lmat), orbs%enerb(mo, 0:
lmat))
1080 ALLOCATE (orbs%refene(mo, 0:
lmat, 2), orbs%refchg(mo, 0:
lmat, 2), orbs%refnod(mo, 0:
lmat, 2))
1084 ALLOCATE (orbs%wrefene(mo, 0:
lmat, 2), orbs%wrefchg(mo, 0:
lmat, 2), orbs%wrefnod(mo, 0:
lmat, 2))
1085 orbs%wrefene = 0._dp
1086 orbs%wrefchg = 0._dp
1087 orbs%wrefnod = 0._dp
1088 ALLOCATE (orbs%crefene(mo, 0:
lmat, 2), orbs%crefchg(mo, 0:
lmat, 2), orbs%crefnod(mo, 0:
lmat, 2))
1089 orbs%crefene = 0._dp
1090 orbs%crefchg = 0._dp
1091 orbs%crefnod = 0._dp
1092 ALLOCATE (orbs%rcmax(mo, 0:
lmat, 2))
1094 ALLOCATE (orbs%wpsir0(mo, 2), orbs%tpsir0(mo, 2))
1097 ALLOCATE (orbs%reftype(mo, 0:
lmat, 2))
1109 cpassert(
ASSOCIATED(orbs))
1111 IF (
ASSOCIATED(orbs%wfn))
THEN
1112 DEALLOCATE (orbs%wfn, orbs%wfna, orbs%wfnb)
1114 IF (
ASSOCIATED(orbs%pmat))
THEN
1115 DEALLOCATE (orbs%pmat, orbs%pmata, orbs%pmatb)
1117 IF (
ASSOCIATED(orbs%ener))
THEN
1118 DEALLOCATE (orbs%ener, orbs%enera, orbs%enerb)
1120 IF (
ASSOCIATED(orbs%refene))
THEN
1121 DEALLOCATE (orbs%refene)
1123 IF (
ASSOCIATED(orbs%refchg))
THEN
1124 DEALLOCATE (orbs%refchg)
1126 IF (
ASSOCIATED(orbs%refnod))
THEN
1127 DEALLOCATE (orbs%refnod)
1129 IF (
ASSOCIATED(orbs%wrefene))
THEN
1130 DEALLOCATE (orbs%wrefene)
1132 IF (
ASSOCIATED(orbs%wrefchg))
THEN
1133 DEALLOCATE (orbs%wrefchg)
1135 IF (
ASSOCIATED(orbs%wrefnod))
THEN
1136 DEALLOCATE (orbs%wrefnod)
1138 IF (
ASSOCIATED(orbs%crefene))
THEN
1139 DEALLOCATE (orbs%crefene)
1141 IF (
ASSOCIATED(orbs%crefchg))
THEN
1142 DEALLOCATE (orbs%crefchg)
1144 IF (
ASSOCIATED(orbs%crefnod))
THEN
1145 DEALLOCATE (orbs%crefnod)
1147 IF (
ASSOCIATED(orbs%rcmax))
THEN
1148 DEALLOCATE (orbs%rcmax)
1150 IF (
ASSOCIATED(orbs%wpsir0))
THEN
1151 DEALLOCATE (orbs%wpsir0)
1153 IF (
ASSOCIATED(orbs%tpsir0))
THEN
1154 DEALLOCATE (orbs%tpsir0)
1156 IF (
ASSOCIATED(orbs%reftype))
THEN
1157 DEALLOCATE (orbs%reftype)
1173 REAL(kind=
dp),
INTENT(OUT) :: hf_frac
1174 LOGICAL,
INTENT(OUT) :: do_hfx
1177 INTEGER,
INTENT(IN) :: extype
1179 INTEGER :: i, j, nr, nu, pot_type
1180 REAL(kind=
dp) :: scale_coulomb, scale_longrange
1181 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: abscissa, weights
1185 IF (
ASSOCIATED(
atom%xc_section))
THEN
1186 xc_section =>
atom%xc_section
1191 atom%hfx_pot%scale_longrange = 0.0_dp
1192 atom%hfx_pot%scale_coulomb = 1.0_dp
1205 SELECT CASE (pot_type)
1207 cpwarn(
"Potential not implemented, use Coulomb instead!")
1209 atom%hfx_pot%scale_longrange = 0.0_dp
1210 atom%hfx_pot%scale_coulomb = scale_coulomb
1212 atom%hfx_pot%scale_coulomb = 0.0_dp
1213 atom%hfx_pot%scale_longrange = scale_longrange
1215 atom%hfx_pot%scale_coulomb = 1.0_dp
1216 atom%hfx_pot%scale_longrange = -1.0_dp
1218 atom%hfx_pot%scale_coulomb = scale_coulomb
1219 atom%hfx_pot%scale_longrange = scale_longrange
1225 cpabort(
"Only numerical and semi-analytic lrHF exchange available!")
1228 IF (
atom%hfx_pot%scale_longrange /= 0.0_dp .AND. extype ==
do_numeric .AND. .NOT.
ALLOCATED(
atom%hfx_pot%kernel))
THEN
1231 IF (
atom%hfx_pot%do_gh)
THEN
1235 ALLOCATE (weights(
atom%hfx_pot%nr_gh), abscissa(
atom%hfx_pot%nr_gh))
1236 CALL get_gauss_hermite_weights(abscissa, weights,
atom%hfx_pot%nr_gh)
1238 nr =
atom%basis%grid%nr
1239 ALLOCATE (
atom%hfx_pot%kernel(nr,
atom%hfx_pot%nr_gh, 0:
atom%state%maxl_calc +
atom%state%maxl_occ))
1240 atom%hfx_pot%kernel = 0.0_dp
1241 DO nu = 0,
atom%state%maxl_calc +
atom%state%maxl_occ
1242 DO i = 1,
atom%hfx_pot%nr_gh
1245 *abscissa(i)*
atom%basis%grid%rad(j), nu)*sqrt(weights(i))
1253 nr =
atom%basis%grid%nr
1254 ALLOCATE (
atom%hfx_pot%kernel(nr, nr, 0:
atom%state%maxl_calc +
atom%state%maxl_occ))
1255 atom%hfx_pot%kernel = 0.0_dp
1256 DO nu = 0,
atom%state%maxl_calc +
atom%state%maxl_occ
1260 *
atom%basis%grid%rad(i)*
atom%basis%grid%rad(j), nu)
1267 NULLIFY (xc_section)
1279 SUBROUTINE get_gauss_hermite_weights(abscissa, weights, nn)
1280 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: abscissa, weights
1281 INTEGER,
INTENT(IN) :: nn
1283 INTEGER :: counter, ii, info, liwork, lwork
1284 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: iwork
1285 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: diag, subdiag, work
1286 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: eigenvec
1290 ALLOCATE (work(1), iwork(1), diag(2*nn), subdiag(2*nn - 1), eigenvec(2*nn, 2*nn))
1295 subdiag(ii) = sqrt(real(ii, kind=
dp)/2.0_dp)
1299 CALL dstevd(
'V', 2*nn, diag, subdiag, eigenvec, 2*nn, work, lwork, iwork, liwork, info)
1302 cpabort(
'Finding size of working matrices failed!')
1306 lwork = int(work(1))
1308 DEALLOCATE (work, iwork)
1309 ALLOCATE (work(lwork), iwork(liwork))
1312 CALL dstevd(
'V', 2*nn, diag, subdiag, eigenvec, 2*nn, work, lwork, iwork, liwork, info)
1315 cpabort(
'Eigenvalue decomposition failed!')
1318 DEALLOCATE (work, iwork, subdiag)
1324 IF (diag(ii) > 0.0_dp)
THEN
1325 counter = counter + 1
1326 abscissa(counter) = diag(ii)
1327 weights(counter) =
rootpi*eigenvec(1, ii)**2
1330 IF (counter /= nn)
THEN
1331 cpabort(
'Have not found enough or too many zeros!')
1334 END SUBROUTINE get_gauss_hermite_weights
1344 INTEGER,
DIMENSION(0:lmat),
INTENT(IN) :: n
1345 INTEGER,
INTENT(IN),
OPTIONAL :: lmax
1350 IF (
PRESENT(lmax))
THEN
1356 cpassert(.NOT.
ASSOCIATED(opmat))
1361 ALLOCATE (opmat%op(m, m, 0:lm))
1373 cpassert(
ASSOCIATED(opmat))
1376 DEALLOCATE (opmat%op)
1393 cpassert(.NOT.
ASSOCIATED(opgrid))
1401 ALLOCATE (opgrid%op(nr))
1413 cpassert(
ASSOCIATED(opgrid))
1415 NULLIFY (opgrid%grid)
1416 DEALLOCATE (opgrid%op)
1431 INTEGER,
INTENT(IN) :: zval
1432 REAL(
dp),
INTENT(OUT) :: cval, aval
1433 INTEGER,
DIMENSION(0:lmat),
INTENT(OUT) :: ngto, ival
1448 cval = 2.14774520_dp
1449 aval = 0.04850670_dp
1452 cval = 2.08932430_dp
1453 aval = 0.02031060_dp
1456 cval = 2.09753060_dp
1457 aval = 0.03207070_dp
1460 cval = 2.10343410_dp
1461 aval = 0.03591970_dp
1465 cval = 2.10662820_dp
1466 aval = 0.05292410_dp
1470 cval = 2.13743840_dp
1471 aval = 0.06291970_dp
1475 cval = 2.08687310_dp
1476 aval = 0.08350860_dp
1480 cval = 2.12318180_dp
1481 aval = 0.09899170_dp
1485 cval = 2.13164810_dp
1486 aval = 0.11485350_dp
1490 cval = 2.11413310_dp
1491 aval = 0.00922630_dp
1496 cval = 2.12183620_dp
1497 aval = 0.01215850_dp
1502 cval = 2.06073230_dp
1503 aval = 0.01449350_dp
1508 cval = 2.08563660_dp
1509 aval = 0.01861460_dp
1514 cval = 2.04879270_dp
1515 aval = 0.02147790_dp
1520 cval = 2.06216660_dp
1521 aval = 0.01978920_dp
1526 cval = 2.04628670_dp
1527 aval = 0.02451470_dp
1532 cval = 2.08675200_dp
1533 aval = 0.02635040_dp
1538 cval = 2.02715220_dp
1539 aval = 0.01822040_dp
1544 cval = 2.01465650_dp
1545 aval = 0.01646570_dp
1550 cval = 2.01605240_dp
1551 aval = 0.01254190_dp
1557 cval = 2.01800000_dp
1558 aval = 0.01195490_dp
1565 cval = 1.98803560_dp
1566 aval = 0.02492140_dp
1573 cval = 1.98984000_dp
1574 aval = 0.02568400_dp
1581 cval = 2.01694380_dp
1582 aval = 0.02664480_dp
1589 cval = 2.01824090_dp
1590 aval = 0.01355000_dp
1597 cval = 1.98359400_dp
1598 aval = 0.01702210_dp
1605 cval = 1.96797340_dp
1606 aval = 0.02163180_dp
1613 cval = 1.98955180_dp
1614 aval = 0.02304480_dp
1621 cval = 1.98074320_dp
1622 aval = 0.02754320_dp
1629 cval = 2.00551070_dp
1630 aval = 0.02005530_dp
1637 cval = 2.00000030_dp
1638 aval = 0.02003000_dp
1645 cval = 2.00609100_dp
1646 aval = 0.02055620_dp
1653 cval = 2.00701000_dp
1654 aval = 0.02230400_dp
1661 cval = 2.01508710_dp
1662 aval = 0.02685790_dp
1669 cval = 2.01960430_dp
1670 aval = 0.02960430_dp
1677 cval = 2.00031000_dp
1678 aval = 0.00768400_dp
1686 cval = 1.99563960_dp
1687 aval = 0.01401940_dp
1694 cval = 1.98971210_dp
1695 aval = 0.01558470_dp
1701 cval = 1.97976190_dp
1702 aval = 0.01705520_dp
1708 cval = 1.97989290_dp
1709 aval = 0.01527040_dp
1715 cval = 1.97909240_dp
1716 aval = 0.01879720_dp
1722 cval = 1.98508430_dp
1723 aval = 0.01497550_dp
1730 cval = 1.98515010_dp
1731 aval = 0.01856670_dp
1738 cval = 1.98502970_dp
1739 aval = 0.01487000_dp
1746 cval = 1.97672850_dp
1747 aval = 0.01762500_dp
1755 cval = 1.97862730_dp
1756 aval = 0.01863310_dp
1763 cval = 1.97990020_dp
1764 aval = 0.01347150_dp
1771 cval = 1.97979410_dp
1772 aval = 0.00890265_dp
1779 cval = 1.98001000_dp
1780 aval = 0.00895215_dp
1787 cval = 1.97979980_dp
1788 aval = 0.01490290_dp
1795 cval = 1.98009310_dp
1796 aval = 0.01490390_dp
1803 cval = 1.97794750_dp
1804 aval = 0.01425880_dp
1812 cval = 1.97784450_dp
1813 aval = 0.01430130_dp
1821 cval = 1.97784450_dp
1822 aval = 0.00499318_dp
1830 cval = 1.97764820_dp
1831 aval = 0.00500392_dp
1839 cval = 1.97765150_dp
1840 aval = 0.00557083_dp
1848 cval = 1.97768750_dp
1849 aval = 0.00547531_dp
1859 cval = 1.96986600_dp
1860 aval = 0.00813143_dp
1870 cval = 1.97765720_dp
1871 aval = 0.00489201_dp
1881 cval = 1.97768120_dp
1882 aval = 0.00499000_dp
1892 cval = 1.97745700_dp
1893 aval = 0.00615587_dp
1903 cval = 1.97570240_dp
1904 aval = 0.00769959_dp
1914 cval = 1.97629350_dp
1915 aval = 0.00706610_dp
1925 cval = 1.96900000_dp
1926 aval = 0.01019150_dp
1936 cval = 1.97350000_dp
1937 aval = 0.01334320_dp
1947 cval = 1.97493000_dp
1948 aval = 0.01331360_dp
1957 cval = 1.97597670_dp
1958 aval = 0.01434040_dp
1968 cval = 1.97809240_dp
1969 aval = 0.01529430_dp
1979 cval = 1.97644360_dp
1980 aval = 0.01312770_dp
1990 cval = 1.96998000_dp
1991 aval = 0.01745150_dp
2001 cval = 1.97223830_dp
2002 aval = 0.01639750_dp
2012 cval = 1.97462110_dp
2013 aval = 0.01603680_dp
2023 cval = 1.97756000_dp
2024 aval = 0.02030570_dp
2034 cval = 1.97645760_dp
2035 aval = 0.02057180_dp
2045 cval = 1.97725820_dp
2046 aval = 0.02058210_dp
2056 cval = 1.97749380_dp
2057 aval = 0.02219380_dp
2067 cval = 1.97946280_dp
2068 aval = 0.02216280_dp
2078 cval = 1.97852130_dp
2079 aval = 0.02168500_dp
2089 cval = 1.98045190_dp
2090 aval = 0.02177860_dp
2100 cval = 1.97000000_dp
2101 aval = 0.02275000_dp
2111 cval = 1.97713580_dp
2112 aval = 0.02317030_dp
2122 cval = 1.97537880_dp
2123 aval = 0.02672860_dp
2133 cval = 1.97545360_dp
2134 aval = 0.02745360_dp
2144 cval = 1.97338370_dp
2145 aval = 0.02616310_dp
2155 cval = 1.97294240_dp
2156 aval = 0.02429220_dp
2166 cval = 1.98000000_dp
2167 aval = 0.01400000_dp
2187 SUBROUTINE read_basis_set(element_symbol, basis, basis_set_name, basis_set_file, &
2190 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol
2192 CHARACTER(LEN=*),
INTENT(IN) :: basis_set_name, basis_set_file
2195 INTEGER,
PARAMETER :: maxpri = 40, maxset = 20
2197 CHARACTER(len=20*default_string_length) :: line_att
2198 CHARACTER(LEN=240) :: line
2199 CHARACTER(LEN=242) :: line2
2200 CHARACTER(LEN=LEN(basis_set_name)) :: bsname
2201 CHARACTER(LEN=LEN(basis_set_name)+2) :: bsname2
2202 CHARACTER(LEN=LEN(element_symbol)) :: symbol
2203 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
2204 INTEGER :: i, ii, ipgf, irep, iset, ishell, j, k, &
2205 lshell, nj, nmin, ns, nset, strlen1, &
2207 INTEGER,
DIMENSION(maxpri, maxset) :: l
2208 INTEGER,
DIMENSION(maxset) :: lmax, lmin, n, npgf, nshell
2209 LOGICAL :: found, is_ok, match, read_from_input
2210 REAL(
dp) :: expzet, gcca, prefac, zeta
2211 REAL(
dp),
DIMENSION(maxpri, maxpri, maxset) :: gcc
2212 REAL(
dp),
DIMENSION(maxpri, maxset) :: zet
2216 bsname = basis_set_name
2217 symbol = element_symbol
2229 read_from_input = .false.
2231 IF (read_from_input)
THEN
2238 CALL val_get(val, c_val=line_att)
2239 READ (line_att, *) nset
2240 cpassert(nset <= maxset)
2244 CALL val_get(val, c_val=line_att)
2245 READ (line_att, *) n(iset)
2247 READ (line_att, *) lmin(iset)
2249 READ (line_att, *) lmax(iset)
2251 READ (line_att, *) npgf(iset)
2253 cpassert(npgf(iset) <= maxpri)
2255 DO lshell = lmin(iset), lmax(iset)
2256 nmin = n(iset) + lshell - lmin(iset)
2257 READ (line_att, *) ishell
2259 nshell(iset) = nshell(iset) + ishell
2261 l(nshell(iset) - ishell + i, iset) = lshell
2264 cpassert(len_trim(line_att) == 0)
2265 DO ipgf = 1, npgf(iset)
2268 CALL val_get(val, c_val=line_att)
2269 READ (line_att, *) zet(ipgf, iset), (gcc(ipgf, ishell, iset), ishell=1, nshell(iset))
2286 line2 =
" "//line//
" "
2287 symbol2 =
" "//trim(symbol)//
" "
2288 bsname2 =
" "//trim(bsname)//
" "
2289 strlen1 = len_trim(symbol2) + 1
2290 strlen2 = len_trim(bsname2) + 1
2292 IF ((index(line2, symbol2(:strlen1)) > 0) .AND. &
2293 (index(line2, bsname2(:strlen2)) > 0)) match = .true.
2298 cpassert(nset <= maxset)
2304 cpassert(npgf(iset) <= maxpri)
2306 DO lshell = lmin(iset), lmax(iset)
2307 nmin = n(iset) + lshell - lmin(iset)
2309 nshell(iset) = nshell(iset) + ishell
2311 l(nshell(iset) - ishell + i, iset) = lshell
2314 DO ipgf = 1, npgf(iset)
2316 DO ishell = 1, nshell(iset)
2340 DO j = lmin(i), min(lmax(i),
lmat)
2341 basis%nprim(j) = basis%nprim(j) + npgf(i)
2345 IF (k <=
lmat) basis%nbas(k) = basis%nbas(k) + 1
2349 nj = maxval(basis%nprim)
2350 ns = maxval(basis%nbas)
2351 ALLOCATE (basis%am(nj, 0:
lmat))
2353 ALLOCATE (basis%cm(nj, ns, 0:
lmat))
2360 IF (j >= lmin(i) .AND. j <= lmax(i))
THEN
2361 DO ipgf = 1, npgf(i)
2362 basis%am(nj + ipgf, j) = zet(ipgf, i)
2364 DO ii = 1, nshell(i)
2365 IF (l(ii, i) == j)
THEN
2367 DO ipgf = 1, npgf(i)
2368 basis%cm(nj + ipgf, ns, j) = gcc(ipgf, ii, i)
2379 expzet = 0.25_dp*real(2*j + 3,
dp)
2380 prefac = sqrt(
rootpi/2._dp**(j + 2)*
dfac(2*j + 1))
2381 DO ipgf = 1, basis%nprim(j)
2382 DO ii = 1, basis%nbas(j)
2383 gcca = basis%cm(ipgf, ii, j)
2384 zeta = 2._dp*basis%am(ipgf, j)
2385 basis%cm(ipgf, ii, j) = zeta**expzet*gcca/prefac
2390 END SUBROUTINE read_basis_set
2399 TYPE(section_vals_type),
POINTER :: opt_section
2401 INTEGER :: miter, ndiis
2402 REAL(kind=dp) :: damp, eps_diis, eps_scf
2404 CALL section_vals_val_get(opt_section,
"MAX_ITER", i_val=miter)
2405 CALL section_vals_val_get(opt_section,
"EPS_SCF", r_val=eps_scf)
2406 CALL section_vals_val_get(opt_section,
"N_DIIS", i_val=ndiis)
2407 CALL section_vals_val_get(opt_section,
"EPS_DIIS", r_val=eps_diis)
2408 CALL section_vals_val_get(opt_section,
"DAMPING", r_val=damp)
2410 optimization%max_iter = miter
2411 optimization%eps_scf = eps_scf
2412 optimization%n_diis = ndiis
2413 optimization%eps_diis = eps_diis
2414 optimization%damping = damp
2425 TYPE(section_vals_type),
POINTER :: potential_section
2426 INTEGER,
INTENT(IN) :: zval
2428 CHARACTER(LEN=default_string_length) :: pseudo_fn, pseudo_name
2430 REAL(dp),
DIMENSION(:),
POINTER :: convals
2431 TYPE(section_vals_type),
POINTER :: ecp_potential_section, &
2432 gth_potential_section
2435 CALL section_vals_val_get(potential_section,
"PSEUDO_TYPE", i_val=potential%ppot_type)
2437 SELECT CASE (potential%ppot_type)
2439 CALL section_vals_val_get(potential_section,
"POTENTIAL_FILE_NAME", c_val=pseudo_fn)
2440 CALL section_vals_val_get(potential_section,
"POTENTIAL_NAME", c_val=pseudo_name)
2441 gth_potential_section => section_vals_get_subs_vals(potential_section,
"GTH_POTENTIAL")
2442 CALL read_gth_potential(ptable(zval)%symbol, potential%gth_pot, &
2443 pseudo_name, pseudo_fn, gth_potential_section)
2445 CALL section_vals_val_get(potential_section,
"POTENTIAL_FILE_NAME", c_val=pseudo_fn)
2446 CALL section_vals_val_get(potential_section,
"POTENTIAL_NAME", c_val=pseudo_name)
2447 ecp_potential_section => section_vals_get_subs_vals(potential_section,
"ECP")
2449 pseudo_name, pseudo_fn, ecp_potential_section)
2451 CALL section_vals_val_get(potential_section,
"POTENTIAL_FILE_NAME", c_val=pseudo_fn)
2452 CALL section_vals_val_get(potential_section,
"POTENTIAL_NAME", c_val=pseudo_name)
2453 CALL atom_read_upf(potential%upf_pot, pseudo_fn)
2454 potential%upf_pot%pname = pseudo_name
2456 cpabort(
"Not implemented")
2463 potential%ppot_type = no_pseudo
2468 CALL section_vals_val_get(potential_section,
"CONFINEMENT_TYPE", i_val=ic)
2469 potential%conf_type = ic
2470 IF (potential%conf_type == no_conf)
THEN
2471 potential%acon = 0.0_dp
2472 potential%rcon = 4.0_dp
2473 potential%scon = 2.0_dp
2474 potential%confinement = .false.
2475 ELSE IF (potential%conf_type == poly_conf)
THEN
2476 CALL section_vals_val_get(potential_section,
"CONFINEMENT", r_vals=convals)
2477 IF (
SIZE(convals) >= 1)
THEN
2478 IF (convals(1) > 0.0_dp)
THEN
2479 potential%confinement = .true.
2480 potential%acon = convals(1)
2481 IF (
SIZE(convals) >= 2)
THEN
2482 potential%rcon = convals(2)
2484 potential%rcon = 4.0_dp
2486 IF (
SIZE(convals) >= 3)
THEN
2487 potential%scon = convals(3)
2489 potential%scon = 2.0_dp
2492 potential%confinement = .false.
2495 potential%confinement = .false.
2497 ELSE IF (potential%conf_type == barrier_conf)
THEN
2498 potential%acon = 200.0_dp
2499 potential%rcon = 4.0_dp
2500 potential%scon = 12.0_dp
2501 potential%confinement = .true.
2502 CALL section_vals_val_get(potential_section,
"CONFINEMENT", r_vals=convals)
2503 IF (
SIZE(convals) >= 1)
THEN
2504 IF (convals(1) > 0.0_dp)
THEN
2505 potential%acon = convals(1)
2506 IF (
SIZE(convals) >= 2)
THEN
2507 potential%rcon = convals(2)
2509 IF (
SIZE(convals) >= 3)
THEN
2510 potential%scon = convals(3)
2513 potential%confinement = .false.
2526 potential%confinement = .false.
2528 CALL atom_release_upf(potential%upf_pot)
2539 SUBROUTINE read_gth_potential(element_symbol, potential, pseudo_name, pseudo_file, &
2542 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol
2544 CHARACTER(LEN=*),
INTENT(IN) :: pseudo_name, pseudo_file
2545 TYPE(section_vals_type),
POINTER :: potential_section
2547 CHARACTER(LEN=240) :: line
2548 CHARACTER(LEN=242) :: line2
2549 CHARACTER(len=5*default_string_length) :: line_att
2550 CHARACTER(LEN=LEN(element_symbol)) :: symbol
2551 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
2552 CHARACTER(LEN=LEN(pseudo_name)) :: apname
2553 CHARACTER(LEN=LEN(pseudo_name)+2) :: apname2
2554 INTEGER :: i, ic, ipot, j, l, nlmax, strlen1, &
2556 INTEGER,
DIMENSION(0:lmat) :: elec_conf
2557 LOGICAL :: found, is_ok, match, read_from_input
2558 TYPE(cp_sll_val_type),
POINTER ::
list
2559 TYPE(val_type),
POINTER :: val
2563 apname = pseudo_name
2564 symbol = element_symbol
2566 potential%symbol = symbol
2567 potential%pname = apname
2569 potential%rc = 0._dp
2571 potential%cl = 0._dp
2573 potential%rcnl = 0._dp
2574 potential%hnl = 0._dp
2575 potential%soc = .false.
2576 potential%knl = 0._dp
2578 potential%lpotextended = .false.
2579 potential%lsdpot = .false.
2580 potential%nlcc = .false.
2581 potential%nexp_lpot = 0
2582 potential%nexp_lsd = 0
2583 potential%nexp_nlcc = 0
2585 read_from_input = .false.
2586 CALL section_vals_get(potential_section, explicit=read_from_input)
2587 IF (read_from_input)
THEN
2588 CALL section_vals_list_get(potential_section,
"_DEFAULT_KEYWORD_",
list=
list)
2589 CALL uppercase(symbol)
2590 CALL uppercase(apname)
2593 is_ok = cp_sll_val_next(
list, val)
2595 CALL val_get(val, c_val=line_att)
2596 READ (line_att, *) elec_conf(l)
2597 CALL remove_word(line_att)
2598 DO WHILE (len_trim(line_att) /= 0)
2600 READ (line_att, *) elec_conf(l)
2601 CALL remove_word(line_att)
2603 potential%econf(0:
lmat) = elec_conf(0:
lmat)
2604 potential%zion = real(sum(elec_conf), dp)
2606 is_ok = cp_sll_val_next(
list, val)
2608 CALL val_get(val, c_val=line_att)
2609 READ (line_att, *) potential%rc
2610 CALL remove_word(line_att)
2612 READ (line_att, *) potential%ncl
2613 CALL remove_word(line_att)
2614 DO i = 1, potential%ncl
2615 READ (line_att, *) potential%cl(i)
2616 CALL remove_word(line_att)
2620 is_ok = cp_sll_val_next(
list, val)
2622 CALL val_get(val, c_val=line_att)
2623 IF (index(line_att,
"LPOT") /= 0)
THEN
2624 potential%lpotextended = .true.
2625 CALL remove_word(line_att)
2626 READ (line_att, *) potential%nexp_lpot
2627 DO ipot = 1, potential%nexp_lpot
2628 is_ok = cp_sll_val_next(
list, val)
2630 CALL val_get(val, c_val=line_att)
2631 READ (line_att, *) potential%alpha_lpot(ipot)
2632 CALL remove_word(line_att)
2633 READ (line_att, *) potential%nct_lpot(ipot)
2634 CALL remove_word(line_att)
2635 DO ic = 1, potential%nct_lpot(ipot)
2636 READ (line_att, *) potential%cval_lpot(ic, ipot)
2637 CALL remove_word(line_att)
2640 ELSEIF (index(line_att,
"NLCC") /= 0)
THEN
2641 potential%nlcc = .true.
2642 CALL remove_word(line_att)
2643 READ (line_att, *) potential%nexp_nlcc
2644 DO ipot = 1, potential%nexp_nlcc
2645 is_ok = cp_sll_val_next(
list, val)
2647 CALL val_get(val, c_val=line_att)
2648 READ (line_att, *) potential%alpha_nlcc(ipot)
2649 CALL remove_word(line_att)
2650 READ (line_att, *) potential%nct_nlcc(ipot)
2651 CALL remove_word(line_att)
2652 DO ic = 1, potential%nct_nlcc(ipot)
2653 READ (line_att, *) potential%cval_nlcc(ic, ipot)
2655 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*pi)
2656 CALL remove_word(line_att)
2659 ELSEIF (index(line_att,
"LSD") /= 0)
THEN
2660 potential%lsdpot = .true.
2661 CALL remove_word(line_att)
2662 READ (line_att, *) potential%nexp_lsd
2663 DO ipot = 1, potential%nexp_lsd
2664 is_ok = cp_sll_val_next(
list, val)
2666 CALL val_get(val, c_val=line_att)
2667 READ (line_att, *) potential%alpha_lsd(ipot)
2668 CALL remove_word(line_att)
2669 READ (line_att, *) potential%nct_lsd(ipot)
2670 CALL remove_word(line_att)
2671 DO ic = 1, potential%nct_lsd(ipot)
2672 READ (line_att, *) potential%cval_lsd(ic, ipot)
2673 CALL remove_word(line_att)
2681 READ (line_att, *) nlmax
2682 CALL remove_word(line_att)
2683 IF (index(line_att,
"SOC") /= 0) potential%soc = .true.
2687 is_ok = cp_sll_val_next(
list, val)
2689 CALL val_get(val, c_val=line_att)
2690 READ (line_att, *) potential%rcnl(l)
2691 CALL remove_word(line_att)
2692 READ (line_att, *) potential%nl(l)
2693 CALL remove_word(line_att)
2694 DO i = 1, potential%nl(l)
2696 READ (line_att, *) potential%hnl(1, 1, l)
2697 CALL remove_word(line_att)
2699 cpassert(len_trim(line_att) == 0)
2700 is_ok = cp_sll_val_next(
list, val)
2702 CALL val_get(val, c_val=line_att)
2703 READ (line_att, *) potential%hnl(i, i, l)
2704 CALL remove_word(line_att)
2706 DO j = i + 1, potential%nl(l)
2707 READ (line_att, *) potential%hnl(i, j, l)
2708 potential%hnl(j, i, l) = potential%hnl(i, j, l)
2709 CALL remove_word(line_att)
2712 IF (potential%soc .AND. l /= 0)
THEN
2713 is_ok = cp_sll_val_next(
list, val)
2715 CALL val_get(val, c_val=line_att)
2716 DO i = 1, potential%nl(l)
2718 READ (line_att, *) potential%knl(1, 1, l)
2719 CALL remove_word(line_att)
2721 cpassert(len_trim(line_att) == 0)
2722 is_ok = cp_sll_val_next(
list, val)
2724 CALL val_get(val, c_val=line_att)
2725 READ (line_att, *) potential%knl(i, i, l)
2726 CALL remove_word(line_att)
2728 DO j = i + 1, potential%nl(l)
2729 READ (line_att, *) potential%knl(i, j, l)
2730 potential%knl(j, i, l) = potential%knl(i, j, l)
2731 CALL remove_word(line_att)
2735 cpassert(len_trim(line_att) == 0)
2740 TYPE(cp_parser_type) :: parser
2741 CALL parser_create(parser, pseudo_file)
2744 CALL parser_search_string(parser, trim(apname), .true., found, line)
2746 CALL uppercase(symbol)
2747 CALL uppercase(apname)
2750 CALL uppercase(line)
2751 line2 =
" "//line//
" "
2752 symbol2 =
" "//trim(symbol)//
" "
2753 apname2 =
" "//trim(apname)//
" "
2754 strlen1 = len_trim(symbol2) + 1
2755 strlen2 = len_trim(apname2) + 1
2757 IF ((index(line2, symbol2(:strlen1)) > 0) .AND. &
2758 (index(line2, apname2(:strlen2)) > 0)) match = .true.
2763 CALL parser_get_object(parser, elec_conf(l), newline=.true.)
2764 DO WHILE (parser_test_next_token(parser) ==
"INT")
2766 CALL parser_get_object(parser, elec_conf(l))
2768 potential%econf(0:
lmat) = elec_conf(0:
lmat)
2769 potential%zion = real(sum(elec_conf), dp)
2771 CALL parser_get_object(parser, potential%rc, newline=.true.)
2773 CALL parser_get_object(parser, potential%ncl)
2774 DO i = 1, potential%ncl
2775 CALL parser_get_object(parser, potential%cl(i))
2779 CALL parser_get_next_line(parser, 1)
2780 IF (parser_test_next_token(parser) ==
"INT")
THEN
2782 ELSEIF (parser_test_next_token(parser) ==
"STR")
THEN
2783 CALL parser_get_object(parser, line)
2784 IF (index(line,
"LPOT") /= 0)
THEN
2786 potential%lpotextended = .true.
2787 CALL parser_get_object(parser, potential%nexp_lpot)
2788 DO ipot = 1, potential%nexp_lpot
2789 CALL parser_get_object(parser, potential%alpha_lpot(ipot), newline=.true.)
2790 CALL parser_get_object(parser, potential%nct_lpot(ipot))
2791 DO ic = 1, potential%nct_lpot(ipot)
2792 CALL parser_get_object(parser, potential%cval_lpot(ic, ipot))
2795 ELSEIF (index(line,
"NLCC") /= 0)
THEN
2797 potential%nlcc = .true.
2798 CALL parser_get_object(parser, potential%nexp_nlcc)
2799 DO ipot = 1, potential%nexp_nlcc
2800 CALL parser_get_object(parser, potential%alpha_nlcc(ipot), newline=.true.)
2801 CALL parser_get_object(parser, potential%nct_nlcc(ipot))
2802 DO ic = 1, potential%nct_nlcc(ipot)
2803 CALL parser_get_object(parser, potential%cval_nlcc(ic, ipot))
2805 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*pi)
2808 ELSEIF (index(line,
"LSD") /= 0)
THEN
2810 potential%lsdpot = .true.
2811 CALL parser_get_object(parser, potential%nexp_lsd)
2812 DO ipot = 1, potential%nexp_lsd
2813 CALL parser_get_object(parser, potential%alpha_lsd(ipot), newline=.true.)
2814 CALL parser_get_object(parser, potential%nct_lsd(ipot))
2815 DO ic = 1, potential%nct_lsd(ipot)
2816 CALL parser_get_object(parser, potential%cval_lsd(ic, ipot))
2827 CALL parser_get_object(parser, nlmax)
2829 IF (parser_test_next_token(parser) ==
"STR")
THEN
2830 CALL parser_get_object(parser, line)
2831 IF (index(line,
"SOC") /= 0) potential%soc = .true.
2835 CALL parser_get_object(parser, potential%rcnl(l), newline=.true.)
2836 CALL parser_get_object(parser, potential%nl(l))
2837 DO i = 1, potential%nl(l)
2839 CALL parser_get_object(parser, potential%hnl(i, i, l))
2841 CALL parser_get_object(parser, potential%hnl(i, i, l), newline=.true.)
2843 DO j = i + 1, potential%nl(l)
2844 CALL parser_get_object(parser, potential%hnl(i, j, l))
2845 potential%hnl(j, i, l) = potential%hnl(i, j, l)
2848 IF (potential%soc .AND. l /= 0)
THEN
2849 DO i = 1, potential%nl(l)
2850 CALL parser_get_object(parser, potential%knl(i, i, l), newline=.true.)
2851 DO j = i + 1, potential%nl(l)
2852 CALL parser_get_object(parser, potential%knl(i, j, l))
2853 potential%knl(j, i, l) = potential%knl(i, j, l)
2868 CALL parser_release(parser)
2872 END SUBROUTINE read_gth_potential
2884 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol
2886 CHARACTER(LEN=*),
INTENT(IN) :: pseudo_name, pseudo_file
2887 TYPE(section_vals_type),
POINTER :: potential_section
2889 CHARACTER(LEN=240) :: line
2890 CHARACTER(len=5*default_string_length) :: line_att
2891 CHARACTER(LEN=LEN(element_symbol)+1) :: symbol
2892 CHARACTER(LEN=LEN(pseudo_name)) :: apname
2893 INTEGER :: i, ic, l, ncore, nel
2894 LOGICAL :: found, is_ok, read_from_input
2895 TYPE(cp_sll_val_type),
POINTER ::
list
2896 TYPE(val_type),
POINTER :: val
2898 apname = pseudo_name
2899 symbol = element_symbol
2900 CALL get_ptable_info(symbol, number=ncore)
2902 potential%symbol = symbol
2903 potential%pname = apname
2909 potential%aloc = 0.0_dp
2910 potential%bloc = 0.0_dp
2913 potential%apot = 0.0_dp
2914 potential%bpot = 0.0_dp
2916 read_from_input = .false.
2917 CALL section_vals_get(potential_section, explicit=read_from_input)
2918 IF (read_from_input)
THEN
2919 CALL section_vals_list_get(potential_section,
"_DEFAULT_KEYWORD_",
list=
list)
2921 is_ok = cp_sll_val_next(
list, val)
2923 CALL val_get(val, c_val=line_att)
2924 CALL remove_word(line_att)
2925 CALL remove_word(line_att)
2927 READ (line_att, *) nel
2928 potential%zion = real(ncore - nel, kind=dp)
2930 is_ok = cp_sll_val_next(
list, val)
2932 CALL val_get(val, c_val=line_att)
2934 IF (.NOT. cp_sll_val_next(
list, val))
EXIT
2935 CALL val_get(val, c_val=line_att)
2936 IF (index(line_att, element_symbol) == 0)
THEN
2937 potential%nloc = potential%nloc + 1
2939 READ (line_att, *) potential%nrloc(ic), potential%bloc(ic), potential%aloc(ic)
2946 CALL val_get(val, c_val=line_att)
2947 IF (index(line_att, element_symbol) == 0)
THEN
2948 potential%npot(l) = potential%npot(l) + 1
2949 ic = potential%npot(l)
2950 READ (line_att, *) potential%nrpot(ic, l), potential%bpot(ic, l), potential%apot(ic, l)
2952 potential%lmax = potential%lmax + 1
2955 IF (.NOT. cp_sll_val_next(
list, val))
EXIT
2960 TYPE(cp_parser_type) :: parser
2961 CALL parser_create(parser, pseudo_file)
2964 CALL parser_search_string(parser, trim(apname), .true., found, line)
2967 CALL parser_get_object(parser, line, newline=.true.)
2968 IF (trim(line) == element_symbol)
THEN
2969 CALL parser_get_object(parser, line, lower_to_upper=.true.)
2970 cpassert(trim(line) ==
"NELEC")
2972 CALL parser_get_object(parser, nel)
2973 potential%zion = real(ncore - nel, kind=dp)
2975 CALL parser_get_object(parser, line, newline=.true.)
2978 CALL parser_read_line(parser, 1)
2979 IF (parser_test_next_token(parser) ==
"STR")
EXIT
2980 potential%nloc = potential%nloc + 1
2982 CALL parser_get_object(parser, potential%nrloc(ic))
2983 CALL parser_get_object(parser, potential%bloc(ic))
2984 CALL parser_get_object(parser, potential%aloc(ic))
2988 CALL parser_get_object(parser, symbol)
2989 IF (symbol == element_symbol)
THEN
2991 potential%lmax = potential%lmax + 1
2993 CALL parser_read_line(parser, 1)
2994 IF (parser_test_next_token(parser) ==
"STR")
EXIT
2995 potential%npot(l) = potential%npot(l) + 1
2996 ic = potential%npot(l)
2997 CALL parser_get_object(parser, potential%nrpot(ic, l))
2998 CALL parser_get_object(parser, potential%bpot(ic, l))
2999 CALL parser_get_object(parser, potential%apot(ic, l))
3006 ELSE IF (line ==
"END")
THEN
3007 cpabort(
"Element not found in ECP library")
3011 cpabort(
"ECP type not found in library")
3016 CALL parser_release(parser)
3021 potential%econf(0:3) = ptable(ncore)%e_conv(0:3)
3024 cpabort(
"Unknown Core State")
3027 potential%econf(0:3) = potential%econf(0:3) - ptable(2)%e_conv(0:3)
3029 potential%econf(0:3) = potential%econf(0:3) - ptable(10)%e_conv(0:3)
3031 potential%econf(0:3) = potential%econf(0:3) - ptable(18)%e_conv(0:3)
3033 potential%econf(0:3) = potential%econf(0:3) - ptable(18)%e_conv(0:3)
3034 potential%econf(2) = potential%econf(2) - 10
3036 potential%econf(0:3) = potential%econf(0:3) - ptable(36)%e_conv(0:3)
3038 potential%econf(0:3) = potential%econf(0:3) - ptable(36)%e_conv(0:3)
3039 potential%econf(2) = potential%econf(2) - 10
3041 potential%econf(0:3) = potential%econf(0:3) - ptable(54)%e_conv(0:3)
3043 potential%econf(0:3) = potential%econf(0:3) - ptable(36)%e_conv(0:3)
3044 potential%econf(2) = potential%econf(2) - 10
3045 potential%econf(3) = potential%econf(3) - 14
3047 potential%econf(0:3) = potential%econf(0:3) - ptable(54)%e_conv(0:3)
3048 potential%econf(3) = potential%econf(3) - 14
3050 potential%econf(0:3) = potential%econf(0:3) - ptable(54)%e_conv(0:3)
3051 potential%econf(2) = potential%econf(2) - 10
3052 potential%econf(3) = potential%econf(3) - 14
3055 cpassert(all(potential%econf >= 0))
3065 TYPE(grid_atom_type) :: grid1, grid2
3069 REAL(kind=dp) :: dr, dw
3072 IF (grid1%nr == grid2%nr)
THEN
3074 dr = abs(grid1%rad(i) - grid2%rad(i))
3075 dw = abs(grid1%wr(i) - grid2%wr(i))
3076 IF (dr + dw > 1.0e-12_dp)
THEN
Define the atom type and its sub types.
integer, parameter, public num_basis
subroutine, public read_atom_opt_section(optimization, opt_section)
...
subroutine, public create_atom_type(atom)
...
integer, parameter, public cgto_basis
integer, parameter, public gto_basis
integer, parameter, public sto_basis
subroutine, public release_atom_type(atom)
...
subroutine, public release_opmat(opmat)
...
subroutine, public release_atom_potential(potential)
...
subroutine, public init_atom_basis(basis, basis_section, zval, btyp)
Initialize the basis for the atomic code.
logical function, public atom_compare_grids(grid1, grid2)
...
subroutine, public release_opgrid(opgrid)
...
subroutine, public release_atom_orbs(orbs)
...
integer, parameter, public lmat
subroutine, public set_atom(atom, basis, state, integrals, orbitals, potential, zcore, pp_calc, do_zmp, doread, read_vxc, method_type, relativistic, coulomb_integral_type, exchange_integral_type, fmat)
...
subroutine, public init_atom_potential(potential, potential_section, zval)
...
subroutine, public release_atom_basis(basis)
...
subroutine, public create_atom_orbs(orbs, mbas, mo)
...
subroutine, public init_atom_basis_default_pp(basis)
...
subroutine, public create_opmat(opmat, n, lmax)
...
subroutine, public atom_basis_gridrep(basis, gbasis, r, rab)
...
subroutine, public read_ecp_potential(element_symbol, potential, pseudo_name, pseudo_file, potential_section)
...
subroutine, public setup_hf_section(hf_frac, do_hfx, atom, xc_section, extype)
...
subroutine, public clementi_geobas(zval, cval, aval, ngto, ival)
...
subroutine, public create_opgrid(opgrid, grid)
...
Routines that process Quantum Espresso UPF files.
subroutine, public atom_read_upf(pot, upf_filename, read_header)
...
pure subroutine, public atom_release_upf(upfpot)
...
Calculates Bessel functions.
elemental impure real(kind=dp) function, public bessel0(x, l)
...
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public limpanuparb2011
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_read_line(parser, nline, at_end)
Read the next line from a logical unit "unit" (I/O node only). Skip (nline-1) lines and skip also all...
subroutine, public parser_get_next_line(parser, nline, at_end)
Read the next input line and broadcast the input information. Skip (nline-1) lines and skip also all ...
character(len=3) function, public parser_test_next_token(parser, string_length)
Test next input object.
subroutine, public parser_search_string(parser, string, ignore_case, found, line, begin_line, search_from_begin_of_file)
Search a string pattern in a file defined by its logical unit number "unit". A case sensitive search ...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_release(parser)
releases the parser
subroutine, public parser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, quote_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)
Start a parser run. Initial variables allow to @SET stuff before opening the file.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
real(kind=dp), dimension(-1:2 *maxfac+1), parameter, public dfac
real(kind=dp), parameter, public rootpi
real(kind=dp), dimension(0:maxfac), parameter, public fac
Periodic Table related data definitions.
type(atom), dimension(0:nelem), public ptable
subroutine, public get_ptable_info(symbol, number, amass, ielement, covalent_radius, metallic_radius, vdw_radius, found)
Pass information about the kind given the element symbol.
subroutine, public deallocate_grid_atom(grid_atom)
Deallocate a Gaussian-type orbital (GTO) basis set data set.
subroutine, public allocate_grid_atom(grid_atom)
Initialize components of the grid_atom_type structure.
subroutine, public create_grid_atom(grid_atom, nr, na, llmax, ll, quadrature)
...
Utilities for string manipulations.
character(len=1), parameter, public newline
subroutine, public remove_word(string)
remove a word from a string (words are separated by white spaces)
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
Provides all information about a basis set.
Provides all information about a pseudopotential.
Provides info about hartree-fock exchange (For now, we only support potentials that can be represente...
Information on optimization procedure.
Holds atomic orbitals and energies.
Provides all information on states and occupation.
Provides all information about an atomic kind.