55#include "../base/base_uses.f90"
63 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'basis_set_types'
74 CHARACTER(LEN=default_string_length) :: name =
""
75 CHARACTER(LEN=default_string_length) :: aliases =
""
76 REAL(kind=
dp) :: kind_radius = 0.0_dp
77 REAL(kind=
dp) :: short_kind_radius = 0.0_dp
78 INTEGER :: norm_type = -1
79 INTEGER :: ncgf = -1, nset = -1, nsgf = -1
80 CHARACTER(LEN=12),
DIMENSION(:),
POINTER ::
cgf_symbol => null()
81 CHARACTER(LEN=6),
DIMENSION(:),
POINTER ::
sgf_symbol => null()
82 REAL(kind=
dp),
DIMENSION(:),
POINTER :: norm_cgf => null(), set_radius => null()
83 INTEGER,
DIMENSION(:),
POINTER :: lmax => null(), lmin => null(), &
84 lx => null(), ly => null(), lz => null(), &
85 m => null(), ncgf_set => null(), &
86 npgf => null(), nsgf_set => null(), nshell => null()
87 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: cphi => null(), pgf_radius => null(), sphi => null(), &
88 scon => null(), zet => null()
89 INTEGER,
DIMENSION(:, :),
POINTER :: first_cgf => null(), first_sgf => null(), l => null(), &
90 last_cgf => null(), last_sgf => null(), n => null()
91 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: gcc => null()
103 CHARACTER(LEN=default_string_length) :: name =
""
104 INTEGER :: nshell = -1
105 CHARACTER(LEN=6),
DIMENSION(:),
POINTER :: symbol => null()
106 INTEGER,
DIMENSION(:),
POINTER :: nq => null(), lq => null()
107 REAL(kind=
dp),
DIMENSION(:),
POINTER :: zet => null()
112 MODULE PROCEDURE read_gto_basis_set1, read_gto_basis_set2
160 ALLOCATE (gto_basis_set)
176 IF (
ASSOCIATED(gto_basis_set))
THEN
177 IF (
ASSOCIATED(gto_basis_set%cgf_symbol))
DEALLOCATE (gto_basis_set%cgf_symbol)
178 IF (
ASSOCIATED(gto_basis_set%sgf_symbol))
DEALLOCATE (gto_basis_set%sgf_symbol)
179 IF (
ASSOCIATED(gto_basis_set%norm_cgf))
DEALLOCATE (gto_basis_set%norm_cgf)
180 IF (
ASSOCIATED(gto_basis_set%set_radius))
DEALLOCATE (gto_basis_set%set_radius)
181 IF (
ASSOCIATED(gto_basis_set%lmax))
DEALLOCATE (gto_basis_set%lmax)
182 IF (
ASSOCIATED(gto_basis_set%lmin))
DEALLOCATE (gto_basis_set%lmin)
183 IF (
ASSOCIATED(gto_basis_set%lx))
DEALLOCATE (gto_basis_set%lx)
184 IF (
ASSOCIATED(gto_basis_set%ly))
DEALLOCATE (gto_basis_set%ly)
185 IF (
ASSOCIATED(gto_basis_set%lz))
DEALLOCATE (gto_basis_set%lz)
186 IF (
ASSOCIATED(gto_basis_set%m))
DEALLOCATE (gto_basis_set%m)
187 IF (
ASSOCIATED(gto_basis_set%ncgf_set))
DEALLOCATE (gto_basis_set%ncgf_set)
188 IF (
ASSOCIATED(gto_basis_set%npgf))
DEALLOCATE (gto_basis_set%npgf)
189 IF (
ASSOCIATED(gto_basis_set%nsgf_set))
DEALLOCATE (gto_basis_set%nsgf_set)
190 IF (
ASSOCIATED(gto_basis_set%nshell))
DEALLOCATE (gto_basis_set%nshell)
191 IF (
ASSOCIATED(gto_basis_set%cphi))
DEALLOCATE (gto_basis_set%cphi)
192 IF (
ASSOCIATED(gto_basis_set%pgf_radius))
DEALLOCATE (gto_basis_set%pgf_radius)
193 IF (
ASSOCIATED(gto_basis_set%sphi))
DEALLOCATE (gto_basis_set%sphi)
194 IF (
ASSOCIATED(gto_basis_set%scon))
DEALLOCATE (gto_basis_set%scon)
195 IF (
ASSOCIATED(gto_basis_set%zet))
DEALLOCATE (gto_basis_set%zet)
196 IF (
ASSOCIATED(gto_basis_set%first_cgf))
DEALLOCATE (gto_basis_set%first_cgf)
197 IF (
ASSOCIATED(gto_basis_set%first_sgf))
DEALLOCATE (gto_basis_set%first_sgf)
198 IF (
ASSOCIATED(gto_basis_set%l))
DEALLOCATE (gto_basis_set%l)
199 IF (
ASSOCIATED(gto_basis_set%last_cgf))
DEALLOCATE (gto_basis_set%last_cgf)
200 IF (
ASSOCIATED(gto_basis_set%last_sgf))
DEALLOCATE (gto_basis_set%last_sgf)
201 IF (
ASSOCIATED(gto_basis_set%n))
DEALLOCATE (gto_basis_set%n)
202 IF (
ASSOCIATED(gto_basis_set%gcc))
DEALLOCATE (gto_basis_set%gcc)
203 DEALLOCATE (gto_basis_set)
219 INTEGER :: maxco, maxpgf, maxshell, ncgf, nset, nsgf
223 basis_set_out%name = basis_set_in%name
224 basis_set_out%aliases = basis_set_in%aliases
225 basis_set_out%kind_radius = basis_set_in%kind_radius
226 basis_set_out%norm_type = basis_set_in%norm_type
227 basis_set_out%nset = basis_set_in%nset
228 basis_set_out%ncgf = basis_set_in%ncgf
229 basis_set_out%nsgf = basis_set_in%nsgf
230 nset = basis_set_in%nset
231 ncgf = basis_set_in%ncgf
232 nsgf = basis_set_in%nsgf
233 ALLOCATE (basis_set_out%cgf_symbol(ncgf))
234 ALLOCATE (basis_set_out%sgf_symbol(nsgf))
235 basis_set_out%cgf_symbol = basis_set_in%cgf_symbol
236 basis_set_out%sgf_symbol = basis_set_in%sgf_symbol
237 ALLOCATE (basis_set_out%norm_cgf(ncgf))
238 basis_set_out%norm_cgf = basis_set_in%norm_cgf
239 ALLOCATE (basis_set_out%set_radius(nset))
240 basis_set_out%set_radius = basis_set_in%set_radius
241 ALLOCATE (basis_set_out%lmax(nset), basis_set_out%lmin(nset), basis_set_out%npgf(nset), basis_set_out%nshell(nset))
242 basis_set_out%lmax = basis_set_in%lmax
243 basis_set_out%lmin = basis_set_in%lmin
244 basis_set_out%npgf = basis_set_in%npgf
245 basis_set_out%nshell = basis_set_in%nshell
246 ALLOCATE (basis_set_out%lx(ncgf), basis_set_out%ly(ncgf), basis_set_out%lz(ncgf), basis_set_out%m(nsgf))
247 basis_set_out%lx = basis_set_in%lx
248 basis_set_out%ly = basis_set_in%ly
249 basis_set_out%lz = basis_set_in%lz
250 basis_set_out%m = basis_set_in%m
251 ALLOCATE (basis_set_out%ncgf_set(nset), basis_set_out%nsgf_set(nset))
252 basis_set_out%ncgf_set = basis_set_in%ncgf_set
253 basis_set_out%nsgf_set = basis_set_in%nsgf_set
254 maxco =
SIZE(basis_set_in%cphi, 1)
255 ALLOCATE (basis_set_out%cphi(maxco, ncgf), basis_set_out%sphi(maxco, nsgf), basis_set_out%scon(maxco, nsgf))
256 basis_set_out%cphi = basis_set_in%cphi
257 basis_set_out%sphi = basis_set_in%sphi
258 basis_set_out%scon = basis_set_in%scon
259 maxpgf = maxval(basis_set_in%npgf)
260 ALLOCATE (basis_set_out%pgf_radius(maxpgf, nset), basis_set_out%zet(maxpgf, nset))
261 basis_set_out%pgf_radius = basis_set_in%pgf_radius
262 basis_set_out%zet = basis_set_in%zet
263 maxshell = maxval(basis_set_in%nshell)
264 ALLOCATE (basis_set_out%first_cgf(maxshell, nset), basis_set_out%first_sgf(maxshell, nset))
265 ALLOCATE (basis_set_out%last_cgf(maxshell, nset), basis_set_out%last_sgf(maxshell, nset))
266 basis_set_out%first_cgf = basis_set_in%first_cgf
267 basis_set_out%first_sgf = basis_set_in%first_sgf
268 basis_set_out%last_cgf = basis_set_in%last_cgf
269 basis_set_out%last_sgf = basis_set_in%last_sgf
270 ALLOCATE (basis_set_out%n(maxshell, nset), basis_set_out%l(maxshell, nset))
271 basis_set_out%n = basis_set_in%n
272 basis_set_out%l = basis_set_in%l
273 ALLOCATE (basis_set_out%gcc(maxpgf, maxshell, nset))
274 basis_set_out%gcc = basis_set_in%gcc
290 INTEGER,
INTENT(IN),
OPTIONAL :: lmax
292 INTEGER :: i, ico, ip, ipgf, iset, ishell, l, lm, &
293 lshell, m, maxco, mpgf, nc, ncgf, ns, &
295 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: nindex, nprim
296 REAL(kind=
dp) :: zet0
297 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: zet, zeta
299 mpgf = sum(basis_set%npgf)
300 lm = maxval(basis_set%lmax)
301 ALLOCATE (zet(mpgf, 0:lm), zeta(mpgf, lm + 1), nindex(mpgf), nprim(0:lm))
306 DO iset = 1, basis_set%nset
307 IF (basis_set%lmin(iset) <= l .AND. basis_set%lmax(iset) >= l)
THEN
308 DO ipgf = 1, basis_set%npgf(iset)
310 zet(ip, l) = basis_set%zet(ipgf, iset)
319 zet(1:nprim(l), l) = -zet(1:nprim(l), l)
320 CALL sort(zet(1:nprim(l), l), nprim(l), nindex)
325 IF (abs(zet0 - zet(i, l)) > 1.e-6_dp)
THEN
327 zeta(ip, l + 1) = zet(i, l)
332 zeta(1:ip, l + 1) = -zeta(1:ip, l + 1)
337 IF (
PRESENT(lmax))
THEN
343 cpwarn(
"The name of the primitive basis set will be truncated.")
345 pbasis%name = trim(basis_set%name)//
"_primitive"
346 pbasis%kind_radius = basis_set%kind_radius
347 pbasis%short_kind_radius = basis_set%short_kind_radius
348 pbasis%norm_type = basis_set%norm_type
351 ALLOCATE (pbasis%lmax(nset), pbasis%lmin(nset), pbasis%npgf(nset), pbasis%nshell(nset))
353 pbasis%lmax(iset) = iset - 1
354 pbasis%lmin(iset) = iset - 1
355 pbasis%npgf(iset) = nprim(iset - 1)
356 pbasis%nshell(iset) = nprim(iset - 1)
361 pbasis%ncgf = pbasis%ncgf + nprim(l)*((l + 1)*(l + 2))/2
362 pbasis%nsgf = pbasis%nsgf + nprim(l)*(2*l + 1)
365 ALLOCATE (pbasis%zet(mpgf, nset))
366 pbasis%zet(1:mpgf, 1:nset) = zeta(1:mpgf, 1:nset)
368 ALLOCATE (pbasis%l(mpgf, nset), pbasis%n(mpgf, nset))
370 DO ip = 1, nprim(iset - 1)
371 pbasis%l(ip, iset) = iset - 1
372 pbasis%n(ip, iset) = iset + ip - 1
376 ALLOCATE (pbasis%cgf_symbol(pbasis%ncgf))
377 ALLOCATE (pbasis%lx(pbasis%ncgf))
378 ALLOCATE (pbasis%ly(pbasis%ncgf))
379 ALLOCATE (pbasis%lz(pbasis%ncgf))
380 ALLOCATE (pbasis%m(pbasis%nsgf))
381 ALLOCATE (pbasis%sgf_symbol(pbasis%nsgf))
382 ALLOCATE (pbasis%ncgf_set(nset), pbasis%nsgf_set(nset))
388 pbasis%ncgf_set(iset) = nprim(l)*((l + 1)*(l + 2))/2
389 pbasis%nsgf_set(iset) = nprim(l)*(2*l + 1)
390 DO ishell = 1, pbasis%nshell(iset)
391 lshell = pbasis%l(ishell, iset)
394 pbasis%lx(ncgf) =
indco(1, ico)
395 pbasis%ly(ncgf) =
indco(2, ico)
396 pbasis%lz(ncgf) =
indco(3, ico)
397 pbasis%cgf_symbol(ncgf) = &
398 cgf_symbol(pbasis%n(ishell, iset), (/pbasis%lx(ncgf), pbasis%ly(ncgf), pbasis%lz(ncgf)/))
400 DO m = -lshell, lshell
403 pbasis%sgf_symbol(nsgf) =
sgf_symbol(pbasis%n(ishell, iset), lshell, m)
407 cpassert(ncgf == pbasis%ncgf)
408 cpassert(nsgf == pbasis%nsgf)
410 ALLOCATE (pbasis%gcc(mpgf, mpgf, nset))
414 pbasis%gcc(i, i, iset) = 1.0_dp
418 ALLOCATE (pbasis%first_cgf(mpgf, nset))
419 ALLOCATE (pbasis%first_sgf(mpgf, nset))
420 ALLOCATE (pbasis%last_cgf(mpgf, nset))
421 ALLOCATE (pbasis%last_sgf(mpgf, nset))
426 DO ishell = 1, pbasis%nshell(iset)
427 lshell = pbasis%l(ishell, iset)
428 pbasis%first_cgf(ishell, iset) = nc + 1
429 nc = nc +
nco(lshell)
430 pbasis%last_cgf(ishell, iset) = nc
431 pbasis%first_sgf(ishell, iset) = ns + 1
432 ns = ns +
nso(lshell)
433 pbasis%last_sgf(ishell, iset) = ns
435 maxco = max(maxco, pbasis%npgf(iset)*
ncoset(pbasis%lmax(iset)))
438 ALLOCATE (pbasis%norm_cgf(ncgf))
439 ALLOCATE (pbasis%cphi(maxco, ncgf))
441 ALLOCATE (pbasis%sphi(maxco, nsgf))
443 ALLOCATE (pbasis%scon(maxco, ncgf))
445 ALLOCATE (pbasis%set_radius(nset))
446 ALLOCATE (pbasis%pgf_radius(mpgf, nset))
447 pbasis%pgf_radius = 0.0_dp
451 DEALLOCATE (zet, zeta, nindex, nprim)
467 CHARACTER(LEN=12),
DIMENSION(:),
POINTER ::
cgf_symbol
468 CHARACTER(LEN=6),
DIMENSION(:),
POINTER ::
sgf_symbol
469 INTEGER :: iset, ishell, lshell, maxco, maxpgf, &
470 maxshell, nc, ncgf, ncgfn, ncgfo, ns, &
471 nset, nsetn, nseto, nsgf, nsgfn, nsgfo
474 cpwarn(
"The name of the combined GTO basis set will be truncated.")
476 basis_set%name = trim(basis_set%name)//trim(basis_set_add%name)
477 basis_set%nset = basis_set%nset + basis_set_add%nset
478 basis_set%ncgf = basis_set%ncgf + basis_set_add%ncgf
479 basis_set%nsgf = basis_set%nsgf + basis_set_add%nsgf
480 nset = basis_set%nset
481 ncgf = basis_set%ncgf
482 nsgf = basis_set%nsgf
484 nsetn = basis_set_add%nset
486 CALL reallocate(basis_set%set_radius, 1, nset)
491 basis_set%lmax(nseto + 1:nset) = basis_set_add%lmax(1:nsetn)
492 basis_set%lmin(nseto + 1:nset) = basis_set_add%lmin(1:nsetn)
493 basis_set%npgf(nseto + 1:nset) = basis_set_add%npgf(1:nsetn)
494 basis_set%nshell(nseto + 1:nset) = basis_set_add%nshell(1:nsetn)
497 basis_set%ncgf_set(nseto + 1:nset) = basis_set_add%ncgf_set(1:nsetn)
498 basis_set%nsgf_set(nseto + 1:nset) = basis_set_add%nsgf_set(1:nsetn)
500 nsgfn = basis_set_add%nsgf
502 ncgfn = basis_set_add%ncgf
506 cgf_symbol(1:ncgfo) = basis_set%cgf_symbol(1:ncgfo)
507 cgf_symbol(ncgfo + 1:ncgf) = basis_set_add%cgf_symbol(1:ncgfn)
508 sgf_symbol(1:nsgfo) = basis_set%sgf_symbol(1:nsgfo)
509 sgf_symbol(nsgfo + 1:nsgf) = basis_set_add%sgf_symbol(1:nsgfn)
510 DEALLOCATE (basis_set%cgf_symbol, basis_set%sgf_symbol)
511 ALLOCATE (basis_set%cgf_symbol(ncgf), basis_set%sgf_symbol(nsgf))
520 basis_set%lx(ncgfo + 1:ncgf) = basis_set_add%lx(1:ncgfn)
521 basis_set%ly(ncgfo + 1:ncgf) = basis_set_add%ly(1:ncgfn)
522 basis_set%lz(ncgfo + 1:ncgf) = basis_set_add%lz(1:ncgfn)
523 basis_set%m(nsgfo + 1:nsgf) = basis_set_add%m(1:nsgfn)
525 maxpgf = maxval(basis_set%npgf)
526 CALL reallocate(basis_set%zet, 1, maxpgf, 1, nset)
527 nc =
SIZE(basis_set_add%zet, 1)
529 basis_set%zet(1:nc, nseto + iset) = basis_set_add%zet(1:nc, iset)
532 maxshell = maxval(basis_set%nshell)
533 CALL reallocate(basis_set%l, 1, maxshell, 1, nset)
534 CALL reallocate(basis_set%n, 1, maxshell, 1, nset)
535 nc =
SIZE(basis_set_add%l, 1)
537 basis_set%l(1:nc, nseto + iset) = basis_set_add%l(1:nc, iset)
538 basis_set%n(1:nc, nseto + iset) = basis_set_add%n(1:nc, iset)
541 CALL reallocate(basis_set%first_cgf, 1, maxshell, 1, nset)
542 CALL reallocate(basis_set%first_sgf, 1, maxshell, 1, nset)
543 CALL reallocate(basis_set%last_cgf, 1, maxshell, 1, nset)
544 CALL reallocate(basis_set%last_sgf, 1, maxshell, 1, nset)
548 DO ishell = 1, basis_set%nshell(iset)
549 lshell = basis_set%l(ishell, iset)
550 basis_set%first_cgf(ishell, iset) = nc + 1
551 nc = nc +
nco(lshell)
552 basis_set%last_cgf(ishell, iset) = nc
553 basis_set%first_sgf(ishell, iset) = ns + 1
554 ns = ns +
nso(lshell)
555 basis_set%last_sgf(ishell, iset) = ns
559 CALL reallocate(basis_set%gcc, 1, maxpgf, 1, maxshell, 1, nset)
560 nc =
SIZE(basis_set_add%gcc, 1)
561 ns =
SIZE(basis_set_add%gcc, 2)
563 basis_set%gcc(1:nc, 1:ns, nseto + iset) = basis_set_add%gcc(1:nc, 1:ns, iset)
568 maxco = max(
SIZE(basis_set%cphi, 1),
SIZE(basis_set_add%cphi, 1))
569 CALL reallocate(basis_set%cphi, 1, maxco, 1, ncgf)
570 CALL reallocate(basis_set%sphi, 1, maxco, 1, nsgf)
571 CALL reallocate(basis_set%scon, 1, maxco, 1, nsgf)
572 CALL reallocate(basis_set%pgf_radius, 1, maxpgf, 1, nset)
626 nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, &
627 m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, &
628 last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, &
629 npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum)
636 CHARACTER(LEN=default_string_length), &
637 INTENT(OUT),
OPTIONAL :: name, aliases
638 INTEGER,
INTENT(OUT),
OPTIONAL :: norm_type
639 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: kind_radius
640 INTEGER,
INTENT(OUT),
OPTIONAL :: ncgf, nset, nsgf
641 CHARACTER(LEN=12),
DIMENSION(:),
OPTIONAL,
POINTER ::
cgf_symbol
642 CHARACTER(LEN=6),
DIMENSION(:),
OPTIONAL,
POINTER ::
sgf_symbol
643 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: norm_cgf, set_radius
644 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: lmax, lmin, lx, ly, lz, m, ncgf_set, &
645 npgf, nsgf_set, nshell
646 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cphi, pgf_radius, sphi, scon, zet
647 INTEGER,
DIMENSION(:, :),
OPTIONAL,
POINTER :: first_cgf, first_sgf, l, last_cgf, &
649 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
651 INTEGER,
INTENT(OUT),
OPTIONAL :: maxco, maxl, maxpgf, maxsgf_set, &
652 maxshell, maxso, nco_sum, npgf_sum, &
654 INTEGER,
INTENT(IN),
OPTIONAL :: maxder
655 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: short_kind_radius
656 INTEGER,
INTENT(OUT),
OPTIONAL :: npgf_seg_sum
658 INTEGER :: iset, nder
660 IF (
PRESENT(name)) name = gto_basis_set%name
661 IF (
PRESENT(aliases)) aliases = gto_basis_set%aliases
662 IF (
PRESENT(norm_type)) norm_type = gto_basis_set%norm_type
663 IF (
PRESENT(kind_radius)) kind_radius = gto_basis_set%kind_radius
664 IF (
PRESENT(short_kind_radius)) short_kind_radius = gto_basis_set%short_kind_radius
665 IF (
PRESENT(ncgf)) ncgf = gto_basis_set%ncgf
666 IF (
PRESENT(nset)) nset = gto_basis_set%nset
667 IF (
PRESENT(nsgf)) nsgf = gto_basis_set%nsgf
670 IF (
PRESENT(norm_cgf)) norm_cgf => gto_basis_set%norm_cgf
671 IF (
PRESENT(set_radius)) set_radius => gto_basis_set%set_radius
672 IF (
PRESENT(lmax)) lmax => gto_basis_set%lmax
673 IF (
PRESENT(lmin)) lmin => gto_basis_set%lmin
674 IF (
PRESENT(lx)) lx => gto_basis_set%lx
675 IF (
PRESENT(ly)) ly => gto_basis_set%ly
676 IF (
PRESENT(lz)) lz => gto_basis_set%lz
677 IF (
PRESENT(m)) m => gto_basis_set%m
678 IF (
PRESENT(ncgf_set)) ncgf_set => gto_basis_set%ncgf_set
679 IF (
PRESENT(npgf)) npgf => gto_basis_set%npgf
680 IF (
PRESENT(nsgf_set)) nsgf_set => gto_basis_set%nsgf_set
681 IF (
PRESENT(nshell)) nshell => gto_basis_set%nshell
682 IF (
PRESENT(cphi)) cphi => gto_basis_set%cphi
683 IF (
PRESENT(pgf_radius)) pgf_radius => gto_basis_set%pgf_radius
684 IF (
PRESENT(sphi)) sphi => gto_basis_set%sphi
685 IF (
PRESENT(scon)) scon => gto_basis_set%scon
686 IF (
PRESENT(zet)) zet => gto_basis_set%zet
687 IF (
PRESENT(first_cgf)) first_cgf => gto_basis_set%first_cgf
688 IF (
PRESENT(first_sgf)) first_sgf => gto_basis_set%first_sgf
689 IF (
PRESENT(l)) l => gto_basis_set%l
690 IF (
PRESENT(last_cgf)) last_cgf => gto_basis_set%last_cgf
691 IF (
PRESENT(last_sgf)) last_sgf => gto_basis_set%last_sgf
692 IF (
PRESENT(n)) n => gto_basis_set%n
693 IF (
PRESENT(gcc)) gcc => gto_basis_set%gcc
694 IF (
PRESENT(maxco))
THEN
696 IF (
PRESENT(maxder))
THEN
701 DO iset = 1, gto_basis_set%nset
702 maxco = max(maxco, gto_basis_set%npgf(iset)* &
703 ncoset(gto_basis_set%lmax(iset) + nder))
706 IF (
PRESENT(maxl))
THEN
708 DO iset = 1, gto_basis_set%nset
709 maxl = max(maxl, gto_basis_set%lmax(iset))
712 IF (
PRESENT(maxpgf))
THEN
714 DO iset = 1, gto_basis_set%nset
715 maxpgf = max(maxpgf, gto_basis_set%npgf(iset))
718 IF (
PRESENT(maxsgf_set))
THEN
720 DO iset = 1, gto_basis_set%nset
721 maxsgf_set = max(maxsgf_set, gto_basis_set%nsgf_set(iset))
724 IF (
PRESENT(maxshell))
THEN
726 DO iset = 1, gto_basis_set%nset
727 maxshell = max(maxshell, gto_basis_set%nshell(iset))
730 IF (
PRESENT(maxso))
THEN
732 DO iset = 1, gto_basis_set%nset
733 maxso = max(maxso, gto_basis_set%npgf(iset)* &
734 nsoset(gto_basis_set%lmax(iset)))
738 IF (
PRESENT(nco_sum))
THEN
740 DO iset = 1, gto_basis_set%nset
741 nco_sum = nco_sum + gto_basis_set%npgf(iset)* &
742 ncoset(gto_basis_set%lmax(iset))
745 IF (
PRESENT(npgf_sum)) npgf_sum = sum(gto_basis_set%npgf)
746 IF (
PRESENT(nshell_sum)) nshell_sum = sum(gto_basis_set%nshell)
747 IF (
PRESENT(npgf_seg_sum))
THEN
749 DO iset = 1, gto_basis_set%nset
750 npgf_seg_sum = npgf_seg_sum + gto_basis_set%npgf(iset)*gto_basis_set%nshell(iset)
768 CHARACTER(len=*),
PARAMETER :: routinen =
'init_aux_basis_set'
774 IF (.NOT.
ASSOCIATED(gto_basis_set))
RETURN
776 CALL timeset(routinen, handle)
778 SELECT CASE (gto_basis_set%norm_type)
782 CALL init_norm_cgf_aux_2(gto_basis_set)
785 CALL init_norm_cgf_aux(gto_basis_set)
787 cpabort(
"Normalization method not specified")
793 CALL timestop(handle)
811 CHARACTER(len=*),
PARAMETER :: routinen =
'init_cphi_and_sphi'
813 INTEGER :: first_cgf, first_sgf, handle, icgf, ico, &
814 ipgf, iset, ishell, l, last_sgf, lmax, &
815 lmin, n, n1, n2, ncgf, nn, nn1, nn2, &
821 CALL timeset(routinen, handle)
823 gto_basis_set%cphi = 0.0_dp
824 DO iset = 1, gto_basis_set%nset
825 n =
ncoset(gto_basis_set%lmax(iset))
826 DO ishell = 1, gto_basis_set%nshell(iset)
827 DO icgf = gto_basis_set%first_cgf(ishell, iset), &
828 gto_basis_set%last_cgf(ishell, iset)
829 ico =
coset(gto_basis_set%lx(icgf), &
830 gto_basis_set%ly(icgf), &
831 gto_basis_set%lz(icgf))
832 DO ipgf = 1, gto_basis_set%npgf(iset)
833 gto_basis_set%cphi(ico, icgf) = gto_basis_set%norm_cgf(icgf)* &
834 gto_basis_set%gcc(ipgf, ishell, iset)
843 n =
SIZE(gto_basis_set%cphi, 1)
845 gto_basis_set%sphi = 0.0_dp
849 DO iset = 1, gto_basis_set%nset
850 DO ishell = 1, gto_basis_set%nshell(iset)
851 lmax = max(lmax, gto_basis_set%l(ishell, iset))
856 DO iset = 1, gto_basis_set%nset
857 DO ishell = 1, gto_basis_set%nshell(iset)
858 l = gto_basis_set%l(ishell, iset)
859 first_cgf = gto_basis_set%first_cgf(ishell, iset)
860 first_sgf = gto_basis_set%first_sgf(ishell, iset)
863 CALL dgemm(
"N",
"T", n, nsgf, ncgf, &
864 1.0_dp, gto_basis_set%cphi(1, first_cgf), n, &
866 0.0_dp, gto_basis_set%sphi(1, first_sgf), n)
875 n =
SIZE(gto_basis_set%scon, 1)
877 gto_basis_set%scon = 0.0_dp
879 DO iset = 1, gto_basis_set%nset
880 lmin = gto_basis_set%lmin(iset)
881 lmax = gto_basis_set%lmax(iset)
882 npgf = gto_basis_set%npgf(iset)
884 DO ishell = 1, gto_basis_set%nshell(iset)
885 first_sgf = gto_basis_set%first_sgf(ishell, iset)
886 last_sgf = gto_basis_set%last_sgf(ishell, iset)
890 n1 = (ipgf - 1)*nn + 1
892 gto_basis_set%scon(n1:n2, first_sgf:last_sgf) = gto_basis_set%sphi(nn1:nn2, first_sgf:last_sgf)
898 CALL timestop(handle)
906 SUBROUTINE init_norm_cgf_aux(gto_basis_set)
915 INTEGER :: icgf, ico, ipgf, iset, ishell, jco, &
916 jpgf, ll, lmax, lmin, lx, ly, lz, n, &
918 REAL(kind=
dp) :: fnorm, gcca, gccb
919 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: ff
920 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: gaa
921 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: vv
922 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rpgfa, zeta
928 DO iset = 1, gto_basis_set%nset
929 n = max(n, gto_basis_set%npgf(iset)*
ncoset(gto_basis_set%lmax(iset)))
930 ll = max(ll, gto_basis_set%lmax(iset))
935 ALLOCATE (ff(0:ll + ll))
937 DO iset = 1, gto_basis_set%nset
938 lmax = gto_basis_set%lmax(iset)
939 lmin = gto_basis_set%lmin(iset)
941 npgfa = gto_basis_set%npgf(iset)
942 rpgfa => gto_basis_set%pgf_radius(1:npgfa, iset)
943 zeta => gto_basis_set%zet(1:npgfa, iset)
944 CALL coulomb2(lmax, npgfa, zeta, rpgfa, lmin, &
945 lmax, npgfa, zeta, rpgfa, lmin, &
946 (/0.0_dp, 0.0_dp, 0.0_dp/), 0.0_dp, gaa, vv, ff(0:))
947 DO ishell = 1, gto_basis_set%nshell(iset)
948 DO icgf = gto_basis_set%first_cgf(ishell, iset), &
949 gto_basis_set%last_cgf(ishell, iset)
950 lx = gto_basis_set%lx(icgf)
951 ly = gto_basis_set%ly(icgf)
952 lz = gto_basis_set%lz(icgf)
953 ico =
coset(lx, ly, lz)
956 gcca = gto_basis_set%gcc(ipgf, ishell, iset)
957 jco =
coset(lx, ly, lz)
959 gccb = gto_basis_set%gcc(jpgf, ishell, iset)
960 fnorm = fnorm + gcca*gccb*gaa(ico, jco)
965 gto_basis_set%norm_cgf(icgf) = 1.0_dp/sqrt(fnorm)
973 END SUBROUTINE init_norm_cgf_aux
979 ELEMENTAL SUBROUTINE init_norm_cgf_aux_2(gto_basis_set)
988 INTEGER :: icgf, iset, ishell
990 DO iset = 1, gto_basis_set%nset
991 DO ishell = 1, gto_basis_set%nshell(iset)
992 DO icgf = gto_basis_set%first_cgf(ishell, iset), &
993 gto_basis_set%last_cgf(ishell, iset)
994 gto_basis_set%norm_cgf(icgf) = 1.0_dp
999 END SUBROUTINE init_norm_cgf_aux_2
1006 ELEMENTAL SUBROUTINE init_norm_cgf_orb(gto_basis_set)
1010 INTEGER :: icgf, ipgf, iset, ishell, jpgf, l, lx, &
1012 REAL(kind=
dp) :: expzet, fnorm, gcca, gccb, prefac, zeta, &
1015 DO iset = 1, gto_basis_set%nset
1016 DO ishell = 1, gto_basis_set%nshell(iset)
1018 l = gto_basis_set%l(ishell, iset)
1020 expzet = 0.5_dp*real(2*l + 3,
dp)
1024 DO ipgf = 1, gto_basis_set%npgf(iset)
1025 gcca = gto_basis_set%gcc(ipgf, ishell, iset)
1026 zeta = gto_basis_set%zet(ipgf, iset)
1027 DO jpgf = 1, gto_basis_set%npgf(iset)
1028 gccb = gto_basis_set%gcc(jpgf, ishell, iset)
1029 zetb = gto_basis_set%zet(jpgf, iset)
1030 fnorm = fnorm + gcca*gccb/(zeta + zetb)**expzet
1034 fnorm = 0.5_dp**l*
pi**1.5_dp*fnorm
1036 DO icgf = gto_basis_set%first_cgf(ishell, iset), &
1037 gto_basis_set%last_cgf(ishell, iset)
1038 lx = gto_basis_set%lx(icgf)
1039 ly = gto_basis_set%ly(icgf)
1040 lz = gto_basis_set%lz(icgf)
1042 gto_basis_set%norm_cgf(icgf) = 1.0_dp/sqrt(prefac*fnorm)
1048 END SUBROUTINE init_norm_cgf_orb
1056 ELEMENTAL SUBROUTINE init_norm_cgf_orb_den(gto_basis_set)
1060 INTEGER :: icgf, ipgf, iset, ishell, l
1061 REAL(kind=
dp) :: expzet, gcca, prefac, zeta
1063 DO iset = 1, gto_basis_set%nset
1064 DO ishell = 1, gto_basis_set%nshell(iset)
1065 l = gto_basis_set%l(ishell, iset)
1066 expzet = 0.5_dp*real(2*l + 3,
dp)
1067 prefac = (1.0_dp/
pi)**1.5_dp
1068 DO ipgf = 1, gto_basis_set%npgf(iset)
1069 gcca = gto_basis_set%gcc(ipgf, ishell, iset)
1070 zeta = gto_basis_set%zet(ipgf, iset)
1071 gto_basis_set%gcc(ipgf, ishell, iset) = prefac*zeta**expzet*gcca
1073 DO icgf = gto_basis_set%first_cgf(ishell, iset), &
1074 gto_basis_set%last_cgf(ishell, iset)
1075 gto_basis_set%norm_cgf(icgf) = 1.0_dp
1080 END SUBROUTINE init_norm_cgf_orb_den
1091 CHARACTER(len=*),
PARAMETER :: routinen =
'init_orb_basis_set'
1097 IF (.NOT.
ASSOCIATED(gto_basis_set))
RETURN
1099 CALL timeset(routinen, handle)
1101 SELECT CASE (gto_basis_set%norm_type)
1105 CALL init_norm_cgf_orb_den(gto_basis_set)
1108 CALL normalise_gcc_orb(gto_basis_set)
1111 CALL init_norm_cgf_orb(gto_basis_set)
1113 CALL init_norm_cgf_orb(gto_basis_set)
1115 cpabort(
"Normalization method not specified")
1122 CALL timestop(handle)
1132 SUBROUTINE normalise_gcc_orb(gto_basis_set)
1136 INTEGER :: ipgf, iset, ishell, l
1137 REAL(kind=
dp) :: expzet, gcca, prefac, zeta
1139 DO iset = 1, gto_basis_set%nset
1140 DO ishell = 1, gto_basis_set%nshell(iset)
1141 l = gto_basis_set%l(ishell, iset)
1142 expzet = 0.25_dp*real(2*l + 3,
dp)
1143 prefac = 2.0_dp**l*(2.0_dp/
pi)**0.75_dp
1144 DO ipgf = 1, gto_basis_set%npgf(iset)
1145 gcca = gto_basis_set%gcc(ipgf, ishell, iset)
1146 zeta = gto_basis_set%zet(ipgf, iset)
1147 gto_basis_set%gcc(ipgf, ishell, iset) = prefac*zeta**expzet*gcca
1152 END SUBROUTINE normalise_gcc_orb
1163 SUBROUTINE read_gto_basis_set1(element_symbol, basis_set_name, gto_basis_set, &
1164 para_env, dft_section)
1166 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol, basis_set_name
1171 CHARACTER(LEN=240) :: line
1172 CHARACTER(LEN=242) :: line2
1173 CHARACTER(len=default_path_length) :: basis_set_file_name, tmp
1174 CHARACTER(LEN=default_path_length),
DIMENSION(:), &
1176 CHARACTER(LEN=LEN(basis_set_name)) :: bsname
1177 CHARACTER(LEN=LEN(basis_set_name)+2) :: bsname2
1178 CHARACTER(LEN=LEN(element_symbol)) :: symbol
1179 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
1180 INTEGER :: i, ibasis, ico, ipgf, irep, iset, ishell, lshell, m, maxco, maxl, maxpgf, &
1181 maxshell, nbasis, ncgf, nmin, nset, nsgf, sort_method, strlen1, strlen2
1182 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, nshell
1183 INTEGER,
DIMENSION(:, :),
POINTER :: l, n
1184 LOGICAL :: basis_found, found, match
1185 REAL(KIND=
dp),
DIMENSION(:, :),
POINTER :: zet
1186 REAL(KIND=
dp),
DIMENSION(:, :, :),
POINTER :: gcc
1198 gto_basis_set%name = basis_set_name
1199 gto_basis_set%aliases = basis_set_name
1202 ALLOCATE (cbasis(nbasis))
1203 DO ibasis = 1, nbasis
1205 i_rep_val=ibasis, c_val=cbasis(ibasis))
1206 basis_set_file_name = cbasis(ibasis)
1207 tmp = basis_set_file_name
1215 basis_found = .false.
1216 basis_loop:
DO ibasis = 1, nbasis
1217 IF (basis_found)
EXIT basis_loop
1218 basis_set_file_name = cbasis(ibasis)
1219 CALL parser_create(parser, basis_set_file_name, para_env=para_env)
1221 bsname = basis_set_name
1222 symbol = element_symbol
1225 tmp = basis_set_name
1235 gto_basis_set%nset = nset
1236 gto_basis_set%ncgf = ncgf
1237 gto_basis_set%nsgf = nsgf
1241 CALL reallocate(gto_basis_set%nshell, 1, nset)
1242 CALL reallocate(gto_basis_set%n, 1, maxshell, 1, nset)
1243 CALL reallocate(gto_basis_set%l, 1, maxshell, 1, nset)
1244 CALL reallocate(gto_basis_set%zet, 1, maxpgf, 1, nset)
1245 CALL reallocate(gto_basis_set%gcc, 1, maxpgf, 1, maxshell, 1, nset)
1246 CALL reallocate(gto_basis_set%set_radius, 1, nset)
1247 CALL reallocate(gto_basis_set%pgf_radius, 1, maxpgf, 1, nset)
1248 CALL reallocate(gto_basis_set%first_cgf, 1, maxshell, 1, nset)
1249 CALL reallocate(gto_basis_set%first_sgf, 1, maxshell, 1, nset)
1250 CALL reallocate(gto_basis_set%last_cgf, 1, maxshell, 1, nset)
1251 CALL reallocate(gto_basis_set%last_sgf, 1, maxshell, 1, nset)
1252 CALL reallocate(gto_basis_set%ncgf_set, 1, nset)
1253 CALL reallocate(gto_basis_set%nsgf_set, 1, nset)
1254 CALL reallocate(gto_basis_set%cphi, 1, maxco, 1, ncgf)
1255 CALL reallocate(gto_basis_set%sphi, 1, maxco, 1, nsgf)
1256 CALL reallocate(gto_basis_set%scon, 1, maxco, 1, nsgf)
1261 CALL reallocate(gto_basis_set%norm_cgf, 1, ncgf)
1263 IF (tmp .NE.
"NONE")
THEN
1274 line2 =
" "//line//
" "
1275 symbol2 =
" "//trim(symbol)//
" "
1276 bsname2 =
" "//trim(bsname)//
" "
1277 strlen1 = len_trim(symbol2) + 1
1278 strlen2 = len_trim(bsname2) + 1
1280 IF ((index(line2, symbol2(:strlen1)) > 0) .AND. &
1281 (index(line2, bsname2(:strlen2)) > 0)) match = .true.
1284 i = index(line2, symbol2(:strlen1))
1285 i = i + 1 + index(line2(i + 1:),
" ")
1286 gto_basis_set%aliases = line2(i:)
1288 NULLIFY (gcc, l, lmax, lmin, n, npgf, nshell, zet)
1307 maxl = max(maxl, lmax(iset))
1308 IF (npgf(iset) > maxpgf)
THEN
1311 CALL reallocate(gcc, 1, maxpgf, 1, maxshell, 1, nset)
1314 DO lshell = lmin(iset), lmax(iset)
1315 nmin = n(1, iset) + lshell - lmin(iset)
1317 nshell(iset) = nshell(iset) + ishell
1318 IF (nshell(iset) > maxshell)
THEN
1319 maxshell = nshell(iset)
1322 CALL reallocate(gcc, 1, maxpgf, 1, maxshell, 1, nset)
1325 n(nshell(iset) - ishell + i, iset) = nmin + i - 1
1326 l(nshell(iset) - ishell + i, iset) = lshell
1329 DO ipgf = 1, npgf(iset)
1331 DO ishell = 1, nshell(iset)
1343 gto_basis_set%nset = nset
1347 CALL reallocate(gto_basis_set%nshell, 1, nset)
1348 CALL reallocate(gto_basis_set%n, 1, maxshell, 1, nset)
1349 CALL reallocate(gto_basis_set%l, 1, maxshell, 1, nset)
1350 CALL reallocate(gto_basis_set%zet, 1, maxpgf, 1, nset)
1351 CALL reallocate(gto_basis_set%gcc, 1, maxpgf, 1, maxshell, 1, nset)
1356 gto_basis_set%lmax(iset) = lmax(iset)
1357 gto_basis_set%lmin(iset) = lmin(iset)
1358 gto_basis_set%npgf(iset) = npgf(iset)
1359 gto_basis_set%nshell(iset) = nshell(iset)
1360 DO ishell = 1, nshell(iset)
1361 gto_basis_set%n(ishell, iset) = n(ishell, iset)
1362 gto_basis_set%l(ishell, iset) = l(ishell, iset)
1363 DO ipgf = 1, npgf(iset)
1364 gto_basis_set%gcc(ipgf, ishell, iset) = gcc(ipgf, ishell, iset)
1367 DO ipgf = 1, npgf(iset)
1368 gto_basis_set%zet(ipgf, iset) = zet(ipgf, iset)
1374 CALL reallocate(gto_basis_set%set_radius, 1, nset)
1375 CALL reallocate(gto_basis_set%pgf_radius, 1, maxpgf, 1, nset)
1376 CALL reallocate(gto_basis_set%first_cgf, 1, maxshell, 1, nset)
1377 CALL reallocate(gto_basis_set%first_sgf, 1, maxshell, 1, nset)
1378 CALL reallocate(gto_basis_set%last_cgf, 1, maxshell, 1, nset)
1379 CALL reallocate(gto_basis_set%last_sgf, 1, maxshell, 1, nset)
1380 CALL reallocate(gto_basis_set%ncgf_set, 1, nset)
1381 CALL reallocate(gto_basis_set%nsgf_set, 1, nset)
1388 gto_basis_set%ncgf_set(iset) = 0
1389 gto_basis_set%nsgf_set(iset) = 0
1390 DO ishell = 1, nshell(iset)
1391 lshell = gto_basis_set%l(ishell, iset)
1392 gto_basis_set%first_cgf(ishell, iset) = ncgf + 1
1393 ncgf = ncgf +
nco(lshell)
1394 gto_basis_set%last_cgf(ishell, iset) = ncgf
1395 gto_basis_set%ncgf_set(iset) = &
1396 gto_basis_set%ncgf_set(iset) +
nco(lshell)
1397 gto_basis_set%first_sgf(ishell, iset) = nsgf + 1
1398 nsgf = nsgf +
nso(lshell)
1399 gto_basis_set%last_sgf(ishell, iset) = nsgf
1400 gto_basis_set%nsgf_set(iset) = &
1401 gto_basis_set%nsgf_set(iset) +
nso(lshell)
1403 maxco = max(maxco, npgf(iset)*
ncoset(lmax(iset)))
1406 gto_basis_set%ncgf = ncgf
1407 gto_basis_set%nsgf = nsgf
1409 CALL reallocate(gto_basis_set%cphi, 1, maxco, 1, ncgf)
1410 CALL reallocate(gto_basis_set%sphi, 1, maxco, 1, nsgf)
1411 CALL reallocate(gto_basis_set%scon, 1, maxco, 1, nsgf)
1416 CALL reallocate(gto_basis_set%norm_cgf, 1, ncgf)
1417 ALLOCATE (gto_basis_set%cgf_symbol(ncgf))
1419 ALLOCATE (gto_basis_set%sgf_symbol(nsgf))
1425 DO ishell = 1, nshell(iset)
1426 lshell = gto_basis_set%l(ishell, iset)
1429 gto_basis_set%lx(ncgf) =
indco(1, ico)
1430 gto_basis_set%ly(ncgf) =
indco(2, ico)
1431 gto_basis_set%lz(ncgf) =
indco(3, ico)
1432 gto_basis_set%cgf_symbol(ncgf) = &
1433 cgf_symbol(n(ishell, iset), (/gto_basis_set%lx(ncgf), &
1434 gto_basis_set%ly(ncgf), &
1435 gto_basis_set%lz(ncgf)/))
1437 DO m = -lshell, lshell
1439 gto_basis_set%m(nsgf) = m
1440 gto_basis_set%sgf_symbol(nsgf) = &
1446 DEALLOCATE (gcc, l, lmax, lmin, n, npgf, nshell, zet)
1448 basis_found = .true.
1457 ALLOCATE (gto_basis_set%cgf_symbol(ncgf))
1458 ALLOCATE (gto_basis_set%sgf_symbol(nsgf))
1465 IF (tmp .NE.
"NONE")
THEN
1466 IF (.NOT. basis_found)
THEN
1467 basis_set_file_name =
""
1468 DO ibasis = 1, nbasis
1469 basis_set_file_name = trim(basis_set_file_name)//
"<"//trim(cbasis(ibasis))//
"> "
1471 CALL cp_abort(__location__, &
1472 "The requested basis set <"//trim(bsname)// &
1473 "> for element <"//trim(symbol)//
"> was not "// &
1474 "found in the basis set files "// &
1475 trim(basis_set_file_name))
1483 END SUBROUTINE read_gto_basis_set1
1495 SUBROUTINE read_gto_basis_set2(element_symbol, basis_type, gto_basis_set, &
1496 basis_section, irep, dft_section)
1498 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol
1499 CHARACTER(LEN=*),
INTENT(INOUT) :: basis_type
1505 CHARACTER(len=20*default_string_length) :: line_att
1506 CHARACTER(LEN=240) :: line
1507 CHARACTER(LEN=242) :: line2
1508 CHARACTER(LEN=default_path_length) :: bsname, bsname2
1509 CHARACTER(LEN=LEN(element_symbol)) :: symbol
1510 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
1511 INTEGER :: i, ico, ipgf, iset, ishell, lshell, m, &
1512 maxco, maxl, maxpgf, maxshell, ncgf, &
1513 nmin, nset, nsgf, sort_method
1514 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, nshell
1515 INTEGER,
DIMENSION(:, :),
POINTER :: l, n
1517 REAL(KIND=
dp),
DIMENSION(:, :),
POINTER :: zet
1518 REAL(KIND=
dp),
DIMENSION(:, :, :),
POINTER :: gcc
1529 gto_basis_set%name =
" "
1530 gto_basis_set%aliases =
" "
1533 symbol = element_symbol
1541 gto_basis_set%nset = nset
1542 gto_basis_set%ncgf = ncgf
1543 gto_basis_set%nsgf = nsgf
1547 CALL reallocate(gto_basis_set%nshell, 1, nset)
1548 CALL reallocate(gto_basis_set%n, 1, maxshell, 1, nset)
1549 CALL reallocate(gto_basis_set%l, 1, maxshell, 1, nset)
1550 CALL reallocate(gto_basis_set%zet, 1, maxpgf, 1, nset)
1551 CALL reallocate(gto_basis_set%gcc, 1, maxpgf, 1, maxshell, 1, nset)
1552 CALL reallocate(gto_basis_set%set_radius, 1, nset)
1553 CALL reallocate(gto_basis_set%pgf_radius, 1, maxpgf, 1, nset)
1554 CALL reallocate(gto_basis_set%first_cgf, 1, maxshell, 1, nset)
1555 CALL reallocate(gto_basis_set%first_sgf, 1, maxshell, 1, nset)
1556 CALL reallocate(gto_basis_set%last_cgf, 1, maxshell, 1, nset)
1557 CALL reallocate(gto_basis_set%last_sgf, 1, maxshell, 1, nset)
1558 CALL reallocate(gto_basis_set%ncgf_set, 1, nset)
1559 CALL reallocate(gto_basis_set%nsgf_set, 1, nset)
1560 CALL reallocate(gto_basis_set%cphi, 1, maxco, 1, ncgf)
1561 CALL reallocate(gto_basis_set%sphi, 1, maxco, 1, nsgf)
1562 CALL reallocate(gto_basis_set%scon, 1, maxco, 1, nsgf)
1567 CALL reallocate(gto_basis_set%norm_cgf, 1, ncgf)
1570 CALL section_vals_val_get(basis_section,
"_SECTION_PARAMETERS_", i_rep_section=irep, c_val=basis_type)
1571 IF (basis_type ==
"Orbital") basis_type =
"ORB"
1578 NULLIFY (gcc, l, lmax, lmin, n, npgf, nshell, zet)
1581 IF (.NOT. is_ok) cpabort(
"Error reading the Basis set from input file!")
1582 CALL val_get(val, c_val=line_att)
1583 READ (line_att, *) nset
1597 IF (.NOT. is_ok) cpabort(
"Error reading the Basis set from input file!")
1598 CALL val_get(val, c_val=line_att)
1599 READ (line_att, *) n(1, iset)
1601 READ (line_att, *) lmin(iset)
1603 READ (line_att, *) lmax(iset)
1605 READ (line_att, *) npgf(iset)
1607 maxl = max(maxl, lmax(iset))
1608 IF (npgf(iset) > maxpgf)
THEN
1611 CALL reallocate(gcc, 1, maxpgf, 1, maxshell, 1, nset)
1614 DO lshell = lmin(iset), lmax(iset)
1615 nmin = n(1, iset) + lshell - lmin(iset)
1616 READ (line_att, *) ishell
1618 nshell(iset) = nshell(iset) + ishell
1619 IF (nshell(iset) > maxshell)
THEN
1620 maxshell = nshell(iset)
1623 CALL reallocate(gcc, 1, maxpgf, 1, maxshell, 1, nset)
1626 n(nshell(iset) - ishell + i, iset) = nmin + i - 1
1627 l(nshell(iset) - ishell + i, iset) = lshell
1630 IF (len_trim(line_att) /= 0) &
1631 cpabort(
"Error reading the Basis from input file!")
1632 DO ipgf = 1, npgf(iset)
1634 IF (.NOT. is_ok) cpabort(
"Error reading the Basis set from input file!")
1635 CALL val_get(val, c_val=line_att)
1636 READ (line_att, *) zet(ipgf, iset), (gcc(ipgf, ishell, iset), ishell=1, nshell(iset))
1646 gto_basis_set%nset = nset
1650 CALL reallocate(gto_basis_set%nshell, 1, nset)
1651 CALL reallocate(gto_basis_set%n, 1, maxshell, 1, nset)
1652 CALL reallocate(gto_basis_set%l, 1, maxshell, 1, nset)
1653 CALL reallocate(gto_basis_set%zet, 1, maxpgf, 1, nset)
1654 CALL reallocate(gto_basis_set%gcc, 1, maxpgf, 1, maxshell, 1, nset)
1659 gto_basis_set%lmax(iset) = lmax(iset)
1660 gto_basis_set%lmin(iset) = lmin(iset)
1661 gto_basis_set%npgf(iset) = npgf(iset)
1662 gto_basis_set%nshell(iset) = nshell(iset)
1663 DO ishell = 1, nshell(iset)
1664 gto_basis_set%n(ishell, iset) = n(ishell, iset)
1665 gto_basis_set%l(ishell, iset) = l(ishell, iset)
1666 DO ipgf = 1, npgf(iset)
1667 gto_basis_set%gcc(ipgf, ishell, iset) = gcc(ipgf, ishell, iset)
1670 DO ipgf = 1, npgf(iset)
1671 gto_basis_set%zet(ipgf, iset) = zet(ipgf, iset)
1677 CALL reallocate(gto_basis_set%set_radius, 1, nset)
1678 CALL reallocate(gto_basis_set%pgf_radius, 1, maxpgf, 1, nset)
1679 CALL reallocate(gto_basis_set%first_cgf, 1, maxshell, 1, nset)
1680 CALL reallocate(gto_basis_set%first_sgf, 1, maxshell, 1, nset)
1681 CALL reallocate(gto_basis_set%last_cgf, 1, maxshell, 1, nset)
1682 CALL reallocate(gto_basis_set%last_sgf, 1, maxshell, 1, nset)
1683 CALL reallocate(gto_basis_set%ncgf_set, 1, nset)
1684 CALL reallocate(gto_basis_set%nsgf_set, 1, nset)
1691 gto_basis_set%ncgf_set(iset) = 0
1692 gto_basis_set%nsgf_set(iset) = 0
1693 DO ishell = 1, nshell(iset)
1694 lshell = gto_basis_set%l(ishell, iset)
1695 gto_basis_set%first_cgf(ishell, iset) = ncgf + 1
1696 ncgf = ncgf +
nco(lshell)
1697 gto_basis_set%last_cgf(ishell, iset) = ncgf
1698 gto_basis_set%ncgf_set(iset) = &
1699 gto_basis_set%ncgf_set(iset) +
nco(lshell)
1700 gto_basis_set%first_sgf(ishell, iset) = nsgf + 1
1701 nsgf = nsgf +
nso(lshell)
1702 gto_basis_set%last_sgf(ishell, iset) = nsgf
1703 gto_basis_set%nsgf_set(iset) = &
1704 gto_basis_set%nsgf_set(iset) +
nso(lshell)
1706 maxco = max(maxco, npgf(iset)*
ncoset(lmax(iset)))
1709 gto_basis_set%ncgf = ncgf
1710 gto_basis_set%nsgf = nsgf
1712 CALL reallocate(gto_basis_set%cphi, 1, maxco, 1, ncgf)
1713 CALL reallocate(gto_basis_set%sphi, 1, maxco, 1, nsgf)
1714 CALL reallocate(gto_basis_set%scon, 1, maxco, 1, nsgf)
1719 CALL reallocate(gto_basis_set%norm_cgf, 1, ncgf)
1720 ALLOCATE (gto_basis_set%cgf_symbol(ncgf))
1722 ALLOCATE (gto_basis_set%sgf_symbol(nsgf))
1728 DO ishell = 1, nshell(iset)
1729 lshell = gto_basis_set%l(ishell, iset)
1732 gto_basis_set%lx(ncgf) =
indco(1, ico)
1733 gto_basis_set%ly(ncgf) =
indco(2, ico)
1734 gto_basis_set%lz(ncgf) =
indco(3, ico)
1735 gto_basis_set%cgf_symbol(ncgf) = &
1736 cgf_symbol(n(ishell, iset), (/gto_basis_set%lx(ncgf), &
1737 gto_basis_set%ly(ncgf), &
1738 gto_basis_set%lz(ncgf)/))
1740 DO m = -lshell, lshell
1742 gto_basis_set%m(nsgf) = m
1743 gto_basis_set%sgf_symbol(nsgf) = &
1749 DEALLOCATE (gcc, l, lmax, lmin, n, npgf, nshell, zet)
1751 IF (
PRESENT(dft_section))
THEN
1756 END SUBROUTINE read_gto_basis_set2
1798 nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, &
1799 lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, &
1800 cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, &
1801 last_cgf, last_sgf, n, gcc, short_kind_radius)
1804 CHARACTER(LEN=default_string_length),
INTENT(IN), &
1805 OPTIONAL :: name, aliases
1806 INTEGER,
INTENT(IN),
OPTIONAL :: norm_type
1807 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: kind_radius
1808 INTEGER,
INTENT(IN),
OPTIONAL :: ncgf, nset, nsgf
1809 CHARACTER(LEN=12),
DIMENSION(:),
OPTIONAL,
POINTER ::
cgf_symbol
1810 CHARACTER(LEN=6),
DIMENSION(:),
OPTIONAL,
POINTER ::
sgf_symbol
1811 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: norm_cgf, set_radius
1812 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: lmax, lmin, lx, ly, lz, m, ncgf_set, &
1813 npgf, nsgf_set, nshell
1814 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cphi, pgf_radius, sphi, scon, zet
1815 INTEGER,
DIMENSION(:, :),
OPTIONAL,
POINTER :: first_cgf, first_sgf, l, last_cgf, &
1817 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
1819 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: short_kind_radius
1821 IF (
PRESENT(name)) gto_basis_set%name = name
1822 IF (
PRESENT(aliases)) gto_basis_set%aliases = aliases
1823 IF (
PRESENT(norm_type)) gto_basis_set%norm_type = norm_type
1824 IF (
PRESENT(kind_radius)) gto_basis_set%kind_radius = kind_radius
1825 IF (
PRESENT(short_kind_radius)) gto_basis_set%short_kind_radius = short_kind_radius
1826 IF (
PRESENT(ncgf)) gto_basis_set%ncgf = ncgf
1827 IF (
PRESENT(nset)) gto_basis_set%nset = nset
1828 IF (
PRESENT(nsgf)) gto_basis_set%nsgf = nsgf
1831 IF (
PRESENT(norm_cgf)) gto_basis_set%norm_cgf(:) = norm_cgf(:)
1832 IF (
PRESENT(set_radius)) gto_basis_set%set_radius(:) = set_radius(:)
1833 IF (
PRESENT(lmax)) gto_basis_set%lmax(:) = lmax(:)
1834 IF (
PRESENT(lmin)) gto_basis_set%lmin(:) = lmin(:)
1835 IF (
PRESENT(lx)) gto_basis_set%lx(:) = lx(:)
1836 IF (
PRESENT(ly)) gto_basis_set%ly(:) = ly(:)
1837 IF (
PRESENT(lz)) gto_basis_set%lz(:) = lz(:)
1838 IF (
PRESENT(m)) gto_basis_set%m(:) = m(:)
1839 IF (
PRESENT(ncgf_set)) gto_basis_set%ncgf_set(:) = ncgf_set(:)
1840 IF (
PRESENT(npgf)) gto_basis_set%npgf(:) = npgf(:)
1841 IF (
PRESENT(nsgf_set)) gto_basis_set%nsgf_set(:) = nsgf_set(:)
1842 IF (
PRESENT(nshell)) gto_basis_set%nshell(:) = nshell(:)
1843 IF (
PRESENT(cphi)) gto_basis_set%cphi(:, :) = cphi(:, :)
1844 IF (
PRESENT(pgf_radius)) gto_basis_set%pgf_radius(:, :) = pgf_radius(:, :)
1845 IF (
PRESENT(sphi)) gto_basis_set%sphi(:, :) = sphi(:, :)
1846 IF (
PRESENT(scon)) gto_basis_set%scon(:, :) = scon(:, :)
1847 IF (
PRESENT(zet)) gto_basis_set%zet(:, :) = zet(:, :)
1848 IF (
PRESENT(first_cgf)) gto_basis_set%first_cgf(:, :) = first_cgf(:, :)
1849 IF (
PRESENT(first_sgf)) gto_basis_set%first_sgf(:, :) = first_sgf(:, :)
1850 IF (
PRESENT(l)) l(:, :) = gto_basis_set%l(:, :)
1851 IF (
PRESENT(last_cgf)) gto_basis_set%last_cgf(:, :) = last_cgf(:, :)
1852 IF (
PRESENT(last_sgf)) gto_basis_set%last_sgf(:, :) = last_sgf(:, :)
1853 IF (
PRESENT(n)) gto_basis_set%n(:, :) = n(:, :)
1854 IF (
PRESENT(gcc)) gto_basis_set%gcc(:, :, :) = gcc(:, :, :)
1868 INTEGER,
INTENT(in) :: output_unit
1869 CHARACTER(len=*),
OPTIONAL ::
header
1871 INTEGER :: ipgf, iset, ishell
1873 IF (output_unit > 0)
THEN
1875 IF (
PRESENT(
header))
THEN
1876 WRITE (unit=output_unit, fmt=
"(/,T6,A,T41,A40)") &
1877 trim(
header), trim(gto_basis_set%name)
1880 WRITE (unit=output_unit, fmt=
"(/,(T8,A,T71,I10))") &
1881 "Number of orbital shell sets: ", &
1882 gto_basis_set%nset, &
1883 "Number of orbital shells: ", &
1884 sum(gto_basis_set%nshell(:)), &
1885 "Number of primitive Cartesian functions: ", &
1886 sum(gto_basis_set%npgf(:)), &
1887 "Number of Cartesian basis functions: ", &
1888 gto_basis_set%ncgf, &
1889 "Number of spherical basis functions: ", &
1890 gto_basis_set%nsgf, &
1892 gto_basis_set%norm_type
1894 WRITE (unit=output_unit, fmt=
"(/,T6,A,T41,A40,/,/,T25,A)") &
1895 "GTO basis set information for", trim(gto_basis_set%name), &
1896 "Set Shell n l Exponent Coefficient"
1898 DO iset = 1, gto_basis_set%nset
1899 WRITE (unit=output_unit, fmt=
"(A)")
""
1900 DO ishell = 1, gto_basis_set%nshell(iset)
1901 WRITE (unit=output_unit, &
1902 fmt=
"(T25,I3,4X,I4,4X,I2,2X,I2,(T51,2F15.6))") &
1904 gto_basis_set%n(ishell, iset), &
1905 gto_basis_set%l(ishell, iset), &
1906 (gto_basis_set%zet(ipgf, iset), &
1907 gto_basis_set%gcc(ipgf, ishell, iset), &
1908 ipgf=1, gto_basis_set%npgf(iset))
1928 INTEGER,
INTENT(in) :: output_unit
1929 CHARACTER(len=*),
OPTIONAL ::
header
1931 INTEGER :: icgf, ico, ipgf, iset, ishell
1933 IF (output_unit > 0)
THEN
1934 IF (
PRESENT(
header))
THEN
1935 WRITE (unit=output_unit, fmt=
"(/,T6,A,T41,A40)") &
1936 trim(
header), trim(orb_basis_set%name)
1939 WRITE (unit=output_unit, fmt=
"(/,(T8,A,T71,I10))") &
1940 "Number of orbital shell sets: ", &
1941 orb_basis_set%nset, &
1942 "Number of orbital shells: ", &
1943 sum(orb_basis_set%nshell(:)), &
1944 "Number of primitive Cartesian functions: ", &
1945 sum(orb_basis_set%npgf(:)), &
1946 "Number of Cartesian basis functions: ", &
1947 orb_basis_set%ncgf, &
1948 "Number of spherical basis functions: ", &
1949 orb_basis_set%nsgf, &
1951 orb_basis_set%norm_type
1953 WRITE (unit=output_unit, fmt=
"(/,T8,A,/,/,T25,A)") &
1954 "Normalised Cartesian orbitals:", &
1955 "Set Shell Orbital Exponent Coefficient"
1959 DO iset = 1, orb_basis_set%nset
1960 DO ishell = 1, orb_basis_set%nshell(iset)
1961 WRITE (unit=output_unit, fmt=
"(A)")
""
1962 DO ico = 1,
nco(orb_basis_set%l(ishell, iset))
1964 WRITE (unit=output_unit, &
1965 fmt=
"(T25,I3,4X,I4,3X,A12,(T51,2F15.6))") &
1966 iset, ishell, orb_basis_set%cgf_symbol(icgf), &
1967 (orb_basis_set%zet(ipgf, iset), &
1968 orb_basis_set%norm_cgf(icgf)* &
1969 orb_basis_set%gcc(ipgf, ishell, iset), &
1970 ipgf=1, orb_basis_set%npgf(iset))
1988 ALLOCATE (sto_basis_set)
2002 IF (
ASSOCIATED(sto_basis_set))
THEN
2003 IF (
ASSOCIATED(sto_basis_set%symbol))
THEN
2004 DEALLOCATE (sto_basis_set%symbol)
2006 IF (
ASSOCIATED(sto_basis_set%nq))
THEN
2007 DEALLOCATE (sto_basis_set%nq)
2009 IF (
ASSOCIATED(sto_basis_set%lq))
THEN
2010 DEALLOCATE (sto_basis_set%lq)
2012 IF (
ASSOCIATED(sto_basis_set%zet))
THEN
2013 DEALLOCATE (sto_basis_set%zet)
2016 DEALLOCATE (sto_basis_set)
2032 SUBROUTINE get_sto_basis_set(sto_basis_set, name, nshell, symbol, nq, lq, zet, maxlq, numsto)
2035 CHARACTER(LEN=default_string_length), &
2036 INTENT(OUT),
OPTIONAL :: name
2037 INTEGER,
INTENT(OUT),
OPTIONAL :: nshell
2038 CHARACTER(LEN=6),
DIMENSION(:),
OPTIONAL,
POINTER :: symbol
2039 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nq, lq
2040 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: zet
2041 INTEGER,
INTENT(OUT),
OPTIONAL :: maxlq, numsto
2045 IF (
PRESENT(name)) name = sto_basis_set%name
2046 IF (
PRESENT(nshell)) nshell = sto_basis_set%nshell
2047 IF (
PRESENT(symbol)) symbol => sto_basis_set%symbol
2048 IF (
PRESENT(nq)) nq => sto_basis_set%nq
2049 IF (
PRESENT(lq)) lq => sto_basis_set%lq
2050 IF (
PRESENT(zet)) zet => sto_basis_set%zet
2051 IF (
PRESENT(maxlq))
THEN
2052 maxlq = maxval(sto_basis_set%lq(1:sto_basis_set%nshell))
2054 IF (
PRESENT(numsto))
THEN
2056 DO iset = 1, sto_basis_set%nshell
2057 numsto = numsto + 2*sto_basis_set%lq(iset) + 1
2061 END SUBROUTINE get_sto_basis_set
2076 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2078 INTEGER,
INTENT(IN),
OPTIONAL :: nshell
2079 CHARACTER(LEN=6),
DIMENSION(:),
OPTIONAL,
POINTER :: symbol
2080 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nq, lq
2081 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: zet
2085 IF (
PRESENT(name)) sto_basis_set%name = name
2086 IF (
PRESENT(nshell)) sto_basis_set%nshell = nshell
2087 IF (
PRESENT(symbol))
THEN
2089 IF (
ASSOCIATED(sto_basis_set%symbol))
DEALLOCATE (sto_basis_set%symbol)
2090 ALLOCATE (sto_basis_set%symbol(1:ns))
2091 sto_basis_set%symbol(:) = symbol(:)
2093 IF (
PRESENT(nq))
THEN
2096 sto_basis_set%nq = nq(:)
2098 IF (
PRESENT(lq))
THEN
2101 sto_basis_set%lq = lq(:)
2103 IF (
PRESENT(zet))
THEN
2106 sto_basis_set%zet = zet(:)
2123 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol, basis_set_name
2128 CHARACTER(LEN=10) :: nlsym
2129 CHARACTER(LEN=2) :: lsym
2130 CHARACTER(LEN=240) :: line
2131 CHARACTER(LEN=242) :: line2
2132 CHARACTER(len=default_path_length) :: basis_set_file_name, tmp
2133 CHARACTER(LEN=default_path_length),
DIMENSION(:), &
2135 CHARACTER(LEN=LEN(basis_set_name)) :: bsname
2136 CHARACTER(LEN=LEN(basis_set_name)+2) :: bsname2
2137 CHARACTER(LEN=LEN(element_symbol)) :: symbol
2138 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
2139 INTEGER :: ibasis, irep, iset, nbasis, nq, nset, &
2141 LOGICAL :: basis_found, found, match
2142 REAL(kind=
dp) :: zet
2154 sto_basis_set%name = basis_set_name
2157 ALLOCATE (cbasis(nbasis))
2158 DO ibasis = 1, nbasis
2160 i_rep_val=ibasis, c_val=cbasis(ibasis))
2161 basis_set_file_name = cbasis(ibasis)
2162 tmp = basis_set_file_name
2169 basis_found = .false.
2170 basis_loop:
DO ibasis = 1, nbasis
2171 IF (basis_found)
EXIT basis_loop
2172 basis_set_file_name = cbasis(ibasis)
2173 CALL parser_create(parser, basis_set_file_name, para_env=para_env)
2175 bsname = basis_set_name
2176 symbol = element_symbol
2179 tmp = basis_set_name
2182 IF (tmp .NE.
"NONE")
THEN
2193 line2 =
" "//line//
" "
2194 symbol2 =
" "//trim(symbol)//
" "
2195 bsname2 =
" "//trim(bsname)//
" "
2196 strlen1 = len_trim(symbol2) + 1
2197 strlen2 = len_trim(bsname2) + 1
2199 IF ((index(line2, symbol2(:strlen1)) > 0) .AND. &
2200 (index(line2, bsname2(:strlen2)) > 0)) match = .true.
2204 sto_basis_set%nshell = nset
2209 ALLOCATE (sto_basis_set%symbol(nset))
2215 sto_basis_set%nq(iset) = nq
2216 sto_basis_set%zet(iset) = zet
2217 WRITE (nlsym,
"(I2,A)") nq, trim(lsym)
2218 sto_basis_set%symbol(iset) = trim(nlsym)
2219 SELECT CASE (trim(lsym))
2221 sto_basis_set%lq(iset) = 0
2223 sto_basis_set%lq(iset) = 1
2225 sto_basis_set%lq(iset) = 2
2227 sto_basis_set%lq(iset) = 3
2229 sto_basis_set%lq(iset) = 4
2231 sto_basis_set%lq(iset) = 5
2232 CASE (
"I",
"i",
"J",
"j")
2233 sto_basis_set%lq(iset) = 6
2235 sto_basis_set%lq(iset) = 7
2237 sto_basis_set%lq(iset) = 8
2239 sto_basis_set%lq(iset) = 9
2241 CALL cp_abort(__location__, &
2242 "The requested basis set <"//trim(bsname)// &
2243 "> for element <"//trim(symbol)//
"> has an invalid component: ")
2247 basis_found = .true.
2262 IF (tmp .NE.
"NONE")
THEN
2263 IF (.NOT. basis_found)
THEN
2264 basis_set_file_name =
""
2265 DO ibasis = 1, nbasis
2266 basis_set_file_name = trim(basis_set_file_name)//
"<"//trim(cbasis(ibasis))//
"> "
2268 CALL cp_abort(__location__, &
2269 "The requested basis set <"//trim(bsname)// &
2270 "> for element <"//trim(symbol)//
"> was not "// &
2271 "found in the basis set files "// &
2272 trim(basis_set_file_name))
2290 INTEGER,
INTENT(IN),
OPTIONAL :: ngauss
2291 LOGICAL,
INTENT(IN),
OPTIONAL :: ortho
2293 INTEGER,
PARAMETER :: maxng = 6
2295 CHARACTER(LEN=default_string_length) :: name, sng
2296 INTEGER :: ipgf, iset, maxl, ng, nset, nshell
2297 INTEGER,
DIMENSION(:),
POINTER :: lq, nq
2299 REAL(kind=
dp),
DIMENSION(:),
POINTER :: zet
2300 REAL(kind=
dp),
DIMENSION(maxng) :: gcc, zetg
2303 IF (
PRESENT(ngauss)) ng = ngauss
2304 IF (ng > maxng) cpabort(
"Too many Gaussian primitives requested")
2306 IF (
PRESENT(ortho)) do_ortho = ortho
2310 CALL get_sto_basis_set(sto_basis_set, name=name, nshell=nshell, nq=nq, &
2317 gto_basis_set%name = trim(name)//
"_STO-"//trim(sng)//
"G"
2320 gto_basis_set%nset = nset
2324 CALL reallocate(gto_basis_set%nshell, 1, nset)
2325 CALL reallocate(gto_basis_set%n, 1, 1, 1, nset)
2326 CALL reallocate(gto_basis_set%l, 1, 1, 1, nset)
2327 CALL reallocate(gto_basis_set%zet, 1, ng, 1, nset)
2328 CALL reallocate(gto_basis_set%gcc, 1, ng, 1, 1, 1, nset)
2331 CALL get_sto_ng(zet(iset), ng, nq(iset), lq(iset), zetg, gcc)
2332 gto_basis_set%lmax(iset) = lq(iset)
2333 gto_basis_set%lmin(iset) = lq(iset)
2334 gto_basis_set%npgf(iset) = ng
2335 gto_basis_set%nshell(iset) = 1
2336 gto_basis_set%n(1, iset) = lq(iset) + 1
2337 gto_basis_set%l(1, iset) = lq(iset)
2339 gto_basis_set%gcc(ipgf, 1, iset) = gcc(ipgf)
2340 gto_basis_set%zet(ipgf, iset) = zetg(ipgf)
2358 LOGICAL,
INTENT(IN),
OPTIONAL :: do_ortho
2359 INTEGER,
INTENT(IN) :: nset, maxl
2361 INTEGER :: i1, i2, ico, iset, jset, l, lshell, m, &
2362 maxco, ncgf, ng, ngs, np, nsgf
2363 INTEGER,
DIMENSION(0:10) :: mxf
2364 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: gal, zal, zll
2366 ng = gto_basis_set%npgf(1)
2368 IF ((ng /= gto_basis_set%npgf(iset)) .AND. do_ortho) &
2369 cpabort(
"different number of primitves")
2375 l = gto_basis_set%l(1, iset)
2380 ALLOCATE (gal(ng, nset), zal(ng, nset), zll(m*ng, 0:maxl))
2382 zal(1:ng, iset) = gto_basis_set%zet(1:ng, iset)
2383 gal(1:ng, iset) = gto_basis_set%gcc(1:ng, 1, iset)
2385 CALL reallocate(gto_basis_set%zet, 1, m*ng, 1, nset)
2386 CALL reallocate(gto_basis_set%gcc, 1, m*ng, 1, 1, 1, nset)
2388 l = gto_basis_set%l(1, iset)
2389 gto_basis_set%npgf(iset) = ng*mxf(l)
2391 gto_basis_set%zet = 0.0_dp
2392 gto_basis_set%gcc = 0.0_dp
2396 l = gto_basis_set%l(1, iset)
2398 i1 = mxf(l)*ng - ng + 1
2400 zll(i1:i2, l) = zal(1:ng, iset)
2401 gto_basis_set%gcc(i1:i2, 1, iset) = gal(1:ng, iset)
2404 l = gto_basis_set%l(1, iset)
2405 gto_basis_set%zet(:, iset) = zll(:, l)
2408 l = gto_basis_set%l(1, iset)
2409 DO jset = 1, iset - 1
2410 IF (gto_basis_set%l(1, iset) == l)
THEN
2412 CALL orthofun(gto_basis_set%zet(1:m, iset), gto_basis_set%gcc(1:m, 1, iset), &
2413 gto_basis_set%gcc(1:m, 1, jset), l)
2417 DEALLOCATE (gal, zal, zll)
2421 ngs = maxval(gto_basis_set%npgf(1:nset))
2422 CALL reallocate(gto_basis_set%set_radius, 1, nset)
2423 CALL reallocate(gto_basis_set%pgf_radius, 1, ngs, 1, nset)
2424 CALL reallocate(gto_basis_set%first_cgf, 1, 1, 1, nset)
2425 CALL reallocate(gto_basis_set%first_sgf, 1, 1, 1, nset)
2426 CALL reallocate(gto_basis_set%last_cgf, 1, 1, 1, nset)
2427 CALL reallocate(gto_basis_set%last_sgf, 1, 1, 1, nset)
2428 CALL reallocate(gto_basis_set%ncgf_set, 1, nset)
2429 CALL reallocate(gto_basis_set%nsgf_set, 1, nset)
2436 gto_basis_set%ncgf_set(iset) = 0
2437 gto_basis_set%nsgf_set(iset) = 0
2438 lshell = gto_basis_set%l(1, iset)
2439 gto_basis_set%first_cgf(1, iset) = ncgf + 1
2440 ncgf = ncgf +
nco(lshell)
2441 gto_basis_set%last_cgf(1, iset) = ncgf
2442 gto_basis_set%ncgf_set(iset) = &
2443 gto_basis_set%ncgf_set(iset) +
nco(lshell)
2444 gto_basis_set%first_sgf(1, iset) = nsgf + 1
2445 nsgf = nsgf +
nso(lshell)
2446 gto_basis_set%last_sgf(1, iset) = nsgf
2447 gto_basis_set%nsgf_set(iset) = &
2448 gto_basis_set%nsgf_set(iset) +
nso(lshell)
2449 ngs = gto_basis_set%npgf(iset)
2450 maxco = max(maxco, ngs*
ncoset(lshell))
2453 gto_basis_set%ncgf = ncgf
2454 gto_basis_set%nsgf = nsgf
2456 CALL reallocate(gto_basis_set%cphi, 1, maxco, 1, ncgf)
2457 CALL reallocate(gto_basis_set%sphi, 1, maxco, 1, nsgf)
2458 CALL reallocate(gto_basis_set%scon, 1, maxco, 1, nsgf)
2463 CALL reallocate(gto_basis_set%norm_cgf, 1, ncgf)
2464 ALLOCATE (gto_basis_set%cgf_symbol(ncgf))
2465 ALLOCATE (gto_basis_set%sgf_symbol(nsgf))
2471 lshell = gto_basis_set%l(1, iset)
2475 gto_basis_set%lx(ncgf) =
indco(1, ico)
2476 gto_basis_set%ly(ncgf) =
indco(2, ico)
2477 gto_basis_set%lz(ncgf) =
indco(3, ico)
2478 gto_basis_set%cgf_symbol(ncgf) = &
2480 gto_basis_set%ly(ncgf), &
2481 gto_basis_set%lz(ncgf)/))
2483 DO m = -lshell, lshell
2485 gto_basis_set%m(nsgf) = m
2486 gto_basis_set%sgf_symbol(nsgf) =
sgf_symbol(np, lshell, m)
2490 gto_basis_set%norm_type = -1
2501 SUBROUTINE orthofun(zet, co, cr, l)
2502 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: zet
2503 REAL(kind=
dp),
DIMENSION(:),
INTENT(INOUT) ::
co, cr
2504 INTEGER,
INTENT(IN) :: l
2508 CALL aovlp(l, zet, cr, cr, ss)
2509 cr(:) = cr(:)/sqrt(ss)
2510 CALL aovlp(l, zet,
co, cr, ss)
2511 co(:) =
co(:) - ss*cr(:)
2512 CALL aovlp(l, zet,
co,
co, ss)
2513 co(:) =
co(:)/sqrt(ss)
2515 END SUBROUTINE orthofun
2525 SUBROUTINE aovlp(l, zet, ca, cb, ss)
2526 INTEGER,
INTENT(IN) :: l
2527 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: zet, ca, cb
2528 REAL(kind=
dp),
INTENT(OUT) :: ss
2531 REAL(kind=
dp) :: ab, ai, aj, s00, sss
2539 ai = (2.0_dp*zet(i)/
pi)**0.75_dp
2541 aj = (2.0_dp*zet(j)/
pi)**0.75_dp
2542 ab = 1._dp/(zet(i) + zet(j))
2543 s00 = ai*aj*(
pi*ab)**1.50_dp
2546 ELSEIF (l == 1)
THEN
2549 cpabort(
"aovlp lvalue")
2551 ss = ss + sss*ca(i)*cb(j)
2555 END SUBROUTINE aovlp
2567 INTEGER,
INTENT(IN) :: z
2568 INTEGER,
DIMENSION(:, :),
INTENT(IN) :: ne
2569 INTEGER,
INTENT(IN) :: n, l
2572 REAL(
dp),
DIMENSION(7),
PARAMETER :: &
2573 xns = (/1.0_dp, 2.0_dp, 3.0_dp, 3.7_dp, 4.0_dp, 4.2_dp, 4.4_dp/)
2575 INTEGER :: i, l1, l2, m, m1, m2, nn
2590 s = s + 0.3_dp*real(m - 1,
dp)
2592 m = ne(l1, nn) + ne(l2, nn)
2593 s = s + 0.35_dp*real(m - 1,
dp)
2597 IF (l1 + l2 == 3)
THEN
2599 m1 = ne(1, nn - 1) + ne(2, nn - 1) + ne(3, nn - 1) + ne(4, nn - 1)
2602 m2 = m2 + ne(1, i) + ne(2, i) + ne(3, i) + ne(4, i)
2604 s = s + 0.85_dp*real(m1,
dp) + 1._dp*real(m2,
dp)
2610 m = m + ne(1, i) + ne(2, i) + ne(3, i) + ne(4, i)
2612 s = s + 1._dp*real(m,
dp)
2625 INTEGER,
INTENT(IN) :: sort_method
2627 CHARACTER(LEN=12),
DIMENSION(:),
POINTER ::
cgf_symbol
2628 CHARACTER(LEN=6),
DIMENSION(:),
POINTER ::
sgf_symbol
2629 INTEGER :: ic, ic_max, icgf, icgf_new, icgf_old, ico, is, is_max, iset, isgf, isgf_new, &
2630 isgf_old, ishell, lshell, maxco, maxpgf, maxshell, mm, nc, ncgf, ns, nset
2631 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: sort_index
2632 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: icgf_set, isgf_set
2633 INTEGER,
DIMENSION(:),
POINTER :: lx, ly, lz, m, npgf
2634 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: tmp
2635 REAL(
dp),
DIMENSION(:),
POINTER :: set_radius
2636 REAL(
dp),
DIMENSION(:, :),
POINTER :: zet
2637 REAL(kind=
dp),
DIMENSION(:),
POINTER :: norm_cgf
2638 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: cphi, scon, sphi
2640 NULLIFY (set_radius, zet)
2646 maxshell=maxshell, &
2651 set_radius=set_radius, &
2654 ALLOCATE (sort_index(nset))
2655 ALLOCATE (tmp(nset))
2656 SELECT CASE (sort_method)
2659 tmp(iset) = minval(basis_set%zet(:npgf(iset), iset))
2662 cpabort(
"Request basis sort criterion not implemented.")
2665 CALL sort(tmp(1:nset), nset, sort_index)
2672 DO ishell = 1, basis_set%nshell(iset)
2673 DO ico = 1,
nco(basis_set%l(ishell, iset))
2675 IF (ic > ic_max) ic_max = ic
2677 lshell = basis_set%l(ishell, iset)
2678 DO mm = -lshell, lshell
2680 IF (is > is_max) is_max = is
2687 ALLOCATE (icgf_set(nset, ic_max))
2689 ALLOCATE (isgf_set(nset, is_max))
2695 DO ishell = 1, basis_set%nshell(iset)
2696 DO ico = 1,
nco(basis_set%l(ishell, iset))
2699 icgf_set(iset, ic) = icgf
2701 lshell = basis_set%l(ishell, iset)
2702 DO mm = -lshell, lshell
2705 isgf_set(iset, is) = isgf
2710 ALLOCATE (
cgf_symbol(
SIZE(basis_set%cgf_symbol)))
2711 ALLOCATE (norm_cgf(
SIZE(basis_set%norm_cgf)))
2712 ALLOCATE (lx(
SIZE(basis_set%lx)))
2713 ALLOCATE (ly(
SIZE(basis_set%ly)))
2714 ALLOCATE (lz(
SIZE(basis_set%lz)))
2715 ALLOCATE (cphi(
SIZE(basis_set%cphi, 1),
SIZE(basis_set%cphi, 2)))
2717 ALLOCATE (sphi(
SIZE(basis_set%sphi, 1),
SIZE(basis_set%sphi, 2)))
2719 ALLOCATE (scon(
SIZE(basis_set%scon, 1),
SIZE(basis_set%scon, 2)))
2722 ALLOCATE (
sgf_symbol(
SIZE(basis_set%sgf_symbol)))
2723 ALLOCATE (m(
SIZE(basis_set%m)))
2729 icgf_old = icgf_set(sort_index(iset), ic)
2730 IF (icgf_old == 0) cycle
2731 icgf_new = icgf_new + 1
2732 norm_cgf(icgf_new) = basis_set%norm_cgf(icgf_old)
2733 lx(icgf_new) = basis_set%lx(icgf_old)
2734 ly(icgf_new) = basis_set%ly(icgf_old)
2735 lz(icgf_new) = basis_set%lz(icgf_old)
2736 cphi(:, icgf_new) = basis_set%cphi(:, icgf_old)
2737 cgf_symbol(icgf_new) = basis_set%cgf_symbol(icgf_old)
2740 isgf_old = isgf_set(sort_index(iset), is)
2741 IF (isgf_old == 0) cycle
2742 isgf_new = isgf_new + 1
2743 m(isgf_new) = basis_set%m(isgf_old)
2744 sphi(:, isgf_new) = basis_set%sphi(:, isgf_old)
2745 scon(:, isgf_new) = basis_set%scon(:, isgf_old)
2746 sgf_symbol(isgf_new) = basis_set%sgf_symbol(isgf_old)
2750 DEALLOCATE (basis_set%cgf_symbol)
2752 DEALLOCATE (basis_set%norm_cgf)
2753 basis_set%norm_cgf => norm_cgf
2754 DEALLOCATE (basis_set%lx)
2756 DEALLOCATE (basis_set%ly)
2758 DEALLOCATE (basis_set%lz)
2760 DEALLOCATE (basis_set%cphi)
2761 basis_set%cphi => cphi
2762 DEALLOCATE (basis_set%sphi)
2763 basis_set%sphi => sphi
2764 DEALLOCATE (basis_set%scon)
2765 basis_set%scon => scon
2767 DEALLOCATE (basis_set%m)
2769 DEALLOCATE (basis_set%sgf_symbol)
2772 basis_set%lmax = basis_set%lmax(sort_index)
2773 basis_set%lmin = basis_set%lmin(sort_index)
2774 basis_set%npgf = basis_set%npgf(sort_index)
2775 basis_set%nshell = basis_set%nshell(sort_index)
2776 basis_set%ncgf_set = basis_set%ncgf_set(sort_index)
2777 basis_set%nsgf_set = basis_set%nsgf_set(sort_index)
2779 basis_set%n(:, :) = basis_set%n(:, sort_index)
2780 basis_set%l(:, :) = basis_set%l(:, sort_index)
2781 basis_set%zet(:, :) = basis_set%zet(:, sort_index)
2783 basis_set%gcc(:, :, :) = basis_set%gcc(:, :, sort_index)
2784 basis_set%set_radius(:) = basis_set%set_radius(sort_index)
2785 basis_set%pgf_radius(:, :) = basis_set%pgf_radius(:, sort_index)
2790 DO ishell = 1, basis_set%nshell(iset)
2791 lshell = basis_set%l(ishell, iset)
2792 basis_set%first_cgf(ishell, iset) = nc + 1
2793 nc = nc +
nco(lshell)
2794 basis_set%last_cgf(ishell, iset) = nc
2795 basis_set%first_sgf(ishell, iset) = ns + 1
2796 ns = ns +
nso(lshell)
2797 basis_set%last_sgf(ishell, iset) = ns
static void dgemm(const char transa, const char transb, const int m, const int n, const int k, const double alpha, const double *a, const int lda, const double *b, const int ldb, const double beta, double *c, const int ldc)
Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b.
Calculation of Coulomb integrals over Cartesian Gaussian-type functions (electron repulsion integrals...
subroutine, public coulomb2(la_max, npgfa, zeta, rpgfa, la_min, lc_max, npgfc, zetc, rpgfc, lc_min, rac, rac2, vac, v, f, maxder, vac_plus)
Calculation of the primitive two-center Coulomb integrals over Cartesian Gaussian-type functions.
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)
...
integer, parameter, public basis_sort_zet
subroutine, public process_gto_basis(gto_basis_set, do_ortho, nset, maxl)
...
subroutine, public set_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, short_kind_radius)
Set the components of Gaussian-type orbital (GTO) basis set data set.
subroutine, public deallocate_gto_basis_set(gto_basis_set)
...
pure real(dp) function, public srules(z, ne, n, l)
...
subroutine, public write_orb_basis_set(orb_basis_set, output_unit, header)
Write a Gaussian-type orbital (GTO) basis set data set to the output unit.
subroutine, public sort_gto_basis_set(basis_set, sort_method)
sort basis sets w.r.t. radius
subroutine, public deallocate_sto_basis_set(sto_basis_set)
...
subroutine, public init_aux_basis_set(gto_basis_set)
...
subroutine, public allocate_gto_basis_set(gto_basis_set)
...
subroutine, public copy_gto_basis_set(basis_set_in, basis_set_out)
...
subroutine, public init_cphi_and_sphi(gto_basis_set)
...
subroutine, public combine_basis_sets(basis_set, basis_set_add)
...
subroutine, public write_gto_basis_set(gto_basis_set, output_unit, header)
Write a Gaussian-type orbital (GTO) basis set data set to the output unit.
subroutine, public allocate_sto_basis_set(sto_basis_set)
...
subroutine, public create_primitive_basis_set(basis_set, pbasis, lmax)
...
subroutine, public create_gto_from_sto_basis(sto_basis_set, gto_basis_set, ngauss, ortho)
...
subroutine, public set_sto_basis_set(sto_basis_set, name, nshell, symbol, nq, lq, zet)
...
subroutine, public read_sto_basis_set(element_symbol, basis_set_name, sto_basis_set, para_env, dft_section)
...
subroutine, public init_orb_basis_set(gto_basis_set)
Initialise a Gaussian-type orbital (GTO) basis set data set.
integer, parameter, public basis_sort_default
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public vandevondele2007
Utility routines to read data from files. Kept as close as possible to the old parser because.
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
integer, parameter, public default_path_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
Utility routines for the memory handling.
Interface to the message passing library MPI.
Provides Cartesian and spherical orbital pointers and indices.
subroutine, public init_orbital_pointers(maxl)
Initialize or update the orbital pointers.
integer, dimension(:, :, :), allocatable, public co
integer, dimension(:), allocatable, public nco
integer, dimension(:), allocatable, public nsoset
integer, dimension(:), allocatable, public ncoset
integer, dimension(:, :, :), allocatable, public coset
integer, dimension(:, :), allocatable, public indco
integer, dimension(:), allocatable, public nso
character(len=12) function, public cgf_symbol(n, lxyz)
Build a Cartesian orbital symbol (orbital labels for printing).
character(len=6) function, public sgf_symbol(n, l, m)
Build a spherical orbital symbol (orbital labels for printing).
subroutine, public get_sto_ng(zeta, n, nq, lq, alpha, coef)
return STO-NG parameters; INPUT: zeta (Slater exponent) n (Expansion length) nq (principle quantum nu...
Utilities for string manipulations.
subroutine, public integer_to_string(inumber, string)
Converts an integer number to a string. The WRITE statement will return an error message,...
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.
All kind of helpful little routines.
stores all the informations relevant to an mpi environment