60 paw_type_forced, gpw_r3d_rs_type_forced)
63 REAL(
dp),
INTENT(IN) :: eps_fit, rc
64 LOGICAL,
INTENT(OUT) :: paw_atom
65 LOGICAL,
INTENT(IN) :: paw_type_forced, gpw_r3d_rs_type_forced
67 CHARACTER(LEN=default_string_length) :: bsname
68 INTEGER :: ico, ipgf, ipgf_s, iset, iset_s, ishell, lshell, lshell_old, m, maxco, maxpgf, &
69 maxpgf_s, maxshell, maxshell_s, ncgf, nset, nset_s, nsgf
70 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: iset_s2h
71 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, nshell
72 INTEGER,
DIMENSION(:, :),
POINTER :: l, n
73 LOGICAL :: my_gpw_r3d_rs_type_forced
74 REAL(kind=
dp) :: minzet, radius
75 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: zet
76 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: gcc
78 NULLIFY (gcc, l, lmax, lmin, n, npgf, nshell, zet)
80 my_gpw_r3d_rs_type_forced = gpw_r3d_rs_type_forced
81 IF (paw_type_forced)
THEN
83 my_gpw_r3d_rs_type_forced = .false.
85 IF (.NOT. my_gpw_r3d_rs_type_forced)
THEN
87 maxpgf=maxpgf, maxshell=maxshell, nset=nset)
89 soft_basis%name = trim(bsname)//
"_soft"
100 CALL reallocate(gcc, 1, maxpgf, 1, maxshell, 1, nset)
102 ALLOCATE (iset_s2h(nset))
110 minzet = orb_basis%zet(orb_basis%npgf(iset), iset)
111 DO ipgf = orb_basis%npgf(iset) - 1, 1, -1
112 IF (orb_basis%zet(ipgf, iset) < minzet)
THEN
113 minzet = orb_basis%zet(ipgf, iset)
116 radius =
exp_radius(orb_basis%lmax(iset), minzet, eps_fit, 1.0_dp)
120 nshell(iset_s) = orb_basis%nshell(iset)
121 lmax(iset_s) = orb_basis%lmax(iset)
122 lmin(iset_s) = orb_basis%lmin(iset)
124 iset_s2h(iset_s) = iset
126 DO ishell = 1, nshell(iset_s)
127 n(ishell, iset_s) = orb_basis%n(ishell, iset)
128 l(ishell, iset_s) = orb_basis%l(ishell, iset)
131 IF (nshell(iset_s) > maxshell_s)
THEN
132 maxshell_s = nshell(iset_s)
135 IF (radius < rc)
THEN
147 DO ipgf = 1, orb_basis%npgf(iset)
148 IF (orb_basis%zet(ipgf, iset) > 100.0_dp)
THEN
154 radius =
exp_radius(orb_basis%lmax(iset), orb_basis%zet(ipgf, iset), &
156 IF (radius < rc)
THEN
164 zet(ipgf_s, iset_s) = orb_basis%zet(ipgf, iset)
166 lshell_old = orb_basis%l(1, iset)
167 radius =
exp_radius(lshell_old, zet(ipgf_s, iset_s), eps_fit, 1.0_dp)
169 DO ishell = 1, nshell(iset_s)
170 lshell = orb_basis%l(ishell, iset)
171 IF (lshell == lshell_old)
THEN
174 radius =
exp_radius(lshell_old, zet(ipgf_s, iset_s), eps_fit, 1.0_dp)
176 IF (radius < rc)
THEN
177 gcc(ipgf_s, ishell, iset_s) = 0.0_dp
180 gcc(ipgf_s, ishell, iset_s) = orb_basis%gcc(ipgf, ishell, iset)
184 npgf(iset_s) = ipgf_s
185 IF (ipgf_s > maxpgf_s)
THEN
191 soft_basis%nset = nset_s
196 CALL reallocate(soft_basis%n, 1, maxshell_s, 1, nset_s)
197 CALL reallocate(soft_basis%l, 1, maxshell_s, 1, nset_s)
198 CALL reallocate(soft_basis%zet, 1, maxpgf_s, 1, nset_s)
199 CALL reallocate(soft_basis%gcc, 1, maxpgf_s, 1, maxshell_s, 1, nset_s)
204 soft_basis%lmax(iset) = lmax(iset)
205 soft_basis%lmin(iset) = lmin(iset)
206 soft_basis%npgf(iset) = npgf(iset)
207 soft_basis%nshell(iset) = nshell(iset)
208 DO ishell = 1, nshell(iset)
209 soft_basis%n(ishell, iset) = n(ishell, iset)
210 soft_basis%l(ishell, iset) = l(ishell, iset)
211 DO ipgf = 1, npgf(iset)
212 soft_basis%gcc(ipgf, ishell, iset) = gcc(ipgf, ishell, iset)
215 DO ipgf = 1, npgf(iset)
216 soft_basis%zet(ipgf, iset) = zet(ipgf, iset)
221 CALL reallocate(soft_basis%set_radius, 1, nset_s)
222 CALL reallocate(soft_basis%pgf_radius, 1, maxpgf_s, 1, nset_s)
223 CALL reallocate(soft_basis%first_cgf, 1, maxshell_s, 1, nset_s)
224 CALL reallocate(soft_basis%first_sgf, 1, maxshell_s, 1, nset_s)
225 CALL reallocate(soft_basis%last_cgf, 1, maxshell_s, 1, nset_s)
226 CALL reallocate(soft_basis%last_sgf, 1, maxshell_s, 1, nset_s)
227 CALL reallocate(soft_basis%ncgf_set, 1, nset_s)
228 CALL reallocate(soft_basis%nsgf_set, 1, nset_s)
235 soft_basis%ncgf_set(iset) = 0
236 soft_basis%nsgf_set(iset) = 0
237 DO ishell = 1, nshell(iset)
238 lshell = soft_basis%l(ishell, iset)
239 soft_basis%first_cgf(ishell, iset) = ncgf + 1
240 ncgf = ncgf +
nco(lshell)
241 soft_basis%last_cgf(ishell, iset) = ncgf
242 soft_basis%ncgf_set(iset) = &
243 soft_basis%ncgf_set(iset) +
nco(lshell)
244 soft_basis%first_sgf(ishell, iset) = nsgf + 1
245 nsgf = nsgf +
nso(lshell)
246 soft_basis%last_sgf(ishell, iset) = nsgf
247 soft_basis%nsgf_set(iset) = &
248 soft_basis%nsgf_set(iset) +
nso(lshell)
250 maxco = max(maxco, npgf(iset)*
ncoset(lmax(iset)))
252 soft_basis%ncgf = ncgf
253 soft_basis%nsgf = nsgf
255 CALL reallocate(soft_basis%cphi, 1, maxco, 1, ncgf)
256 CALL reallocate(soft_basis%sphi, 1, maxco, 1, nsgf)
257 CALL reallocate(soft_basis%scon, 1, maxco, 1, nsgf)
263 ALLOCATE (soft_basis%cgf_symbol(ncgf))
264 ALLOCATE (soft_basis%sgf_symbol(nsgf))
270 DO ishell = 1, nshell(iset)
271 lshell = soft_basis%l(ishell, iset)
274 soft_basis%lx(ncgf) =
indco(1, ico)
275 soft_basis%ly(ncgf) =
indco(2, ico)
276 soft_basis%lz(ncgf) =
indco(3, ico)
277 soft_basis%cgf_symbol(ncgf) = &
278 cgf_symbol(n(ishell, iset), (/soft_basis%lx(ncgf), &
279 soft_basis%ly(ncgf), &
280 soft_basis%lz(ncgf)/))
282 DO m = -lshell, lshell
284 soft_basis%m(nsgf) = m
285 soft_basis%sgf_symbol(nsgf) = &
292 soft_basis%norm_type = orb_basis%norm_type
293 soft_basis%norm_cgf = orb_basis%norm_cgf
298 DEALLOCATE (gcc, l, lmax, lmin, n, npgf, nshell, zet, iset_s2h)
301 IF (.NOT. paw_atom)
THEN
305 soft_basis%name = trim(bsname)//
"_soft"
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)
...