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
111 LOGICAL :: nlcc = .false.
112 INTEGER :: nexp_nlcc = 0
113 REAL(kind=
dp),
DIMENSION(10) :: alpha_nlcc = 0.0_dp
114 INTEGER,
DIMENSION(10) :: nct_nlcc = 0
115 REAL(kind=
dp),
DIMENSION(4, 10) :: cval_nlcc = 0.0_dp
117 LOGICAL :: lsdpot = .false.
118 INTEGER :: nexp_lsd = 0
119 REAL(kind=
dp),
DIMENSION(10) :: alpha_lsd = 0.0_dp
120 INTEGER,
DIMENSION(10) :: nct_lsd = 0
121 REAL(kind=
dp),
DIMENSION(4, 10) :: cval_lsd = 0.0_dp
123 LOGICAL :: lpotextended = .false.
124 INTEGER :: nexp_lpot = 0
125 REAL(kind=
dp),
DIMENSION(10) :: alpha_lpot = 0.0_dp
126 INTEGER,
DIMENSION(10) :: nct_lpot = 0
127 REAL(kind=
dp),
DIMENSION(4, 10) :: cval_lpot = 0.0_dp
131 CHARACTER(LEN=2) :: symbol =
""
132 CHARACTER(LEN=default_string_length) :: pname =
""
133 INTEGER,
DIMENSION(0:lmat) :: econf = 0
134 REAL(
dp) :: zion = 0.0_dp
137 INTEGER,
DIMENSION(1:15) :: nrloc = 0
138 REAL(
dp),
DIMENSION(1:15) :: aloc = 0.0_dp
139 REAL(
dp),
DIMENSION(1:15) :: bloc = 0.0_dp
140 INTEGER,
DIMENSION(0:10) :: npot = 0
141 INTEGER,
DIMENSION(1:15, 0:10) :: nrpot = 0
142 REAL(
dp),
DIMENSION(1:15, 0:10) :: apot = 0.0_dp
143 REAL(
dp),
DIMENSION(1:15, 0:10) :: bpot = 0.0_dp
147 CHARACTER(LEN=2) :: symbol =
""
148 CHARACTER(LEN=default_string_length) :: pname =
""
149 INTEGER,
DIMENSION(0:lmat) :: econf = 0
150 REAL(
dp) :: zion = 0.0_dp
152 LOGICAL :: has_nonlocal = .false.
153 INTEGER :: n_nonlocal = 0
154 LOGICAL,
DIMENSION(0:5) :: is_nonlocal = .false.
155 REAL(kind=
dp),
DIMENSION(nmax) :: a_nonlocal = 0.0_dp
156 REAL(kind=
dp),
DIMENSION(nmax, 0:lmat) :: h_nonlocal = 0.0_dp
157 REAL(kind=
dp),
DIMENSION(nmax, nmax, 0:lmat) :: c_nonlocal = 0.0_dp
158 INTEGER :: n_local = 0
159 REAL(kind=
dp) :: ac_local = 0.0_dp
160 REAL(kind=
dp),
DIMENSION(nmax) :: a_local = 0.0_dp
161 REAL(kind=
dp),
DIMENSION(nmax) :: c_local = 0.0_dp
162 LOGICAL :: has_nlcc = .false.
163 INTEGER :: n_nlcc = 0
164 REAL(kind=
dp),
DIMENSION(nmax) :: a_nlcc = 0.0_dp
165 REAL(kind=
dp),
DIMENSION(nmax) :: c_nlcc = 0.0_dp
169 INTEGER :: ppot_type = 0
170 LOGICAL :: confinement = .false.
171 INTEGER :: conf_type = 0
172 REAL(
dp) :: acon = 0.0_dp
173 REAL(
dp) :: rcon = 0.0_dp
174 REAL(
dp) :: scon = 0.0_dp
185 REAL(kind=
dp) :: scale_coulomb = 0.0_dp
186 REAL(kind=
dp) :: scale_longrange = 0.0_dp
187 REAL(kind=
dp) :: omega = 0.0_dp
188 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: kernel
189 LOGICAL :: do_gh = .false.
196 REAL(kind=
dp),
DIMENSION(0:lmat, 10) :: occ = 0.0_dp
197 REAL(kind=
dp),
DIMENSION(0:lmat, 10) :: core = 0.0_dp
198 REAL(kind=
dp),
DIMENSION(0:lmat, 10) :: occupation = 0.0_dp
199 INTEGER :: maxl_occ = 0
200 INTEGER,
DIMENSION(0:lmat) :: maxn_occ = 0
201 INTEGER :: maxl_calc = 0
202 INTEGER,
DIMENSION(0:lmat) :: maxn_calc = 0
203 INTEGER :: multiplicity = 0
204 REAL(kind=
dp),
DIMENSION(0:lmat, 10) :: occa = 0.0_dp, occb = 0.0_dp
210 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: int => null()
214 INTEGER :: status = 0
215 INTEGER :: ppstat = 0
216 LOGICAL :: eri_coulomb = .false.
217 LOGICAL :: eri_exchange = .false.
218 LOGICAL :: all_nu = .false.
219 INTEGER,
DIMENSION(0:lmat) :: n = 0, nne = 0
220 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: ovlp => null(), kin => null(), core => null(), clsd => null()
221 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: utrans => null(), uptrans => null()
222 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: hnl => null()
223 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: conf => null()
224 TYPE(
eri),
DIMENSION(100) :: ceri =
eri()
225 TYPE(
eri),
DIMENSION(100) :: eeri =
eri()
226 INTEGER :: dkhstat = 0
227 INTEGER :: zorastat = 0
228 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: tzora => null()
229 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: hdkh => null()
235 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: wfn => null(), wfna => null(), wfnb => null()
236 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: pmat => null(), pmata => null(), pmatb => null()
237 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: ener => null(), enera => null(), enerb => null()
238 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: refene => null(), refchg => null(), refnod => null()
239 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: wrefene => null(), wrefchg => null(), wrefnod => null()
240 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: crefene => null(), crefchg => null(), crefnod => null()
241 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: wpsir0 => null(), tpsir0 => null()
242 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: rcmax => null()
243 CHARACTER(LEN=2),
DIMENSION(:, :, :),
POINTER :: reftype => null()
249 INTEGER,
DIMENSION(0:lmat) :: n = 0
250 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: op => null()
256 REAL(kind=
dp),
DIMENSION(:),
POINTER :: op => null()
262 TYPE atom_energy_type
263 REAL(kind=
dp) :: etot = 0.0_dp
264 REAL(kind=
dp) :: eband = 0.0_dp
265 REAL(kind=
dp) :: ekin = 0.0_dp
266 REAL(kind=
dp) :: epot = 0.0_dp
267 REAL(kind=
dp) :: ecore = 0.0_dp
268 REAL(kind=
dp) :: elsd = 0.0_dp
269 REAL(kind=
dp) :: epseudo = 0.0_dp
270 REAL(kind=
dp) :: eploc = 0.0_dp
271 REAL(kind=
dp) :: epnl = 0.0_dp
272 REAL(kind=
dp) :: exc = 0.0_dp
273 REAL(kind=
dp) :: ecoulomb = 0.0_dp
274 REAL(kind=
dp) :: eexchange = 0.0_dp
275 REAL(kind=
dp) :: econfinement = 0.0_dp
276 END TYPE atom_energy_type
281 REAL(kind=
dp) :: damping = 0.0_dp
282 REAL(kind=
dp) :: eps_scf = 0.0_dp
283 REAL(kind=
dp) :: eps_diis = 0.0_dp
284 INTEGER :: max_iter = 0
285 INTEGER :: n_diis = 0
293 LOGICAL :: pp_calc = .false.
295 LOGICAL :: do_zmp = .false., doread = .false., read_vxc = .false., dm = .false.
296 CHARACTER(LEN=default_string_length) :: ext_file =
"", ext_vxc_file =
"", &
297 zmp_restart_file =
""
304 REAL(kind=
dp) :: lambda = 0.0_dp
305 REAL(kind=
dp) :: rho_diff_integral = 0.0_dp
306 REAL(kind=
dp) :: weight = 0.0_dp, zmpgrid_tol = 0.0_dp, zmpvxcgrid_tol = 0.0_dp
313 TYPE(atom_energy_type) :: energy = atom_energy_type()
377 INTEGER,
INTENT(IN) :: zval
378 CHARACTER(LEN=2) :: btyp
380 INTEGER,
PARAMETER :: nua = 40, nup = 16
381 REAL(kind=
dp),
DIMENSION(nua),
PARAMETER :: ugbs = (/0.007299_dp, 0.013705_dp, 0.025733_dp, &
382 0.048316_dp, 0.090718_dp, 0.170333_dp, 0.319819_dp, 0.600496_dp, 1.127497_dp, 2.117000_dp,&
383 3.974902_dp, 7.463317_dp, 14.013204_dp, 26.311339_dp, 49.402449_dp, 92.758561_dp, &
384 174.164456_dp, 327.013024_dp, 614.003114_dp, 1152.858743_dp, 2164.619772_dp, &
385 4064.312984_dp, 7631.197056_dp, 14328.416324_dp, 26903.186074_dp, 50513.706789_dp, &
386 94845.070265_dp, 178082.107320_dp, 334368.848683_dp, 627814.487663_dp, 1178791.123851_dp, &
387 2213310.684886_dp, 4155735.557141_dp, 7802853.046713_dp, 14650719.428954_dp, &
388 27508345.793637_dp, 51649961.080194_dp, 96978513.342764_dp, 182087882.613702_dp, &
389 341890134.751331_dp/)
391 CHARACTER(LEN=default_string_length) :: basis_fn, basis_name
392 INTEGER :: basistype, i, j, k, l, ll, m, ngp, nl, &
394 INTEGER,
DIMENSION(0:lmat) :: starti
395 INTEGER,
DIMENSION(:),
POINTER :: nqm, num_gto, num_slater, sindex
396 REAL(kind=
dp) :: al, amax, aval, cval, ear, pf, rk
397 REAL(kind=
dp),
DIMENSION(:),
POINTER :: expo
405 NULLIFY (basis%am, basis%cm, basis%as, basis%ns, basis%bf, basis%dbf, basis%ddbf)
412 cpabort(
"# point radial grid < 0")
415 basis%geometrical = .false.
422 SELECT CASE (basistype)
429 IF (num_gto(1) < 1)
THEN
431 IF (btyp ==
"AE")
THEN
433 ELSEIF (btyp ==
"PP")
THEN
440 ALLOCATE (basis%am(nu, 0:
lmat))
442 basis%am(1:nu, i) = ugbs(1:nu)
446 DO i = 1,
SIZE(num_gto)
447 basis%nbas(i - 1) = num_gto(i)
449 basis%nprim = basis%nbas
450 m = maxval(basis%nbas)
451 ALLOCATE (basis%am(m, 0:
lmat))
454 IF (basis%nbas(l) > 0)
THEN
458 cpabort(
"Atom Basis")
468 cpassert(
SIZE(expo) >= basis%nbas(l))
469 DO i = 1, basis%nbas(l)
470 basis%am(i, l) = expo(i)
477 m = maxval(basis%nbas)
478 ALLOCATE (basis%bf(nr, m, 0:
lmat))
479 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
480 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
485 DO i = 1, basis%nbas(l)
488 rk = basis%grid%rad(k)
489 ear = exp(-al*basis%grid%rad(k)**2)
490 basis%bf(k, i, l) = rk**l*ear
491 basis%dbf(k, i, l) = (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear
492 basis%ddbf(k, i, l) = (real(l*(l - 1),
dp)*rk**(l - 2) - &
493 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))*ear
501 IF (num_gto(1) < 1)
THEN
502 IF (btyp ==
"AE")
THEN
505 ELSEIF (btyp ==
"PP")
THEN
508 ELSEIF (btyp ==
"AA")
THEN
510 amax = cval**(basis%nbas(0) - 1)
511 basis%nbas(0) = nint((log(amax)/log(1.6_dp)))
514 basis%nbas(1) = basis%nbas(0) - 4
515 basis%nbas(2) = basis%nbas(0) - 8
516 basis%nbas(3) = basis%nbas(0) - 12
517 IF (
lmat > 3) basis%nbas(4:
lmat) = 0
518 ELSEIF (btyp ==
"AP")
THEN
521 basis%nbas = nint((log(amax)/log(1.6_dp)))
528 basis%nprim = basis%nbas
531 DO i = 1,
SIZE(num_gto)
532 basis%nbas(i - 1) = num_gto(i)
534 basis%nprim = basis%nbas
538 DO i = 1,
SIZE(sindex)
539 starti(i - 1) = sindex(i)
540 cpassert(sindex(i) >= 0)
545 m = maxval(basis%nbas)
546 ALLOCATE (basis%am(m, 0:
lmat))
549 DO i = 1, basis%nbas(l)
550 ll = i - 1 + starti(l)
551 basis%am(i, l) = aval*cval**(ll)
555 basis%geometrical = .true.
562 m = maxval(basis%nbas)
563 ALLOCATE (basis%bf(nr, m, 0:
lmat))
564 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
565 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
570 DO i = 1, basis%nbas(l)
573 rk = basis%grid%rad(k)
574 ear = exp(-al*basis%grid%rad(k)**2)
575 basis%bf(k, i, l) = rk**l*ear
576 basis%dbf(k, i, l) = (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear
577 basis%ddbf(k, i, l) = (real(l*(l - 1),
dp)*rk**(l - 2) - &
578 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))*ear
587 CALL read_basis_set(
ptable(zval)%symbol, basis, basis_name, basis_fn, &
592 m = maxval(basis%nbas)
593 ALLOCATE (basis%bf(nr, m, 0:
lmat))
594 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
595 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
600 DO i = 1, basis%nprim(l)
603 rk = basis%grid%rad(k)
604 ear = exp(-al*basis%grid%rad(k)**2)
605 DO j = 1, basis%nbas(l)
606 basis%bf(k, j, l) = basis%bf(k, j, l) + rk**l*ear*basis%cm(i, j, l)
607 basis%dbf(k, j, l) = basis%dbf(k, j, l) &
608 + (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear*basis%cm(i, j, l)
609 basis%ddbf(k, j, l) = basis%ddbf(k, j, l) + &
610 (real(l*(l - 1),
dp)*rk**(l - 2) - 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))* &
611 ear*basis%cm(i, j, l)
620 IF (num_slater(1) < 1)
THEN
624 DO i = 1,
SIZE(num_slater)
625 basis%nbas(i - 1) = num_slater(i)
627 basis%nprim = basis%nbas
628 m = maxval(basis%nbas)
629 ALLOCATE (basis%as(m, 0:
lmat), basis%ns(m, 0:
lmat))
633 IF (basis%nbas(l) > 0)
THEN
637 cpabort(
"Atom Basis")
647 cpassert(
SIZE(expo) >= basis%nbas(l))
648 DO i = 1, basis%nbas(l)
649 basis%as(i, l) = expo(i)
654 cpabort(
"Atom Basis")
664 cpassert(
SIZE(nqm) >= basis%nbas(l))
665 DO i = 1, basis%nbas(l)
666 basis%ns(i, l) = nqm(i)
673 m = maxval(basis%nbas)
674 ALLOCATE (basis%bf(nr, m, 0:
lmat))
675 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
676 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
681 DO i = 1, basis%nbas(l)
684 pf = (2._dp*al)**nl*sqrt(2._dp*al/
fac(2*nl))
686 rk = basis%grid%rad(k)
687 ear = rk**(nl - 1)*exp(-al*rk)
688 basis%bf(k, i, l) = pf*ear
689 basis%dbf(k, i, l) = pf*(real(nl - 1,
dp)/rk - al)*ear
690 basis%ddbf(k, i, l) = pf*(real((nl - 2)*(nl - 1),
dp)/rk/rk &
691 - al*real(2*(nl - 1),
dp)/rk + al*al)*ear
709 INTEGER,
PARAMETER :: nua = 40, nup = 20
710 REAL(kind=
dp),
DIMENSION(nua),
PARAMETER :: ugbs = (/0.007299_dp, 0.013705_dp, 0.025733_dp, &
711 0.048316_dp, 0.090718_dp, 0.170333_dp, 0.319819_dp, 0.600496_dp, 1.127497_dp, 2.117000_dp,&
712 3.974902_dp, 7.463317_dp, 14.013204_dp, 26.311339_dp, 49.402449_dp, 92.758561_dp, &
713 174.164456_dp, 327.013024_dp, 614.003114_dp, 1152.858743_dp, 2164.619772_dp, &
714 4064.312984_dp, 7631.197056_dp, 14328.416324_dp, 26903.186074_dp, 50513.706789_dp, &
715 94845.070265_dp, 178082.107320_dp, 334368.848683_dp, 627814.487663_dp, 1178791.123851_dp, &
716 2213310.684886_dp, 4155735.557141_dp, 7802853.046713_dp, 14650719.428954_dp, &
717 27508345.793637_dp, 51649961.080194_dp, 96978513.342764_dp, 182087882.613702_dp, &
718 341890134.751331_dp/)
720 INTEGER :: i, k, l, m, ngp, nr, nu, quadtype
721 REAL(kind=
dp) :: al, ear, rk
723 NULLIFY (basis%am, basis%cm, basis%as, basis%ns, basis%bf, basis%dbf, basis%ddbf)
731 basis%geometrical = .false.
735 basis%eps_eig = 1.e-12_dp
741 ALLOCATE (basis%am(nu, 0:
lmat))
743 basis%am(1:nu, i) = ugbs(1:nu)
747 m = maxval(basis%nbas)
748 ALLOCATE (basis%bf(nr, m, 0:
lmat))
749 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
750 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
755 DO i = 1, basis%nbas(l)
758 rk = basis%grid%rad(k)
759 ear = exp(-al*basis%grid%rad(k)**2)
760 basis%bf(k, i, l) = rk**l*ear
761 basis%dbf(k, i, l) = (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear
762 basis%ddbf(k, i, l) = (real(l*(l - 1),
dp)*rk**(l - 2) - &
763 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))*ear
780 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: r, rab
782 INTEGER :: i, j, k, l, m, n1, n2, n3, ngp, nl, nr, &
784 REAL(kind=
dp) :: al, ear, pf, rk
786 NULLIFY (gbasis%am, gbasis%cm, gbasis%as, gbasis%ns, gbasis%bf, gbasis%dbf, gbasis%ddbf)
789 gbasis%basis_type = basis%basis_type
790 gbasis%nbas(0:
lmat) = basis%nbas(0:
lmat)
791 gbasis%nprim(0:
lmat) = basis%nprim(0:
lmat)
792 IF (
ASSOCIATED(basis%am))
THEN
793 n1 =
SIZE(basis%am, 1)
794 n2 =
SIZE(basis%am, 2)
795 ALLOCATE (gbasis%am(n1, 0:n2 - 1))
798 IF (
ASSOCIATED(basis%cm))
THEN
799 n1 =
SIZE(basis%cm, 1)
800 n2 =
SIZE(basis%cm, 2)
801 n3 =
SIZE(basis%cm, 3)
802 ALLOCATE (gbasis%cm(n1, n2, 0:n3 - 1))
805 IF (
ASSOCIATED(basis%as))
THEN
806 n1 =
SIZE(basis%as, 1)
807 n2 =
SIZE(basis%as, 2)
808 ALLOCATE (gbasis%as(n1, 0:n2 - 1))
811 IF (
ASSOCIATED(basis%ns))
THEN
812 n1 =
SIZE(basis%ns, 1)
813 n2 =
SIZE(basis%ns, 2)
814 ALLOCATE (gbasis%ns(n1, 0:n2 - 1))
817 gbasis%eps_eig = basis%eps_eig
818 gbasis%geometrical = basis%geometrical
819 gbasis%aval = basis%aval
820 gbasis%cval = basis%cval
821 gbasis%start(0:
lmat) = basis%start(0:
lmat)
825 NULLIFY (gbasis%grid)
830 cpabort(
"# point radial grid < 0")
833 gbasis%grid%rad(:) = r(:)
834 gbasis%grid%rad2(:) = r(:)*r(:)
835 gbasis%grid%wr(:) = rab(:)*gbasis%grid%rad2(:)
839 m = maxval(gbasis%nbas)
840 ALLOCATE (gbasis%bf(nr, m, 0:
lmat))
841 ALLOCATE (gbasis%dbf(nr, m, 0:
lmat))
842 ALLOCATE (gbasis%ddbf(nr, m, 0:
lmat))
847 SELECT CASE (gbasis%basis_type)
852 DO i = 1, gbasis%nbas(l)
855 rk = gbasis%grid%rad(k)
856 ear = exp(-al*gbasis%grid%rad(k)**2)
857 gbasis%bf(k, i, l) = rk**l*ear
858 gbasis%dbf(k, i, l) = (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear
859 gbasis%ddbf(k, i, l) = (real(l*(l - 1),
dp)*rk**(l - 2) - &
860 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))*ear
866 DO i = 1, gbasis%nprim(l)
869 rk = gbasis%grid%rad(k)
870 ear = exp(-al*gbasis%grid%rad(k)**2)
871 DO j = 1, gbasis%nbas(l)
872 gbasis%bf(k, j, l) = gbasis%bf(k, j, l) + rk**l*ear*gbasis%cm(i, j, l)
873 gbasis%dbf(k, j, l) = gbasis%dbf(k, j, l) &
874 + (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear*gbasis%cm(i, j, l)
875 gbasis%ddbf(k, j, l) = gbasis%ddbf(k, j, l) + &
876 (real(l*(l - 1),
dp)*rk**(l - 2) - 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))* &
877 ear*gbasis%cm(i, j, l)
884 DO i = 1, gbasis%nbas(l)
887 pf = (2._dp*al)**nl*sqrt(2._dp*al/
fac(2*nl))
889 rk = gbasis%grid%rad(k)
890 ear = rk**(nl - 1)*exp(-al*rk)
891 gbasis%bf(k, i, l) = pf*ear
892 gbasis%dbf(k, i, l) = pf*(real(nl - 1,
dp)/rk - al)*ear
893 gbasis%ddbf(k, i, l) = pf*(real((nl - 2)*(nl - 1),
dp)/rk/rk &
894 - al*real(2*(nl - 1),
dp)/rk + al*al)*ear
912 IF (
ASSOCIATED(basis%am))
THEN
913 DEALLOCATE (basis%am)
915 IF (
ASSOCIATED(basis%cm))
THEN
916 DEALLOCATE (basis%cm)
918 IF (
ASSOCIATED(basis%as))
THEN
919 DEALLOCATE (basis%as)
921 IF (
ASSOCIATED(basis%ns))
THEN
922 DEALLOCATE (basis%ns)
924 IF (
ASSOCIATED(basis%bf))
THEN
925 DEALLOCATE (basis%bf)
927 IF (
ASSOCIATED(basis%dbf))
THEN
928 DEALLOCATE (basis%dbf)
930 IF (
ASSOCIATED(basis%ddbf))
THEN
931 DEALLOCATE (basis%ddbf)
946 cpassert(.NOT.
ASSOCIATED(
atom))
950 NULLIFY (
atom%zmp_section)
951 NULLIFY (
atom%xc_section)
953 atom%do_zmp = .false.
954 atom%doread = .false.
955 atom%read_vxc = .false.
957 atom%hfx_pot%scale_coulomb = 0.0_dp
958 atom%hfx_pot%scale_longrange = 0.0_dp
959 atom%hfx_pot%omega = 0.0_dp
970 cpassert(
ASSOCIATED(
atom))
973 NULLIFY (
atom%integrals)
974 IF (
ASSOCIATED(
atom%state))
THEN
975 DEALLOCATE (
atom%state)
977 IF (
ASSOCIATED(
atom%orbitals))
THEN
1007 SUBROUTINE set_atom(atom, basis, state, integrals, orbitals, potential, zcore, pp_calc, do_zmp, doread, &
1008 read_vxc, method_type, relativistic, coulomb_integral_type, exchange_integral_type, fmat)
1015 INTEGER,
INTENT(IN),
OPTIONAL :: zcore
1016 LOGICAL,
INTENT(IN),
OPTIONAL :: pp_calc, do_zmp, doread, read_vxc
1017 INTEGER,
INTENT(IN),
OPTIONAL :: method_type, relativistic, &
1018 coulomb_integral_type, &
1019 exchange_integral_type
1022 cpassert(
ASSOCIATED(
atom))
1024 IF (
PRESENT(basis))
atom%basis => basis
1025 IF (
PRESENT(state))
atom%state => state
1026 IF (
PRESENT(integrals))
atom%integrals => integrals
1027 IF (
PRESENT(orbitals))
atom%orbitals => orbitals
1028 IF (
PRESENT(potential))
atom%potential => potential
1029 IF (
PRESENT(zcore))
atom%zcore = zcore
1030 IF (
PRESENT(pp_calc))
atom%pp_calc = pp_calc
1032 IF (
PRESENT(do_zmp))
atom%do_zmp = do_zmp
1033 IF (
PRESENT(doread))
atom%doread = doread
1034 IF (
PRESENT(read_vxc))
atom%read_vxc = read_vxc
1036 IF (
PRESENT(method_type))
atom%method_type = method_type
1037 IF (
PRESENT(relativistic))
atom%relativistic = relativistic
1038 IF (
PRESENT(coulomb_integral_type))
atom%coulomb_integral_type = coulomb_integral_type
1039 IF (
PRESENT(exchange_integral_type))
atom%exchange_integral_type = exchange_integral_type
1041 IF (
PRESENT(fmat))
THEN
1056 INTEGER,
INTENT(IN) :: mbas, mo
1058 cpassert(.NOT.
ASSOCIATED(orbs))
1062 ALLOCATE (orbs%wfn(mbas, mo, 0:
lmat), orbs%wfna(mbas, mo, 0:
lmat), orbs%wfnb(mbas, mo, 0:
lmat))
1067 ALLOCATE (orbs%pmat(mbas, mbas, 0:
lmat), orbs%pmata(mbas, mbas, 0:
lmat), orbs%pmatb(mbas, mbas, 0:
lmat))
1072 ALLOCATE (orbs%ener(mo, 0:
lmat), orbs%enera(mo, 0:
lmat), orbs%enerb(mo, 0:
lmat))
1077 ALLOCATE (orbs%refene(mo, 0:
lmat, 2), orbs%refchg(mo, 0:
lmat, 2), orbs%refnod(mo, 0:
lmat, 2))
1081 ALLOCATE (orbs%wrefene(mo, 0:
lmat, 2), orbs%wrefchg(mo, 0:
lmat, 2), orbs%wrefnod(mo, 0:
lmat, 2))
1082 orbs%wrefene = 0._dp
1083 orbs%wrefchg = 0._dp
1084 orbs%wrefnod = 0._dp
1085 ALLOCATE (orbs%crefene(mo, 0:
lmat, 2), orbs%crefchg(mo, 0:
lmat, 2), orbs%crefnod(mo, 0:
lmat, 2))
1086 orbs%crefene = 0._dp
1087 orbs%crefchg = 0._dp
1088 orbs%crefnod = 0._dp
1089 ALLOCATE (orbs%rcmax(mo, 0:
lmat, 2))
1091 ALLOCATE (orbs%wpsir0(mo, 2), orbs%tpsir0(mo, 2))
1094 ALLOCATE (orbs%reftype(mo, 0:
lmat, 2))
1106 cpassert(
ASSOCIATED(orbs))
1108 IF (
ASSOCIATED(orbs%wfn))
THEN
1109 DEALLOCATE (orbs%wfn, orbs%wfna, orbs%wfnb)
1111 IF (
ASSOCIATED(orbs%pmat))
THEN
1112 DEALLOCATE (orbs%pmat, orbs%pmata, orbs%pmatb)
1114 IF (
ASSOCIATED(orbs%ener))
THEN
1115 DEALLOCATE (orbs%ener, orbs%enera, orbs%enerb)
1117 IF (
ASSOCIATED(orbs%refene))
THEN
1118 DEALLOCATE (orbs%refene)
1120 IF (
ASSOCIATED(orbs%refchg))
THEN
1121 DEALLOCATE (orbs%refchg)
1123 IF (
ASSOCIATED(orbs%refnod))
THEN
1124 DEALLOCATE (orbs%refnod)
1126 IF (
ASSOCIATED(orbs%wrefene))
THEN
1127 DEALLOCATE (orbs%wrefene)
1129 IF (
ASSOCIATED(orbs%wrefchg))
THEN
1130 DEALLOCATE (orbs%wrefchg)
1132 IF (
ASSOCIATED(orbs%wrefnod))
THEN
1133 DEALLOCATE (orbs%wrefnod)
1135 IF (
ASSOCIATED(orbs%crefene))
THEN
1136 DEALLOCATE (orbs%crefene)
1138 IF (
ASSOCIATED(orbs%crefchg))
THEN
1139 DEALLOCATE (orbs%crefchg)
1141 IF (
ASSOCIATED(orbs%crefnod))
THEN
1142 DEALLOCATE (orbs%crefnod)
1144 IF (
ASSOCIATED(orbs%rcmax))
THEN
1145 DEALLOCATE (orbs%rcmax)
1147 IF (
ASSOCIATED(orbs%wpsir0))
THEN
1148 DEALLOCATE (orbs%wpsir0)
1150 IF (
ASSOCIATED(orbs%tpsir0))
THEN
1151 DEALLOCATE (orbs%tpsir0)
1153 IF (
ASSOCIATED(orbs%reftype))
THEN
1154 DEALLOCATE (orbs%reftype)
1170 REAL(kind=
dp),
INTENT(OUT) :: hf_frac
1171 LOGICAL,
INTENT(OUT) :: do_hfx
1174 INTEGER,
INTENT(IN) :: extype
1176 INTEGER :: i, j, nr, nu, pot_type
1177 REAL(kind=
dp) :: scale_coulomb, scale_longrange
1178 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: abscissa, weights
1182 IF (
ASSOCIATED(
atom%xc_section))
THEN
1183 xc_section =>
atom%xc_section
1188 atom%hfx_pot%scale_longrange = 0.0_dp
1189 atom%hfx_pot%scale_coulomb = 1.0_dp
1202 SELECT CASE (pot_type)
1204 cpwarn(
"Potential not implemented, use Coulomb instead!")
1206 atom%hfx_pot%scale_longrange = 0.0_dp
1207 atom%hfx_pot%scale_coulomb = scale_coulomb
1209 atom%hfx_pot%scale_coulomb = 0.0_dp
1210 atom%hfx_pot%scale_longrange = scale_longrange
1212 atom%hfx_pot%scale_coulomb = 1.0_dp
1213 atom%hfx_pot%scale_longrange = -1.0_dp
1215 atom%hfx_pot%scale_coulomb = scale_coulomb
1216 atom%hfx_pot%scale_longrange = scale_longrange
1222 cpabort(
"Only numerical and semi-analytic lrHF exchange available!")
1225 IF (
atom%hfx_pot%scale_longrange /= 0.0_dp .AND. extype ==
do_numeric .AND. .NOT.
ALLOCATED(
atom%hfx_pot%kernel))
THEN
1228 IF (
atom%hfx_pot%do_gh)
THEN
1232 ALLOCATE (weights(
atom%hfx_pot%nr_gh), abscissa(
atom%hfx_pot%nr_gh))
1233 CALL get_gauss_hermite_weights(abscissa, weights,
atom%hfx_pot%nr_gh)
1235 nr =
atom%basis%grid%nr
1236 ALLOCATE (
atom%hfx_pot%kernel(nr,
atom%hfx_pot%nr_gh, 0:
atom%state%maxl_calc +
atom%state%maxl_occ))
1237 atom%hfx_pot%kernel = 0.0_dp
1238 DO nu = 0,
atom%state%maxl_calc +
atom%state%maxl_occ
1239 DO i = 1,
atom%hfx_pot%nr_gh
1242 *abscissa(i)*
atom%basis%grid%rad(j), nu)*sqrt(weights(i))
1250 nr =
atom%basis%grid%nr
1251 ALLOCATE (
atom%hfx_pot%kernel(nr, nr, 0:
atom%state%maxl_calc +
atom%state%maxl_occ))
1252 atom%hfx_pot%kernel = 0.0_dp
1253 DO nu = 0,
atom%state%maxl_calc +
atom%state%maxl_occ
1257 *
atom%basis%grid%rad(i)*
atom%basis%grid%rad(j), nu)
1264 NULLIFY (xc_section)
1276 SUBROUTINE get_gauss_hermite_weights(abscissa, weights, nn)
1277 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: abscissa, weights
1278 INTEGER,
INTENT(IN) :: nn
1280 INTEGER :: counter, ii, info, liwork, lwork
1281 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: iwork
1282 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: diag, subdiag, work
1283 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: eigenvec
1287 ALLOCATE (work(1), iwork(1), diag(2*nn), subdiag(2*nn - 1), eigenvec(2*nn, 2*nn))
1292 subdiag(ii) = sqrt(real(ii, kind=
dp)/2.0_dp)
1296 CALL dstevd(
'V', 2*nn, diag, subdiag, eigenvec, 2*nn, work, lwork, iwork, liwork, info)
1299 cpabort(
'Finding size of working matrices failed!')
1303 lwork = int(work(1))
1305 DEALLOCATE (work, iwork)
1306 ALLOCATE (work(lwork), iwork(liwork))
1309 CALL dstevd(
'V', 2*nn, diag, subdiag, eigenvec, 2*nn, work, lwork, iwork, liwork, info)
1312 cpabort(
'Eigenvalue decomposition failed!')
1315 DEALLOCATE (work, iwork, subdiag)
1321 IF (diag(ii) > 0.0_dp)
THEN
1322 counter = counter + 1
1323 abscissa(counter) = diag(ii)
1324 weights(counter) =
rootpi*eigenvec(1, ii)**2
1327 IF (counter /= nn)
THEN
1328 cpabort(
'Have not found enough or too many zeros!')
1331 END SUBROUTINE get_gauss_hermite_weights
1341 INTEGER,
DIMENSION(0:lmat),
INTENT(IN) :: n
1342 INTEGER,
INTENT(IN),
OPTIONAL :: lmax
1347 IF (
PRESENT(lmax))
THEN
1353 cpassert(.NOT.
ASSOCIATED(opmat))
1358 ALLOCATE (opmat%op(m, m, 0:lm))
1370 cpassert(
ASSOCIATED(opmat))
1373 DEALLOCATE (opmat%op)
1390 cpassert(.NOT.
ASSOCIATED(opgrid))
1398 ALLOCATE (opgrid%op(nr))
1410 cpassert(
ASSOCIATED(opgrid))
1412 NULLIFY (opgrid%grid)
1413 DEALLOCATE (opgrid%op)
1428 INTEGER,
INTENT(IN) :: zval
1429 REAL(
dp),
INTENT(OUT) :: cval, aval
1430 INTEGER,
DIMENSION(0:lmat),
INTENT(OUT) :: ngto, ival
1445 cval = 2.14774520_dp
1446 aval = 0.04850670_dp
1449 cval = 2.08932430_dp
1450 aval = 0.02031060_dp
1453 cval = 2.09753060_dp
1454 aval = 0.03207070_dp
1457 cval = 2.10343410_dp
1458 aval = 0.03591970_dp
1462 cval = 2.10662820_dp
1463 aval = 0.05292410_dp
1467 cval = 2.13743840_dp
1468 aval = 0.06291970_dp
1472 cval = 2.08687310_dp
1473 aval = 0.08350860_dp
1477 cval = 2.12318180_dp
1478 aval = 0.09899170_dp
1482 cval = 2.13164810_dp
1483 aval = 0.11485350_dp
1487 cval = 2.11413310_dp
1488 aval = 0.00922630_dp
1493 cval = 2.12183620_dp
1494 aval = 0.01215850_dp
1499 cval = 2.06073230_dp
1500 aval = 0.01449350_dp
1505 cval = 2.08563660_dp
1506 aval = 0.01861460_dp
1511 cval = 2.04879270_dp
1512 aval = 0.02147790_dp
1517 cval = 2.06216660_dp
1518 aval = 0.01978920_dp
1523 cval = 2.04628670_dp
1524 aval = 0.02451470_dp
1529 cval = 2.08675200_dp
1530 aval = 0.02635040_dp
1535 cval = 2.02715220_dp
1536 aval = 0.01822040_dp
1541 cval = 2.01465650_dp
1542 aval = 0.01646570_dp
1547 cval = 2.01605240_dp
1548 aval = 0.01254190_dp
1554 cval = 2.01800000_dp
1555 aval = 0.01195490_dp
1562 cval = 1.98803560_dp
1563 aval = 0.02492140_dp
1570 cval = 1.98984000_dp
1571 aval = 0.02568400_dp
1578 cval = 2.01694380_dp
1579 aval = 0.02664480_dp
1586 cval = 2.01824090_dp
1587 aval = 0.01355000_dp
1594 cval = 1.98359400_dp
1595 aval = 0.01702210_dp
1602 cval = 1.96797340_dp
1603 aval = 0.02163180_dp
1610 cval = 1.98955180_dp
1611 aval = 0.02304480_dp
1618 cval = 1.98074320_dp
1619 aval = 0.02754320_dp
1626 cval = 2.00551070_dp
1627 aval = 0.02005530_dp
1634 cval = 2.00000030_dp
1635 aval = 0.02003000_dp
1642 cval = 2.00609100_dp
1643 aval = 0.02055620_dp
1650 cval = 2.00701000_dp
1651 aval = 0.02230400_dp
1658 cval = 2.01508710_dp
1659 aval = 0.02685790_dp
1666 cval = 2.01960430_dp
1667 aval = 0.02960430_dp
1674 cval = 2.00031000_dp
1675 aval = 0.00768400_dp
1683 cval = 1.99563960_dp
1684 aval = 0.01401940_dp
1691 cval = 1.98971210_dp
1692 aval = 0.01558470_dp
1698 cval = 1.97976190_dp
1699 aval = 0.01705520_dp
1705 cval = 1.97989290_dp
1706 aval = 0.01527040_dp
1712 cval = 1.97909240_dp
1713 aval = 0.01879720_dp
1719 cval = 1.98508430_dp
1720 aval = 0.01497550_dp
1727 cval = 1.98515010_dp
1728 aval = 0.01856670_dp
1735 cval = 1.98502970_dp
1736 aval = 0.01487000_dp
1743 cval = 1.97672850_dp
1744 aval = 0.01762500_dp
1752 cval = 1.97862730_dp
1753 aval = 0.01863310_dp
1760 cval = 1.97990020_dp
1761 aval = 0.01347150_dp
1768 cval = 1.97979410_dp
1769 aval = 0.00890265_dp
1776 cval = 1.98001000_dp
1777 aval = 0.00895215_dp
1784 cval = 1.97979980_dp
1785 aval = 0.01490290_dp
1792 cval = 1.98009310_dp
1793 aval = 0.01490390_dp
1800 cval = 1.97794750_dp
1801 aval = 0.01425880_dp
1809 cval = 1.97784450_dp
1810 aval = 0.01430130_dp
1818 cval = 1.97784450_dp
1819 aval = 0.00499318_dp
1827 cval = 1.97764820_dp
1828 aval = 0.00500392_dp
1836 cval = 1.97765150_dp
1837 aval = 0.00557083_dp
1845 cval = 1.97768750_dp
1846 aval = 0.00547531_dp
1856 cval = 1.96986600_dp
1857 aval = 0.00813143_dp
1867 cval = 1.97765720_dp
1868 aval = 0.00489201_dp
1878 cval = 1.97768120_dp
1879 aval = 0.00499000_dp
1889 cval = 1.97745700_dp
1890 aval = 0.00615587_dp
1900 cval = 1.97570240_dp
1901 aval = 0.00769959_dp
1911 cval = 1.97629350_dp
1912 aval = 0.00706610_dp
1922 cval = 1.96900000_dp
1923 aval = 0.01019150_dp
1933 cval = 1.97350000_dp
1934 aval = 0.01334320_dp
1944 cval = 1.97493000_dp
1945 aval = 0.01331360_dp
1954 cval = 1.97597670_dp
1955 aval = 0.01434040_dp
1965 cval = 1.97809240_dp
1966 aval = 0.01529430_dp
1976 cval = 1.97644360_dp
1977 aval = 0.01312770_dp
1987 cval = 1.96998000_dp
1988 aval = 0.01745150_dp
1998 cval = 1.97223830_dp
1999 aval = 0.01639750_dp
2009 cval = 1.97462110_dp
2010 aval = 0.01603680_dp
2020 cval = 1.97756000_dp
2021 aval = 0.02030570_dp
2031 cval = 1.97645760_dp
2032 aval = 0.02057180_dp
2042 cval = 1.97725820_dp
2043 aval = 0.02058210_dp
2053 cval = 1.97749380_dp
2054 aval = 0.02219380_dp
2064 cval = 1.97946280_dp
2065 aval = 0.02216280_dp
2075 cval = 1.97852130_dp
2076 aval = 0.02168500_dp
2086 cval = 1.98045190_dp
2087 aval = 0.02177860_dp
2097 cval = 1.97000000_dp
2098 aval = 0.02275000_dp
2108 cval = 1.97713580_dp
2109 aval = 0.02317030_dp
2119 cval = 1.97537880_dp
2120 aval = 0.02672860_dp
2130 cval = 1.97545360_dp
2131 aval = 0.02745360_dp
2141 cval = 1.97338370_dp
2142 aval = 0.02616310_dp
2152 cval = 1.97294240_dp
2153 aval = 0.02429220_dp
2163 cval = 1.98000000_dp
2164 aval = 0.01400000_dp
2184 SUBROUTINE read_basis_set(element_symbol, basis, basis_set_name, basis_set_file, &
2187 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol
2189 CHARACTER(LEN=*),
INTENT(IN) :: basis_set_name, basis_set_file
2192 INTEGER,
PARAMETER :: maxpri = 40, maxset = 20
2194 CHARACTER(len=20*default_string_length) :: line_att
2195 CHARACTER(LEN=240) :: line
2196 CHARACTER(LEN=242) :: line2
2197 CHARACTER(LEN=LEN(basis_set_name)) :: bsname
2198 CHARACTER(LEN=LEN(basis_set_name)+2) :: bsname2
2199 CHARACTER(LEN=LEN(element_symbol)) :: symbol
2200 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
2201 INTEGER :: i, ii, ipgf, irep, iset, ishell, j, k, &
2202 lshell, nj, nmin, ns, nset, strlen1, &
2204 INTEGER,
DIMENSION(maxpri, maxset) :: l
2205 INTEGER,
DIMENSION(maxset) :: lmax, lmin, n, npgf, nshell
2206 LOGICAL :: found, is_ok, match, read_from_input
2207 REAL(
dp) :: expzet, gcca, prefac, zeta
2208 REAL(
dp),
DIMENSION(maxpri, maxpri, maxset) :: gcc
2209 REAL(
dp),
DIMENSION(maxpri, maxset) :: zet
2213 bsname = basis_set_name
2214 symbol = element_symbol
2226 read_from_input = .false.
2228 IF (read_from_input)
THEN
2235 CALL val_get(val, c_val=line_att)
2236 READ (line_att, *) nset
2237 cpassert(nset <= maxset)
2241 CALL val_get(val, c_val=line_att)
2242 READ (line_att, *) n(iset)
2244 READ (line_att, *) lmin(iset)
2246 READ (line_att, *) lmax(iset)
2248 READ (line_att, *) npgf(iset)
2250 cpassert(npgf(iset) <= maxpri)
2252 DO lshell = lmin(iset), lmax(iset)
2253 nmin = n(iset) + lshell - lmin(iset)
2254 READ (line_att, *) ishell
2256 nshell(iset) = nshell(iset) + ishell
2258 l(nshell(iset) - ishell + i, iset) = lshell
2261 cpassert(len_trim(line_att) == 0)
2262 DO ipgf = 1, npgf(iset)
2265 CALL val_get(val, c_val=line_att)
2266 READ (line_att, *) zet(ipgf, iset), (gcc(ipgf, ishell, iset), ishell=1, nshell(iset))
2283 line2 =
" "//line//
" "
2284 symbol2 =
" "//trim(symbol)//
" "
2285 bsname2 =
" "//trim(bsname)//
" "
2286 strlen1 = len_trim(symbol2) + 1
2287 strlen2 = len_trim(bsname2) + 1
2289 IF ((index(line2, symbol2(:strlen1)) > 0) .AND. &
2290 (index(line2, bsname2(:strlen2)) > 0)) match = .true.
2295 cpassert(nset <= maxset)
2301 cpassert(npgf(iset) <= maxpri)
2303 DO lshell = lmin(iset), lmax(iset)
2304 nmin = n(iset) + lshell - lmin(iset)
2306 nshell(iset) = nshell(iset) + ishell
2308 l(nshell(iset) - ishell + i, iset) = lshell
2311 DO ipgf = 1, npgf(iset)
2313 DO ishell = 1, nshell(iset)
2337 DO j = lmin(i), min(lmax(i),
lmat)
2338 basis%nprim(j) = basis%nprim(j) + npgf(i)
2342 IF (k <=
lmat) basis%nbas(k) = basis%nbas(k) + 1
2346 nj = maxval(basis%nprim)
2347 ns = maxval(basis%nbas)
2348 ALLOCATE (basis%am(nj, 0:
lmat))
2350 ALLOCATE (basis%cm(nj, ns, 0:
lmat))
2357 IF (j >= lmin(i) .AND. j <= lmax(i))
THEN
2358 DO ipgf = 1, npgf(i)
2359 basis%am(nj + ipgf, j) = zet(ipgf, i)
2361 DO ii = 1, nshell(i)
2362 IF (l(ii, i) == j)
THEN
2364 DO ipgf = 1, npgf(i)
2365 basis%cm(nj + ipgf, ns, j) = gcc(ipgf, ii, i)
2376 expzet = 0.25_dp*real(2*j + 3,
dp)
2377 prefac = sqrt(
rootpi/2._dp**(j + 2)*
dfac(2*j + 1))
2378 DO ipgf = 1, basis%nprim(j)
2379 DO ii = 1, basis%nbas(j)
2380 gcca = basis%cm(ipgf, ii, j)
2381 zeta = 2._dp*basis%am(ipgf, j)
2382 basis%cm(ipgf, ii, j) = zeta**expzet*gcca/prefac
2387 END SUBROUTINE read_basis_set
2396 TYPE(section_vals_type),
POINTER :: opt_section
2398 INTEGER :: miter, ndiis
2399 REAL(kind=dp) :: damp, eps_diis, eps_scf
2401 CALL section_vals_val_get(opt_section,
"MAX_ITER", i_val=miter)
2402 CALL section_vals_val_get(opt_section,
"EPS_SCF", r_val=eps_scf)
2403 CALL section_vals_val_get(opt_section,
"N_DIIS", i_val=ndiis)
2404 CALL section_vals_val_get(opt_section,
"EPS_DIIS", r_val=eps_diis)
2405 CALL section_vals_val_get(opt_section,
"DAMPING", r_val=damp)
2407 optimization%max_iter = miter
2408 optimization%eps_scf = eps_scf
2409 optimization%n_diis = ndiis
2410 optimization%eps_diis = eps_diis
2411 optimization%damping = damp
2422 TYPE(section_vals_type),
POINTER :: potential_section
2423 INTEGER,
INTENT(IN) :: zval
2425 CHARACTER(LEN=default_string_length) :: pseudo_fn, pseudo_name
2427 REAL(dp),
DIMENSION(:),
POINTER :: convals
2428 TYPE(section_vals_type),
POINTER :: ecp_potential_section, &
2429 gth_potential_section
2432 CALL section_vals_val_get(potential_section,
"PSEUDO_TYPE", i_val=potential%ppot_type)
2434 SELECT CASE (potential%ppot_type)
2436 CALL section_vals_val_get(potential_section,
"POTENTIAL_FILE_NAME", c_val=pseudo_fn)
2437 CALL section_vals_val_get(potential_section,
"POTENTIAL_NAME", c_val=pseudo_name)
2438 gth_potential_section => section_vals_get_subs_vals(potential_section,
"GTH_POTENTIAL")
2439 CALL read_gth_potential(ptable(zval)%symbol, potential%gth_pot, &
2440 pseudo_name, pseudo_fn, gth_potential_section)
2442 CALL section_vals_val_get(potential_section,
"POTENTIAL_FILE_NAME", c_val=pseudo_fn)
2443 CALL section_vals_val_get(potential_section,
"POTENTIAL_NAME", c_val=pseudo_name)
2444 ecp_potential_section => section_vals_get_subs_vals(potential_section,
"ECP")
2446 pseudo_name, pseudo_fn, ecp_potential_section)
2448 CALL section_vals_val_get(potential_section,
"POTENTIAL_FILE_NAME", c_val=pseudo_fn)
2449 CALL section_vals_val_get(potential_section,
"POTENTIAL_NAME", c_val=pseudo_name)
2450 CALL atom_read_upf(potential%upf_pot, pseudo_fn)
2451 potential%upf_pot%pname = pseudo_name
2453 cpabort(
"Not implemented")
2460 potential%ppot_type = no_pseudo
2465 CALL section_vals_val_get(potential_section,
"CONFINEMENT_TYPE", i_val=ic)
2466 potential%conf_type = ic
2467 IF (potential%conf_type == no_conf)
THEN
2468 potential%acon = 0.0_dp
2469 potential%rcon = 4.0_dp
2470 potential%scon = 2.0_dp
2471 potential%confinement = .false.
2472 ELSE IF (potential%conf_type == poly_conf)
THEN
2473 CALL section_vals_val_get(potential_section,
"CONFINEMENT", r_vals=convals)
2474 IF (
SIZE(convals) >= 1)
THEN
2475 IF (convals(1) > 0.0_dp)
THEN
2476 potential%confinement = .true.
2477 potential%acon = convals(1)
2478 IF (
SIZE(convals) >= 2)
THEN
2479 potential%rcon = convals(2)
2481 potential%rcon = 4.0_dp
2483 IF (
SIZE(convals) >= 3)
THEN
2484 potential%scon = convals(3)
2486 potential%scon = 2.0_dp
2489 potential%confinement = .false.
2492 potential%confinement = .false.
2494 ELSE IF (potential%conf_type == barrier_conf)
THEN
2495 potential%acon = 200.0_dp
2496 potential%rcon = 4.0_dp
2497 potential%scon = 12.0_dp
2498 potential%confinement = .true.
2499 CALL section_vals_val_get(potential_section,
"CONFINEMENT", r_vals=convals)
2500 IF (
SIZE(convals) >= 1)
THEN
2501 IF (convals(1) > 0.0_dp)
THEN
2502 potential%acon = convals(1)
2503 IF (
SIZE(convals) >= 2)
THEN
2504 potential%rcon = convals(2)
2506 IF (
SIZE(convals) >= 3)
THEN
2507 potential%scon = convals(3)
2510 potential%confinement = .false.
2523 potential%confinement = .false.
2525 CALL atom_release_upf(potential%upf_pot)
2536 SUBROUTINE read_gth_potential(element_symbol, potential, pseudo_name, pseudo_file, &
2539 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol
2541 CHARACTER(LEN=*),
INTENT(IN) :: pseudo_name, pseudo_file
2542 TYPE(section_vals_type),
POINTER :: potential_section
2544 CHARACTER(LEN=240) :: line
2545 CHARACTER(LEN=242) :: line2
2546 CHARACTER(len=5*default_string_length) :: line_att
2547 CHARACTER(LEN=LEN(element_symbol)) :: symbol
2548 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
2549 CHARACTER(LEN=LEN(pseudo_name)) :: apname
2550 CHARACTER(LEN=LEN(pseudo_name)+2) :: apname2
2551 INTEGER :: i, ic, ipot, j, l, nlmax, strlen1, &
2553 INTEGER,
DIMENSION(0:lmat) :: elec_conf
2554 LOGICAL :: found, is_ok, match, read_from_input
2555 TYPE(cp_sll_val_type),
POINTER ::
list
2556 TYPE(val_type),
POINTER :: val
2560 apname = pseudo_name
2561 symbol = element_symbol
2563 potential%symbol = symbol
2564 potential%pname = apname
2566 potential%rc = 0._dp
2568 potential%cl = 0._dp
2570 potential%rcnl = 0._dp
2571 potential%hnl = 0._dp
2573 potential%lpotextended = .false.
2574 potential%lsdpot = .false.
2575 potential%nlcc = .false.
2576 potential%nexp_lpot = 0
2577 potential%nexp_lsd = 0
2578 potential%nexp_nlcc = 0
2580 read_from_input = .false.
2581 CALL section_vals_get(potential_section, explicit=read_from_input)
2582 IF (read_from_input)
THEN
2583 CALL section_vals_list_get(potential_section,
"_DEFAULT_KEYWORD_",
list=
list)
2584 CALL uppercase(symbol)
2585 CALL uppercase(apname)
2588 is_ok = cp_sll_val_next(
list, val)
2590 CALL val_get(val, c_val=line_att)
2591 READ (line_att, *) elec_conf(l)
2592 CALL remove_word(line_att)
2593 DO WHILE (len_trim(line_att) /= 0)
2595 READ (line_att, *) elec_conf(l)
2596 CALL remove_word(line_att)
2598 potential%econf(0:
lmat) = elec_conf(0:
lmat)
2599 potential%zion = real(sum(elec_conf), dp)
2601 is_ok = cp_sll_val_next(
list, val)
2603 CALL val_get(val, c_val=line_att)
2604 READ (line_att, *) potential%rc
2605 CALL remove_word(line_att)
2607 READ (line_att, *) potential%ncl
2608 CALL remove_word(line_att)
2609 DO i = 1, potential%ncl
2610 READ (line_att, *) potential%cl(i)
2611 CALL remove_word(line_att)
2615 is_ok = cp_sll_val_next(
list, val)
2617 CALL val_get(val, c_val=line_att)
2618 IF (index(line_att,
"LPOT") /= 0)
THEN
2619 potential%lpotextended = .true.
2620 CALL remove_word(line_att)
2621 READ (line_att, *) potential%nexp_lpot
2622 DO ipot = 1, potential%nexp_lpot
2623 is_ok = cp_sll_val_next(
list, val)
2625 CALL val_get(val, c_val=line_att)
2626 READ (line_att, *) potential%alpha_lpot(ipot)
2627 CALL remove_word(line_att)
2628 READ (line_att, *) potential%nct_lpot(ipot)
2629 CALL remove_word(line_att)
2630 DO ic = 1, potential%nct_lpot(ipot)
2631 READ (line_att, *) potential%cval_lpot(ic, ipot)
2632 CALL remove_word(line_att)
2635 ELSEIF (index(line_att,
"NLCC") /= 0)
THEN
2636 potential%nlcc = .true.
2637 CALL remove_word(line_att)
2638 READ (line_att, *) potential%nexp_nlcc
2639 DO ipot = 1, potential%nexp_nlcc
2640 is_ok = cp_sll_val_next(
list, val)
2642 CALL val_get(val, c_val=line_att)
2643 READ (line_att, *) potential%alpha_nlcc(ipot)
2644 CALL remove_word(line_att)
2645 READ (line_att, *) potential%nct_nlcc(ipot)
2646 CALL remove_word(line_att)
2647 DO ic = 1, potential%nct_nlcc(ipot)
2648 READ (line_att, *) potential%cval_nlcc(ic, ipot)
2650 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*pi)
2651 CALL remove_word(line_att)
2654 ELSEIF (index(line_att,
"LSD") /= 0)
THEN
2655 potential%lsdpot = .true.
2656 CALL remove_word(line_att)
2657 READ (line_att, *) potential%nexp_lsd
2658 DO ipot = 1, potential%nexp_lsd
2659 is_ok = cp_sll_val_next(
list, val)
2661 CALL val_get(val, c_val=line_att)
2662 READ (line_att, *) potential%alpha_lsd(ipot)
2663 CALL remove_word(line_att)
2664 READ (line_att, *) potential%nct_lsd(ipot)
2665 CALL remove_word(line_att)
2666 DO ic = 1, potential%nct_lsd(ipot)
2667 READ (line_att, *) potential%cval_lsd(ic, ipot)
2668 CALL remove_word(line_att)
2676 READ (line_att, *) nlmax
2677 CALL remove_word(line_att)
2681 is_ok = cp_sll_val_next(
list, val)
2683 CALL val_get(val, c_val=line_att)
2684 READ (line_att, *) potential%rcnl(l)
2685 CALL remove_word(line_att)
2686 READ (line_att, *) potential%nl(l)
2687 CALL remove_word(line_att)
2688 DO i = 1, potential%nl(l)
2690 READ (line_att, *) potential%hnl(1, 1, l)
2691 CALL remove_word(line_att)
2693 cpassert(len_trim(line_att) == 0)
2694 is_ok = cp_sll_val_next(
list, val)
2696 CALL val_get(val, c_val=line_att)
2697 READ (line_att, *) potential%hnl(i, i, l)
2698 CALL remove_word(line_att)
2700 DO j = i + 1, potential%nl(l)
2701 READ (line_att, *) potential%hnl(i, j, l)
2702 potential%hnl(j, i, l) = potential%hnl(i, j, l)
2703 CALL remove_word(line_att)
2706 cpassert(len_trim(line_att) == 0)
2711 TYPE(cp_parser_type) :: parser
2712 CALL parser_create(parser, pseudo_file)
2715 CALL parser_search_string(parser, trim(apname), .true., found, line)
2717 CALL uppercase(symbol)
2718 CALL uppercase(apname)
2721 CALL uppercase(line)
2722 line2 =
" "//line//
" "
2723 symbol2 =
" "//trim(symbol)//
" "
2724 apname2 =
" "//trim(apname)//
" "
2725 strlen1 = len_trim(symbol2) + 1
2726 strlen2 = len_trim(apname2) + 1
2728 IF ((index(line2, symbol2(:strlen1)) > 0) .AND. &
2729 (index(line2, apname2(:strlen2)) > 0)) match = .true.
2734 CALL parser_get_object(parser, elec_conf(l), newline=.true.)
2735 DO WHILE (parser_test_next_token(parser) ==
"INT")
2737 CALL parser_get_object(parser, elec_conf(l))
2739 potential%econf(0:
lmat) = elec_conf(0:
lmat)
2740 potential%zion = real(sum(elec_conf), dp)
2742 CALL parser_get_object(parser, potential%rc, newline=.true.)
2744 CALL parser_get_object(parser, potential%ncl)
2745 DO i = 1, potential%ncl
2746 CALL parser_get_object(parser, potential%cl(i))
2750 CALL parser_get_next_line(parser, 1)
2751 IF (parser_test_next_token(parser) ==
"INT")
THEN
2753 ELSEIF (parser_test_next_token(parser) ==
"STR")
THEN
2754 CALL parser_get_object(parser, line)
2755 IF (index(line,
"LPOT") /= 0)
THEN
2757 potential%lpotextended = .true.
2758 CALL parser_get_object(parser, potential%nexp_lpot)
2759 DO ipot = 1, potential%nexp_lpot
2760 CALL parser_get_object(parser, potential%alpha_lpot(ipot), newline=.true.)
2761 CALL parser_get_object(parser, potential%nct_lpot(ipot))
2762 DO ic = 1, potential%nct_lpot(ipot)
2763 CALL parser_get_object(parser, potential%cval_lpot(ic, ipot))
2766 ELSEIF (index(line,
"NLCC") /= 0)
THEN
2768 potential%nlcc = .true.
2769 CALL parser_get_object(parser, potential%nexp_nlcc)
2770 DO ipot = 1, potential%nexp_nlcc
2771 CALL parser_get_object(parser, potential%alpha_nlcc(ipot), newline=.true.)
2772 CALL parser_get_object(parser, potential%nct_nlcc(ipot))
2773 DO ic = 1, potential%nct_nlcc(ipot)
2774 CALL parser_get_object(parser, potential%cval_nlcc(ic, ipot))
2776 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*pi)
2779 ELSEIF (index(line,
"LSD") /= 0)
THEN
2781 potential%lsdpot = .true.
2782 CALL parser_get_object(parser, potential%nexp_lsd)
2783 DO ipot = 1, potential%nexp_lsd
2784 CALL parser_get_object(parser, potential%alpha_lsd(ipot), newline=.true.)
2785 CALL parser_get_object(parser, potential%nct_lsd(ipot))
2786 DO ic = 1, potential%nct_lsd(ipot)
2787 CALL parser_get_object(parser, potential%cval_lsd(ic, ipot))
2798 CALL parser_get_object(parser, nlmax)
2802 CALL parser_get_object(parser, potential%rcnl(l), newline=.true.)
2803 CALL parser_get_object(parser, potential%nl(l))
2804 DO i = 1, potential%nl(l)
2806 CALL parser_get_object(parser, potential%hnl(i, i, l))
2808 CALL parser_get_object(parser, potential%hnl(i, i, l), newline=.true.)
2810 DO j = i + 1, potential%nl(l)
2811 CALL parser_get_object(parser, potential%hnl(i, j, l))
2812 potential%hnl(j, i, l) = potential%hnl(i, j, l)
2826 CALL parser_release(parser)
2830 END SUBROUTINE read_gth_potential
2842 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol
2844 CHARACTER(LEN=*),
INTENT(IN) :: pseudo_name, pseudo_file
2845 TYPE(section_vals_type),
POINTER :: potential_section
2847 CHARACTER(LEN=240) :: line
2848 CHARACTER(len=5*default_string_length) :: line_att
2849 CHARACTER(LEN=LEN(element_symbol)+1) :: symbol
2850 CHARACTER(LEN=LEN(pseudo_name)) :: apname
2851 INTEGER :: i, ic, l, ncore, nel
2852 LOGICAL :: found, is_ok, read_from_input
2853 TYPE(cp_sll_val_type),
POINTER ::
list
2854 TYPE(val_type),
POINTER :: val
2856 apname = pseudo_name
2857 symbol = element_symbol
2858 CALL get_ptable_info(symbol, number=ncore)
2860 potential%symbol = symbol
2861 potential%pname = apname
2867 potential%aloc = 0.0_dp
2868 potential%bloc = 0.0_dp
2871 potential%apot = 0.0_dp
2872 potential%bpot = 0.0_dp
2874 read_from_input = .false.
2875 CALL section_vals_get(potential_section, explicit=read_from_input)
2876 IF (read_from_input)
THEN
2877 CALL section_vals_list_get(potential_section,
"_DEFAULT_KEYWORD_",
list=
list)
2879 is_ok = cp_sll_val_next(
list, val)
2881 CALL val_get(val, c_val=line_att)
2882 CALL remove_word(line_att)
2883 CALL remove_word(line_att)
2885 READ (line_att, *) nel
2886 potential%zion = real(ncore - nel, kind=dp)
2888 is_ok = cp_sll_val_next(
list, val)
2890 CALL val_get(val, c_val=line_att)
2892 IF (.NOT. cp_sll_val_next(
list, val))
EXIT
2893 CALL val_get(val, c_val=line_att)
2894 IF (index(line_att, element_symbol) == 0)
THEN
2895 potential%nloc = potential%nloc + 1
2897 READ (line_att, *) potential%nrloc(ic), potential%bloc(ic), potential%aloc(ic)
2904 CALL val_get(val, c_val=line_att)
2905 IF (index(line_att, element_symbol) == 0)
THEN
2906 potential%npot(l) = potential%npot(l) + 1
2907 ic = potential%npot(l)
2908 READ (line_att, *) potential%nrpot(ic, l), potential%bpot(ic, l), potential%apot(ic, l)
2910 potential%lmax = potential%lmax + 1
2913 IF (.NOT. cp_sll_val_next(
list, val))
EXIT
2918 TYPE(cp_parser_type) :: parser
2919 CALL parser_create(parser, pseudo_file)
2922 CALL parser_search_string(parser, trim(apname), .true., found, line)
2925 CALL parser_get_object(parser, line, newline=.true.)
2926 IF (trim(line) == element_symbol)
THEN
2927 CALL parser_get_object(parser, line, lower_to_upper=.true.)
2928 cpassert(trim(line) ==
"NELEC")
2930 CALL parser_get_object(parser, nel)
2931 potential%zion = real(ncore - nel, kind=dp)
2933 CALL parser_get_object(parser, line, newline=.true.)
2936 CALL parser_read_line(parser, 1)
2937 IF (parser_test_next_token(parser) ==
"STR")
EXIT
2938 potential%nloc = potential%nloc + 1
2940 CALL parser_get_object(parser, potential%nrloc(ic))
2941 CALL parser_get_object(parser, potential%bloc(ic))
2942 CALL parser_get_object(parser, potential%aloc(ic))
2946 CALL parser_get_object(parser, symbol)
2947 IF (symbol == element_symbol)
THEN
2949 potential%lmax = potential%lmax + 1
2951 CALL parser_read_line(parser, 1)
2952 IF (parser_test_next_token(parser) ==
"STR")
EXIT
2953 potential%npot(l) = potential%npot(l) + 1
2954 ic = potential%npot(l)
2955 CALL parser_get_object(parser, potential%nrpot(ic, l))
2956 CALL parser_get_object(parser, potential%bpot(ic, l))
2957 CALL parser_get_object(parser, potential%apot(ic, l))
2964 ELSE IF (line ==
"END")
THEN
2965 cpabort(
"Element not found in ECP library")
2969 cpabort(
"ECP type not found in library")
2974 CALL parser_release(parser)
2979 potential%econf(0:3) = ptable(ncore)%e_conv(0:3)
2982 cpabort(
"Unknown Core State")
2985 potential%econf(0:3) = potential%econf(0:3) - ptable(2)%e_conv(0:3)
2987 potential%econf(0:3) = potential%econf(0:3) - ptable(10)%e_conv(0:3)
2989 potential%econf(0:3) = potential%econf(0:3) - ptable(18)%e_conv(0:3)
2991 potential%econf(0:3) = potential%econf(0:3) - ptable(18)%e_conv(0:3)
2992 potential%econf(2) = potential%econf(2) - 10
2994 potential%econf(0:3) = potential%econf(0:3) - ptable(36)%e_conv(0:3)
2996 potential%econf(0:3) = potential%econf(0:3) - ptable(36)%e_conv(0:3)
2997 potential%econf(2) = potential%econf(2) - 10
2999 potential%econf(0:3) = potential%econf(0:3) - ptable(54)%e_conv(0:3)
3001 potential%econf(0:3) = potential%econf(0:3) - ptable(36)%e_conv(0:3)
3002 potential%econf(2) = potential%econf(2) - 10
3003 potential%econf(3) = potential%econf(3) - 14
3005 potential%econf(0:3) = potential%econf(0:3) - ptable(54)%e_conv(0:3)
3006 potential%econf(3) = potential%econf(3) - 14
3008 potential%econf(0:3) = potential%econf(0:3) - ptable(54)%e_conv(0:3)
3009 potential%econf(2) = potential%econf(2) - 10
3010 potential%econf(3) = potential%econf(3) - 14
3013 cpassert(all(potential%econf >= 0))
3023 TYPE(grid_atom_type) :: grid1, grid2
3027 REAL(kind=dp) :: dr, dw
3030 IF (grid1%nr == grid2%nr)
THEN
3032 dr = abs(grid1%rad(i) - grid2%rad(i))
3033 dw = abs(grid1%wr(i) - grid2%wr(i))
3034 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.