33 fac_x_to_z,
ijkl_ind,
ijkl_sym,
inddd,
inddp,
indexa,
indexb,
indpp,
int2c_type,
l_index, &
47 se_int_control_type, &
50 semi_empirical_type, &
54 #include "./base/base_uses.f90"
71 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
72 REAL(KIND=
dp),
DIMENSION(3),
INTENT(IN) :: rjiv
73 TYPE(rotmat_type),
POINTER :: ij_matrix
74 LOGICAL,
INTENT(IN) :: do_invert
92 se_int_control_type, &
94 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
95 REAL(dp),
INTENT(IN) :: r, dssss
96 INTEGER,
INTENT(IN) :: itype
97 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
98 TYPE(se_taper_type),
POINTER :: se_taper
116 se_int_control_type, &
118 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
119 REAL(dp),
INTENT(IN) :: r
120 REAL(dp),
DIMENSION(10, 2),
INTENT(IN) :: dcore
121 INTEGER,
INTENT(IN) :: itype
122 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
123 TYPE(se_taper_type),
POINTER :: se_taper
138 e1b, e2a, de1b, de2a)
141 se_int_control_type, &
143 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
144 REAL(dp),
DIMENSION(3),
INTENT(IN) :: rijv
145 INTEGER,
INTENT(IN) :: itype
146 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
147 TYPE(se_taper_type),
POINTER :: se_taper
148 REAL(dp),
DIMENSION(45),
INTENT(IN),
OPTIONAL :: e1b, e2a
149 REAL(dp),
DIMENSION(45, 3),
INTENT(IN),
OPTIONAL :: de1b, de2a
164 se_taper, enuc, denuc)
167 se_int_control_type, &
169 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
170 REAL(dp),
DIMENSION(3),
INTENT(IN) :: rijv
171 INTEGER,
INTENT(IN) :: itype
172 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
173 TYPE(se_taper_type),
POINTER :: se_taper
174 REAL(dp),
INTENT(IN),
OPTIONAL :: enuc
175 REAL(dp),
DIMENSION(3),
INTENT(IN),
OPTIONAL :: denuc
194 se_int_control_type, &
196 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
197 REAL(KIND=
dp),
DIMENSION(3),
INTENT(IN) :: rijv
198 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
199 TYPE(se_taper_type),
POINTER :: se_taper
200 LOGICAL,
INTENT(IN) :: invert
201 INTEGER,
INTENT(IN) :: ii, kk
202 REAL(KIND=
dp),
DIMENSION(45, 45, 3),
INTENT(IN) :: v_d
219 se_int_control_type, &
221 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
222 REAL(dp),
INTENT(IN) :: r
223 REAL(dp),
DIMENSION(491),
INTENT(IN) :: ri, dri
224 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
225 TYPE(se_taper_type),
POINTER :: se_taper
226 LOGICAL,
INTENT(IN) :: lgrad
243 se_int_control_type, &
245 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
246 REAL(dp),
DIMENSION(3),
INTENT(IN) :: rijv
247 REAL(dp),
DIMENSION(2025),
INTENT(IN),
OPTIONAL :: w
248 REAL(dp),
DIMENSION(2025, 3),
INTENT(IN),
OPTIONAL :: dw
249 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
250 TYPE(se_taper_type),
POINTER :: se_taper
255 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'semi_empirical_int_ana'
256 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .false.
283 RECURSIVE SUBROUTINE rotnuc_ana(sepi, sepj, rijv, itype, e1b, e2a, de1b, de2a, &
284 se_int_control, se_taper)
285 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
286 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rijv
287 INTEGER,
INTENT(IN) :: itype
288 REAL(
dp),
DIMENSION(45),
INTENT(OUT),
OPTIONAL :: e1b, e2a
289 REAL(
dp),
DIMENSION(3, 45),
INTENT(OUT),
OPTIONAL :: de1b, de2a
290 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
291 TYPE(se_taper_type),
POINTER :: se_taper
293 INTEGER :: i, idd, idp, ind1, ind2, ipp, j, &
294 last_orbital(2), m, n
295 LOGICAL :: invert, l_de1b, l_de2a, l_e1b, l_e2a, &
297 REAL(kind=
dp) :: rij, xtmp
298 REAL(kind=
dp),
DIMENSION(10, 2) :: core, dcore
299 REAL(kind=
dp),
DIMENSION(3) :: drij
300 REAL(kind=
dp),
DIMENSION(3, 45) :: tmp_d
301 REAL(kind=
dp),
DIMENSION(45) :: tmp
302 TYPE(rotmat_type),
POINTER :: ij_matrix
305 rij = dot_product(rijv, rijv)
309 l_de1b =
PRESENT(de1b)
310 l_de2a =
PRESENT(de2a)
311 lgrad = l_de1b .OR. l_de2a
318 CALL rotmat(sepi, sepj, rijv, rij, ij_matrix, do_derivatives=lgrad, do_invert=invert)
321 drij(1) = rijv(1)/rij
322 drij(2) = rijv(2)/rij
323 drij(3) = rijv(3)/rij
332 CALL dcore_nucint_ana(sepi, sepj, rij, core=core, dcore=dcore, itype=itype, se_taper=se_taper, &
333 se_int_control=se_int_control, lgrad=lgrad)
336 last_orbital(1) = sepi%natorb
337 last_orbital(2) = sepj%natorb
341 IF (.NOT. task(n)) cycle
342 DO i = 1, last_orbital(n)
346 m = (i*(i - 1))/2 + j
352 ELSE IF (ind1 < 4)
THEN
354 tmp(m) = ij_matrix%sp(1, ind1)*core(2, n)
357 tmp(m) = ij_matrix%sd(1, ind1 - 3)*core(5, n)
359 ELSE IF (ind2 < 4)
THEN
362 ipp =
indpp(ind1, ind2)
363 tmp(m) = core(3, n)*ij_matrix%pp(ipp, 1, 1) + &
364 core(4, n)*(ij_matrix%pp(ipp, 2, 2) + ij_matrix%pp(ipp, 3, 3))
367 idp =
inddp(ind1 - 3, ind2)
368 tmp(m) = core(6, n)*ij_matrix%pd(idp, 1, 1) + &
369 core(8, n)*(ij_matrix%pd(idp, 2, 2) + ij_matrix%pd(idp, 3, 3))
373 idd =
inddd(ind1 - 3, ind2 - 3)
374 tmp(m) = core(7, n)*ij_matrix%dd(idd, 1, 1) + &
375 core(9, n)*(ij_matrix%dd(idd, 2, 2) + ij_matrix%dd(idd, 3, 3)) + &
376 core(10, n)*(ij_matrix%dd(idd, 4, 4) + ij_matrix%dd(idd, 5, 5))
381 DO i = 1, sepi%atm_int_size
386 DO i = 1, sepj%atm_int_size
391 IF (invert .AND. l_e1b)
CALL invert_integral(sepi, sepi, int1el=e1b)
392 IF (invert .AND. l_e2a)
CALL invert_integral(sepj, sepj, int1el=e2a)
398 IF (.NOT. task(n)) cycle
399 DO i = 1, last_orbital(n)
403 m = (i*(i - 1))/2 + j
408 tmp_d(1, m) = dcore(1, n)*drij(1)
409 tmp_d(2, m) = dcore(1, n)*drij(2)
410 tmp_d(3, m) = dcore(1, n)*drij(3)
411 ELSE IF (ind1 < 4)
THEN
413 tmp_d(1, m) = ij_matrix%sp_d(1, 1, ind1)*core(2, n) + &
414 ij_matrix%sp(1, ind1)*dcore(2, n)*drij(1)
416 tmp_d(2, m) = ij_matrix%sp_d(2, 1, ind1)*core(2, n) + &
417 ij_matrix%sp(1, ind1)*dcore(2, n)*drij(2)
419 tmp_d(3, m) = ij_matrix%sp_d(3, 1, ind1)*core(2, n) + &
420 ij_matrix%sp(1, ind1)*dcore(2, n)*drij(3)
423 tmp_d(1, m) = ij_matrix%sd_d(1, 1, ind1 - 3)*core(5, n) + &
424 ij_matrix%sd(1, ind1 - 3)*dcore(5, n)*drij(1)
426 tmp_d(2, m) = ij_matrix%sd_d(2, 1, ind1 - 3)*core(5, n) + &
427 ij_matrix%sd(1, ind1 - 3)*dcore(5, n)*drij(2)
429 tmp_d(3, m) = ij_matrix%sd_d(3, 1, ind1 - 3)*core(5, n) + &
430 ij_matrix%sd(1, ind1 - 3)*dcore(5, n)*drij(3)
432 ELSE IF (ind2 < 4)
THEN
435 ipp =
indpp(ind1, ind2)
436 tmp_d(1, m) = dcore(3, n)*drij(1)*ij_matrix%pp(ipp, 1, 1) + &
437 core(3, n)*ij_matrix%pp_d(1, ipp, 1, 1) + &
438 dcore(4, n)*drij(1)*(ij_matrix%pp(ipp, 2, 2) + ij_matrix%pp(ipp, 3, 3)) + &
439 core(4, n)*(ij_matrix%pp_d(1, ipp, 2, 2) + ij_matrix%pp_d(1, ipp, 3, 3))
441 tmp_d(2, m) = dcore(3, n)*drij(2)*ij_matrix%pp(ipp, 1, 1) + &
442 core(3, n)*ij_matrix%pp_d(2, ipp, 1, 1) + &
443 dcore(4, n)*drij(2)*(ij_matrix%pp(ipp, 2, 2) + ij_matrix%pp(ipp, 3, 3)) + &
444 core(4, n)*(ij_matrix%pp_d(2, ipp, 2, 2) + ij_matrix%pp_d(2, ipp, 3, 3))
446 tmp_d(3, m) = dcore(3, n)*drij(3)*ij_matrix%pp(ipp, 1, 1) + &
447 core(3, n)*ij_matrix%pp_d(3, ipp, 1, 1) + &
448 dcore(4, n)*drij(3)*(ij_matrix%pp(ipp, 2, 2) + ij_matrix%pp(ipp, 3, 3)) + &
449 core(4, n)*(ij_matrix%pp_d(3, ipp, 2, 2) + ij_matrix%pp_d(3, ipp, 3, 3))
452 idp =
inddp(ind1 - 3, ind2)
453 tmp_d(1, m) = dcore(6, n)*drij(1)*ij_matrix%pd(idp, 1, 1) + &
454 core(6, n)*ij_matrix%pd_d(1, idp, 1, 1) + &
455 dcore(8, n)*drij(1)*(ij_matrix%pd(idp, 2, 2) + ij_matrix%pd(idp, 3, 3)) + &
456 core(8, n)*(ij_matrix%pd_d(1, idp, 2, 2) + ij_matrix%pd_d(1, idp, 3, 3))
458 tmp_d(2, m) = dcore(6, n)*drij(2)*ij_matrix%pd(idp, 1, 1) + &
459 core(6, n)*ij_matrix%pd_d(2, idp, 1, 1) + &
460 dcore(8, n)*drij(2)*(ij_matrix%pd(idp, 2, 2) + ij_matrix%pd(idp, 3, 3)) + &
461 core(8, n)*(ij_matrix%pd_d(2, idp, 2, 2) + ij_matrix%pd_d(2, idp, 3, 3))
463 tmp_d(3, m) = dcore(6, n)*drij(3)*ij_matrix%pd(idp, 1, 1) + &
464 core(6, n)*ij_matrix%pd_d(3, idp, 1, 1) + &
465 dcore(8, n)*drij(3)*(ij_matrix%pd(idp, 2, 2) + ij_matrix%pd(idp, 3, 3)) + &
466 core(8, n)*(ij_matrix%pd_d(3, idp, 2, 2) + ij_matrix%pd_d(3, idp, 3, 3))
470 idd =
inddd(ind1 - 3, ind2 - 3)
471 tmp_d(1, m) = dcore(7, n)*drij(1)*ij_matrix%dd(idd, 1, 1) + &
472 core(7, n)*ij_matrix%dd_d(1, idd, 1, 1) + &
473 dcore(9, n)*drij(1)*(ij_matrix%dd(idd, 2, 2) + ij_matrix%dd(idd, 3, 3)) + &
474 core(9, n)*(ij_matrix%dd_d(1, idd, 2, 2) + ij_matrix%dd_d(1, idd, 3, 3)) + &
475 dcore(10, n)*drij(1)*(ij_matrix%dd(idd, 4, 4) + ij_matrix%dd(idd, 5, 5)) + &
476 core(10, n)*(ij_matrix%dd_d(1, idd, 4, 4) + ij_matrix%dd_d(1, idd, 5, 5))
478 tmp_d(2, m) = dcore(7, n)*drij(2)*ij_matrix%dd(idd, 1, 1) + &
479 core(7, n)*ij_matrix%dd_d(2, idd, 1, 1) + &
480 dcore(9, n)*drij(2)*(ij_matrix%dd(idd, 2, 2) + ij_matrix%dd(idd, 3, 3)) + &
481 core(9, n)*(ij_matrix%dd_d(2, idd, 2, 2) + ij_matrix%dd_d(2, idd, 3, 3)) + &
482 dcore(10, n)*drij(2)*(ij_matrix%dd(idd, 4, 4) + ij_matrix%dd(idd, 5, 5)) + &
483 core(10, n)*(ij_matrix%dd_d(2, idd, 4, 4) + ij_matrix%dd_d(2, idd, 5, 5))
485 tmp_d(3, m) = dcore(7, n)*drij(3)*ij_matrix%dd(idd, 1, 1) + &
486 core(7, n)*ij_matrix%dd_d(3, idd, 1, 1) + &
487 dcore(9, n)*drij(3)*(ij_matrix%dd(idd, 2, 2) + ij_matrix%dd(idd, 3, 3)) + &
488 core(9, n)*(ij_matrix%dd_d(3, idd, 2, 2) + ij_matrix%dd_d(3, idd, 3, 3)) + &
489 dcore(10, n)*drij(3)*(ij_matrix%dd(idd, 4, 4) + ij_matrix%dd(idd, 5, 5)) + &
490 core(10, n)*(ij_matrix%dd_d(3, idd, 4, 4) + ij_matrix%dd_d(3, idd, 5, 5))
495 DO i = 1, sepi%atm_int_size
496 de1b(1, i) = -tmp_d(1, i)
497 de1b(2, i) = -tmp_d(2, i)
498 de1b(3, i) = -tmp_d(3, i)
502 DO i = 1, sepj%atm_int_size
503 de2a(1, i) = -tmp_d(1, i)
504 de2a(2, i) = -tmp_d(2, i)
505 de2a(3, i) = -tmp_d(3, i)
509 IF (invert .AND. l_de1b)
CALL invert_derivative(sepi, sepi, dint1el=de1b)
510 IF (invert .AND. l_de2a)
CALL invert_derivative(sepj, sepj, dint1el=de2a)
514 IF (debug_this_module)
THEN
515 CALL check_drotnuc_ana(sepi, sepj, rijv, itype, se_int_control, se_taper, e1b, e2a, de1b, de2a)
541 RECURSIVE SUBROUTINE corecore_ana(sepi, sepj, rijv, itype, enuc, denuc, se_int_control, se_taper)
542 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
543 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rijv
544 INTEGER,
INTENT(IN) :: itype
545 REAL(
dp),
INTENT(OUT),
OPTIONAL :: enuc
546 REAL(
dp),
DIMENSION(3),
INTENT(OUT),
OPTIONAL :: denuc
547 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
548 TYPE(se_taper_type),
POINTER :: se_taper
551 LOGICAL :: l_denuc, l_enuc
552 REAL(
dp) :: aab, alpi, alpj, apdg, ax, dai, daj, dax, dbi, dbj, denuc_loc, dqcorr, drija, &
553 dscale, dssss, dssss_sr, dtmp, dzz, enuc_loc, pai, paj, pbi, pbj, qcorr, rij, rija, &
554 scale, ssss, ssss_sr, tmp, xab, xtmp, zaf, zbf, zz
555 REAL(
dp),
DIMENSION(3) :: drij
556 REAL(
dp),
DIMENSION(4) :: fni1, fni2, fni3, fnj1, fnj2, fnj3
557 TYPE(se_int_control_type) :: se_int_control_off
559 rij = dot_product(rijv, rijv)
561 l_enuc =
PRESENT(enuc)
562 l_denuc =
PRESENT(denuc)
567 do_ewald_gks=.false., integral_screening=se_int_control%integral_screening, &
569 CALL dssss_nucint_ana(sepi, sepj, rij, ssss=ssss, dssss=dssss, itype=itype, se_taper=se_taper, &
570 se_int_control=se_int_control_off, lgrad=l_denuc)
572 IF (se_int_control%shortrange)
THEN
573 CALL dssss_nucint_ana(sepi, sepj, rij, ssss=ssss_sr, dssss=dssss_sr, itype=itype, &
574 se_taper=se_taper, se_int_control=se_int_control, lgrad=l_denuc)
586 zz = sepi%zeff*sepj%zeff
588 IF (l_enuc) enuc_loc = zz*ssss_sr
589 IF (l_denuc) denuc_loc = zz*dssss_sr
592 IF (l_denuc) dtmp = zz*dssss
596 scale = exp(-alpi*rij) + exp(-alpj*rij)
598 dscale = -alpi*exp(-alpi*rij) - alpj*exp(-alpj*rij)
601 IF (nt == 8 .OR. nt == 9)
THEN
602 IF (sepi%z == 7 .OR. sepi%z == 8)
THEN
603 scale = scale + (
angstrom*rij - 1._dp)*exp(-alpi*rij)
605 dscale = dscale +
angstrom*exp(-alpi*rij) - (
angstrom*rij - 1._dp)*alpi*exp(-alpi*rij)
608 IF (sepj%z == 7 .OR. sepj%z == 8)
THEN
609 scale = scale + (
angstrom*rij - 1._dp)*exp(-alpj*rij)
611 dscale = dscale +
angstrom*exp(-alpj*rij) - (
angstrom*rij - 1._dp)*alpj*exp(-alpj*rij)
616 dscale = sign(1.0_dp, scale*tmp)*(dscale*tmp + scale*dtmp)
619 scale = abs(scale*tmp)
634 fni1(1) = sepi%bfn1(1, nt)
635 fni1(2) = sepi%bfn1(2, nt)
636 fni1(3) = sepi%bfn1(3, nt)
637 fni1(4) = sepi%bfn1(4, nt)
638 fni2(1) = sepi%bfn2(1, nt)
639 fni2(2) = sepi%bfn2(2, nt)
640 fni2(3) = sepi%bfn2(3, nt)
641 fni2(4) = sepi%bfn2(4, nt)
642 fni3(1) = sepi%bfn3(1, nt)
643 fni3(2) = sepi%bfn3(2, nt)
644 fni3(3) = sepi%bfn3(3, nt)
645 fni3(4) = sepi%bfn3(4, nt)
647 fni1(1) = sepi%fn1(1)
648 fni1(2) = sepi%fn1(2)
649 fni1(3) = sepi%fn1(3)
650 fni1(4) = sepi%fn1(4)
651 fni2(1) = sepi%fn2(1)
652 fni2(2) = sepi%fn2(2)
653 fni2(3) = sepi%fn2(3)
654 fni2(4) = sepi%fn2(4)
655 fni3(1) = sepi%fn3(1)
656 fni3(2) = sepi%fn3(2)
657 fni3(3) = sepi%fn3(3)
658 fni3(4) = sepi%fn3(4)
672 fnj1(1) = sepj%bfn1(1, nt)
673 fnj1(2) = sepj%bfn1(2, nt)
674 fnj1(3) = sepj%bfn1(3, nt)
675 fnj1(4) = sepj%bfn1(4, nt)
676 fnj2(1) = sepj%bfn2(1, nt)
677 fnj2(2) = sepj%bfn2(2, nt)
678 fnj2(3) = sepj%bfn2(3, nt)
679 fnj2(4) = sepj%bfn2(4, nt)
680 fnj3(1) = sepj%bfn3(1, nt)
681 fnj3(2) = sepj%bfn3(2, nt)
682 fnj3(3) = sepj%bfn3(3, nt)
683 fnj3(4) = sepj%bfn3(4, nt)
685 fnj1(1) = sepj%fn1(1)
686 fnj1(2) = sepj%fn1(2)
687 fnj1(3) = sepj%fn1(3)
688 fnj1(4) = sepj%fn1(4)
689 fnj2(1) = sepj%fn2(1)
690 fnj2(2) = sepj%fn2(2)
691 fnj2(3) = sepj%fn2(3)
692 fnj2(4) = sepj%fn2(4)
693 fnj3(1) = sepj%fn3(1)
694 fnj3(2) = sepj%fn3(2)
695 fnj3(3) = sepj%fn3(3)
696 fnj3(4) = sepj%fn3(4)
699 DO ig = 1,
SIZE(fni1)
700 IF (abs(fni1(ig)) > 0._dp)
THEN
701 ax = fni2(ig)*(rij - fni3(ig))**2
702 IF (ax <= 25._dp)
THEN
703 scale = scale + zz*fni1(ig)*exp(-ax)
705 dax = fni2(ig)*2.0_dp*(rij - fni3(ig))
706 dscale = dscale + dzz*fni1(ig)*exp(-ax) - dax*zz*fni1(ig)*exp(-ax)
710 IF (abs(fnj1(ig)) > 0._dp)
THEN
711 ax = fnj2(ig)*(rij - fnj3(ig))**2
712 IF (ax <= 25._dp)
THEN
713 scale = scale + zz*fnj1(ig)*exp(-ax)
715 dax = fnj2(ig)*2.0_dp*(rij - fnj3(ig))
716 dscale = dscale + dzz*fnj1(ig)*exp(-ax) - dax*zz*fnj1(ig)*exp(-ax)
735 qcorr = (zaf*pai + zbf*paj)*exp(-apdg*(rij - dai - daj)**2) + &
736 (zaf*pai + zbf*pbj)*exp(-apdg*(rij - dai - dbj)**2) + &
737 (zaf*pbi + zbf*paj)*exp(-apdg*(rij - dbi - daj)**2) + &
738 (zaf*pbi + zbf*pbj)*exp(-apdg*(rij - dbi - dbj)**2)
740 dqcorr = (zaf*pai + zbf*paj)*exp(-apdg*(rij - dai - daj)**2)*(-2.0_dp*apdg*(rij - dai - daj)) + &
741 (zaf*pai + zbf*pbj)*exp(-apdg*(rij - dai - dbj)**2)*(-2.0_dp*apdg*(rij - dai - dbj)) + &
742 (zaf*pbi + zbf*paj)*exp(-apdg*(rij - dbi - daj)**2)*(-2.0_dp*apdg*(rij - dbi - daj)) + &
743 (zaf*pbi + zbf*pbj)*exp(-apdg*(rij - dbi - dbj)**2)*(-2.0_dp*apdg*(rij - dbi - dbj))
757 IF (l_denuc) dscale = dtmp
760 xab = sepi%xab(sepj%z)
761 aab = sepi%aab(sepj%z)
762 IF ((sepi%z == 1 .AND. (sepj%z == 6 .OR. sepj%z == 7 .OR. sepj%z == 8)) .OR. &
763 (sepj%z == 1 .AND. (sepi%z == 6 .OR. sepi%z == 7 .OR. sepi%z == 8)))
THEN
765 IF (l_denuc) dscale = dscale*(2._dp*xab*exp(-aab*rija*rija)) - &
766 scale*2._dp*xab*exp(-aab*rija*rija)*(2.0_dp*aab*rija)*drija
767 IF (l_enuc) scale = scale*(2._dp*xab*exp(-aab*rija*rija))
768 ELSEIF (sepi%z == 6 .AND. sepj%z == 6)
THEN
770 IF (l_denuc) dscale = &
771 dscale*(2._dp*xab*exp(-aab*(rija + 0.0003_dp*rija**6)) + 9.28_dp*exp(-5.98_dp*rija)) &
772 - scale*2._dp*xab*exp(-aab*(rija + 0.0003_dp*rija**6))*aab*(1.0_dp + 6.0_dp*0.0003_dp*rija**5)*drija &
773 - scale*9.28_dp*exp(-5.98_dp*rija)*5.98_dp*drija
774 IF (l_enuc) scale = scale*(2._dp*xab*exp(-aab*(rija + 0.0003_dp*rija**6)) + 9.28_dp*exp(-5.98_dp*rija))
775 ELSEIF ((sepi%z == 8 .AND. sepj%z == 14) .OR. &
776 (sepj%z == 8 .AND. sepi%z == 14))
THEN
778 IF (l_denuc) dscale = &
779 dscale*(2._dp*xab*exp(-aab*(rija + 0.0003_dp*rija**6)) - 0.0007_dp*exp(-(rija - 2.9_dp)**2)) &
780 - scale*2._dp*xab*exp(-aab*(rija + 0.0003_dp*rija**6))*aab*(1.0_dp + 6.0_dp*0.0003_dp*rija**5)*drija + &
781 scale*0.0007_dp*exp(-(rija - 2.9_dp)**2)*(2.0_dp*(rija - 2.9_dp)*drija)
782 IF (l_enuc) scale = scale*(2._dp*xab*exp(-aab*(rija + 0.0003_dp*rija**6)) - 0.0007_dp*exp(-(rija - 2.9_dp)**2))
786 IF (l_denuc) dscale = dscale*(2._dp*xab*exp(-aab*(rija + 0.0003_dp*rija**6))) &
787 - scale*2._dp*xab*exp(-aab*(rija + 0.0003_dp*rija**6))*aab*(1.0_dp + 6.0_dp*0.0003_dp*rija**5)*drija
788 IF (l_enuc) scale = scale*(2._dp*xab*exp(-aab*(rija + 0.0003_dp*rija**6)))
791 xtmp = 1.e-8_dp/
evolt*((real(sepi%z,
dp)**(1._dp/3._dp) + real(sepj%z,
dp)**(1._dp/3._dp))/rija)**12
793 qcorr = (sepi%a*exp(-sepi%b*(rij - sepi%c)**2))*zz/rij + &
794 (sepj%a*exp(-sepj%b*(rij - sepj%c)**2))*zz/rij + &
799 dqcorr = (sepi%a*exp(-sepi%b*(rij - sepi%c)**2)*(-2.0_dp*sepi%b*(rij - sepi%c)))*zz/rij - &
800 (sepi%a*exp(-sepi%b*(rij - sepi%c)**2))*zz/rij**2 + &
801 (sepj%a*exp(-sepj%b*(rij - sepj%c)**2)*(-2.0_dp*sepj%b*(rij - sepj%c)))*zz/rij - &
802 (sepj%a*exp(-sepj%b*(rij - sepj%c)**2))*zz/rij**2 + &
804 (-12.0_dp*xtmp/rija*drija)
811 enuc = enuc_loc + scale + qcorr
814 drij(1) = rijv(1)/rij
815 drij(2) = rijv(2)/rij
816 drij(3) = rijv(3)/rij
817 denuc = (denuc_loc + dscale + dqcorr)*drij
820 IF (debug_this_module)
THEN
850 se_int_control, se_taper)
851 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
852 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rijv
853 INTEGER,
INTENT(IN) :: itype
854 REAL(
dp),
INTENT(OUT),
OPTIONAL :: enuc
855 REAL(
dp),
DIMENSION(3),
INTENT(OUT),
OPTIONAL :: denuc
856 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
857 TYPE(se_taper_type),
POINTER :: se_taper
859 LOGICAL :: l_denuc, l_enuc
860 REAL(
dp) :: drij(3), dssss, dssss_sr, rij, ssss, &
862 TYPE(se_int_control_type) :: se_int_control_off
864 rij = dot_product(rijv, rijv)
866 l_enuc =
PRESENT(enuc)
867 l_denuc =
PRESENT(denuc)
872 do_ewald_gks=.false., integral_screening=se_int_control%integral_screening, &
874 CALL dssss_nucint_ana(sepi, sepj, rij, ssss=ssss, dssss=dssss, itype=itype, se_taper=se_taper, &
875 se_int_control=se_int_control_off, lgrad=l_denuc)
877 IF (se_int_control%shortrange .OR. se_int_control%pc_coulomb_int)
THEN
878 CALL dssss_nucint_ana(sepi, sepj, rij, ssss=ssss_sr, dssss=dssss_sr, itype=itype, &
879 se_taper=se_taper, se_int_control=se_int_control, lgrad=l_denuc)
884 zz = sepi%zeff*sepj%zeff
886 IF (l_enuc) enuc = zz*ssss_sr
888 drij(1) = rijv(1)/rij
889 drij(2) = rijv(2)/rij
890 drij(3) = rijv(3)/rij
908 SUBROUTINE invert_integral(sepi, sepj, int1el, int2el)
909 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
910 REAL(
dp),
DIMENSION(:),
INTENT(INOUT),
OPTIONAL :: int1el, int2el
912 INTEGER :: fdim, gind, gknd, i, imap, ind, j, jmap, &
913 jnd, k, kmap, knd, l, lmap, lnd, ndim, &
915 REAL(kind=
dp) :: ifac, jfac, kfac, lfac
916 REAL(kind=
dp),
DIMENSION(2025) :: tmp2el
917 REAL(kind=
dp),
DIMENSION(45) :: tmp1el
921 IF (
PRESENT(int1el))
THEN
922 fdim = sepi%atm_int_size
927 DO i = 1, sepi%natorb
942 tmp1el(ndim) = tmp1el(ndim) + ifac*jfac*int1el(gind)
948 int1el(i) = tmp1el(i)
953 IF (
PRESENT(int2el))
THEN
954 sdim = sepi%atm_int_size
955 tdim = sepj%atm_int_size
961 DO i = 1, sepi%natorb
963 DO k = 1, sepj%natorb
989 tind = (gind - 1)*tdim + gknd
990 tmp2el(ndim) = tmp2el(ndim) + ifac*jfac*lfac*kfac*int2el(tind)
1002 int2el(i) = tmp2el(i)
1005 END SUBROUTINE invert_integral
1017 SUBROUTINE invert_derivative(sepi, sepj, dint1el, dint2el)
1018 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
1019 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT), &
1020 OPTIONAL :: dint1el, dint2el
1023 REAL(kind=
dp) :: tmp
1028 IF (
PRESENT(dint1el))
THEN
1029 CALL invert_integral(sepi, sepj, int1el=dint1el(i, :))
1031 IF (
PRESENT(dint2el))
THEN
1032 CALL invert_integral(sepi, sepj, int2el=dint2el(i, :))
1037 IF (
PRESENT(dint1el))
THEN
1038 DO m = 1,
SIZE(dint1el, 2)
1040 dint1el(3, m) = dint1el(1, m)
1044 IF (
PRESENT(dint2el))
THEN
1045 DO m = 1,
SIZE(dint2el, 2)
1047 dint2el(3, m) = dint2el(1, m)
1051 END SUBROUTINE invert_derivative
1076 SUBROUTINE dssss_nucint_ana(sepi, sepj, rij, ssss, dssss, itype, se_taper, se_int_control, &
1078 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
1079 REAL(
dp),
INTENT(IN) :: rij
1080 REAL(
dp),
INTENT(OUT) :: ssss, dssss
1081 INTEGER,
INTENT(IN) :: itype
1082 TYPE(se_taper_type),
POINTER :: se_taper
1083 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
1084 LOGICAL,
INTENT(IN) :: lgrad
1086 REAL(kind=
dp) :: dft, ft
1087 TYPE(se_int_screen_type) :: se_int_screen
1099 se_int_screen%ft = 1.0_dp
1100 se_int_screen%dft = 0.0_dp
1102 se_int_screen%ft =
taper_eval(se_taper%taper_add, rij)
1103 se_int_screen%dft =
dtaper_eval(se_taper%taper_add, rij)
1108 CALL nucint_sp_num(sepi, sepj, rij, ssss=ssss, itype=itype, se_int_control=se_int_control, &
1109 se_int_screen=se_int_screen)
1113 CALL dnucint_sp_ana(sepi, sepj, rij, dssss=dssss, itype=itype, se_int_control=se_int_control, &
1114 se_int_screen=se_int_screen)
1119 dssss = ft*dssss + dft*ssss
1124 IF (debug_this_module .AND. lgrad)
THEN
1127 END SUBROUTINE dssss_nucint_ana
1157 SUBROUTINE dcore_nucint_ana(sepi, sepj, rij, core, dcore, itype, se_taper, &
1158 se_int_control, lgrad)
1159 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
1160 REAL(
dp),
INTENT(IN) :: rij
1161 REAL(
dp),
DIMENSION(10, 2),
INTENT(OUT) :: core, dcore
1162 INTEGER,
INTENT(IN) :: itype
1163 TYPE(se_taper_type),
POINTER :: se_taper
1164 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
1165 LOGICAL,
INTENT(IN) :: lgrad
1168 REAL(kind=
dp) :: dft, ft
1169 TYPE(se_int_screen_type) :: se_int_screen
1181 se_int_screen%ft = 1.0_dp
1182 se_int_screen%dft = 0.0_dp
1184 se_int_screen%ft =
taper_eval(se_taper%taper_add, rij)
1185 se_int_screen%dft =
dtaper_eval(se_taper%taper_add, rij)
1190 CALL nucint_sp_num(sepi, sepj, rij, core=core, itype=itype, &
1191 se_int_control=se_int_control, se_int_screen=se_int_screen)
1193 IF (sepi%dorb .OR. sepj%dorb)
THEN
1196 se_int_control=se_int_control, se_int_screen=se_int_screen)
1201 CALL dnucint_sp_ana(sepi, sepj, rij, dcore=dcore, itype=itype, &
1202 se_int_control=se_int_control, se_int_screen=se_int_screen)
1204 IF (sepi%dorb .OR. sepj%dorb)
THEN
1206 CALL dnucint_d_ana(sepi, sepj, rij, dcore=dcore, itype=itype, &
1207 se_int_control=se_int_control, se_int_screen=se_int_screen)
1213 DO i = 1, sepi%core_size
1214 dcore(i, 1) = ft*dcore(i, 1) + dft*core(i, 1)
1216 DO i = 1, sepj%core_size
1217 dcore(i, 2) = ft*dcore(i, 2) + dft*core(i, 2)
1220 DO i = 1, sepi%core_size
1221 core(i, 1) = ft*core(i, 1)
1223 DO i = 1, sepj%core_size
1224 core(i, 2) = ft*core(i, 2)
1228 IF (debug_this_module .AND. lgrad)
THEN
1231 END SUBROUTINE dcore_nucint_ana
1263 SUBROUTINE dnucint_sp_ana(sepi, sepj, rij, dssss, dcore, itype, se_int_control, &
1265 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
1266 REAL(
dp),
INTENT(IN) :: rij
1267 REAL(
dp),
INTENT(INOUT),
OPTIONAL :: dssss
1268 REAL(
dp),
DIMENSION(10, 2),
INTENT(INOUT), &
1270 INTEGER,
INTENT(IN) :: itype
1271 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
1272 TYPE(se_int_screen_type),
INTENT(IN) :: se_int_screen
1275 LOGICAL :: l_core, l_ssss, si, sj
1277 l_core =
PRESENT(dcore)
1278 l_ssss =
PRESENT(dssss)
1279 IF (.NOT. (l_core .OR. l_ssss))
RETURN
1281 si = (sepi%natorb > 1)
1282 sj = (sepj%natorb > 1)
1287 dssss =
d_ijkl_sp(sepi, sepj, ij, ij, 0, 0, 0, 0, -1, rij, se_int_control, se_int_screen, itype)
1293 dcore(1, 1) =
d_ijkl_sp(sepi, sepj, kl, ij, 0, 0, 0, 0, 2, rij, se_int_control, se_int_screen, itype)*sepj%zeff
1297 dcore(2, 1) =
d_ijkl_sp(sepi, sepj, kl, ij, 0, 1, 0, 0, 2, rij, se_int_control, se_int_screen, itype)*sepj%zeff
1300 dcore(3, 1) =
d_ijkl_sp(sepi, sepj, kl, ij, 1, 1, 0, 0, 2, rij, se_int_control, se_int_screen, itype)*sepj%zeff
1303 dcore(4, 1) =
d_ijkl_sp(sepi, sepj, kl, ij, 1, 1, 0, 0, 2, rij, se_int_control, se_int_screen, itype)*sepj%zeff
1308 dcore(1, 2) =
d_ijkl_sp(sepi, sepj, ij, kl, 0, 0, 0, 0, 1, rij, se_int_control, se_int_screen, itype)*sepi%zeff
1312 dcore(2, 2) =
d_ijkl_sp(sepi, sepj, ij, kl, 0, 0, 0, 1, 1, rij, se_int_control, se_int_screen, itype)*sepi%zeff
1315 dcore(3, 2) =
d_ijkl_sp(sepi, sepj, ij, kl, 0, 0, 1, 1, 1, rij, se_int_control, se_int_screen, itype)*sepi%zeff
1318 dcore(4, 2) =
d_ijkl_sp(sepi, sepj, ij, kl, 0, 0, 1, 1, 1, rij, se_int_control, se_int_screen, itype)*sepi%zeff
1321 END SUBROUTINE dnucint_sp_ana
1344 SUBROUTINE dnucint_d_ana(sepi, sepj, rij, dcore, itype, se_int_control, &
1346 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
1347 REAL(
dp),
INTENT(IN) :: rij
1348 REAL(
dp),
DIMENSION(10, 2),
INTENT(INOUT) :: dcore
1349 INTEGER,
INTENT(IN) :: itype
1350 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
1351 TYPE(se_int_screen_type),
INTENT(IN) :: se_int_screen
1357 IF (sepi%dorb .OR. sepj%dorb)
THEN
1362 dcore(5, 2) =
d_ijkl_d(sepi, sepj, ij, kl, 0, 0, 2, 0, 1, rij, se_int_control, se_int_screen, itype)*sepi%zeff
1365 dcore(6, 2) =
d_ijkl_d(sepi, sepj, ij, kl, 0, 0, 2, 1, 1, rij, se_int_control, se_int_screen, itype)*sepi%zeff
1368 dcore(7, 2) =
d_ijkl_d(sepi, sepj, ij, kl, 0, 0, 2, 2, 1, rij, se_int_control, se_int_screen, itype)*sepi%zeff
1371 dcore(8, 2) =
d_ijkl_d(sepi, sepj, ij, kl, 0, 0, 2, 1, 1, rij, se_int_control, se_int_screen, itype)*sepi%zeff
1374 dcore(9, 2) =
d_ijkl_d(sepi, sepj, ij, kl, 0, 0, 2, 2, 1, rij, se_int_control, se_int_screen, itype)*sepi%zeff
1377 dcore(10, 2) =
d_ijkl_d(sepi, sepj, ij, kl, 0, 0, 2, 2, 1, rij, se_int_control, se_int_screen, itype)*sepi%zeff
1382 dcore(5, 1) =
d_ijkl_d(sepi, sepj, kl, ij, 2, 0, 0, 0, 2, rij, se_int_control, se_int_screen, itype)*sepj%zeff
1385 dcore(6, 1) =
d_ijkl_d(sepi, sepj, kl, ij, 2, 1, 0, 0, 2, rij, se_int_control, se_int_screen, itype)*sepj%zeff
1388 dcore(7, 1) =
d_ijkl_d(sepi, sepj, kl, ij, 2, 2, 0, 0, 2, rij, se_int_control, se_int_screen, itype)*sepj%zeff
1391 dcore(8, 1) =
d_ijkl_d(sepi, sepj, kl, ij, 2, 1, 0, 0, 2, rij, se_int_control, se_int_screen, itype)*sepj%zeff
1394 dcore(9, 1) =
d_ijkl_d(sepi, sepj, kl, ij, 2, 2, 0, 0, 2, rij, se_int_control, se_int_screen, itype)*sepj%zeff
1397 dcore(10, 1) =
d_ijkl_d(sepi, sepj, kl, ij, 2, 2, 0, 0, 2, rij, se_int_control, se_int_screen, itype)*sepj%zeff
1400 END SUBROUTINE dnucint_d_ana
1422 RECURSIVE SUBROUTINE rotint_ana(sepi, sepj, rijv, w, dw, se_int_control, se_taper)
1423 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
1424 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rijv
1425 REAL(
dp),
DIMENSION(2025),
INTENT(OUT),
OPTIONAL :: w
1426 REAL(
dp),
DIMENSION(3, 2025),
INTENT(OUT), &
1428 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
1429 TYPE(se_taper_type),
POINTER :: se_taper
1431 INTEGER :: i, i1, ii, ij, ij1, iminus, istep, &
1432 iw_loc, j, j1, jj, k, kk, kl, l, &
1434 LOGICAL :: invert, l_w, lgrad
1435 LOGICAL,
DIMENSION(45, 45) :: logv, logv_d
1436 REAL(
dp) :: rij, xtmp
1437 REAL(
dp),
DIMENSION(3) :: drij
1438 REAL(kind=
dp) :: cc, cc_d(3), wrepp, wrepp_d(3)
1439 REAL(kind=
dp),
DIMENSION(2025) :: ww
1440 REAL(kind=
dp),
DIMENSION(3, 2025) :: ww_d
1441 REAL(kind=
dp),
DIMENSION(3, 45, 45) :: v_d
1442 REAL(kind=
dp),
DIMENSION(45, 45) :: v
1443 REAL(kind=
dp),
DIMENSION(491) :: rep, rep_d
1444 TYPE(rotmat_type),
POINTER :: ij_matrix
1449 IF (.NOT. (l_w .OR. lgrad))
RETURN
1451 rij = dot_product(rijv, rijv)
1461 CALL rotmat(sepi, sepj, rijv, rij, ij_matrix, do_derivatives=lgrad, do_invert=invert)
1464 CALL dterep_ana(sepi, sepj, rij, rep, rep_d, se_taper, se_int_control, lgrad=lgrad)
1467 drij(1) = rijv(1)/rij
1468 drij(2) = rijv(2)/rij
1469 drij(3) = rijv(3)/rij
1481 CALL rot_2el_2c_first(sepi, sepj, rijv, se_int_control, se_taper, invert, ii, kk, rep, logv, ij_matrix, &
1482 v, lgrad, rep_d, v_d, logv_d, drij)
1488 limij = sepi%atm_int_size
1489 limkl = sepj%atm_int_size
1503 IF (logv(ij, kl))
THEN
1510 iw_loc = (
indexb(i, j) - 1)*limkl + kl
1516 iw_loc = (
indexb(i + 1, j) - 1)*limkl + kl
1517 ww(iw_loc) = ww(iw_loc) + ij_matrix%sp(i1 - 1, i)*wrepp
1522 cc = ij_matrix%pp(i, i1 - 1, j1 - 1)
1523 iw_loc = (
indexb(i + 1, i + 1) - 1)*limkl + kl
1524 ww(iw_loc) = ww(iw_loc) + cc*wrepp
1526 IF (iminus /= 0)
THEN
1528 cc = ij_matrix%pp(1 + i + j, i1 - 1, j1 - 1)
1529 iw_loc = (
indexb(i + 1, j + 1) - 1)*limkl + kl
1530 ww(iw_loc) = ww(iw_loc) + cc*wrepp
1538 iw_loc = (
indexb(i + 4, j) - 1)*limkl + kl
1539 ww(iw_loc) = ww(iw_loc) + ij_matrix%sd(i1 - 4, i)*wrepp
1545 iw_loc = (
indexb(i + 4, j + 1) - 1)*limkl + kl
1547 ww(iw_loc) = ww(iw_loc) + ij_matrix%pd(ij1, i1 - 4, j1 - 1)*wrepp
1553 cc = ij_matrix%dd(i, i1 - 4, j1 - 4)
1554 iw_loc = (
indexb(i + 4, i + 4) - 1)*limkl + kl
1555 ww(iw_loc) = ww(iw_loc) + cc*wrepp
1557 IF (iminus /= 0)
THEN
1560 cc = ij_matrix%dd(ij1, i1 - 4, j1 - 4)
1561 iw_loc = (
indexb(i + 4, j + 4) - 1)*limkl + kl
1562 ww(iw_loc) = ww(iw_loc) + cc*wrepp
1574 IF (invert)
CALL invert_integral(sepi, sepj, int2el=w)
1577 IF (debug_this_module)
THEN
1579 CALL check_rotint_ana(sepi, sepj, rijv, w, se_int_control=se_int_control, se_taper=se_taper)
1587 limij = sepi%atm_int_size
1588 limkl = sepj%atm_int_size
1591 ww_d(1, i1) = 0.0_dp
1592 ww_d(2, i1) = 0.0_dp
1593 ww_d(3, i1) = 0.0_dp
1605 IF (logv_d(ij, kl))
THEN
1606 wrepp_d(1) = v_d(1, ij, kl)
1607 wrepp_d(2) = v_d(2, ij, kl)
1608 wrepp_d(3) = v_d(3, ij, kl)
1615 iw_loc = (
indexb(i, j) - 1)*limkl + kl
1616 ww_d(1, iw_loc) = wrepp_d(1)
1617 ww_d(2, iw_loc) = wrepp_d(2)
1618 ww_d(3, iw_loc) = wrepp_d(3)
1623 iw_loc = (
indexb(i + 1, j) - 1)*limkl + kl
1624 ww_d(1, iw_loc) = ww_d(1, iw_loc) + ij_matrix%sp_d(1, i1 - 1, i)*wrepp + &
1625 ij_matrix%sp(i1 - 1, i)*wrepp_d(1)
1627 ww_d(2, iw_loc) = ww_d(2, iw_loc) + ij_matrix%sp_d(2, i1 - 1, i)*wrepp + &
1628 ij_matrix%sp(i1 - 1, i)*wrepp_d(2)
1630 ww_d(3, iw_loc) = ww_d(3, iw_loc) + ij_matrix%sp_d(3, i1 - 1, i)*wrepp + &
1631 ij_matrix%sp(i1 - 1, i)*wrepp_d(3)
1636 cc = ij_matrix%pp(i, i1 - 1, j1 - 1)
1637 cc_d(1) = ij_matrix%pp_d(1, i, i1 - 1, j1 - 1)
1638 cc_d(2) = ij_matrix%pp_d(2, i, i1 - 1, j1 - 1)
1639 cc_d(3) = ij_matrix%pp_d(3, i, i1 - 1, j1 - 1)
1640 iw_loc = (
indexb(i + 1, i + 1) - 1)*limkl + kl
1641 ww_d(1, iw_loc) = ww_d(1, iw_loc) + cc_d(1)*wrepp + cc*wrepp_d(1)
1642 ww_d(2, iw_loc) = ww_d(2, iw_loc) + cc_d(2)*wrepp + cc*wrepp_d(2)
1643 ww_d(3, iw_loc) = ww_d(3, iw_loc) + cc_d(3)*wrepp + cc*wrepp_d(3)
1645 IF (iminus /= 0)
THEN
1647 cc = ij_matrix%pp(1 + i + j, i1 - 1, j1 - 1)
1648 cc_d(1) = ij_matrix%pp_d(1, 1 + i + j, i1 - 1, j1 - 1)
1649 cc_d(2) = ij_matrix%pp_d(2, 1 + i + j, i1 - 1, j1 - 1)
1650 cc_d(3) = ij_matrix%pp_d(3, 1 + i + j, i1 - 1, j1 - 1)
1651 iw_loc = (
indexb(i + 1, j + 1) - 1)*limkl + kl
1652 ww_d(1, iw_loc) = ww_d(1, iw_loc) + cc_d(1)*wrepp + cc*wrepp_d(1)
1653 ww_d(2, iw_loc) = ww_d(2, iw_loc) + cc_d(2)*wrepp + cc*wrepp_d(2)
1654 ww_d(3, iw_loc) = ww_d(3, iw_loc) + cc_d(3)*wrepp + cc*wrepp_d(3)
1662 iw_loc = (
indexb(i + 4, j) - 1)*limkl + kl
1663 ww_d(1, iw_loc) = ww_d(1, iw_loc) + ij_matrix%sd_d(1, i1 - 4, i)*wrepp + &
1664 ij_matrix%sd(i1 - 4, i)*wrepp_d(1)
1666 ww_d(2, iw_loc) = ww_d(2, iw_loc) + ij_matrix%sd_d(2, i1 - 4, i)*wrepp + &
1667 ij_matrix%sd(i1 - 4, i)*wrepp_d(2)
1669 ww_d(3, iw_loc) = ww_d(3, iw_loc) + ij_matrix%sd_d(3, i1 - 4, i)*wrepp + &
1670 ij_matrix%sd(i1 - 4, i)*wrepp_d(3)
1676 iw_loc = (
indexb(i + 4, j + 1) - 1)*limkl + kl
1678 ww_d(1, iw_loc) = ww_d(1, iw_loc) + ij_matrix%pd_d(1, ij1, i1 - 4, j1 - 1)*wrepp + &
1679 ij_matrix%pd(ij1, i1 - 4, j1 - 1)*wrepp_d(1)
1681 ww_d(2, iw_loc) = ww_d(2, iw_loc) + ij_matrix%pd_d(2, ij1, i1 - 4, j1 - 1)*wrepp + &
1682 ij_matrix%pd(ij1, i1 - 4, j1 - 1)*wrepp_d(2)
1684 ww_d(3, iw_loc) = ww_d(3, iw_loc) + ij_matrix%pd_d(3, ij1, i1 - 4, j1 - 1)*wrepp + &
1685 ij_matrix%pd(ij1, i1 - 4, j1 - 1)*wrepp_d(3)
1691 cc = ij_matrix%dd(i, i1 - 4, j1 - 4)
1692 cc_d = ij_matrix%dd_d(:, i, i1 - 4, j1 - 4)
1693 iw_loc = (
indexb(i + 4, i + 4) - 1)*limkl + kl
1694 ww_d(1, iw_loc) = ww_d(1, iw_loc) + cc_d(1)*wrepp + cc*wrepp_d(1)
1695 ww_d(2, iw_loc) = ww_d(2, iw_loc) + cc_d(2)*wrepp + cc*wrepp_d(2)
1696 ww_d(3, iw_loc) = ww_d(3, iw_loc) + cc_d(3)*wrepp + cc*wrepp_d(3)
1698 IF (iminus /= 0)
THEN
1701 cc = ij_matrix%dd(ij1, i1 - 4, j1 - 4)
1702 cc_d(1) = ij_matrix%dd_d(1, ij1, i1 - 4, j1 - 4)
1703 cc_d(2) = ij_matrix%dd_d(2, ij1, i1 - 4, j1 - 4)
1704 cc_d(3) = ij_matrix%dd_d(3, ij1, i1 - 4, j1 - 4)
1705 iw_loc = (
indexb(i + 4, j + 4) - 1)*limkl + kl
1706 ww_d(1, iw_loc) = ww_d(1, iw_loc) + cc_d(1)*wrepp + cc*wrepp_d(1)
1707 ww_d(2, iw_loc) = ww_d(2, iw_loc) + cc_d(2)*wrepp + cc*wrepp_d(2)
1708 ww_d(3, iw_loc) = ww_d(3, iw_loc) + cc_d(3)*wrepp + cc*wrepp_d(3)
1719 CALL store_2el_2c_diag(limij, limkl, ww_dx=ww_d(1, 1:istep), ww_dy=ww_d(2, 1:istep), ww_dz=ww_d(3, 1:istep), &
1721 IF (invert)
CALL invert_derivative(sepi, sepj, dint2el=dw)
1724 IF (debug_this_module)
THEN
1726 CALL check_rotint_ana(sepi, sepj, rijv, dw=dw, se_int_control=se_int_control, se_taper=se_taper)
1749 RECURSIVE SUBROUTINE dterep_ana(sepi, sepj, rij, rep, rep_d, se_taper, &
1750 se_int_control, lgrad)
1751 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
1752 REAL(kind=
dp),
INTENT(IN) :: rij
1753 REAL(kind=
dp),
DIMENSION(491),
INTENT(OUT) :: rep, rep_d
1754 TYPE(se_taper_type),
POINTER :: se_taper
1755 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
1756 LOGICAL,
INTENT(IN) :: lgrad
1758 INTEGER :: i, ij, j, k, kl, l, lasti, lastj, li, &
1760 REAL(kind=
dp) :: dft, ft, ft1
1761 TYPE(se_int_screen_type) :: se_int_screen
1774 se_int_screen%ft =
taper_eval(se_taper%taper_add, rij)
1776 se_int_screen%dft =
dtaper_eval(se_taper%taper_add, rij)
1780 CALL terep_sp_num(sepi, sepj, rij, rep, se_int_control=se_int_control, &
1781 se_int_screen=se_int_screen, ft=ft1)
1783 IF (sepi%dorb .OR. sepj%dorb)
THEN
1785 CALL terep_d_num(sepi, sepj, rij, rep, se_int_control=se_int_control, &
1786 se_int_screen=se_int_screen, ft=ft1)
1791 CALL dterep_sp_ana(sepi, sepj, rij, rep_d, rep, se_int_control, &
1792 se_int_screen, ft, dft)
1794 IF (sepi%dorb .OR. sepj%dorb)
THEN
1796 CALL dterep_d_ana(sepi, sepj, rij, rep_d, rep, se_int_control, &
1797 se_int_screen, ft, dft)
1814 IF (numb > 0) rep(numb) = rep(numb)*ft
1822 IF (debug_this_module)
THEN
1823 CALL check_dterep_ana(sepi, sepj, rij, rep, rep_d, se_int_control, se_taper=se_taper, &
1826 END SUBROUTINE dterep_ana
1853 SUBROUTINE dterep_sp_ana(sepi, sepj, rij, drep, rep, se_int_control, &
1854 se_int_screen, ft, dft)
1855 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
1856 REAL(
dp),
INTENT(IN) :: rij
1857 REAL(
dp),
DIMENSION(491),
INTENT(OUT) :: drep
1858 REAL(
dp),
DIMENSION(491),
INTENT(IN) :: rep
1859 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
1860 TYPE(se_int_screen_type),
INTENT(IN) :: se_int_screen
1861 REAL(
dp),
INTENT(IN) :: ft, dft
1863 INTEGER :: i, ij, j, k, kl, l, lasti, lastj, li, &
1864 lj, lk, ll, nold, numb
1865 REAL(kind=
dp) :: tmp
1869 DO i = 1, min(lasti, 4)
1874 DO k = 1, min(lastj, 4)
1884 drep(numb) = drep(nold)
1885 ELSE IF (nold < 0)
THEN
1886 drep(numb) = -drep(-nold)
1887 ELSE IF (nold == 0)
THEN
1888 tmp =
d_ijkl_sp(sepi, sepj, ij, kl, li, lj, lk, ll, 0, rij, &
1890 drep(numb) = dft*rep(numb) + ft*tmp
1897 END SUBROUTINE dterep_sp_ana
1915 SUBROUTINE dterep_d_ana(sepi, sepj, rij, drep, rep, se_int_control, &
1916 se_int_screen, ft, dft)
1917 TYPE(semi_empirical_type),
POINTER :: sepi, sepj
1918 REAL(
dp),
INTENT(IN) :: rij
1919 REAL(
dp),
DIMENSION(491),
INTENT(INOUT) :: drep
1920 REAL(
dp),
DIMENSION(491),
INTENT(IN) :: rep
1921 TYPE(se_int_control_type),
INTENT(IN) :: se_int_control
1922 TYPE(se_int_screen_type),
INTENT(IN) :: se_int_screen
1923 REAL(
dp),
INTENT(IN) :: ft, dft
1925 INTEGER :: i, ij, j, k, kl, l, lasti, lastj, li, &
1926 lj, lk, ll, nold, numb
1927 REAL(kind=
dp) :: tmp
1947 drep(numb) = drep(nold)
1948 ELSE IF (nold < -34)
THEN
1949 drep(numb) = -drep(-nold)
1950 ELSE IF (nold == 0)
THEN
1951 tmp =
d_ijkl_d(sepi, sepj, ij, kl, li, lj, lk, ll, 0, rij, &
1953 drep(numb) = dft*rep(numb) + ft*tmp
1960 END SUBROUTINE dterep_d_ana
Check Numerical Vs Analytical NUCINT core.
Check Numerical Vs Analytical CORECORE.
Check Numerical Vs Analytical ROTNUC.
Check Numerical Vs Analytical NUCINT ssss.
Check Numerical Vs Analytical check_dterep_ana.
Check Numerical Vs Analytical check_rotint_ana.
Check Numerical Vs Analytical rot_2el_2c_first.
Defines the basic variable types.
integer, parameter, public dp
Multipole structure: for multipole (fixed and induced) in FF based MD.
integer, parameter, public do_multipole_none
Definition of physical constants:
real(kind=dp), parameter, public evolt
real(kind=dp), parameter, public angstrom
Analytical derivatives of Integrals for semi-empirical methods.
recursive subroutine, public rotint_ana(sepi, sepj, rijv, w, dw, se_int_control, se_taper)
calculates the derivative of the two-particle interactions
recursive subroutine, public corecore_el_ana(sepi, sepj, rijv, itype, enuc, denuc, se_int_control, se_taper)
Computes analytical gradients for semiempirical core-core electrostatic interaction only.
recursive subroutine, public corecore_ana(sepi, sepj, rijv, itype, enuc, denuc, se_int_control, se_taper)
Computes analytical gradients for semiempirical core-core interaction.
recursive subroutine, public rotnuc_ana(sepi, sepj, rijv, itype, e1b, e2a, de1b, de2a, se_int_control, se_taper)
Computes analytical gradients for semiempirical integrals.
Arrays of parameters used in the semi-empirical calculations \References Everywhere in this module TC...
real(kind=dp), parameter, public rij_threshold
integer, dimension(9, 9), public indexb
integer, dimension(45), parameter, public int2c_type
integer, dimension(491), public ijkl_sym
integer, dimension(5, 3), public inddp
integer, dimension(3, 3), public indpp
real(kind=dp), dimension(2, 9), parameter, public fac_x_to_z
integer, dimension(2, 9), parameter, public map_x_to_z
integer, dimension(9), parameter, public l_index
integer, dimension(9, 9), public indexa
integer, dimension(5, 5), public inddd
integer, dimension(45, 45), public ijkl_ind
Integrals for semi-empiric methods.
subroutine, public terep_d_num(sepi, sepj, rij, rep, se_int_control, se_int_screen, ft)
Calculates the two-electron repulsion integrals - d shell only.
subroutine, public terep_sp_num(sepi, sepj, rij, rep, se_int_control, se_int_screen, ft)
Calculates the two-electron repulsion integrals - sp shell only.
subroutine, public nucint_d_num(sepi, sepj, rij, core, itype, se_int_control, se_int_screen)
Calculates the nuclear attraction integrals involving d orbitals.
subroutine, public nucint_sp_num(sepi, sepj, rij, ssss, core, itype, se_int_control, se_int_screen)
...
Utilities for Integrals for semi-empiric methods.
real(kind=dp) function, public d_ijkl_sp(sepi, sepj, ij, kl, li, lj, lk, ll, ic, r, se_int_control, se_int_screen, itype)
General driver for computing derivatives of semi-empirical integrals <ij|kl> with sp basis set....
subroutine, public store_2el_2c_diag(limij, limkl, ww, w, ww_dx, ww_dy, ww_dz, dw)
Store the two-electron two-center integrals in diagonal form.
recursive subroutine, public rotmat(sepi, sepj, rjiv, r, ij_matrix, do_derivatives, do_invert, debug_invert)
Computes the general rotation matrices for the integrals between I and J (J>=I)
recursive subroutine, public rot_2el_2c_first(sepi, sepj, rijv, se_int_control, se_taper, invert, ii, kk, rep, logv, ij_matrix, v, lgrad, rep_d, v_d, logv_d, drij)
First Step of the rotation of the two-electron two-center integrals in SPD basis.
real(kind=dp) function, public d_ijkl_d(sepi, sepj, ij, kl, li, lj, lk, ll, ic, r, se_int_control, se_int_screen, itype)
General driver for computing the derivatives of semi-empirical integrals <ij|kl> involving d-orbitals...
Definition of the semi empirical parameter types.
subroutine, public rotmat_release(rotmat)
Releases rotmat type.
subroutine, public setup_se_int_control_type(se_int_control, shortrange, do_ewald_r3, do_ewald_gks, integral_screening, max_multipole, pc_coulomb_int)
Setup the Semiempirical integral control type.
subroutine, public rotmat_create(rotmat)
Creates rotmat type.
Definition of the semi empirical parameter types.
real(kind=dp) function, public dtaper_eval(taper, rij)
Analytical derivatives for taper function.
real(kind=dp) function, public taper_eval(taper, rij)
Taper functions.
subroutine check_rotmat_der(sepi, sepj, rjiv, ij_matrix, do_invert)
Debug the derivatives of the the rotational matrices.