24#include "./base/base_uses.f90"
30 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'atom_set_basis'
32 INTEGER,
PARAMETER :: nua = 40, nup = 20
33 REAL(KIND=
dp),
DIMENSION(nua),
PARAMETER :: ugbs = (/0.007299_dp, 0.013705_dp, 0.025733_dp, &
34 0.048316_dp, 0.090718_dp, 0.170333_dp, 0.319819_dp, 0.600496_dp, 1.127497_dp, 2.117000_dp, &
35 3.974902_dp, 7.463317_dp, 14.013204_dp, 26.311339_dp, 49.402449_dp, 92.758561_dp, &
36 174.164456_dp, 327.013024_dp, 614.003114_dp, 1152.858743_dp, 2164.619772_dp, &
37 4064.312984_dp, 7631.197056_dp, 14328.416324_dp, 26903.186074_dp, 50513.706789_dp, &
38 94845.070265_dp, 178082.107320_dp, 334368.848683_dp, 627814.487663_dp, 1178791.123851_dp, &
39 2213310.684886_dp, 4155735.557141_dp, 7802853.046713_dp, 14650719.428954_dp, &
40 27508345.793637_dp, 51649961.080194_dp, 96978513.342764_dp, 182087882.613702_dp, &
60 LOGICAL,
INTENT(IN) :: has_pp
62 LOGICAL,
INTENT(IN),
OPTIONAL :: cp2k_norm
64 INTEGER :: i, ii, ipgf, j, k, l, m, ngp, nj, nr, &
65 ns, nset, nsgf, nu, quadtype
66 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, nshell
67 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgf, last_sgf, ls
68 LOGICAL :: has_basis, set_norm
69 REAL(kind=
dp) :: al, an, cn, ear, en, rk
70 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: zet
71 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: gcc
74 IF (
ASSOCIATED(orb_basis_set))
THEN
80 IF (
PRESENT(cp2k_norm))
THEN
87 IF (
PRESENT(agrid))
THEN
89 quadtype = agrid%quadrature
99 NULLIFY (basis%am, basis%cm, basis%as, basis%ns, basis%bf, basis%dbf, basis%ddbf)
104 basis%eps_eig = 1.e-12_dp
106 nset=nset, nshell=nshell, npgf=npgf, lmin=lmin, lmax=lmax, &
107 l=ls, nsgf=nsgf, zet=zet, gcc=gcc, &
108 first_sgf=first_sgf, last_sgf=last_sgf)
112 DO j = lmin(i), min(lmax(i),
lmat)
113 basis%nprim(j) = basis%nprim(j) + npgf(i)
118 basis%nbas(l) = basis%nbas(l) + 1
124 nj = maxval(basis%nprim)
125 ns = maxval(basis%nbas)
126 ALLOCATE (basis%am(nj, 0:
lmat))
128 ALLOCATE (basis%cm(nj, ns, 0:
lmat))
133 cn = 2.0_dp**(j + 2)/sqrt(
dfac(2*j + 1))/
twopi**0.25_dp
134 en = (2*j + 3)*0.25_dp
136 IF (j >= lmin(i) .AND. j <= lmax(i))
THEN
138 basis%am(nj + ipgf, j) = zet(ipgf, i)
141 IF (ls(ii, i) == j)
THEN
145 an = cn*zet(ipgf, i)**en
146 basis%cm(nj + ipgf, ns, j) = an*gcc(ipgf, ii, i)
150 basis%cm(nj + ipgf, ns, j) = gcc(ipgf, ii, i)
161 CALL normalize_basis_cp2k(basis)
170 basis%geometrical = .false.
174 basis%eps_eig = 1.e-12_dp
179 ALLOCATE (basis%am(nu, 0:
lmat))
181 basis%am(1:nu, i) = ugbs(1:nu)
187 m = maxval(basis%nbas)
188 ALLOCATE (basis%bf(nr, m, 0:
lmat))
189 ALLOCATE (basis%dbf(nr, m, 0:
lmat))
190 ALLOCATE (basis%ddbf(nr, m, 0:
lmat))
196 DO i = 1, basis%nprim(l)
200 rk = basis%grid%rad(k)
201 ear = exp(-al*basis%grid%rad(k)**2)
202 basis%bf(k, i, l) = rk**l*ear
203 basis%dbf(k, i, l) = (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear
204 basis%ddbf(k, i, l) = (real(l*(l - 1),
dp)*rk**(l - 2) - &
205 2._dp*al*real(2*l + 1,
dp)*rk**(l) + 4._dp*al*rk**(l + 2))*ear
209 rk = basis%grid%rad(k)
210 ear = exp(-al*basis%grid%rad(k)**2)
211 DO j = 1, basis%nbas(l)
212 basis%bf(k, j, l) = basis%bf(k, j, l) + rk**l*ear*basis%cm(i, j, l)
213 basis%dbf(k, j, l) = basis%dbf(k, j, l) &
214 + (real(l,
dp)*rk**(l - 1) - 2._dp*al*rk**(l + 1))*ear*basis%cm(i, j, l)
215 basis%ddbf(k, j, l) = basis%ddbf(k, j, l) + &
216 (real(l*(l - 1),
dp)*rk**(l - 2) - 2._dp*al*real(2*l + 1,
dp)*rk**(l) + &
217 4._dp*al*rk**(l + 2))*ear*basis%cm(i, j, l)
221 cpabort(
'Atom basis type?')
232 SUBROUTINE normalize_basis_cp2k(basis)
235 INTEGER :: ii, l, n, np
236 REAL(kind=
dp) :: fnorm
237 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: smat
243 ALLOCATE (smat(np, np))
244 CALL sg_overlap(smat, l, basis%am(1:np, l), basis%am(1:np, l))
245 DO ii = 1, basis%nbas(l)
246 fnorm = dot_product(basis%cm(1:np, ii, l), matmul(smat, basis%cm(1:np, ii, l)))
247 fnorm = 1._dp/sqrt(fnorm)
248 basis%cm(1:np, ii, l) = fnorm*basis%cm(1:np, ii, l)
254 END SUBROUTINE normalize_basis_cp2k
subroutine, public sg_overlap(smat, l, pa, pb)
...
subroutine, public set_kind_basis_atomic(basis, orb_basis_set, has_pp, agrid, cp2k_norm)
...
Define the atom type and its sub types.
integer, parameter, public cgto_basis
integer, parameter, public gto_basis
integer, parameter, public lmat
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum)
...
Defines the basic variable types.
integer, parameter, public dp
Definition of mathematical constants and functions.
real(kind=dp), dimension(-1:2 *maxfac+1), parameter, public dfac
real(kind=dp), parameter, public twopi
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)
...
Provides all information about a basis set.