83 SUBROUTINE list_control(atomic_kind_set, particle_set, local_particles, &
84 cell, fist_nonbond_env, para_env, mm_section, shell_particle_set, &
85 core_particle_set, force_update, exclusions)
94 TYPE(
particle_type),
OPTIONAL,
POINTER :: shell_particle_set(:), &
96 LOGICAL,
INTENT(IN),
OPTIONAL :: force_update
99 CHARACTER(LEN=*),
PARAMETER :: routinen =
'list_control'
101 INTEGER :: counter, handle, ikind, iparticle, iparticle_kind, iparticle_local, ishell, &
102 jkind, last_update, nparticle, nparticle_kind, nparticle_local, nshell, num_update, &
104 LOGICAL :: build_from_scratch, geo_check, &
105 shell_adiabatic, shell_present, &
106 update_neighbor_lists
107 LOGICAL,
DIMENSION(:, :),
POINTER :: full_nl
108 REAL(kind=
dp) :: aup, dr2, dr2_max, ei_scale14, lup, &
109 vdw_scale14, verlet_skin
110 REAL(kind=
dp),
DIMENSION(3) :: dr, rab, rab_last_update, s, s2r
111 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: rlist_cut, rlist_lowsq
112 TYPE(
cell_type),
POINTER :: cell_last_update
116 TYPE(
pos_type),
DIMENSION(:),
POINTER :: r_last_update, r_last_update_pbc, &
117 rcore_last_update_pbc, &
118 rshell_last_update_pbc
120 CALL timeset(routinen, handle)
126 nonbonded=nonbonded, &
127 rlist_cut=rlist_cut, &
128 rlist_lowsq=rlist_lowsq, &
131 ei_scale14=ei_scale14, &
132 vdw_scale14=vdw_scale14, &
134 r_last_update=r_last_update, &
135 r_last_update_pbc=r_last_update_pbc, &
136 rshell_last_update_pbc=rshell_last_update_pbc, &
137 rcore_last_update_pbc=rcore_last_update_pbc, &
138 cell_last_update=cell_last_update, &
139 num_update=num_update, &
141 last_update=last_update)
143 nparticle =
SIZE(particle_set)
144 nparticle_kind =
SIZE(atomic_kind_set)
147 shell_present=shell_present, shell_adiabatic=shell_adiabatic)
148 IF (shell_present)
THEN
149 nshell =
SIZE(shell_particle_set)
153 update_neighbor_lists = .false.
155 l_val=build_from_scratch)
158 IF (
ASSOCIATED(r_last_update))
THEN
164 DO iparticle_kind = 1, nparticle_kind
165 nparticle_local = local_particles%n_el(iparticle_kind)
166 DO iparticle_local = 1, nparticle_local
167 iparticle = local_particles%list(iparticle_kind)%array(iparticle_local)
168 s2r = r_last_update(iparticle)%r
169 s = particle_set(iparticle)%r(:)
171 dr2 = dr(1)*dr(1) + dr(2)*dr(2) + dr(3)*dr(3)
172 dr2_max = max(dr2_max, dr2)
176 CALL para_env%max(dr2_max)
179 IF (dr2_max > 0.25_dp*verlet_skin**2 .OR. build_from_scratch)
THEN
180 DO iparticle = 1, nparticle
181 r_last_update(iparticle)%r = particle_set(iparticle)%r(:)
183 update_neighbor_lists = .true.
187 ALLOCATE (r_last_update(nparticle))
188 DO iparticle = 1, nparticle
189 r_last_update(iparticle)%r = particle_set(iparticle)%r(:)
192 update_neighbor_lists = .true.
193 build_from_scratch = .true.
196 IF (
PRESENT(force_update))
THEN
197 IF (force_update) update_neighbor_lists = .true.
201 IF (.NOT.
ASSOCIATED(r_last_update_pbc))
THEN
202 ALLOCATE (r_last_update_pbc(nparticle))
204 IF (shell_present .AND. .NOT.
ASSOCIATED(rshell_last_update_pbc))
THEN
205 ALLOCATE (rshell_last_update_pbc(nshell))
207 IF (shell_present .AND. .NOT.
ASSOCIATED(rcore_last_update_pbc))
THEN
208 ALLOCATE (rcore_last_update_pbc(nshell))
212 IF (update_neighbor_lists)
THEN
215 ALLOCATE (full_nl(nparticle_kind, nparticle_kind))
216 IF (
ASSOCIATED(potparm))
THEN
217 DO ikind = 1, nparticle_kind
218 DO jkind = ikind, nparticle_kind
219 full_nl(ikind, jkind) = .false.
220 IF (any(potparm%pot(ikind, jkind)%pot%type ==
tersoff_type))
THEN
221 full_nl(ikind, jkind) = .true.
223 IF (any(potparm%pot(ikind, jkind)%pot%type ==
siepmann_type))
THEN
224 full_nl(ikind, jkind) = .true.
226 IF (any(potparm%pot(ikind, jkind)%pot%type ==
gal_type))
THEN
227 full_nl(ikind, jkind) = .true.
229 IF (any(potparm%pot(ikind, jkind)%pot%type ==
gal21_type))
THEN
230 full_nl(ikind, jkind) = .true.
232 IF (any(potparm%pot(ikind, jkind)%pot%type ==
nequip_type))
THEN
233 full_nl(ikind, jkind) = .true.
235 IF (any(potparm%pot(ikind, jkind)%pot%type ==
allegro_type))
THEN
236 full_nl(ikind, jkind) = .true.
238 full_nl(jkind, ikind) = full_nl(ikind, jkind)
245 local_particles, cell, rlist_cut, rlist_lowsq, ei_scale14, &
246 vdw_scale14, nonbonded, para_env, &
247 build_from_scratch=build_from_scratch, geo_check=geo_check, &
248 mm_section=mm_section, full_nl=full_nl, &
249 exclusions=exclusions)
255 IF (counter > 0)
THEN
256 num_update = num_update + 1
257 lup = counter + 1 - last_update
258 last_update = counter + 1
259 aup = aup + (lup - aup)/real(num_update, kind=
dp)
270 r_last_update=r_last_update, &
271 r_last_update_pbc=r_last_update_pbc, &
272 rshell_last_update_pbc=rshell_last_update_pbc, &
273 rcore_last_update_pbc=rcore_last_update_pbc, &
274 nonbonded=nonbonded, &
275 num_update=num_update, &
276 last_update=last_update, &
277 cell_last_update=cell_last_update)
281 IF (output_unit > 0)
THEN
282 WRITE (unit=output_unit, &
283 fmt=
"(/,T2,A,/,T52,A,/,A,T31,A,T49,2(1X,F15.2),/,T2,A,/)") &
284 repeat(
"*", 79),
"INSTANTANEOUS AVERAGES", &
285 " LIST UPDATES[steps]",
"= ", lup, aup, repeat(
"*", 79)
288 "PRINT%NEIGHBOR_LISTS")
294 DO iparticle = 1, nparticle
297 rab_last_update =
pbc(r_last_update(iparticle)%r, cell_last_update) - r_last_update(iparticle)%r
301 r_last_update_pbc(iparticle)%r = particle_set(iparticle)%r + rab
303 ishell = particle_set(iparticle)%shell_index
304 IF (ishell /= 0)
THEN
305 rshell_last_update_pbc(ishell)%r = rab + shell_particle_set(ishell)%r(:)
306 IF (shell_adiabatic)
THEN
307 rcore_last_update_pbc(ishell)%r = rab + core_particle_set(ishell)%r(:)
309 rcore_last_update_pbc(ishell)%r = r_last_update_pbc(iparticle)%r(:)
314 counter = counter + 1
316 CALL timestop(handle)
subroutine, public fist_nonbond_env_get(fist_nonbond_env, potparm14, potparm, nonbonded, rlist_cut, rlist_lowsq, aup, lup, ei_scale14, vdw_scale14, shift_cutoff, do_electrostatics, r_last_update, r_last_update_pbc, rshell_last_update_pbc, rcore_last_update_pbc, cell_last_update, num_update, last_update, counter, natom_types, long_range_correction, ij_kind_full_fac, eam_data, quip_data, nequip_data, allegro_data, deepmd_data, charges)
sets a fist_nonbond_env
subroutine, public fist_nonbond_env_set(fist_nonbond_env, potparm14, potparm, rlist_cut, rlist_lowsq, nonbonded, aup, lup, ei_scale14, vdw_scale14, shift_cutoff, do_electrostatics, r_last_update, r_last_update_pbc, rshell_last_update_pbc, rcore_last_update_pbc, cell_last_update, num_update, last_update, counter, natom_types, long_range_correction, eam_data, quip_data, nequip_data, allegro_data, deepmd_data, charges)
sets a fist_nonbond_env