35#include "./base/base_uses.f90"
43 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'manybody_gal'
59 SUBROUTINE gal_energy(pot_loc, gal, r_last_update_pbc, iparticle, jparticle, &
60 cell, particle_set, mm_section)
62 REAL(kind=
dp),
INTENT(OUT) :: pot_loc
64 TYPE(
pos_type),
DIMENSION(:),
POINTER :: r_last_update_pbc
65 INTEGER,
INTENT(IN) :: iparticle, jparticle
70 CHARACTER(LEN=2) :: element_symbol
71 INTEGER :: index_outfile
72 REAL(kind=
dp) :: anglepart, cosalpha, drji2, gcn_weight, &
73 gcn_weight2, nvec(3), rji(3), &
74 sinalpha, sum_weight, vang, vgaussian, &
80 element_symbol=element_symbol)
82 IF (element_symbol ==
"O")
THEN
85 rji(:) =
pbc(r_last_update_pbc(jparticle)%r(:), r_last_update_pbc(iparticle)%r(:), cell)
87 IF (.NOT.
ALLOCATED(gal%n_vectors))
THEN
88 ALLOCATE (gal%n_vectors(3,
SIZE(particle_set)))
89 gal%n_vectors(:, :) = 0.0_dp
94 IF (gal%gcn(jparticle) < 9.0_dp) gcn_weight = 1.0_dp
96 IF (gal%gcn(jparticle) < 11.5_dp) gcn_weight2 = 1.0_dp
100 IF (gcn_weight2 /= 0.0)
THEN
104 IF (gal%n_vectors(1, jparticle) == 0.0_dp .AND. &
105 gal%n_vectors(2, jparticle) == 0.0_dp .AND. &
106 gal%n_vectors(3, jparticle) == 0.0_dp)
THEN
107 gal%n_vectors(:, jparticle) = normale(gal, r_last_update_pbc, jparticle, &
112 nvec(:) = gal%n_vectors(:, jparticle)
115 sum_weight = somme(gal, r_last_update_pbc, iparticle, particle_set, cell)
118 weight = exp(-norm2(rji)/gal%r1)
121 anglepart = angular(gal, r_last_update_pbc, iparticle, cell, particle_set, nvec, &
125 IF (weight /= 0)
THEN
126 vang = gcn_weight2*weight*weight*anglepart/sum_weight
127 IF (gal%express)
THEN
130 "PRINT%PROGRAM_RUN_INFO", extension=
".mmLog")
131 IF (index_outfile > 0)
WRITE (index_outfile, *)
"Fermi", gcn_weight2*weight*weight/sum_weight
133 "PRINT%PROGRAM_RUN_INFO")
141 drji2 = dot_product(rji, rji)
142 IF (gcn_weight /= 0.0)
THEN
145 cosalpha = dot_product(rji, nvec)/sqrt(drji2)
146 IF (cosalpha < -1.0_dp) cosalpha = -1.0_dp
147 IF (cosalpha > +1.0_dp) cosalpha = +1.0_dp
148 sinalpha = sin(acos(cosalpha))
151 vgaussian = gcn_weight*(-1.0_dp*gal%epsilon*exp(-gal%bz*drji2*cosalpha*cosalpha &
152 - gal%bxy*drji2*sinalpha*sinalpha))
157 vtt = gal%a*exp(-gal%b*sqrt(drji2)) - (1.0 - exp(-gal%b*sqrt(drji2)) &
158 - gal%b*sqrt(drji2)*exp(-gal%b*sqrt(drji2)) &
159 - (((gal%b*sqrt(drji2))**2)/2)*exp(-gal%b*sqrt(drji2)) &
160 - (((gal%b*sqrt(drji2))**3)/6)*exp(-gal%b*sqrt(drji2)) &
161 - (((gal%b*sqrt(drji2))**4)/24)*exp(-gal%b*sqrt(drji2)) &
162 - (((gal%b*sqrt(drji2))**5)/120)*exp(-gal%b*sqrt(drji2)) &
163 - (((gal%b*sqrt(drji2))**6)/720)*exp(-gal%b*sqrt(drji2))) &
164 *gal%c/(sqrt(drji2)**6)
167 IF (gal%express)
THEN
170 "PRINT%PROGRAM_RUN_INFO", extension=
".mmLog")
171 IF (index_outfile > 0)
WRITE (index_outfile, *)
"Gau", gcn_weight*(-1.0_dp*exp(-gal%bz*drji2*cosalpha*cosalpha &
172 - gal%bxy*drji2*sinalpha*sinalpha))
173 IF (weight == 0 .AND. index_outfile > 0)
WRITE (index_outfile, *)
"Fermi 0"
174 IF (index_outfile > 0)
WRITE (index_outfile, *)
"expO", exp(-gal%b*sqrt(drji2))
175 IF (index_outfile > 0)
WRITE (index_outfile, *)
"cstpart", -(1.0 - exp(-gal%b*sqrt(drji2)) &
176 - gal%b*sqrt(drji2)*exp(-gal%b*sqrt(drji2)) &
177 - (((gal%b*sqrt(drji2))**2)/2)*exp(-gal%b*sqrt(drji2)) &
178 - (((gal%b*sqrt(drji2))**3)/6)*exp(-gal%b*sqrt(drji2)) &
179 - (((gal%b*sqrt(drji2))**4)/24)*exp(-gal%b*sqrt(drji2)) &
180 - (((gal%b*sqrt(drji2))**5)/120)*exp(-gal%b*sqrt(drji2)) &
181 - (((gal%b*sqrt(drji2))**6)/720)*exp(-gal%b*sqrt(drji2))) &
182 *gal%c/(sqrt(drji2)**6)
184 "PRINT%PROGRAM_RUN_INFO")
187 pot_loc = vgaussian + vang + vtt
207 FUNCTION normale(gal, r_last_update_pbc, jparticle, particle_set, cell)
209 TYPE(
pos_type),
DIMENSION(:),
POINTER :: r_last_update_pbc
210 INTEGER,
INTENT(IN) :: jparticle
213 REAL(kind=
dp) :: normale(3)
215 CHARACTER(LEN=2) :: element_symbol_k
216 INTEGER :: kparticle, natom
217 REAL(kind=
dp) :: drjk2, rjk(3)
219 natom =
SIZE(particle_set)
222 DO kparticle = 1, natom
223 IF (kparticle == jparticle) cycle
224 CALL get_atomic_kind(atomic_kind=particle_set(kparticle)%atomic_kind, &
225 element_symbol=element_symbol_k)
226 IF (element_symbol_k /= gal%met1 .AND. element_symbol_k /= gal%met2) cycle
227 rjk(:) =
pbc(r_last_update_pbc(jparticle)%r(:), r_last_update_pbc(kparticle)%r(:), cell)
228 drjk2 = dot_product(rjk, rjk)
230 IF (drjk2 > gal%rcutsq) cycle
231 normale(:) = normale(:) - rjk(:)
235 normale(:) = normale(:)/norm2(normale)
251 FUNCTION somme(gal, r_last_update_pbc, iparticle, particle_set, cell)
253 TYPE(
pos_type),
DIMENSION(:),
POINTER :: r_last_update_pbc
254 INTEGER,
INTENT(IN) :: iparticle
257 REAL(kind=
dp) :: somme
259 CHARACTER(LEN=2) :: element_symbol_k
260 INTEGER :: kparticle, natom
261 REAL(kind=
dp) :: rki(3)
263 natom =
SIZE(particle_set)
266 DO kparticle = 1, natom
267 CALL get_atomic_kind(atomic_kind=particle_set(kparticle)%atomic_kind, &
268 element_symbol=element_symbol_k)
269 IF (element_symbol_k /= gal%met1 .AND. element_symbol_k /= gal%met2) cycle
270 rki(:) =
pbc(r_last_update_pbc(kparticle)%r(:), r_last_update_pbc(iparticle)%r(:), cell)
272 IF (norm2(rki) > gal%rcutsq) cycle
274 IF (element_symbol_k == gal%met1) somme = somme + exp(-norm2(rki)/gal%r1)
275 IF (element_symbol_k == gal%met2) somme = somme + exp(-norm2(rki)/gal%r2)
297 FUNCTION angular(gal, r_last_update_pbc, iparticle, cell, particle_set, nvec, energy, mm_section)
299 TYPE(
pos_type),
DIMENSION(:),
POINTER :: r_last_update_pbc
300 INTEGER,
INTENT(IN) :: iparticle
303 REAL(kind=
dp),
DIMENSION(3) :: nvec
306 REAL(kind=
dp) :: angular
308 CHARACTER(LEN=2) :: element_symbol
309 INTEGER :: count_h, iatom, index_h1, index_h2, &
311 REAL(kind=
dp) :: costheta, h_max_dist, rih(3), rih1(3), &
312 rih2(3), rix(3), theta
319 natom =
SIZE(particle_set)
323 element_symbol=element_symbol)
324 IF (element_symbol /=
"H") cycle
325 rih(:) =
pbc(r_last_update_pbc(iparticle)%r(:), r_last_update_pbc(iatom)%r(:), cell)
326 IF (norm2(rih) >= h_max_dist) cycle
327 count_h = count_h + 1
328 IF (count_h == 1)
THEN
330 ELSE IF (count_h == 2)
THEN
336 IF (count_h /= 2)
THEN
337 CALL cp_abort(__location__, &
341 rih1(:) =
pbc(r_last_update_pbc(iparticle)%r(:), r_last_update_pbc(index_h1)%r(:), cell)
342 rih2(:) =
pbc(r_last_update_pbc(iparticle)%r(:), r_last_update_pbc(index_h2)%r(:), cell)
343 rix(:) = rih1(:) + rih2(:)
344 costheta = dot_product(rix, nvec)/norm2(rix)
345 IF (costheta < -1.0_dp) costheta = -1.0_dp
346 IF (costheta > +1.0_dp) costheta = +1.0_dp
347 theta = acos(costheta)
348 angular = gal%a1*costheta + gal%a2*cos(2.0_dp*theta) + gal%a3*cos(3.0_dp*theta) &
349 + gal%a4*cos(4.0_dp*theta)
352 IF (gal%express .AND. energy)
THEN
355 "PRINT%PROGRAM_RUN_INFO", extension=
".mmLog")
357 IF (index_outfile > 0)
WRITE (index_outfile, *)
"Fourier", costheta, cos(2.0_dp*theta), cos(3.0_dp*theta), &
361 "PRINT%PROGRAM_RUN_INFO")
378 SUBROUTINE gal_forces(gal, r_last_update_pbc, iparticle, jparticle, f_nonbond, use_virial, cell, particle_set)
380 TYPE(
pos_type),
DIMENSION(:),
POINTER :: r_last_update_pbc
381 INTEGER,
INTENT(IN) :: iparticle, jparticle
382 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT) :: f_nonbond
383 LOGICAL,
INTENT(IN) :: use_virial
387 CHARACTER(LEN=2) :: element_symbol
388 REAL(kind=
dp) :: anglepart, cosalpha, dgauss(3), drji, drjicosalpha(3), drjisinalpha(3), &
389 dtt(3), dweight(3), gcn_weight, gcn_weight2, nvec(3), prefactor, rji(3), rji_hat(3), &
390 sinalpha, sum_weight, vgaussian, weight
393 CALL get_atomic_kind(atomic_kind=particle_set(iparticle)%atomic_kind, &
394 element_symbol=element_symbol)
396 IF (element_symbol ==
"O")
THEN
398 rji(:) =
pbc(r_last_update_pbc(jparticle)%r(:), r_last_update_pbc(iparticle)%r(:), cell)
400 rji_hat(:) = rji(:)/drji
402 IF (.NOT.
ALLOCATED(gal%n_vectors))
THEN
403 ALLOCATE (gal%n_vectors(3,
SIZE(particle_set)))
404 gal%n_vectors(:, :) = 0.0_dp
409 IF (gal%gcn(jparticle) < 9.0_dp) gcn_weight = 1.0_dp
411 IF (gal%gcn(jparticle) < 11.5_dp) gcn_weight2 = 1.0_dp
414 IF (gcn_weight2 /= 0.0)
THEN
418 IF (gal%n_vectors(1, jparticle) == 0.0_dp .AND. &
419 gal%n_vectors(2, jparticle) == 0.0_dp .AND. &
420 gal%n_vectors(3, jparticle) == 0.0_dp)
THEN
421 gal%n_vectors(:, jparticle) = normale(gal, r_last_update_pbc, jparticle, &
425 nvec(:) = gal%n_vectors(:, jparticle)
428 sum_weight = somme(gal, r_last_update_pbc, iparticle, particle_set, cell)
431 weight = exp(-drji/gal%r1)
432 dweight(:) = 1.0_dp/gal%r1*weight*rji_hat(:)
436 anglepart = angular(gal, r_last_update_pbc, iparticle, cell, particle_set, nvec, .false., mm_section)
439 IF (weight /= 0)
THEN
441 f_nonbond(1:3, iparticle) = gcn_weight2*f_nonbond(1:3, iparticle) + 2.0_dp*dweight(1:3)*weight* &
445 CALL somme_d(gal, r_last_update_pbc, iparticle, jparticle, &
446 f_nonbond, particle_set, cell, anglepart, sum_weight)
448 prefactor = (-1.0_dp)*gcn_weight2*weight*weight/sum_weight
451 CALL angular_d(gal, r_last_update_pbc, iparticle, jparticle, &
452 f_nonbond, prefactor, cell, particle_set, nvec)
459 IF (gcn_weight /= 0.0)
THEN
461 cosalpha = dot_product(rji, nvec)/drji
462 IF (cosalpha < -1.0_dp) cosalpha = -1.0_dp
463 IF (cosalpha > +1.0_dp) cosalpha = +1.0_dp
464 sinalpha = sin(acos(cosalpha))
467 vgaussian = gcn_weight*(-1.0_dp*gal%epsilon*exp(-gal%bz*dot_product(rji, rji)*cosalpha*cosalpha &
468 - gal%bxy*dot_product(rji, rji)*sinalpha*sinalpha))
471 drjicosalpha(:) = rji_hat(:)*cosalpha + nvec(:) - cosalpha*rji_hat(:)
472 drjisinalpha(:) = rji_hat(:)*sinalpha - (cosalpha/sinalpha)*(nvec(:) - cosalpha*rji_hat(:))
473 dgauss(:) = (-1.0_dp*gal%bz*2*drji*cosalpha*drjicosalpha - &
474 1.0_dp*gal%bxy*2*drji*sinalpha*drjisinalpha)*vgaussian*(-1.0_dp)
477 f_nonbond(1:3, iparticle) = f_nonbond(1:3, iparticle) + dgauss(1:3)
483 dtt(:) = (-(gal%a*gal%b + (gal%b**7)*gal%c/720)*exp(-gal%b*drji) + 6*(gal%c/drji**7)* &
484 (1.0 - exp(-gal%b*drji) &
485 - gal%b*drji*exp(-gal%b*drji) &
486 - (((gal%b*drji)**2)/2)*exp(-gal%b*drji) &
487 - (((gal%b*drji)**3)/6)*exp(-gal%b*drji) &
488 - (((gal%b*drji)**4)/24)*exp(-gal%b*drji) &
489 - (((gal%b*drji)**5)/120)*exp(-gal%b*drji) &
490 - (((gal%b*drji)**6)/720)*exp(-gal%b*drji)) &
494 f_nonbond(1:3, iparticle) = f_nonbond(1:3, iparticle) - dtt(1:3)
496 IF (use_virial)
CALL cp_abort(__location__,
"using virial with gal"// &
518 SUBROUTINE somme_d(gal, r_last_update_pbc, iparticle, jparticle, &
519 f_nonbond, particle_set, cell, anglepart, sum_weight)
521 TYPE(
pos_type),
DIMENSION(:),
POINTER :: r_last_update_pbc
522 INTEGER,
INTENT(IN) :: iparticle, jparticle
523 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT) :: f_nonbond
526 REAL(kind=
dp),
INTENT(IN) :: anglepart, sum_weight
528 CHARACTER(LEN=2) :: element_symbol_k
529 INTEGER :: kparticle, natom
530 REAL(kind=
dp) :: drki, dwdr(3), rji(3), rki(3), &
531 rki_hat(3), weight_rji
533 rji(:) =
pbc(r_last_update_pbc(jparticle)%r(:), r_last_update_pbc(iparticle)%r(:), cell)
534 weight_rji = exp(-norm2(rji)/gal%r1)
536 natom =
SIZE(particle_set)
537 DO kparticle = 1, natom
538 CALL get_atomic_kind(atomic_kind=particle_set(kparticle)%atomic_kind, &
539 element_symbol=element_symbol_k)
540 IF (element_symbol_k /= gal%met1 .AND. element_symbol_k /= gal%met2) cycle
541 rki(:) =
pbc(r_last_update_pbc(kparticle)%r(:), r_last_update_pbc(iparticle)%r(:), cell)
543 IF (norm2(rki) > gal%rcutsq) cycle
545 rki_hat(:) = rki(:)/drki
548 IF (element_symbol_k == gal%met1) dwdr(:) = (-1.0_dp)*(1.0_dp/gal%r1)*exp(-drki/gal%r1)*rki_hat(:)
549 IF (element_symbol_k == gal%met2) dwdr(:) = (-1.0_dp)*(1.0_dp/gal%r2)*exp(-drki/gal%r2)*rki_hat(:)
551 f_nonbond(1:3, iparticle) = f_nonbond(1:3, iparticle) + dwdr(1:3)*weight_rji &
552 *weight_rji*anglepart/(sum_weight**2)
555 END SUBROUTINE somme_d
571 SUBROUTINE angular_d(gal, r_last_update_pbc, iparticle, jparticle, f_nonbond, &
572 prefactor, cell, particle_set, nvec)
574 TYPE(
pos_type),
DIMENSION(:),
POINTER :: r_last_update_pbc
575 INTEGER,
INTENT(IN) :: iparticle, jparticle
576 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT) :: f_nonbond
577 REAL(kind=
dp),
INTENT(IN) :: prefactor
580 REAL(kind=
dp),
DIMENSION(3) :: nvec
582 CHARACTER(LEN=2) :: element_symbol
583 INTEGER :: count_h, iatom, index_h1, index_h2, natom
584 REAL(kind=
dp) :: costheta, dsumdtheta, h_max_dist, theta
585 REAL(kind=
dp),
DIMENSION(3) :: dangular, dcostheta, rih, rih1, rih2, &
586 rix, rix_hat, rji, rji_hat
592 natom =
SIZE(particle_set)
596 element_symbol=element_symbol)
597 IF (element_symbol /=
"H") cycle
598 rih(:) =
pbc(r_last_update_pbc(iparticle)%r(:), r_last_update_pbc(iatom)%r(:), cell)
599 IF (norm2(rih) >= h_max_dist) cycle
600 count_h = count_h + 1
601 IF (count_h == 1)
THEN
603 ELSE IF (count_h == 2)
THEN
609 IF (count_h /= 2)
THEN
610 CALL cp_abort(__location__, &
614 rji(:) =
pbc(r_last_update_pbc(jparticle)%r(:), r_last_update_pbc(iparticle)%r(:), cell)
615 rji_hat(:) = rji(:)/norm2(rji)
618 rih1(:) =
pbc(r_last_update_pbc(iparticle)%r(:), r_last_update_pbc(index_h1)%r(:), cell)
619 rih2(:) =
pbc(r_last_update_pbc(iparticle)%r(:), r_last_update_pbc(index_h2)%r(:), cell)
620 rix(:) = rih1(:) + rih2(:)
621 rix_hat(:) = rix(:)/norm2(rix)
623 costheta = dot_product(rix, nvec)/norm2(rix)
624 IF (costheta < -1.0_dp) costheta = -1.0_dp
625 IF (costheta > +1.0_dp) costheta = +1.0_dp
626 theta = acos(costheta)
629 dsumdtheta = -1.0_dp*gal%a1*sin(theta) - gal%a2*2.0_dp*sin(2.0_dp*theta) - &
630 gal%a3*3.0_dp*sin(3.0_dp*theta) - gal%a4*4.0_dp*sin(4.0_dp*theta)
631 dcostheta(:) = (1.0_dp/norm2(rix))*(nvec(:) - costheta*rix_hat(:))
632 dangular(:) = prefactor*dsumdtheta*(-1.0_dp/sin(theta))*dcostheta(:)
635 f_nonbond(1:3, iparticle) = f_nonbond(1:3, iparticle) - dangular(1:3)*2.0_dp
636 f_nonbond(1:3, index_h1) = f_nonbond(1:3, index_h1) + dangular(1:3)
637 f_nonbond(1:3, index_h2) = f_nonbond(1:3, index_h2) + dangular(1:3)
639 END SUBROUTINE angular_d
652 glob_loc_list_a, cell)
655 INTEGER,
DIMENSION(:, :),
POINTER :: glob_loc_list
656 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: glob_cell_v
657 INTEGER,
DIMENSION(:),
POINTER :: glob_loc_list_a
660 CHARACTER(LEN=*),
PARAMETER :: routinen =
'setup_gal_arrays'
662 INTEGER :: handle, i, iend, igrp, ikind, ilist, &
663 ipair, istart, jkind, nkinds, npairs, &
665 INTEGER,
DIMENSION(:),
POINTER :: work_list, work_list2
666 INTEGER,
DIMENSION(:, :),
POINTER ::
list
667 REAL(kind=
dp),
DIMENSION(3) :: cell_v, cvi
668 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: rwork_list
672 cpassert(.NOT.
ASSOCIATED(glob_loc_list))
673 cpassert(.NOT.
ASSOCIATED(glob_loc_list_a))
674 cpassert(.NOT.
ASSOCIATED(glob_cell_v))
675 CALL timeset(routinen, handle)
677 nkinds =
SIZE(potparm%pot, 1)
678 DO ilist = 1, nonbonded%nlists
679 neighbor_kind_pair => nonbonded%neighbor_kind_pairs(ilist)
680 npairs = neighbor_kind_pair%npairs
681 IF (npairs == 0) cycle
682 kind_group_loop1:
DO igrp = 1, neighbor_kind_pair%ngrp_kind
683 istart = neighbor_kind_pair%grp_kind_start(igrp)
684 iend = neighbor_kind_pair%grp_kind_end(igrp)
685 ikind = neighbor_kind_pair%ij_kind(1, igrp)
686 jkind = neighbor_kind_pair%ij_kind(2, igrp)
687 pot => potparm%pot(ikind, jkind)%pot
688 npairs = iend - istart + 1
689 IF (pot%no_mb) cycle kind_group_loop1
690 DO i = 1,
SIZE(pot%type)
691 IF (pot%type(i) ==
gal_type) npairs_tot = npairs_tot + npairs
693 END DO kind_group_loop1
695 ALLOCATE (work_list(npairs_tot))
696 ALLOCATE (work_list2(npairs_tot))
697 ALLOCATE (glob_loc_list(2, npairs_tot))
698 ALLOCATE (glob_cell_v(3, npairs_tot))
701 DO ilist = 1, nonbonded%nlists
702 neighbor_kind_pair => nonbonded%neighbor_kind_pairs(ilist)
703 npairs = neighbor_kind_pair%npairs
704 IF (npairs == 0) cycle
705 kind_group_loop2:
DO igrp = 1, neighbor_kind_pair%ngrp_kind
706 istart = neighbor_kind_pair%grp_kind_start(igrp)
707 iend = neighbor_kind_pair%grp_kind_end(igrp)
708 ikind = neighbor_kind_pair%ij_kind(1, igrp)
709 jkind = neighbor_kind_pair%ij_kind(2, igrp)
710 list => neighbor_kind_pair%list
711 cvi = neighbor_kind_pair%cell_vector
712 pot => potparm%pot(ikind, jkind)%pot
713 npairs = iend - istart + 1
714 IF (pot%no_mb) cycle kind_group_loop2
715 cell_v = matmul(cell%hmat, cvi)
716 DO i = 1,
SIZE(pot%type)
720 glob_loc_list(:, npairs_tot + ipair) =
list(:, istart - 1 + ipair)
721 glob_cell_v(1:3, npairs_tot + ipair) = cell_v(1:3)
723 npairs_tot = npairs_tot + npairs
726 END DO kind_group_loop2
729 CALL sort(glob_loc_list(1, :), npairs_tot, work_list)
730 DO ipair = 1, npairs_tot
731 work_list2(ipair) = glob_loc_list(2, work_list(ipair))
733 glob_loc_list(2, :) = work_list2
734 DEALLOCATE (work_list2)
735 ALLOCATE (rwork_list(3, npairs_tot))
736 DO ipair = 1, npairs_tot
737 rwork_list(:, ipair) = glob_cell_v(:, work_list(ipair))
739 glob_cell_v = rwork_list
740 DEALLOCATE (rwork_list)
741 DEALLOCATE (work_list)
742 ALLOCATE (glob_loc_list_a(npairs_tot))
743 glob_loc_list_a = glob_loc_list(1, :)
744 CALL timestop(handle)
754 INTEGER,
DIMENSION(:, :),
POINTER :: glob_loc_list
755 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: glob_cell_v
756 INTEGER,
DIMENSION(:),
POINTER :: glob_loc_list_a
758 IF (
ASSOCIATED(glob_loc_list))
THEN
759 DEALLOCATE (glob_loc_list)
761 IF (
ASSOCIATED(glob_loc_list_a))
THEN
762 DEALLOCATE (glob_loc_list_a)
764 IF (
ASSOCIATED(glob_cell_v))
THEN
765 DEALLOCATE (glob_cell_v)
781 INTEGER,
INTENT(INOUT) :: nr_ions
784 LOGICAL,
INTENT(IN) :: print_oh, print_h3o, print_o
791 CALL para_env%sum(nr_ions)
797 IF (iw > 0 .AND. nr_ions > 0 .AND. print_oh)
THEN
798 WRITE (iw,
'(/,A,T71,I10,/)')
" gal: number of OH- ions at surface", nr_ions
800 IF (iw > 0 .AND. nr_ions > 0 .AND. print_h3o)
THEN
801 WRITE (iw,
'(/,A,T71,I10,/)')
" gal: number of H3O+ ions at surface", nr_ions
803 IF (iw > 0 .AND. nr_ions > 0 .AND. print_o)
THEN
804 WRITE (iw,
'(/,A,T71,I10,/)')
" gal: number of O^2- ions at surface", nr_ions
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
Handles all functions related to the CELL.
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Define the neighbor list data types and the corresponding functionality.
Defines the basic variable types.
integer, parameter, public dp
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
Implementation of the GAL19 potential.
subroutine, public print_nr_ions_gal(nr_ions, mm_section, para_env, print_oh, print_h3o, print_o)
prints the number of OH- ions or H3O+ ions near surface
subroutine, public destroy_gal_arrays(glob_loc_list, glob_cell_v, glob_loc_list_a)
...
subroutine, public setup_gal_arrays(nonbonded, potparm, glob_loc_list, glob_cell_v, glob_loc_list_a, cell)
...
subroutine, public gal_energy(pot_loc, gal, r_last_update_pbc, iparticle, jparticle, cell, particle_set, mm_section)
Main part of the energy evaluation of GAL19.
subroutine, public gal_forces(gal, r_last_update_pbc, iparticle, jparticle, f_nonbond, use_virial, cell, particle_set)
forces generated by the GAL19 potential
Interface to the message passing library MPI.
integer, parameter, public gal_type
Define the data structure for the particle information.
All kind of helpful little routines.
Type defining parameters related to the simulation cell.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment