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(), ccon => 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
161 ALLOCATE (gto_basis_set)
177 IF (
ASSOCIATED(gto_basis_set))
THEN
178 IF (
ASSOCIATED(gto_basis_set%cgf_symbol))
DEALLOCATE (gto_basis_set%cgf_symbol)
179 IF (
ASSOCIATED(gto_basis_set%sgf_symbol))
DEALLOCATE (gto_basis_set%sgf_symbol)
180 IF (
ASSOCIATED(gto_basis_set%norm_cgf))
DEALLOCATE (gto_basis_set%norm_cgf)
181 IF (
ASSOCIATED(gto_basis_set%set_radius))
DEALLOCATE (gto_basis_set%set_radius)
182 IF (
ASSOCIATED(gto_basis_set%lmax))
DEALLOCATE (gto_basis_set%lmax)
183 IF (
ASSOCIATED(gto_basis_set%lmin))
DEALLOCATE (gto_basis_set%lmin)
184 IF (
ASSOCIATED(gto_basis_set%lx))
DEALLOCATE (gto_basis_set%lx)
185 IF (
ASSOCIATED(gto_basis_set%ly))
DEALLOCATE (gto_basis_set%ly)
186 IF (
ASSOCIATED(gto_basis_set%lz))
DEALLOCATE (gto_basis_set%lz)
187 IF (
ASSOCIATED(gto_basis_set%m))
DEALLOCATE (gto_basis_set%m)
188 IF (
ASSOCIATED(gto_basis_set%ncgf_set))
DEALLOCATE (gto_basis_set%ncgf_set)
189 IF (
ASSOCIATED(gto_basis_set%npgf))
DEALLOCATE (gto_basis_set%npgf)
190 IF (
ASSOCIATED(gto_basis_set%nsgf_set))
DEALLOCATE (gto_basis_set%nsgf_set)
191 IF (
ASSOCIATED(gto_basis_set%nshell))
DEALLOCATE (gto_basis_set%nshell)
192 IF (
ASSOCIATED(gto_basis_set%cphi))
DEALLOCATE (gto_basis_set%cphi)
193 IF (
ASSOCIATED(gto_basis_set%pgf_radius))
DEALLOCATE (gto_basis_set%pgf_radius)
194 IF (
ASSOCIATED(gto_basis_set%sphi))
DEALLOCATE (gto_basis_set%sphi)
195 IF (
ASSOCIATED(gto_basis_set%scon))
DEALLOCATE (gto_basis_set%scon)
196 IF (
ASSOCIATED(gto_basis_set%ccon))
DEALLOCATE (gto_basis_set%ccon)
197 IF (
ASSOCIATED(gto_basis_set%zet))
DEALLOCATE (gto_basis_set%zet)
198 IF (
ASSOCIATED(gto_basis_set%first_cgf))
DEALLOCATE (gto_basis_set%first_cgf)
199 IF (
ASSOCIATED(gto_basis_set%first_sgf))
DEALLOCATE (gto_basis_set%first_sgf)
200 IF (
ASSOCIATED(gto_basis_set%l))
DEALLOCATE (gto_basis_set%l)
201 IF (
ASSOCIATED(gto_basis_set%last_cgf))
DEALLOCATE (gto_basis_set%last_cgf)
202 IF (
ASSOCIATED(gto_basis_set%last_sgf))
DEALLOCATE (gto_basis_set%last_sgf)
203 IF (
ASSOCIATED(gto_basis_set%n))
DEALLOCATE (gto_basis_set%n)
204 IF (
ASSOCIATED(gto_basis_set%gcc))
DEALLOCATE (gto_basis_set%gcc)
205 DEALLOCATE (gto_basis_set)
221 INTEGER :: maxco, maxpgf, maxshell, ncgf, nset, nsgf
225 basis_set_out%name = basis_set_in%name
226 basis_set_out%aliases = basis_set_in%aliases
227 basis_set_out%kind_radius = basis_set_in%kind_radius
228 basis_set_out%norm_type = basis_set_in%norm_type
229 basis_set_out%nset = basis_set_in%nset
230 basis_set_out%ncgf = basis_set_in%ncgf
231 basis_set_out%nsgf = basis_set_in%nsgf
232 nset = basis_set_in%nset
233 ncgf = basis_set_in%ncgf
234 nsgf = basis_set_in%nsgf
235 ALLOCATE (basis_set_out%cgf_symbol(ncgf))
236 ALLOCATE (basis_set_out%sgf_symbol(nsgf))
237 basis_set_out%cgf_symbol = basis_set_in%cgf_symbol
238 basis_set_out%sgf_symbol = basis_set_in%sgf_symbol
239 ALLOCATE (basis_set_out%norm_cgf(ncgf))
240 basis_set_out%norm_cgf = basis_set_in%norm_cgf
241 ALLOCATE (basis_set_out%set_radius(nset))
242 basis_set_out%set_radius = basis_set_in%set_radius
243 ALLOCATE (basis_set_out%lmax(nset), basis_set_out%lmin(nset), basis_set_out%npgf(nset), basis_set_out%nshell(nset))
244 basis_set_out%lmax = basis_set_in%lmax
245 basis_set_out%lmin = basis_set_in%lmin
246 basis_set_out%npgf = basis_set_in%npgf
247 basis_set_out%nshell = basis_set_in%nshell
248 ALLOCATE (basis_set_out%lx(ncgf), basis_set_out%ly(ncgf), basis_set_out%lz(ncgf), basis_set_out%m(nsgf))
249 basis_set_out%lx = basis_set_in%lx
250 basis_set_out%ly = basis_set_in%ly
251 basis_set_out%lz = basis_set_in%lz
252 basis_set_out%m = basis_set_in%m
253 ALLOCATE (basis_set_out%ncgf_set(nset), basis_set_out%nsgf_set(nset))
254 basis_set_out%ncgf_set = basis_set_in%ncgf_set
255 basis_set_out%nsgf_set = basis_set_in%nsgf_set
256 maxco =
SIZE(basis_set_in%cphi, 1)
257 ALLOCATE (basis_set_out%cphi(maxco, ncgf), basis_set_out%sphi(maxco, nsgf), basis_set_out%scon(maxco, nsgf))
258 ALLOCATE (basis_set_out%ccon(maxco, ncgf))
259 basis_set_out%cphi = basis_set_in%cphi
260 basis_set_out%sphi = basis_set_in%sphi
261 basis_set_out%scon = basis_set_in%scon
262 basis_set_out%ccon = 0.0_dp
263 IF (
ASSOCIATED(basis_set_in%ccon))
THEN
264 IF ((
SIZE(basis_set_in%ccon, 1) == maxco) .AND. (
SIZE(basis_set_in%ccon, 2) == ncgf))
THEN
265 basis_set_out%ccon = basis_set_in%ccon
268 maxpgf = maxval(basis_set_in%npgf)
269 ALLOCATE (basis_set_out%pgf_radius(maxpgf, nset), basis_set_out%zet(maxpgf, nset))
270 basis_set_out%pgf_radius = basis_set_in%pgf_radius
271 basis_set_out%zet = basis_set_in%zet
272 maxshell = maxval(basis_set_in%nshell)
273 ALLOCATE (basis_set_out%first_cgf(maxshell, nset), basis_set_out%first_sgf(maxshell, nset))
274 ALLOCATE (basis_set_out%last_cgf(maxshell, nset), basis_set_out%last_sgf(maxshell, nset))
275 basis_set_out%first_cgf = basis_set_in%first_cgf
276 basis_set_out%first_sgf = basis_set_in%first_sgf
277 basis_set_out%last_cgf = basis_set_in%last_cgf
278 basis_set_out%last_sgf = basis_set_in%last_sgf
279 ALLOCATE (basis_set_out%n(maxshell, nset), basis_set_out%l(maxshell, nset))
280 basis_set_out%n = basis_set_in%n
281 basis_set_out%l = basis_set_in%l
282 ALLOCATE (basis_set_out%gcc(maxpgf, maxshell, nset))
283 basis_set_out%gcc = basis_set_in%gcc
299 INTEGER,
INTENT(IN),
OPTIONAL :: lmax
301 INTEGER :: i, ico, ip, ipgf, iset, ishell, l, lm, &
302 lshell, m, maxco, mpgf, nc, ncgf, ns, &
304 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: nindex, nprim
305 REAL(kind=
dp) :: zet0
306 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: zet, zeta
308 mpgf = sum(basis_set%npgf)
309 lm = maxval(basis_set%lmax)
310 ALLOCATE (zet(mpgf, 0:lm), zeta(mpgf, lm + 1), nindex(mpgf), nprim(0:lm))
315 DO iset = 1, basis_set%nset
316 IF (basis_set%lmin(iset) <= l .AND. basis_set%lmax(iset) >= l)
THEN
317 DO ipgf = 1, basis_set%npgf(iset)
319 zet(ip, l) = basis_set%zet(ipgf, iset)
328 zet(1:nprim(l), l) = -zet(1:nprim(l), l)
329 CALL sort(zet(1:nprim(l), l), nprim(l), nindex)
334 IF (abs(zet0 - zet(i, l)) > 1.e-6_dp)
THEN
336 zeta(ip, l + 1) = zet(i, l)
341 zeta(1:ip, l + 1) = -zeta(1:ip, l + 1)
346 IF (
PRESENT(lmax))
THEN
352 cpwarn(
"The name of the primitive basis set will be truncated.")
354 pbasis%name = trim(basis_set%name)//
"_primitive"
355 pbasis%kind_radius = basis_set%kind_radius
356 pbasis%short_kind_radius = basis_set%short_kind_radius
357 pbasis%norm_type = basis_set%norm_type
360 ALLOCATE (pbasis%lmax(nset), pbasis%lmin(nset), pbasis%npgf(nset), pbasis%nshell(nset))
362 pbasis%lmax(iset) = iset - 1
363 pbasis%lmin(iset) = iset - 1
364 pbasis%npgf(iset) = nprim(iset - 1)
365 pbasis%nshell(iset) = nprim(iset - 1)
370 pbasis%ncgf = pbasis%ncgf + nprim(l)*((l + 1)*(l + 2))/2
371 pbasis%nsgf = pbasis%nsgf + nprim(l)*(2*l + 1)
374 ALLOCATE (pbasis%zet(mpgf, nset))
375 pbasis%zet(1:mpgf, 1:nset) = zeta(1:mpgf, 1:nset)
377 ALLOCATE (pbasis%l(mpgf, nset), pbasis%n(mpgf, nset))
379 DO ip = 1, nprim(iset - 1)
380 pbasis%l(ip, iset) = iset - 1
381 pbasis%n(ip, iset) = iset + ip - 1
385 ALLOCATE (pbasis%cgf_symbol(pbasis%ncgf))
386 ALLOCATE (pbasis%lx(pbasis%ncgf))
387 ALLOCATE (pbasis%ly(pbasis%ncgf))
388 ALLOCATE (pbasis%lz(pbasis%ncgf))
389 ALLOCATE (pbasis%m(pbasis%nsgf))
390 ALLOCATE (pbasis%sgf_symbol(pbasis%nsgf))
391 ALLOCATE (pbasis%ncgf_set(nset), pbasis%nsgf_set(nset))
397 pbasis%ncgf_set(iset) = nprim(l)*((l + 1)*(l + 2))/2
398 pbasis%nsgf_set(iset) = nprim(l)*(2*l + 1)
399 DO ishell = 1, pbasis%nshell(iset)
400 lshell = pbasis%l(ishell, iset)
403 pbasis%lx(ncgf) =
indco(1, ico)
404 pbasis%ly(ncgf) =
indco(2, ico)
405 pbasis%lz(ncgf) =
indco(3, ico)
406 pbasis%cgf_symbol(ncgf) = &
407 cgf_symbol(pbasis%n(ishell, iset), [pbasis%lx(ncgf), pbasis%ly(ncgf), pbasis%lz(ncgf)])
409 DO m = -lshell, lshell
412 pbasis%sgf_symbol(nsgf) =
sgf_symbol(pbasis%n(ishell, iset), lshell, m)
416 cpassert(ncgf == pbasis%ncgf)
417 cpassert(nsgf == pbasis%nsgf)
419 ALLOCATE (pbasis%gcc(mpgf, mpgf, nset))
423 pbasis%gcc(i, i, iset) = 1.0_dp
427 ALLOCATE (pbasis%first_cgf(mpgf, nset))
428 ALLOCATE (pbasis%first_sgf(mpgf, nset))
429 ALLOCATE (pbasis%last_cgf(mpgf, nset))
430 ALLOCATE (pbasis%last_sgf(mpgf, nset))
435 DO ishell = 1, pbasis%nshell(iset)
436 lshell = pbasis%l(ishell, iset)
437 pbasis%first_cgf(ishell, iset) = nc + 1
438 nc = nc +
nco(lshell)
439 pbasis%last_cgf(ishell, iset) = nc
440 pbasis%first_sgf(ishell, iset) = ns + 1
441 ns = ns +
nso(lshell)
442 pbasis%last_sgf(ishell, iset) = ns
444 maxco = max(maxco, pbasis%npgf(iset)*
ncoset(pbasis%lmax(iset)))
447 ALLOCATE (pbasis%norm_cgf(ncgf))
448 ALLOCATE (pbasis%cphi(maxco, ncgf))
450 ALLOCATE (pbasis%sphi(maxco, nsgf))
452 ALLOCATE (pbasis%scon(maxco, ncgf))
454 ALLOCATE (pbasis%ccon(maxco, ncgf))
456 ALLOCATE (pbasis%set_radius(nset))
457 ALLOCATE (pbasis%pgf_radius(mpgf, nset))
458 pbasis%pgf_radius = 0.0_dp
462 DEALLOCATE (zet, zeta, nindex, nprim)
478 CHARACTER(LEN=12),
DIMENSION(:),
POINTER ::
cgf_symbol
479 CHARACTER(LEN=6),
DIMENSION(:),
POINTER ::
sgf_symbol
480 INTEGER :: iset, ishell, lshell, maxco, maxpgf, &
481 maxshell, nc, ncgf, ncgfn, ncgfo, ns, &
482 nset, nsetn, nseto, nsgf, nsgfn, nsgfo
485 cpwarn(
"The name of the combined GTO basis set will be truncated.")
487 basis_set%name = trim(basis_set%name)//trim(basis_set_add%name)
488 basis_set%nset = basis_set%nset + basis_set_add%nset
489 basis_set%ncgf = basis_set%ncgf + basis_set_add%ncgf
490 basis_set%nsgf = basis_set%nsgf + basis_set_add%nsgf
491 nset = basis_set%nset
492 ncgf = basis_set%ncgf
493 nsgf = basis_set%nsgf
495 nsetn = basis_set_add%nset
497 CALL reallocate(basis_set%set_radius, 1, nset)
502 basis_set%lmax(nseto + 1:nset) = basis_set_add%lmax(1:nsetn)
503 basis_set%lmin(nseto + 1:nset) = basis_set_add%lmin(1:nsetn)
504 basis_set%npgf(nseto + 1:nset) = basis_set_add%npgf(1:nsetn)
505 basis_set%nshell(nseto + 1:nset) = basis_set_add%nshell(1:nsetn)
508 basis_set%ncgf_set(nseto + 1:nset) = basis_set_add%ncgf_set(1:nsetn)
509 basis_set%nsgf_set(nseto + 1:nset) = basis_set_add%nsgf_set(1:nsetn)
511 nsgfn = basis_set_add%nsgf
513 ncgfn = basis_set_add%ncgf
517 cgf_symbol(1:ncgfo) = basis_set%cgf_symbol(1:ncgfo)
518 cgf_symbol(ncgfo + 1:ncgf) = basis_set_add%cgf_symbol(1:ncgfn)
519 sgf_symbol(1:nsgfo) = basis_set%sgf_symbol(1:nsgfo)
520 sgf_symbol(nsgfo + 1:nsgf) = basis_set_add%sgf_symbol(1:nsgfn)
521 DEALLOCATE (basis_set%cgf_symbol, basis_set%sgf_symbol)
522 ALLOCATE (basis_set%cgf_symbol(ncgf), basis_set%sgf_symbol(nsgf))
531 basis_set%lx(ncgfo + 1:ncgf) = basis_set_add%lx(1:ncgfn)
532 basis_set%ly(ncgfo + 1:ncgf) = basis_set_add%ly(1:ncgfn)
533 basis_set%lz(ncgfo + 1:ncgf) = basis_set_add%lz(1:ncgfn)
534 basis_set%m(nsgfo + 1:nsgf) = basis_set_add%m(1:nsgfn)
536 maxpgf = maxval(basis_set%npgf)
537 CALL reallocate(basis_set%zet, 1, maxpgf, 1, nset)
538 nc =
SIZE(basis_set_add%zet, 1)
540 basis_set%zet(1:nc, nseto + iset) = basis_set_add%zet(1:nc, iset)
543 maxshell = maxval(basis_set%nshell)
544 CALL reallocate(basis_set%l, 1, maxshell, 1, nset)
545 CALL reallocate(basis_set%n, 1, maxshell, 1, nset)
546 nc =
SIZE(basis_set_add%l, 1)
548 basis_set%l(1:nc, nseto + iset) = basis_set_add%l(1:nc, iset)
549 basis_set%n(1:nc, nseto + iset) = basis_set_add%n(1:nc, iset)
552 CALL reallocate(basis_set%first_cgf, 1, maxshell, 1, nset)
553 CALL reallocate(basis_set%first_sgf, 1, maxshell, 1, nset)
554 CALL reallocate(basis_set%last_cgf, 1, maxshell, 1, nset)
555 CALL reallocate(basis_set%last_sgf, 1, maxshell, 1, nset)
559 DO ishell = 1, basis_set%nshell(iset)
560 lshell = basis_set%l(ishell, iset)
561 basis_set%first_cgf(ishell, iset) = nc + 1
562 nc = nc +
nco(lshell)
563 basis_set%last_cgf(ishell, iset) = nc
564 basis_set%first_sgf(ishell, iset) = ns + 1
565 ns = ns +
nso(lshell)
566 basis_set%last_sgf(ishell, iset) = ns
570 CALL reallocate(basis_set%gcc, 1, maxpgf, 1, maxshell, 1, nset)
571 nc =
SIZE(basis_set_add%gcc, 1)
572 ns =
SIZE(basis_set_add%gcc, 2)
574 basis_set%gcc(1:nc, 1:ns, nseto + iset) = basis_set_add%gcc(1:nc, 1:ns, iset)
579 maxco = max(
SIZE(basis_set%cphi, 1),
SIZE(basis_set_add%cphi, 1))
580 CALL reallocate(basis_set%cphi, 1, maxco, 1, ncgf)
581 CALL reallocate(basis_set%sphi, 1, maxco, 1, nsgf)
582 CALL reallocate(basis_set%scon, 1, maxco, 1, nsgf)
583 CALL reallocate(basis_set%ccon, 1, maxco, 1, ncgf)
584 CALL reallocate(basis_set%pgf_radius, 1, maxpgf, 1, nset)
639 nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, &
640 m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, &
641 last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, &
642 npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum, ccon)
649 CHARACTER(LEN=default_string_length), &
650 INTENT(OUT),
OPTIONAL :: name, aliases
651 INTEGER,
INTENT(OUT),
OPTIONAL :: norm_type
652 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: kind_radius
653 INTEGER,
INTENT(OUT),
OPTIONAL :: ncgf, nset, nsgf
654 CHARACTER(LEN=12),
DIMENSION(:),
OPTIONAL,
POINTER ::
cgf_symbol
655 CHARACTER(LEN=6),
DIMENSION(:),
OPTIONAL,
POINTER ::
sgf_symbol
656 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: norm_cgf, set_radius
657 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: lmax, lmin, lx, ly, lz, m, ncgf_set, &
658 npgf, nsgf_set, nshell
659 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cphi, pgf_radius, sphi, scon, zet
660 INTEGER,
DIMENSION(:, :),
OPTIONAL,
POINTER :: first_cgf, first_sgf, l, last_cgf, &
662 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
664 INTEGER,
INTENT(OUT),
OPTIONAL :: maxco, maxl, maxpgf, maxsgf_set, &
665 maxshell, maxso, nco_sum, npgf_sum, &
667 INTEGER,
INTENT(IN),
OPTIONAL :: maxder
668 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: short_kind_radius
669 INTEGER,
INTENT(OUT),
OPTIONAL :: npgf_seg_sum
670 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: ccon
672 INTEGER :: iset, nder
674 IF (
PRESENT(name)) name = gto_basis_set%name
675 IF (
PRESENT(aliases)) aliases = gto_basis_set%aliases
676 IF (
PRESENT(norm_type)) norm_type = gto_basis_set%norm_type
677 IF (
PRESENT(kind_radius)) kind_radius = gto_basis_set%kind_radius
678 IF (
PRESENT(short_kind_radius)) short_kind_radius = gto_basis_set%short_kind_radius
679 IF (
PRESENT(ncgf)) ncgf = gto_basis_set%ncgf
680 IF (
PRESENT(nset)) nset = gto_basis_set%nset
681 IF (
PRESENT(nsgf)) nsgf = gto_basis_set%nsgf
684 IF (
PRESENT(norm_cgf)) norm_cgf => gto_basis_set%norm_cgf
685 IF (
PRESENT(set_radius)) set_radius => gto_basis_set%set_radius
686 IF (
PRESENT(lmax)) lmax => gto_basis_set%lmax
687 IF (
PRESENT(lmin)) lmin => gto_basis_set%lmin
688 IF (
PRESENT(lx)) lx => gto_basis_set%lx
689 IF (
PRESENT(ly)) ly => gto_basis_set%ly
690 IF (
PRESENT(lz)) lz => gto_basis_set%lz
691 IF (
PRESENT(m)) m => gto_basis_set%m
692 IF (
PRESENT(ncgf_set)) ncgf_set => gto_basis_set%ncgf_set
693 IF (
PRESENT(npgf)) npgf => gto_basis_set%npgf
694 IF (
PRESENT(nsgf_set)) nsgf_set => gto_basis_set%nsgf_set
695 IF (
PRESENT(nshell)) nshell => gto_basis_set%nshell
696 IF (
PRESENT(cphi)) cphi => gto_basis_set%cphi
697 IF (
PRESENT(pgf_radius)) pgf_radius => gto_basis_set%pgf_radius
698 IF (
PRESENT(sphi)) sphi => gto_basis_set%sphi
699 IF (
PRESENT(scon)) scon => gto_basis_set%scon
700 IF (
PRESENT(ccon)) ccon => gto_basis_set%ccon
701 IF (
PRESENT(zet)) zet => gto_basis_set%zet
702 IF (
PRESENT(first_cgf)) first_cgf => gto_basis_set%first_cgf
703 IF (
PRESENT(first_sgf)) first_sgf => gto_basis_set%first_sgf
704 IF (
PRESENT(l)) l => gto_basis_set%l
705 IF (
PRESENT(last_cgf)) last_cgf => gto_basis_set%last_cgf
706 IF (
PRESENT(last_sgf)) last_sgf => gto_basis_set%last_sgf
707 IF (
PRESENT(n)) n => gto_basis_set%n
708 IF (
PRESENT(gcc)) gcc => gto_basis_set%gcc
709 IF (
PRESENT(maxco))
THEN
711 IF (
PRESENT(maxder))
THEN
716 DO iset = 1, gto_basis_set%nset
717 maxco = max(maxco, gto_basis_set%npgf(iset)* &
718 ncoset(gto_basis_set%lmax(iset) + nder))
721 IF (
PRESENT(maxl))
THEN
723 DO iset = 1, gto_basis_set%nset
724 maxl = max(maxl, gto_basis_set%lmax(iset))
727 IF (
PRESENT(maxpgf))
THEN
729 DO iset = 1, gto_basis_set%nset
730 maxpgf = max(maxpgf, gto_basis_set%npgf(iset))
733 IF (
PRESENT(maxsgf_set))
THEN
735 DO iset = 1, gto_basis_set%nset
736 maxsgf_set = max(maxsgf_set, gto_basis_set%nsgf_set(iset))
739 IF (
PRESENT(maxshell))
THEN
741 DO iset = 1, gto_basis_set%nset
742 maxshell = max(maxshell, gto_basis_set%nshell(iset))
745 IF (
PRESENT(maxso))
THEN
747 DO iset = 1, gto_basis_set%nset
748 maxso = max(maxso, gto_basis_set%npgf(iset)* &
749 nsoset(gto_basis_set%lmax(iset)))
753 IF (
PRESENT(nco_sum))
THEN
755 DO iset = 1, gto_basis_set%nset
756 nco_sum = nco_sum + gto_basis_set%npgf(iset)* &
757 ncoset(gto_basis_set%lmax(iset))
760 IF (
PRESENT(npgf_sum)) npgf_sum = sum(gto_basis_set%npgf)
761 IF (
PRESENT(nshell_sum)) nshell_sum = sum(gto_basis_set%nshell)
762 IF (
PRESENT(npgf_seg_sum))
THEN
764 DO iset = 1, gto_basis_set%nset
765 npgf_seg_sum = npgf_seg_sum + gto_basis_set%npgf(iset)*gto_basis_set%nshell(iset)
783 CHARACTER(len=*),
PARAMETER :: routinen =
'init_aux_basis_set'
789 IF (.NOT.
ASSOCIATED(gto_basis_set))
RETURN
791 CALL timeset(routinen, handle)
793 SELECT CASE (gto_basis_set%norm_type)
797 CALL init_norm_cgf_aux_2(gto_basis_set)
800 CALL init_norm_cgf_aux(gto_basis_set)
802 cpabort(
"Normalization method not specified")
808 CALL timestop(handle)
826 LOGICAL,
INTENT(IN),
OPTIONAL :: lccon
828 CHARACTER(len=*),
PARAMETER :: routinen =
'init_cphi_and_sphi'
830 INTEGER :: first_cgf, first_sgf, handle, icgf, ico, &
831 ipgf, iset, ishell, l, last_sgf, lmax, &
832 lmin, n, n1, n2, ncgf, nn, nn1, nn2, &
837 IF (
PRESENT(lccon)) my_lccon = lccon
841 CALL timeset(routinen, handle)
843 gto_basis_set%cphi = 0.0_dp
844 DO iset = 1, gto_basis_set%nset
845 n =
ncoset(gto_basis_set%lmax(iset))
846 DO ishell = 1, gto_basis_set%nshell(iset)
847 DO icgf = gto_basis_set%first_cgf(ishell, iset), &
848 gto_basis_set%last_cgf(ishell, iset)
849 ico =
coset(gto_basis_set%lx(icgf), &
850 gto_basis_set%ly(icgf), &
851 gto_basis_set%lz(icgf))
852 DO ipgf = 1, gto_basis_set%npgf(iset)
853 gto_basis_set%cphi(ico, icgf) = gto_basis_set%norm_cgf(icgf)* &
854 gto_basis_set%gcc(ipgf, ishell, iset)
863 n =
SIZE(gto_basis_set%cphi, 1)
865 gto_basis_set%sphi = 0.0_dp
869 DO iset = 1, gto_basis_set%nset
870 DO ishell = 1, gto_basis_set%nshell(iset)
871 lmax = max(lmax, gto_basis_set%l(ishell, iset))
876 DO iset = 1, gto_basis_set%nset
877 DO ishell = 1, gto_basis_set%nshell(iset)
878 l = gto_basis_set%l(ishell, iset)
879 first_cgf = gto_basis_set%first_cgf(ishell, iset)
880 first_sgf = gto_basis_set%first_sgf(ishell, iset)
883 CALL dgemm(
"N",
"T", n, nsgf, ncgf, &
884 1.0_dp, gto_basis_set%cphi(1, first_cgf), n, &
886 0.0_dp, gto_basis_set%sphi(1, first_sgf), n)
895 n =
SIZE(gto_basis_set%scon, 1)
897 gto_basis_set%scon = 0.0_dp
899 DO iset = 1, gto_basis_set%nset
900 lmin = gto_basis_set%lmin(iset)
901 lmax = gto_basis_set%lmax(iset)
902 npgf = gto_basis_set%npgf(iset)
904 DO ishell = 1, gto_basis_set%nshell(iset)
905 first_sgf = gto_basis_set%first_sgf(ishell, iset)
906 last_sgf = gto_basis_set%last_sgf(ishell, iset)
910 n1 = (ipgf - 1)*nn + 1
912 gto_basis_set%scon(n1:n2, first_sgf:last_sgf) = gto_basis_set%sphi(nn1:nn2, first_sgf:last_sgf)
919 IF (.NOT.
ASSOCIATED(gto_basis_set%ccon))
THEN
920 CALL reallocate(gto_basis_set%ccon, 1,
SIZE(gto_basis_set%cphi, 1), 1, gto_basis_set%ncgf)
921 ELSE IF ((
SIZE(gto_basis_set%ccon, 1) /=
SIZE(gto_basis_set%cphi, 1)) .OR. &
922 (
SIZE(gto_basis_set%ccon, 2) /= gto_basis_set%ncgf))
THEN
923 CALL reallocate(gto_basis_set%ccon, 1,
SIZE(gto_basis_set%cphi, 1), 1, gto_basis_set%ncgf)
925 n =
SIZE(gto_basis_set%ccon, 1)
926 gto_basis_set%ccon = 0.0_dp
928 DO iset = 1, gto_basis_set%nset
929 lmin = gto_basis_set%lmin(iset)
930 lmax = gto_basis_set%lmax(iset)
931 npgf = gto_basis_set%npgf(iset)
933 DO ishell = 1, gto_basis_set%nshell(iset)
934 first_sgf = gto_basis_set%first_cgf(ishell, iset)
935 last_sgf = gto_basis_set%last_cgf(ishell, iset)
939 n1 = (ipgf - 1)*nn + 1
941 gto_basis_set%ccon(n1:n2, first_sgf:last_sgf) = gto_basis_set%cphi(nn1:nn2, first_sgf:last_sgf)
948 CALL timestop(handle)
956 SUBROUTINE init_norm_cgf_aux(gto_basis_set)
965 INTEGER :: icgf, ico, ipgf, iset, ishell, jco, &
966 jpgf, ll, lmax, lmin, lx, ly, lz, n, &
968 REAL(kind=
dp) :: fnorm, gcca, gccb
969 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: ff
970 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: gaa
971 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: vv
972 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rpgfa, zeta
978 DO iset = 1, gto_basis_set%nset
979 n = max(n, gto_basis_set%npgf(iset)*
ncoset(gto_basis_set%lmax(iset)))
980 ll = max(ll, gto_basis_set%lmax(iset))
985 ALLOCATE (ff(0:ll + ll))
987 DO iset = 1, gto_basis_set%nset
988 lmax = gto_basis_set%lmax(iset)
989 lmin = gto_basis_set%lmin(iset)
991 npgfa = gto_basis_set%npgf(iset)
992 rpgfa => gto_basis_set%pgf_radius(1:npgfa, iset)
993 zeta => gto_basis_set%zet(1:npgfa, iset)
994 CALL coulomb2(lmax, npgfa, zeta, rpgfa, lmin, &
995 lmax, npgfa, zeta, rpgfa, lmin, &
996 [0.0_dp, 0.0_dp, 0.0_dp], 0.0_dp, gaa, vv, ff(0:))
997 DO ishell = 1, gto_basis_set%nshell(iset)
998 DO icgf = gto_basis_set%first_cgf(ishell, iset), &
999 gto_basis_set%last_cgf(ishell, iset)
1000 lx = gto_basis_set%lx(icgf)
1001 ly = gto_basis_set%ly(icgf)
1002 lz = gto_basis_set%lz(icgf)
1003 ico =
coset(lx, ly, lz)
1006 gcca = gto_basis_set%gcc(ipgf, ishell, iset)
1007 jco =
coset(lx, ly, lz)
1009 gccb = gto_basis_set%gcc(jpgf, ishell, iset)
1010 fnorm = fnorm + gcca*gccb*gaa(ico, jco)
1015 gto_basis_set%norm_cgf(icgf) = 1.0_dp/sqrt(fnorm)
1023 END SUBROUTINE init_norm_cgf_aux
1029 ELEMENTAL SUBROUTINE init_norm_cgf_aux_2(gto_basis_set)
1038 INTEGER :: icgf, iset, ishell
1040 DO iset = 1, gto_basis_set%nset
1041 DO ishell = 1, gto_basis_set%nshell(iset)
1042 DO icgf = gto_basis_set%first_cgf(ishell, iset), &
1043 gto_basis_set%last_cgf(ishell, iset)
1044 gto_basis_set%norm_cgf(icgf) = 1.0_dp
1049 END SUBROUTINE init_norm_cgf_aux_2
1056 ELEMENTAL SUBROUTINE init_norm_cgf_orb(gto_basis_set)
1060 INTEGER :: icgf, ipgf, iset, ishell, jpgf, l, lx, &
1062 REAL(kind=
dp) :: expzet, fnorm, gcca, gccb, prefac, zeta, &
1065 DO iset = 1, gto_basis_set%nset
1066 DO ishell = 1, gto_basis_set%nshell(iset)
1068 l = gto_basis_set%l(ishell, iset)
1070 expzet = 0.5_dp*real(2*l + 3,
dp)
1074 DO ipgf = 1, gto_basis_set%npgf(iset)
1075 gcca = gto_basis_set%gcc(ipgf, ishell, iset)
1076 zeta = gto_basis_set%zet(ipgf, iset)
1077 DO jpgf = 1, gto_basis_set%npgf(iset)
1078 gccb = gto_basis_set%gcc(jpgf, ishell, iset)
1079 zetb = gto_basis_set%zet(jpgf, iset)
1080 fnorm = fnorm + gcca*gccb/(zeta + zetb)**expzet
1084 fnorm = 0.5_dp**l*
pi**1.5_dp*fnorm
1086 DO icgf = gto_basis_set%first_cgf(ishell, iset), &
1087 gto_basis_set%last_cgf(ishell, iset)
1088 lx = gto_basis_set%lx(icgf)
1089 ly = gto_basis_set%ly(icgf)
1090 lz = gto_basis_set%lz(icgf)
1092 gto_basis_set%norm_cgf(icgf) = 1.0_dp/sqrt(prefac*fnorm)
1098 END SUBROUTINE init_norm_cgf_orb
1106 ELEMENTAL SUBROUTINE init_norm_cgf_orb_den(gto_basis_set)
1110 INTEGER :: icgf, ipgf, iset, ishell, l
1111 REAL(kind=
dp) :: expzet, gcca, prefac, zeta
1113 DO iset = 1, gto_basis_set%nset
1114 DO ishell = 1, gto_basis_set%nshell(iset)
1115 l = gto_basis_set%l(ishell, iset)
1116 expzet = 0.5_dp*real(2*l + 3,
dp)
1117 prefac = (1.0_dp/
pi)**1.5_dp
1118 DO ipgf = 1, gto_basis_set%npgf(iset)
1119 gcca = gto_basis_set%gcc(ipgf, ishell, iset)
1120 zeta = gto_basis_set%zet(ipgf, iset)
1121 gto_basis_set%gcc(ipgf, ishell, iset) = prefac*zeta**expzet*gcca
1123 DO icgf = gto_basis_set%first_cgf(ishell, iset), &
1124 gto_basis_set%last_cgf(ishell, iset)
1125 gto_basis_set%norm_cgf(icgf) = 1.0_dp
1130 END SUBROUTINE init_norm_cgf_orb_den
1141 CHARACTER(len=*),
PARAMETER :: routinen =
'init_orb_basis_set'
1147 IF (.NOT.
ASSOCIATED(gto_basis_set))
RETURN
1149 CALL timeset(routinen, handle)
1151 SELECT CASE (gto_basis_set%norm_type)
1155 CALL init_norm_cgf_orb_den(gto_basis_set)
1158 CALL normalise_gcc_orb(gto_basis_set)
1161 CALL init_norm_cgf_orb(gto_basis_set)
1163 CALL init_norm_cgf_orb(gto_basis_set)
1165 cpabort(
"Normalization method not specified")
1172 CALL timestop(handle)
1182 SUBROUTINE normalise_gcc_orb(gto_basis_set)
1186 INTEGER :: ipgf, iset, ishell, l
1187 REAL(kind=
dp) :: expzet, gcca, prefac, zeta
1189 DO iset = 1, gto_basis_set%nset
1190 DO ishell = 1, gto_basis_set%nshell(iset)
1191 l = gto_basis_set%l(ishell, iset)
1192 expzet = 0.25_dp*real(2*l + 3,
dp)
1193 prefac = 2.0_dp**l*(2.0_dp/
pi)**0.75_dp
1194 DO ipgf = 1, gto_basis_set%npgf(iset)
1195 gcca = gto_basis_set%gcc(ipgf, ishell, iset)
1196 zeta = gto_basis_set%zet(ipgf, iset)
1197 gto_basis_set%gcc(ipgf, ishell, iset) = prefac*zeta**expzet*gcca
1202 END SUBROUTINE normalise_gcc_orb
1213 SUBROUTINE read_gto_basis_set1(element_symbol, basis_set_name, gto_basis_set, &
1214 para_env, dft_section)
1216 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol, basis_set_name
1221 CHARACTER(LEN=240) :: line
1222 CHARACTER(LEN=242) :: line2
1223 CHARACTER(len=default_path_length) :: basis_set_file_name, tmp
1224 CHARACTER(LEN=default_path_length),
DIMENSION(:), &
1226 CHARACTER(LEN=LEN(basis_set_name)) :: bsname
1227 CHARACTER(LEN=LEN(basis_set_name)+2) :: bsname2
1228 CHARACTER(LEN=LEN(element_symbol)) :: symbol
1229 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
1230 INTEGER :: i, ibasis, ico, ipgf, irep, iset, ishell, lshell, m, maxco, maxl, maxpgf, &
1231 maxshell, nbasis, ncgf, nmin, nset, nsgf, sort_method, strlen1, strlen2
1232 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, nshell
1233 INTEGER,
DIMENSION(:, :),
POINTER :: l, n
1234 LOGICAL :: basis_found, found, match
1235 REAL(KIND=
dp),
DIMENSION(:, :),
POINTER :: zet
1236 REAL(KIND=
dp),
DIMENSION(:, :, :),
POINTER :: gcc
1248 gto_basis_set%name = basis_set_name
1249 gto_basis_set%aliases = basis_set_name
1252 ALLOCATE (cbasis(nbasis))
1253 DO ibasis = 1, nbasis
1255 i_rep_val=ibasis, c_val=cbasis(ibasis))
1256 basis_set_file_name = cbasis(ibasis)
1257 tmp = basis_set_file_name
1265 basis_found = .false.
1266 basis_loop:
DO ibasis = 1, nbasis
1267 IF (basis_found)
EXIT basis_loop
1268 basis_set_file_name = cbasis(ibasis)
1269 CALL parser_create(parser, basis_set_file_name, para_env=para_env)
1271 bsname = basis_set_name
1272 symbol = element_symbol
1275 tmp = basis_set_name
1285 gto_basis_set%nset = nset
1286 gto_basis_set%ncgf = ncgf
1287 gto_basis_set%nsgf = nsgf
1291 CALL reallocate(gto_basis_set%nshell, 1, nset)
1292 CALL reallocate(gto_basis_set%n, 1, maxshell, 1, nset)
1293 CALL reallocate(gto_basis_set%l, 1, maxshell, 1, nset)
1294 CALL reallocate(gto_basis_set%zet, 1, maxpgf, 1, nset)
1295 CALL reallocate(gto_basis_set%gcc, 1, maxpgf, 1, maxshell, 1, nset)
1296 CALL reallocate(gto_basis_set%set_radius, 1, nset)
1297 CALL reallocate(gto_basis_set%pgf_radius, 1, maxpgf, 1, nset)
1298 CALL reallocate(gto_basis_set%first_cgf, 1, maxshell, 1, nset)
1299 CALL reallocate(gto_basis_set%first_sgf, 1, maxshell, 1, nset)
1300 CALL reallocate(gto_basis_set%last_cgf, 1, maxshell, 1, nset)
1301 CALL reallocate(gto_basis_set%last_sgf, 1, maxshell, 1, nset)
1302 CALL reallocate(gto_basis_set%ncgf_set, 1, nset)
1303 CALL reallocate(gto_basis_set%nsgf_set, 1, nset)
1304 CALL reallocate(gto_basis_set%cphi, 1, maxco, 1, ncgf)
1305 CALL reallocate(gto_basis_set%sphi, 1, maxco, 1, nsgf)
1306 CALL reallocate(gto_basis_set%scon, 1, maxco, 1, nsgf)
1307 CALL reallocate(gto_basis_set%ccon, 1, maxco, 1, ncgf)
1312 CALL reallocate(gto_basis_set%norm_cgf, 1, ncgf)
1314 IF (tmp /=
"NONE")
THEN
1325 line2 =
" "//line//
" "
1326 symbol2 =
" "//trim(symbol)//
" "
1327 bsname2 =
" "//trim(bsname)//
" "
1328 strlen1 = len_trim(symbol2) + 1
1329 strlen2 = len_trim(bsname2) + 1
1331 IF ((index(line2, symbol2(:strlen1)) > 0) .AND. &
1332 (index(line2, bsname2(:strlen2)) > 0)) match = .true.
1335 i = index(line2, symbol2(:strlen1))
1336 i = i + 1 + index(line2(i + 1:),
" ")
1337 gto_basis_set%aliases = line2(i:)
1339 NULLIFY (gcc, l, lmax, lmin, n, npgf, nshell, zet)
1358 maxl = max(maxl, lmax(iset))
1359 IF (npgf(iset) > maxpgf)
THEN
1362 CALL reallocate(gcc, 1, maxpgf, 1, maxshell, 1, nset)
1365 DO lshell = lmin(iset), lmax(iset)
1366 nmin = n(1, iset) + lshell - lmin(iset)
1368 nshell(iset) = nshell(iset) + ishell
1369 IF (nshell(iset) > maxshell)
THEN
1370 maxshell = nshell(iset)
1373 CALL reallocate(gcc, 1, maxpgf, 1, maxshell, 1, nset)
1376 n(nshell(iset) - ishell + i, iset) = nmin + i - 1
1377 l(nshell(iset) - ishell + i, iset) = lshell
1380 DO ipgf = 1, npgf(iset)
1382 DO ishell = 1, nshell(iset)
1394 gto_basis_set%nset = nset
1398 CALL reallocate(gto_basis_set%nshell, 1, nset)
1399 CALL reallocate(gto_basis_set%n, 1, maxshell, 1, nset)
1400 CALL reallocate(gto_basis_set%l, 1, maxshell, 1, nset)
1401 CALL reallocate(gto_basis_set%zet, 1, maxpgf, 1, nset)
1402 CALL reallocate(gto_basis_set%gcc, 1, maxpgf, 1, maxshell, 1, nset)
1407 gto_basis_set%lmax(iset) = lmax(iset)
1408 gto_basis_set%lmin(iset) = lmin(iset)
1409 gto_basis_set%npgf(iset) = npgf(iset)
1410 gto_basis_set%nshell(iset) = nshell(iset)
1411 DO ishell = 1, nshell(iset)
1412 gto_basis_set%n(ishell, iset) = n(ishell, iset)
1413 gto_basis_set%l(ishell, iset) = l(ishell, iset)
1414 DO ipgf = 1, npgf(iset)
1415 gto_basis_set%gcc(ipgf, ishell, iset) = gcc(ipgf, ishell, iset)
1418 DO ipgf = 1, npgf(iset)
1419 gto_basis_set%zet(ipgf, iset) = zet(ipgf, iset)
1425 CALL reallocate(gto_basis_set%set_radius, 1, nset)
1426 CALL reallocate(gto_basis_set%pgf_radius, 1, maxpgf, 1, nset)
1427 CALL reallocate(gto_basis_set%first_cgf, 1, maxshell, 1, nset)
1428 CALL reallocate(gto_basis_set%first_sgf, 1, maxshell, 1, nset)
1429 CALL reallocate(gto_basis_set%last_cgf, 1, maxshell, 1, nset)
1430 CALL reallocate(gto_basis_set%last_sgf, 1, maxshell, 1, nset)
1431 CALL reallocate(gto_basis_set%ncgf_set, 1, nset)
1432 CALL reallocate(gto_basis_set%nsgf_set, 1, nset)
1439 gto_basis_set%ncgf_set(iset) = 0
1440 gto_basis_set%nsgf_set(iset) = 0
1441 DO ishell = 1, nshell(iset)
1442 lshell = gto_basis_set%l(ishell, iset)
1443 gto_basis_set%first_cgf(ishell, iset) = ncgf + 1
1444 ncgf = ncgf +
nco(lshell)
1445 gto_basis_set%last_cgf(ishell, iset) = ncgf
1446 gto_basis_set%ncgf_set(iset) = &
1447 gto_basis_set%ncgf_set(iset) +
nco(lshell)
1448 gto_basis_set%first_sgf(ishell, iset) = nsgf + 1
1449 nsgf = nsgf +
nso(lshell)
1450 gto_basis_set%last_sgf(ishell, iset) = nsgf
1451 gto_basis_set%nsgf_set(iset) = &
1452 gto_basis_set%nsgf_set(iset) +
nso(lshell)
1454 maxco = max(maxco, npgf(iset)*
ncoset(lmax(iset)))
1457 gto_basis_set%ncgf = ncgf
1458 gto_basis_set%nsgf = nsgf
1460 CALL reallocate(gto_basis_set%cphi, 1, maxco, 1, ncgf)
1461 CALL reallocate(gto_basis_set%sphi, 1, maxco, 1, nsgf)
1462 CALL reallocate(gto_basis_set%scon, 1, maxco, 1, nsgf)
1463 CALL reallocate(gto_basis_set%ccon, 1, maxco, 1, ncgf)
1468 CALL reallocate(gto_basis_set%norm_cgf, 1, ncgf)
1469 ALLOCATE (gto_basis_set%cgf_symbol(ncgf))
1471 ALLOCATE (gto_basis_set%sgf_symbol(nsgf))
1477 DO ishell = 1, nshell(iset)
1478 lshell = gto_basis_set%l(ishell, iset)
1481 gto_basis_set%lx(ncgf) =
indco(1, ico)
1482 gto_basis_set%ly(ncgf) =
indco(2, ico)
1483 gto_basis_set%lz(ncgf) =
indco(3, ico)
1484 gto_basis_set%cgf_symbol(ncgf) = &
1485 cgf_symbol(n(ishell, iset), [gto_basis_set%lx(ncgf), &
1486 gto_basis_set%ly(ncgf), &
1487 gto_basis_set%lz(ncgf)])
1489 DO m = -lshell, lshell
1491 gto_basis_set%m(nsgf) = m
1492 gto_basis_set%sgf_symbol(nsgf) = &
1498 DEALLOCATE (gcc, l, lmax, lmin, n, npgf, nshell, zet)
1500 basis_found = .true.
1509 ALLOCATE (gto_basis_set%cgf_symbol(ncgf))
1510 ALLOCATE (gto_basis_set%sgf_symbol(nsgf))
1517 IF (tmp /=
"NONE")
THEN
1518 IF (.NOT. basis_found)
THEN
1519 basis_set_file_name =
""
1520 DO ibasis = 1, nbasis
1521 basis_set_file_name = trim(basis_set_file_name)//
"<"//trim(cbasis(ibasis))//
"> "
1523 CALL cp_abort(__location__, &
1524 "The requested basis set <"//trim(bsname)// &
1525 "> for element <"//trim(symbol)//
"> was not "// &
1526 "found in the basis set files "// &
1527 trim(basis_set_file_name))
1535 END SUBROUTINE read_gto_basis_set1
1547 SUBROUTINE read_gto_basis_set2(element_symbol, basis_type, gto_basis_set, &
1548 basis_section, irep, dft_section)
1550 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol
1551 CHARACTER(LEN=*),
INTENT(INOUT) :: basis_type
1557 CHARACTER(len=20*default_string_length) :: line_att
1558 CHARACTER(LEN=240) :: line
1559 CHARACTER(LEN=242) :: line2
1560 CHARACTER(LEN=default_path_length) :: bsname, bsname2
1561 CHARACTER(LEN=LEN(element_symbol)) :: symbol
1562 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
1563 INTEGER :: i, ico, ipgf, iset, ishell, lshell, m, &
1564 maxco, maxl, maxpgf, maxshell, ncgf, &
1565 nmin, nset, nsgf, sort_method
1566 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, nshell
1567 INTEGER,
DIMENSION(:, :),
POINTER :: l, n
1569 REAL(KIND=
dp),
DIMENSION(:, :),
POINTER :: zet
1570 REAL(KIND=
dp),
DIMENSION(:, :, :),
POINTER :: gcc
1581 gto_basis_set%name =
" "
1582 gto_basis_set%aliases =
" "
1585 symbol = element_symbol
1593 gto_basis_set%nset = nset
1594 gto_basis_set%ncgf = ncgf
1595 gto_basis_set%nsgf = nsgf
1599 CALL reallocate(gto_basis_set%nshell, 1, nset)
1600 CALL reallocate(gto_basis_set%n, 1, maxshell, 1, nset)
1601 CALL reallocate(gto_basis_set%l, 1, maxshell, 1, nset)
1602 CALL reallocate(gto_basis_set%zet, 1, maxpgf, 1, nset)
1603 CALL reallocate(gto_basis_set%gcc, 1, maxpgf, 1, maxshell, 1, nset)
1604 CALL reallocate(gto_basis_set%set_radius, 1, nset)
1605 CALL reallocate(gto_basis_set%pgf_radius, 1, maxpgf, 1, nset)
1606 CALL reallocate(gto_basis_set%first_cgf, 1, maxshell, 1, nset)
1607 CALL reallocate(gto_basis_set%first_sgf, 1, maxshell, 1, nset)
1608 CALL reallocate(gto_basis_set%last_cgf, 1, maxshell, 1, nset)
1609 CALL reallocate(gto_basis_set%last_sgf, 1, maxshell, 1, nset)
1610 CALL reallocate(gto_basis_set%ncgf_set, 1, nset)
1611 CALL reallocate(gto_basis_set%nsgf_set, 1, nset)
1612 CALL reallocate(gto_basis_set%cphi, 1, maxco, 1, ncgf)
1613 CALL reallocate(gto_basis_set%sphi, 1, maxco, 1, nsgf)
1614 CALL reallocate(gto_basis_set%scon, 1, maxco, 1, nsgf)
1615 CALL reallocate(gto_basis_set%ccon, 1, maxco, 1, ncgf)
1620 CALL reallocate(gto_basis_set%norm_cgf, 1, ncgf)
1623 CALL section_vals_val_get(basis_section,
"_SECTION_PARAMETERS_", i_rep_section=irep, c_val=basis_type)
1624 IF (basis_type ==
"Orbital") basis_type =
"ORB"
1631 NULLIFY (gcc, l, lmax, lmin, n, npgf, nshell, zet)
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, *) nset
1650 IF (.NOT. is_ok) cpabort(
"Error reading the Basis set from input file!")
1651 CALL val_get(val, c_val=line_att)
1652 READ (line_att, *) n(1, iset)
1654 READ (line_att, *) lmin(iset)
1656 READ (line_att, *) lmax(iset)
1658 READ (line_att, *) npgf(iset)
1660 maxl = max(maxl, lmax(iset))
1661 IF (npgf(iset) > maxpgf)
THEN
1664 CALL reallocate(gcc, 1, maxpgf, 1, maxshell, 1, nset)
1667 DO lshell = lmin(iset), lmax(iset)
1668 nmin = n(1, iset) + lshell - lmin(iset)
1669 READ (line_att, *) ishell
1671 nshell(iset) = nshell(iset) + ishell
1672 IF (nshell(iset) > maxshell)
THEN
1673 maxshell = nshell(iset)
1676 CALL reallocate(gcc, 1, maxpgf, 1, maxshell, 1, nset)
1679 n(nshell(iset) - ishell + i, iset) = nmin + i - 1
1680 l(nshell(iset) - ishell + i, iset) = lshell
1683 IF (len_trim(line_att) /= 0) &
1684 cpabort(
"Error reading the Basis from input file!")
1685 DO ipgf = 1, npgf(iset)
1687 IF (.NOT. is_ok) cpabort(
"Error reading the Basis set from input file!")
1688 CALL val_get(val, c_val=line_att)
1689 READ (line_att, *) zet(ipgf, iset), (gcc(ipgf, ishell, iset), ishell=1, nshell(iset))
1699 gto_basis_set%nset = nset
1703 CALL reallocate(gto_basis_set%nshell, 1, nset)
1704 CALL reallocate(gto_basis_set%n, 1, maxshell, 1, nset)
1705 CALL reallocate(gto_basis_set%l, 1, maxshell, 1, nset)
1706 CALL reallocate(gto_basis_set%zet, 1, maxpgf, 1, nset)
1707 CALL reallocate(gto_basis_set%gcc, 1, maxpgf, 1, maxshell, 1, nset)
1712 gto_basis_set%lmax(iset) = lmax(iset)
1713 gto_basis_set%lmin(iset) = lmin(iset)
1714 gto_basis_set%npgf(iset) = npgf(iset)
1715 gto_basis_set%nshell(iset) = nshell(iset)
1716 DO ishell = 1, nshell(iset)
1717 gto_basis_set%n(ishell, iset) = n(ishell, iset)
1718 gto_basis_set%l(ishell, iset) = l(ishell, iset)
1719 DO ipgf = 1, npgf(iset)
1720 gto_basis_set%gcc(ipgf, ishell, iset) = gcc(ipgf, ishell, iset)
1723 DO ipgf = 1, npgf(iset)
1724 gto_basis_set%zet(ipgf, iset) = zet(ipgf, iset)
1730 CALL reallocate(gto_basis_set%set_radius, 1, nset)
1731 CALL reallocate(gto_basis_set%pgf_radius, 1, maxpgf, 1, nset)
1732 CALL reallocate(gto_basis_set%first_cgf, 1, maxshell, 1, nset)
1733 CALL reallocate(gto_basis_set%first_sgf, 1, maxshell, 1, nset)
1734 CALL reallocate(gto_basis_set%last_cgf, 1, maxshell, 1, nset)
1735 CALL reallocate(gto_basis_set%last_sgf, 1, maxshell, 1, nset)
1736 CALL reallocate(gto_basis_set%ncgf_set, 1, nset)
1737 CALL reallocate(gto_basis_set%nsgf_set, 1, nset)
1744 gto_basis_set%ncgf_set(iset) = 0
1745 gto_basis_set%nsgf_set(iset) = 0
1746 DO ishell = 1, nshell(iset)
1747 lshell = gto_basis_set%l(ishell, iset)
1748 gto_basis_set%first_cgf(ishell, iset) = ncgf + 1
1749 ncgf = ncgf +
nco(lshell)
1750 gto_basis_set%last_cgf(ishell, iset) = ncgf
1751 gto_basis_set%ncgf_set(iset) = &
1752 gto_basis_set%ncgf_set(iset) +
nco(lshell)
1753 gto_basis_set%first_sgf(ishell, iset) = nsgf + 1
1754 nsgf = nsgf +
nso(lshell)
1755 gto_basis_set%last_sgf(ishell, iset) = nsgf
1756 gto_basis_set%nsgf_set(iset) = &
1757 gto_basis_set%nsgf_set(iset) +
nso(lshell)
1759 maxco = max(maxco, npgf(iset)*
ncoset(lmax(iset)))
1762 gto_basis_set%ncgf = ncgf
1763 gto_basis_set%nsgf = nsgf
1765 CALL reallocate(gto_basis_set%cphi, 1, maxco, 1, ncgf)
1766 CALL reallocate(gto_basis_set%sphi, 1, maxco, 1, nsgf)
1767 CALL reallocate(gto_basis_set%scon, 1, maxco, 1, nsgf)
1768 CALL reallocate(gto_basis_set%ccon, 1, maxco, 1, ncgf)
1773 CALL reallocate(gto_basis_set%norm_cgf, 1, ncgf)
1774 ALLOCATE (gto_basis_set%cgf_symbol(ncgf))
1776 ALLOCATE (gto_basis_set%sgf_symbol(nsgf))
1782 DO ishell = 1, nshell(iset)
1783 lshell = gto_basis_set%l(ishell, iset)
1786 gto_basis_set%lx(ncgf) =
indco(1, ico)
1787 gto_basis_set%ly(ncgf) =
indco(2, ico)
1788 gto_basis_set%lz(ncgf) =
indco(3, ico)
1789 gto_basis_set%cgf_symbol(ncgf) = &
1790 cgf_symbol(n(ishell, iset), [gto_basis_set%lx(ncgf), &
1791 gto_basis_set%ly(ncgf), &
1792 gto_basis_set%lz(ncgf)])
1794 DO m = -lshell, lshell
1796 gto_basis_set%m(nsgf) = m
1797 gto_basis_set%sgf_symbol(nsgf) = &
1803 DEALLOCATE (gcc, l, lmax, lmin, n, npgf, nshell, zet)
1805 IF (
PRESENT(dft_section))
THEN
1810 END SUBROUTINE read_gto_basis_set2
1853 nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, &
1854 lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, &
1855 cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, &
1856 last_cgf, last_sgf, n, gcc, short_kind_radius, ccon)
1859 CHARACTER(LEN=default_string_length),
INTENT(IN), &
1860 OPTIONAL :: name, aliases
1861 INTEGER,
INTENT(IN),
OPTIONAL :: norm_type
1862 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: kind_radius
1863 INTEGER,
INTENT(IN),
OPTIONAL :: ncgf, nset, nsgf
1864 CHARACTER(LEN=12),
DIMENSION(:),
OPTIONAL,
POINTER ::
cgf_symbol
1865 CHARACTER(LEN=6),
DIMENSION(:),
OPTIONAL,
POINTER ::
sgf_symbol
1866 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: norm_cgf, set_radius
1867 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: lmax, lmin, lx, ly, lz, m, ncgf_set, &
1868 npgf, nsgf_set, nshell
1869 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cphi, pgf_radius, sphi, scon, zet
1870 INTEGER,
DIMENSION(:, :),
OPTIONAL,
POINTER :: first_cgf, first_sgf, l, last_cgf, &
1872 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
1874 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: short_kind_radius
1875 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: ccon
1877 IF (
PRESENT(name)) gto_basis_set%name = name
1878 IF (
PRESENT(aliases)) gto_basis_set%aliases = aliases
1879 IF (
PRESENT(norm_type)) gto_basis_set%norm_type = norm_type
1880 IF (
PRESENT(kind_radius)) gto_basis_set%kind_radius = kind_radius
1881 IF (
PRESENT(short_kind_radius)) gto_basis_set%short_kind_radius = short_kind_radius
1882 IF (
PRESENT(ncgf)) gto_basis_set%ncgf = ncgf
1883 IF (
PRESENT(nset)) gto_basis_set%nset = nset
1884 IF (
PRESENT(nsgf)) gto_basis_set%nsgf = nsgf
1887 IF (
PRESENT(norm_cgf)) gto_basis_set%norm_cgf(:) = norm_cgf(:)
1888 IF (
PRESENT(set_radius)) gto_basis_set%set_radius(:) = set_radius(:)
1889 IF (
PRESENT(lmax)) gto_basis_set%lmax(:) = lmax(:)
1890 IF (
PRESENT(lmin)) gto_basis_set%lmin(:) = lmin(:)
1891 IF (
PRESENT(lx)) gto_basis_set%lx(:) = lx(:)
1892 IF (
PRESENT(ly)) gto_basis_set%ly(:) = ly(:)
1893 IF (
PRESENT(lz)) gto_basis_set%lz(:) = lz(:)
1894 IF (
PRESENT(m)) gto_basis_set%m(:) = m(:)
1895 IF (
PRESENT(ncgf_set)) gto_basis_set%ncgf_set(:) = ncgf_set(:)
1896 IF (
PRESENT(npgf)) gto_basis_set%npgf(:) = npgf(:)
1897 IF (
PRESENT(nsgf_set)) gto_basis_set%nsgf_set(:) = nsgf_set(:)
1898 IF (
PRESENT(nshell)) gto_basis_set%nshell(:) = nshell(:)
1899 IF (
PRESENT(cphi)) gto_basis_set%cphi(:, :) = cphi(:, :)
1900 IF (
PRESENT(pgf_radius)) gto_basis_set%pgf_radius(:, :) = pgf_radius(:, :)
1901 IF (
PRESENT(sphi)) gto_basis_set%sphi(:, :) = sphi(:, :)
1902 IF (
PRESENT(scon)) gto_basis_set%scon(:, :) = scon(:, :)
1903 IF (
PRESENT(ccon)) gto_basis_set%ccon(:, :) = ccon(:, :)
1904 IF (
PRESENT(zet)) gto_basis_set%zet(:, :) = zet(:, :)
1905 IF (
PRESENT(first_cgf)) gto_basis_set%first_cgf(:, :) = first_cgf(:, :)
1906 IF (
PRESENT(first_sgf)) gto_basis_set%first_sgf(:, :) = first_sgf(:, :)
1907 IF (
PRESENT(l)) l(:, :) = gto_basis_set%l(:, :)
1908 IF (
PRESENT(last_cgf)) gto_basis_set%last_cgf(:, :) = last_cgf(:, :)
1909 IF (
PRESENT(last_sgf)) gto_basis_set%last_sgf(:, :) = last_sgf(:, :)
1910 IF (
PRESENT(n)) gto_basis_set%n(:, :) = n(:, :)
1911 IF (
PRESENT(gcc)) gto_basis_set%gcc(:, :, :) = gcc(:, :, :)
1925 INTEGER,
INTENT(in) :: output_unit
1926 CHARACTER(len=*),
OPTIONAL ::
header
1928 INTEGER :: ipgf, iset, ishell
1930 IF (output_unit > 0)
THEN
1932 IF (
PRESENT(
header))
THEN
1933 WRITE (unit=output_unit, fmt=
"(/,T6,A,T41,A40)") &
1934 trim(
header), trim(gto_basis_set%name)
1937 WRITE (unit=output_unit, fmt=
"(/,(T8,A,T71,I10))") &
1938 "Number of orbital shell sets: ", &
1939 gto_basis_set%nset, &
1940 "Number of orbital shells: ", &
1941 sum(gto_basis_set%nshell(:)), &
1942 "Number of primitive Cartesian functions: ", &
1943 sum(gto_basis_set%npgf(:)), &
1944 "Number of Cartesian basis functions: ", &
1945 gto_basis_set%ncgf, &
1946 "Number of spherical basis functions: ", &
1947 gto_basis_set%nsgf, &
1949 gto_basis_set%norm_type
1951 WRITE (unit=output_unit, fmt=
"(/,T6,A,T41,A40,/,/,T25,A)") &
1952 "GTO basis set information for", trim(gto_basis_set%name), &
1953 "Set Shell n l Exponent Coefficient"
1955 DO iset = 1, gto_basis_set%nset
1956 WRITE (unit=output_unit, fmt=
"(A)")
""
1957 DO ishell = 1, gto_basis_set%nshell(iset)
1958 WRITE (unit=output_unit, &
1959 fmt=
"(T25,I3,4X,I4,4X,I2,2X,I2,(T51,2F15.6))") &
1961 gto_basis_set%n(ishell, iset), &
1962 gto_basis_set%l(ishell, iset), &
1963 (gto_basis_set%zet(ipgf, iset), &
1964 gto_basis_set%gcc(ipgf, ishell, iset), &
1965 ipgf=1, gto_basis_set%npgf(iset))
1985 INTEGER,
INTENT(in) :: output_unit
1986 CHARACTER(len=*),
OPTIONAL ::
header
1988 INTEGER :: icgf, ico, ipgf, iset, ishell
1990 IF (output_unit > 0)
THEN
1991 IF (
PRESENT(
header))
THEN
1992 WRITE (unit=output_unit, fmt=
"(/,T6,A,T41,A40)") &
1993 trim(
header), trim(orb_basis_set%name)
1996 WRITE (unit=output_unit, fmt=
"(/,(T8,A,T71,I10))") &
1997 "Number of orbital shell sets: ", &
1998 orb_basis_set%nset, &
1999 "Number of orbital shells: ", &
2000 sum(orb_basis_set%nshell(:)), &
2001 "Number of primitive Cartesian functions: ", &
2002 sum(orb_basis_set%npgf(:)), &
2003 "Number of Cartesian basis functions: ", &
2004 orb_basis_set%ncgf, &
2005 "Number of spherical basis functions: ", &
2006 orb_basis_set%nsgf, &
2008 orb_basis_set%norm_type
2010 WRITE (unit=output_unit, fmt=
"(/,T8,A,/,/,T25,A)") &
2011 "Normalised Cartesian orbitals:", &
2012 "Set Shell Orbital Exponent Coefficient"
2016 DO iset = 1, orb_basis_set%nset
2017 DO ishell = 1, orb_basis_set%nshell(iset)
2018 WRITE (unit=output_unit, fmt=
"(A)")
""
2019 DO ico = 1,
nco(orb_basis_set%l(ishell, iset))
2021 WRITE (unit=output_unit, &
2022 fmt=
"(T25,I3,4X,I4,3X,A12,(T51,2F15.6))") &
2023 iset, ishell, orb_basis_set%cgf_symbol(icgf), &
2024 (orb_basis_set%zet(ipgf, iset), &
2025 orb_basis_set%norm_cgf(icgf)* &
2026 orb_basis_set%gcc(ipgf, ishell, iset), &
2027 ipgf=1, orb_basis_set%npgf(iset))
2044 INTEGER,
INTENT(in) :: output_unit
2046 INTEGER :: ipgf, iset, ishell
2048 IF (output_unit > 0)
THEN
2050 WRITE (unit=output_unit, fmt=
"(/,T6,A40)") trim(gto_basis_set%name)
2051 WRITE (unit=output_unit, fmt=
"(/,T6,A40)") trim(gto_basis_set%aliases)
2052 WRITE (unit=output_unit, fmt=
"(/,T6,F12.8)") gto_basis_set%kind_radius
2053 WRITE (unit=output_unit, fmt=
"(/,T6,F12.8)") gto_basis_set%short_kind_radius
2054 WRITE (unit=output_unit, fmt=
"(/,T6,I8)") gto_basis_set%norm_type
2055 WRITE (unit=output_unit, fmt=
"(/,T6,3I8)") gto_basis_set%ncgf, gto_basis_set%nset, gto_basis_set%nsgf
2056 WRITE (unit=output_unit, fmt=
"(/,T6,6A12)") gto_basis_set%cgf_symbol
2057 WRITE (unit=output_unit, fmt=
"(/,T6,6A12)") gto_basis_set%sgf_symbol
2058 WRITE (unit=output_unit, fmt=
"(/,T6,6F12.6)") gto_basis_set%norm_cgf
2059 WRITE (unit=output_unit, fmt=
"(/,T6,6F12.6)") gto_basis_set%set_radius
2060 WRITE (unit=output_unit, fmt=
"(/,T6,12I6)") gto_basis_set%lmax
2061 WRITE (unit=output_unit, fmt=
"(/,T6,12I6)") gto_basis_set%lmin
2062 WRITE (unit=output_unit, fmt=
"(/,T6,12I6)") gto_basis_set%lx
2063 WRITE (unit=output_unit, fmt=
"(/,T6,12I6)") gto_basis_set%ly
2064 WRITE (unit=output_unit, fmt=
"(/,T6,12I6)") gto_basis_set%lz
2065 WRITE (unit=output_unit, fmt=
"(/,T6,12I6)") gto_basis_set%m
2066 WRITE (unit=output_unit, fmt=
"(/,T6,12I6)") gto_basis_set%ncgf_set
2067 WRITE (unit=output_unit, fmt=
"(/,T6,12I6)") gto_basis_set%nsgf_set
2068 WRITE (unit=output_unit, fmt=
"(/,T6,12I6)") gto_basis_set%npgf
2069 WRITE (unit=output_unit, fmt=
"(/,T6,12I6)") gto_basis_set%nshell
2071 DO iset = 1, gto_basis_set%nset
2072 WRITE (unit=output_unit, fmt=
"(T8,6F15.6)") &
2073 gto_basis_set%pgf_radius(1:gto_basis_set%npgf(iset), iset)
2076 DO iset = 1, gto_basis_set%nset
2077 WRITE (unit=output_unit, fmt=
"(T8,6F15.6)") &
2078 gto_basis_set%zet(1:gto_basis_set%npgf(iset), iset)
2081 DO iset = 1, gto_basis_set%nset
2082 DO ishell = 1, gto_basis_set%nshell(iset)
2083 WRITE (unit=output_unit, fmt=
"(T8,8I10)") &
2085 gto_basis_set%n(ishell, iset), &
2086 gto_basis_set%l(ishell, iset), &
2087 gto_basis_set%first_cgf(ishell, iset), &
2088 gto_basis_set%last_cgf(ishell, iset), &
2089 gto_basis_set%first_sgf(ishell, iset), &
2090 gto_basis_set%last_sgf(ishell, iset)
2094 DO iset = 1, gto_basis_set%nset
2095 DO ishell = 1, gto_basis_set%nshell(iset)
2096 WRITE (unit=output_unit, fmt=
"(T8,2I5,(T25,4F15.6))") &
2098 (gto_basis_set%gcc(ipgf, ishell, iset), &
2099 ipgf=1, gto_basis_set%npgf(iset))
2103 WRITE (unit=output_unit, fmt=
"(A5)")
"CPHI"
2104 WRITE (unit=output_unit, fmt=
"(12F10.5)") gto_basis_set%cphi
2105 WRITE (unit=output_unit, fmt=
"(A1)")
"SPHI"
2106 WRITE (unit=output_unit, fmt=
"(12F10.5)") gto_basis_set%sphi
2107 WRITE (unit=output_unit, fmt=
"(A1)")
"SCON"
2108 WRITE (unit=output_unit, fmt=
"(12F10.5)") gto_basis_set%scon
2109 WRITE (unit=output_unit, fmt=
"(A1)")
"CCON"
2110 WRITE (unit=output_unit, fmt=
"(12F10.5)") gto_basis_set%ccon
2126 ALLOCATE (sto_basis_set)
2140 IF (
ASSOCIATED(sto_basis_set))
THEN
2141 IF (
ASSOCIATED(sto_basis_set%symbol))
THEN
2142 DEALLOCATE (sto_basis_set%symbol)
2144 IF (
ASSOCIATED(sto_basis_set%nq))
THEN
2145 DEALLOCATE (sto_basis_set%nq)
2147 IF (
ASSOCIATED(sto_basis_set%lq))
THEN
2148 DEALLOCATE (sto_basis_set%lq)
2150 IF (
ASSOCIATED(sto_basis_set%zet))
THEN
2151 DEALLOCATE (sto_basis_set%zet)
2154 DEALLOCATE (sto_basis_set)
2170 SUBROUTINE get_sto_basis_set(sto_basis_set, name, nshell, symbol, nq, lq, zet, maxlq, numsto)
2173 CHARACTER(LEN=default_string_length), &
2174 INTENT(OUT),
OPTIONAL :: name
2175 INTEGER,
INTENT(OUT),
OPTIONAL :: nshell
2176 CHARACTER(LEN=6),
DIMENSION(:),
OPTIONAL,
POINTER :: symbol
2177 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nq, lq
2178 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: zet
2179 INTEGER,
INTENT(OUT),
OPTIONAL :: maxlq, numsto
2183 IF (
PRESENT(name)) name = sto_basis_set%name
2184 IF (
PRESENT(nshell)) nshell = sto_basis_set%nshell
2185 IF (
PRESENT(symbol)) symbol => sto_basis_set%symbol
2186 IF (
PRESENT(nq)) nq => sto_basis_set%nq
2187 IF (
PRESENT(lq)) lq => sto_basis_set%lq
2188 IF (
PRESENT(zet)) zet => sto_basis_set%zet
2189 IF (
PRESENT(maxlq))
THEN
2190 maxlq = maxval(sto_basis_set%lq(1:sto_basis_set%nshell))
2192 IF (
PRESENT(numsto))
THEN
2194 DO iset = 1, sto_basis_set%nshell
2195 numsto = numsto + 2*sto_basis_set%lq(iset) + 1
2199 END SUBROUTINE get_sto_basis_set
2214 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2216 INTEGER,
INTENT(IN),
OPTIONAL :: nshell
2217 CHARACTER(LEN=6),
DIMENSION(:),
OPTIONAL,
POINTER :: symbol
2218 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nq, lq
2219 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: zet
2223 IF (
PRESENT(name)) sto_basis_set%name = name
2224 IF (
PRESENT(nshell)) sto_basis_set%nshell = nshell
2225 IF (
PRESENT(symbol))
THEN
2227 IF (
ASSOCIATED(sto_basis_set%symbol))
DEALLOCATE (sto_basis_set%symbol)
2228 ALLOCATE (sto_basis_set%symbol(1:ns))
2229 sto_basis_set%symbol(:) = symbol(:)
2231 IF (
PRESENT(nq))
THEN
2234 sto_basis_set%nq = nq(:)
2236 IF (
PRESENT(lq))
THEN
2239 sto_basis_set%lq = lq(:)
2241 IF (
PRESENT(zet))
THEN
2244 sto_basis_set%zet = zet(:)
2261 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol, basis_set_name
2266 CHARACTER(LEN=10) :: nlsym
2267 CHARACTER(LEN=2) :: lsym
2268 CHARACTER(LEN=240) :: line
2269 CHARACTER(LEN=242) :: line2
2270 CHARACTER(len=default_path_length) :: basis_set_file_name, tmp
2271 CHARACTER(LEN=default_path_length),
DIMENSION(:), &
2273 CHARACTER(LEN=LEN(basis_set_name)) :: bsname
2274 CHARACTER(LEN=LEN(basis_set_name)+2) :: bsname2
2275 CHARACTER(LEN=LEN(element_symbol)) :: symbol
2276 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
2277 INTEGER :: ibasis, irep, iset, nbasis, nq, nset, &
2279 LOGICAL :: basis_found, found, match
2280 REAL(kind=
dp) :: zet
2292 sto_basis_set%name = basis_set_name
2295 ALLOCATE (cbasis(nbasis))
2296 DO ibasis = 1, nbasis
2298 i_rep_val=ibasis, c_val=cbasis(ibasis))
2299 basis_set_file_name = cbasis(ibasis)
2300 tmp = basis_set_file_name
2307 basis_found = .false.
2308 basis_loop:
DO ibasis = 1, nbasis
2309 IF (basis_found)
EXIT basis_loop
2310 basis_set_file_name = cbasis(ibasis)
2311 CALL parser_create(parser, basis_set_file_name, para_env=para_env)
2313 bsname = basis_set_name
2314 symbol = element_symbol
2317 tmp = basis_set_name
2320 IF (tmp /=
"NONE")
THEN
2331 line2 =
" "//line//
" "
2332 symbol2 =
" "//trim(symbol)//
" "
2333 bsname2 =
" "//trim(bsname)//
" "
2334 strlen1 = len_trim(symbol2) + 1
2335 strlen2 = len_trim(bsname2) + 1
2337 IF ((index(line2, symbol2(:strlen1)) > 0) .AND. &
2338 (index(line2, bsname2(:strlen2)) > 0)) match = .true.
2342 sto_basis_set%nshell = nset
2347 ALLOCATE (sto_basis_set%symbol(nset))
2353 sto_basis_set%nq(iset) = nq
2354 sto_basis_set%zet(iset) = zet
2355 WRITE (nlsym,
"(I2,A)") nq, trim(lsym)
2356 sto_basis_set%symbol(iset) = trim(nlsym)
2357 SELECT CASE (trim(lsym))
2359 sto_basis_set%lq(iset) = 0
2361 sto_basis_set%lq(iset) = 1
2363 sto_basis_set%lq(iset) = 2
2365 sto_basis_set%lq(iset) = 3
2367 sto_basis_set%lq(iset) = 4
2369 sto_basis_set%lq(iset) = 5
2370 CASE (
"I",
"i",
"J",
"j")
2371 sto_basis_set%lq(iset) = 6
2373 sto_basis_set%lq(iset) = 7
2375 sto_basis_set%lq(iset) = 8
2377 sto_basis_set%lq(iset) = 9
2379 CALL cp_abort(__location__, &
2380 "The requested basis set <"//trim(bsname)// &
2381 "> for element <"//trim(symbol)//
"> has an invalid component: ")
2385 basis_found = .true.
2400 IF (tmp /=
"NONE")
THEN
2401 IF (.NOT. basis_found)
THEN
2402 basis_set_file_name =
""
2403 DO ibasis = 1, nbasis
2404 basis_set_file_name = trim(basis_set_file_name)//
"<"//trim(cbasis(ibasis))//
"> "
2406 CALL cp_abort(__location__, &
2407 "The requested basis set <"//trim(bsname)// &
2408 "> for element <"//trim(symbol)//
"> was not "// &
2409 "found in the basis set files "// &
2410 trim(basis_set_file_name))
2428 INTEGER,
INTENT(IN),
OPTIONAL :: ngauss
2429 LOGICAL,
INTENT(IN),
OPTIONAL :: ortho
2431 INTEGER,
PARAMETER :: maxng = 6
2433 CHARACTER(LEN=default_string_length) :: name, sng
2434 INTEGER :: ipgf, iset, maxl, ng, nset, nshell
2435 INTEGER,
DIMENSION(:),
POINTER :: lq, nq
2437 REAL(kind=
dp),
DIMENSION(:),
POINTER :: zet
2438 REAL(kind=
dp),
DIMENSION(maxng) :: gcc, zetg
2441 IF (
PRESENT(ngauss)) ng = ngauss
2442 IF (ng > maxng) cpabort(
"Too many Gaussian primitives requested")
2444 IF (
PRESENT(ortho)) do_ortho = ortho
2448 CALL get_sto_basis_set(sto_basis_set, name=name, nshell=nshell, nq=nq, &
2455 gto_basis_set%name = trim(name)//
"_STO-"//trim(sng)//
"G"
2458 gto_basis_set%nset = nset
2462 CALL reallocate(gto_basis_set%nshell, 1, nset)
2463 CALL reallocate(gto_basis_set%n, 1, 1, 1, nset)
2464 CALL reallocate(gto_basis_set%l, 1, 1, 1, nset)
2465 CALL reallocate(gto_basis_set%zet, 1, ng, 1, nset)
2466 CALL reallocate(gto_basis_set%gcc, 1, ng, 1, 1, 1, nset)
2469 CALL get_sto_ng(zet(iset), ng, nq(iset), lq(iset), zetg, gcc)
2470 gto_basis_set%lmax(iset) = lq(iset)
2471 gto_basis_set%lmin(iset) = lq(iset)
2472 gto_basis_set%npgf(iset) = ng
2473 gto_basis_set%nshell(iset) = 1
2474 gto_basis_set%n(1, iset) = lq(iset) + 1
2475 gto_basis_set%l(1, iset) = lq(iset)
2477 gto_basis_set%gcc(ipgf, 1, iset) = gcc(ipgf)
2478 gto_basis_set%zet(ipgf, iset) = zetg(ipgf)
2496 LOGICAL,
INTENT(IN),
OPTIONAL :: do_ortho
2497 INTEGER,
INTENT(IN) :: nset, maxl
2499 INTEGER :: i1, i2, ico, iset, jset, l, lshell, m, &
2500 maxco, ncgf, ng, ngs, np, nsgf
2501 INTEGER,
DIMENSION(0:10) :: mxf
2502 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: gal, zal, zll
2504 ng = gto_basis_set%npgf(1)
2506 IF ((ng /= gto_basis_set%npgf(iset)) .AND. do_ortho) &
2507 cpabort(
"different number of primitves")
2513 l = gto_basis_set%l(1, iset)
2518 ALLOCATE (gal(ng, nset), zal(ng, nset), zll(m*ng, 0:maxl))
2520 zal(1:ng, iset) = gto_basis_set%zet(1:ng, iset)
2521 gal(1:ng, iset) = gto_basis_set%gcc(1:ng, 1, iset)
2523 CALL reallocate(gto_basis_set%zet, 1, m*ng, 1, nset)
2524 CALL reallocate(gto_basis_set%gcc, 1, m*ng, 1, 1, 1, nset)
2526 l = gto_basis_set%l(1, iset)
2527 gto_basis_set%npgf(iset) = ng*mxf(l)
2529 gto_basis_set%zet = 0.0_dp
2530 gto_basis_set%gcc = 0.0_dp
2534 l = gto_basis_set%l(1, iset)
2536 i1 = mxf(l)*ng - ng + 1
2538 zll(i1:i2, l) = zal(1:ng, iset)
2539 gto_basis_set%gcc(i1:i2, 1, iset) = gal(1:ng, iset)
2542 l = gto_basis_set%l(1, iset)
2543 gto_basis_set%zet(:, iset) = zll(:, l)
2546 l = gto_basis_set%l(1, iset)
2547 DO jset = 1, iset - 1
2548 IF (gto_basis_set%l(1, iset) == l)
THEN
2550 CALL orthofun(gto_basis_set%zet(1:m, iset), gto_basis_set%gcc(1:m, 1, iset), &
2551 gto_basis_set%gcc(1:m, 1, jset), l)
2555 DEALLOCATE (gal, zal, zll)
2559 ngs = maxval(gto_basis_set%npgf(1:nset))
2560 CALL reallocate(gto_basis_set%set_radius, 1, nset)
2561 CALL reallocate(gto_basis_set%pgf_radius, 1, ngs, 1, nset)
2562 CALL reallocate(gto_basis_set%first_cgf, 1, 1, 1, nset)
2563 CALL reallocate(gto_basis_set%first_sgf, 1, 1, 1, nset)
2564 CALL reallocate(gto_basis_set%last_cgf, 1, 1, 1, nset)
2565 CALL reallocate(gto_basis_set%last_sgf, 1, 1, 1, nset)
2566 CALL reallocate(gto_basis_set%ncgf_set, 1, nset)
2567 CALL reallocate(gto_basis_set%nsgf_set, 1, nset)
2574 gto_basis_set%ncgf_set(iset) = 0
2575 gto_basis_set%nsgf_set(iset) = 0
2576 lshell = gto_basis_set%l(1, iset)
2577 gto_basis_set%first_cgf(1, iset) = ncgf + 1
2578 ncgf = ncgf +
nco(lshell)
2579 gto_basis_set%last_cgf(1, iset) = ncgf
2580 gto_basis_set%ncgf_set(iset) = &
2581 gto_basis_set%ncgf_set(iset) +
nco(lshell)
2582 gto_basis_set%first_sgf(1, iset) = nsgf + 1
2583 nsgf = nsgf +
nso(lshell)
2584 gto_basis_set%last_sgf(1, iset) = nsgf
2585 gto_basis_set%nsgf_set(iset) = &
2586 gto_basis_set%nsgf_set(iset) +
nso(lshell)
2587 ngs = gto_basis_set%npgf(iset)
2588 maxco = max(maxco, ngs*
ncoset(lshell))
2591 gto_basis_set%ncgf = ncgf
2592 gto_basis_set%nsgf = nsgf
2594 CALL reallocate(gto_basis_set%cphi, 1, maxco, 1, ncgf)
2595 CALL reallocate(gto_basis_set%sphi, 1, maxco, 1, nsgf)
2596 CALL reallocate(gto_basis_set%scon, 1, maxco, 1, nsgf)
2597 CALL reallocate(gto_basis_set%ccon, 1, maxco, 1, ncgf)
2602 CALL reallocate(gto_basis_set%norm_cgf, 1, ncgf)
2603 ALLOCATE (gto_basis_set%cgf_symbol(ncgf))
2604 ALLOCATE (gto_basis_set%sgf_symbol(nsgf))
2610 lshell = gto_basis_set%l(1, iset)
2614 gto_basis_set%lx(ncgf) =
indco(1, ico)
2615 gto_basis_set%ly(ncgf) =
indco(2, ico)
2616 gto_basis_set%lz(ncgf) =
indco(3, ico)
2617 gto_basis_set%cgf_symbol(ncgf) = &
2619 gto_basis_set%ly(ncgf), &
2620 gto_basis_set%lz(ncgf)])
2622 DO m = -lshell, lshell
2624 gto_basis_set%m(nsgf) = m
2625 gto_basis_set%sgf_symbol(nsgf) =
sgf_symbol(np, lshell, m)
2629 gto_basis_set%norm_type = -1
2640 SUBROUTINE orthofun(zet, co, cr, l)
2641 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: zet
2642 REAL(kind=
dp),
DIMENSION(:),
INTENT(INOUT) ::
co, cr
2643 INTEGER,
INTENT(IN) :: l
2647 CALL aovlp(l, zet, cr, cr, ss)
2648 cr(:) = cr(:)/sqrt(ss)
2649 CALL aovlp(l, zet,
co, cr, ss)
2650 co(:) =
co(:) - ss*cr(:)
2651 CALL aovlp(l, zet,
co,
co, ss)
2652 co(:) =
co(:)/sqrt(ss)
2654 END SUBROUTINE orthofun
2664 SUBROUTINE aovlp(l, zet, ca, cb, ss)
2665 INTEGER,
INTENT(IN) :: l
2666 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: zet, ca, cb
2667 REAL(kind=
dp),
INTENT(OUT) :: ss
2670 REAL(kind=
dp) :: ab, ai, aj, s00, sss
2678 ai = (2.0_dp*zet(i)/
pi)**0.75_dp
2680 aj = (2.0_dp*zet(j)/
pi)**0.75_dp
2681 ab = 1._dp/(zet(i) + zet(j))
2682 s00 = ai*aj*(
pi*ab)**1.50_dp
2685 ELSEIF (l == 1)
THEN
2688 cpabort(
"aovlp lvalue")
2690 ss = ss + sss*ca(i)*cb(j)
2694 END SUBROUTINE aovlp
2706 INTEGER,
INTENT(IN) :: z
2707 INTEGER,
DIMENSION(:, :),
INTENT(IN) :: ne
2708 INTEGER,
INTENT(IN) :: n, l
2711 REAL(
dp),
DIMENSION(7),
PARAMETER :: &
2712 xns = [1.0_dp, 2.0_dp, 3.0_dp, 3.7_dp, 4.0_dp, 4.2_dp, 4.4_dp]
2714 INTEGER :: i, l1, l2, m, m1, m2, nn
2729 s = s + 0.3_dp*real(m - 1,
dp)
2731 m = ne(l1, nn) + ne(l2, nn)
2732 s = s + 0.35_dp*real(m - 1,
dp)
2736 IF (l1 + l2 == 3)
THEN
2738 m1 = ne(1, nn - 1) + ne(2, nn - 1) + ne(3, nn - 1) + ne(4, nn - 1)
2741 m2 = m2 + ne(1, i) + ne(2, i) + ne(3, i) + ne(4, i)
2743 s = s + 0.85_dp*real(m1,
dp) + 1._dp*real(m2,
dp)
2749 m = m + ne(1, i) + ne(2, i) + ne(3, i) + ne(4, i)
2751 s = s + 1._dp*real(m,
dp)
2764 INTEGER,
INTENT(IN) :: sort_method
2766 CHARACTER(LEN=12),
DIMENSION(:),
POINTER ::
cgf_symbol
2767 CHARACTER(LEN=6),
DIMENSION(:),
POINTER ::
sgf_symbol
2768 INTEGER :: ic, ic_max, icgf, icgf_new, icgf_old, ico, is, is_max, iset, isgf, isgf_new, &
2769 isgf_old, ishell, lshell, maxco, maxpgf, maxshell, mm, nc, ncgf, ns, nset
2770 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: sort_index
2771 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: icgf_set, isgf_set
2772 INTEGER,
DIMENSION(:),
POINTER :: lx, ly, lz, m, npgf
2773 LOGICAL :: ccon_available
2774 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: tmp
2775 REAL(
dp),
DIMENSION(:),
POINTER :: set_radius
2776 REAL(
dp),
DIMENSION(:, :),
POINTER :: zet
2777 REAL(kind=
dp),
DIMENSION(:),
POINTER :: norm_cgf
2778 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: ccon, cphi, scon, sphi
2780 NULLIFY (set_radius, zet)
2786 maxshell=maxshell, &
2791 set_radius=set_radius, &
2794 ALLOCATE (sort_index(nset))
2795 ALLOCATE (tmp(nset))
2796 SELECT CASE (sort_method)
2799 tmp(iset) = minval(basis_set%zet(:npgf(iset), iset))
2802 cpabort(
"Request basis sort criterion not implemented.")
2805 CALL sort(tmp(1:nset), nset, sort_index)
2812 DO ishell = 1, basis_set%nshell(iset)
2813 DO ico = 1,
nco(basis_set%l(ishell, iset))
2815 IF (ic > ic_max) ic_max = ic
2817 lshell = basis_set%l(ishell, iset)
2818 DO mm = -lshell, lshell
2820 IF (is > is_max) is_max = is
2827 ALLOCATE (icgf_set(nset, ic_max))
2829 ALLOCATE (isgf_set(nset, is_max))
2835 DO ishell = 1, basis_set%nshell(iset)
2836 DO ico = 1,
nco(basis_set%l(ishell, iset))
2839 icgf_set(iset, ic) = icgf
2841 lshell = basis_set%l(ishell, iset)
2842 DO mm = -lshell, lshell
2845 isgf_set(iset, is) = isgf
2850 ALLOCATE (
cgf_symbol(
SIZE(basis_set%cgf_symbol)))
2851 ALLOCATE (norm_cgf(
SIZE(basis_set%norm_cgf)))
2852 ALLOCATE (lx(
SIZE(basis_set%lx)))
2853 ALLOCATE (ly(
SIZE(basis_set%ly)))
2854 ALLOCATE (lz(
SIZE(basis_set%lz)))
2855 ALLOCATE (cphi(
SIZE(basis_set%cphi, 1),
SIZE(basis_set%cphi, 2)))
2857 ALLOCATE (sphi(
SIZE(basis_set%sphi, 1),
SIZE(basis_set%sphi, 2)))
2859 ALLOCATE (scon(
SIZE(basis_set%scon, 1),
SIZE(basis_set%scon, 2)))
2861 ALLOCATE (ccon(
SIZE(basis_set%cphi, 1),
SIZE(basis_set%cphi, 2)))
2863 ccon_available =
ASSOCIATED(basis_set%ccon)
2864 IF (ccon_available)
THEN
2865 ccon_available = (
SIZE(basis_set%ccon, 1) ==
SIZE(ccon, 1)) .AND. &
2866 (
SIZE(basis_set%ccon, 2) ==
SIZE(ccon, 2))
2869 ALLOCATE (
sgf_symbol(
SIZE(basis_set%sgf_symbol)))
2870 ALLOCATE (m(
SIZE(basis_set%m)))
2876 icgf_old = icgf_set(sort_index(iset), ic)
2877 IF (icgf_old == 0) cycle
2878 icgf_new = icgf_new + 1
2879 norm_cgf(icgf_new) = basis_set%norm_cgf(icgf_old)
2880 lx(icgf_new) = basis_set%lx(icgf_old)
2881 ly(icgf_new) = basis_set%ly(icgf_old)
2882 lz(icgf_new) = basis_set%lz(icgf_old)
2883 cphi(:, icgf_new) = basis_set%cphi(:, icgf_old)
2884 IF (ccon_available) ccon(:, icgf_new) = basis_set%ccon(:, icgf_old)
2885 cgf_symbol(icgf_new) = basis_set%cgf_symbol(icgf_old)
2888 isgf_old = isgf_set(sort_index(iset), is)
2889 IF (isgf_old == 0) cycle
2890 isgf_new = isgf_new + 1
2891 m(isgf_new) = basis_set%m(isgf_old)
2892 sphi(:, isgf_new) = basis_set%sphi(:, isgf_old)
2893 scon(:, isgf_new) = basis_set%scon(:, isgf_old)
2894 sgf_symbol(isgf_new) = basis_set%sgf_symbol(isgf_old)
2898 DEALLOCATE (basis_set%cgf_symbol)
2900 DEALLOCATE (basis_set%norm_cgf)
2901 basis_set%norm_cgf => norm_cgf
2902 DEALLOCATE (basis_set%lx)
2904 DEALLOCATE (basis_set%ly)
2906 DEALLOCATE (basis_set%lz)
2908 DEALLOCATE (basis_set%cphi)
2909 basis_set%cphi => cphi
2910 DEALLOCATE (basis_set%sphi)
2911 basis_set%sphi => sphi
2912 DEALLOCATE (basis_set%scon)
2913 basis_set%scon => scon
2914 IF (
ASSOCIATED(basis_set%ccon))
DEALLOCATE (basis_set%ccon)
2915 basis_set%ccon => ccon
2917 DEALLOCATE (basis_set%m)
2919 DEALLOCATE (basis_set%sgf_symbol)
2922 basis_set%lmax = basis_set%lmax(sort_index)
2923 basis_set%lmin = basis_set%lmin(sort_index)
2924 basis_set%npgf = basis_set%npgf(sort_index)
2925 basis_set%nshell = basis_set%nshell(sort_index)
2926 basis_set%ncgf_set = basis_set%ncgf_set(sort_index)
2927 basis_set%nsgf_set = basis_set%nsgf_set(sort_index)
2929 basis_set%n(:, :) = basis_set%n(:, sort_index)
2930 basis_set%l(:, :) = basis_set%l(:, sort_index)
2931 basis_set%zet(:, :) = basis_set%zet(:, sort_index)
2933 basis_set%gcc(:, :, :) = basis_set%gcc(:, :, sort_index)
2934 basis_set%set_radius(:) = basis_set%set_radius(sort_index)
2935 basis_set%pgf_radius(:, :) = basis_set%pgf_radius(:, sort_index)
2940 DO ishell = 1, basis_set%nshell(iset)
2941 lshell = basis_set%l(ishell, iset)
2942 basis_set%first_cgf(ishell, iset) = nc + 1
2943 nc = nc +
nco(lshell)
2944 basis_set%last_cgf(ishell, iset) = nc
2945 basis_set%first_sgf(ishell, iset) = ns + 1
2946 ns = ns +
nso(lshell)
2947 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, ccon)
...
integer, parameter, public basis_sort_zet
subroutine, public process_gto_basis(gto_basis_set, do_ortho, nset, maxl)
...
subroutine, public init_cphi_and_sphi(gto_basis_set, lccon)
...
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 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, ccon)
Set the components of Gaussian-type orbital (GTO) basis set data set.
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 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 dump_gto_basis_set(gto_basis_set, output_unit)
...
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